
001 002package ca.uhn.fhir.jpa.rp.dstu2; 003 004import java.util.*; 005 006import org.apache.commons.lang3.StringUtils; 007 008import ca.uhn.fhir.jpa.provider.*; 009import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; 010import ca.uhn.fhir.model.api.Include; 011import ca.uhn.fhir.model.api.annotation.*; 012import ca.uhn.fhir.model.dstu2.composite.*; 013import ca.uhn.fhir.model.dstu2.resource.*; // 014import ca.uhn.fhir.rest.annotation.*; 015import ca.uhn.fhir.rest.param.*; 016import ca.uhn.fhir.rest.api.SortSpec; 017import ca.uhn.fhir.rest.api.SummaryEnum; 018import ca.uhn.fhir.rest.api.SearchTotalModeEnum; 019import ca.uhn.fhir.rest.api.SearchContainedModeEnum; 020 021public class ImagingObjectSelectionResourceProvider extends 022 JpaResourceProviderDstu2<ImagingObjectSelection> 023 { 024 025 @Override 026 public Class<ImagingObjectSelection> getResourceType() { 027 return ImagingObjectSelection.class; 028 } 029 030 @Search(allowUnknownParams=true) 031 public ca.uhn.fhir.rest.api.server.IBundleProvider search( 032 javax.servlet.http.HttpServletRequest theServletRequest, 033 javax.servlet.http.HttpServletResponse theServletResponse, 034 035 ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, 036 037 @Description(shortDefinition="Search the contents of the resource's data using a filter") 038 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_FILTER) 039 StringAndListParam theFtFilter, 040 041 @Description(shortDefinition="Search the contents of the resource's data using a fulltext search") 042 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) 043 StringAndListParam theFtContent, 044 045 @Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search") 046 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) 047 StringAndListParam theFtText, 048 049 @Description(shortDefinition="Search for resources which have the given tag") 050 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) 051 TokenAndListParam theSearchForTag, 052 053 @Description(shortDefinition="Search for resources which have the given security labels") 054 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) 055 TokenAndListParam theSearchForSecurity, 056 057 @Description(shortDefinition="Search for resources which have the given profile") 058 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) 059 UriAndListParam theSearchForProfile, 060 061 @Description(shortDefinition="Search for resources which have the given source value (Resource.meta.source)") 062 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE) 063 UriAndListParam theSearchForSource, 064 065 @Description(shortDefinition="Return resources linked to by the given target") 066 @OptionalParam(name="_has") 067 HasAndListParam theHas, 068 069 070 071 @Description(shortDefinition="The ID of the resource") 072 @OptionalParam(name="_id") 073 StringAndListParam the_id, 074 075 076 @Description(shortDefinition="Author of key DICOM object selection") 077 @OptionalParam(name="author", targetTypes={ } ) 078 ReferenceAndListParam theAuthor, 079 080 081 @Description(shortDefinition="Time of key DICOM object selection authoring") 082 @OptionalParam(name="authoring-time") 083 DateRangeParam theAuthoring_time, 084 085 086 @Description(shortDefinition="UID of key DICOM object selection") 087 @OptionalParam(name="identifier") 088 UriAndListParam theIdentifier, 089 090 091 @Description(shortDefinition="Subject of key DICOM object selection") 092 @OptionalParam(name="patient", targetTypes={ } ) 093 ReferenceAndListParam thePatient, 094 095 096 @Description(shortDefinition="Study selected in key DICOM object selection") 097 @OptionalParam(name="selected-study") 098 UriAndListParam theSelected_study, 099 100 101 @Description(shortDefinition="Title of key DICOM object selection") 102 @OptionalParam(name="title") 103 TokenAndListParam theTitle, 104 105 @RawParam 106 Map<String, List<String>> theAdditionalRawParams, 107 108 @Description(shortDefinition="Only return resources which were last updated as specified by the given range") 109 @OptionalParam(name="_lastUpdated") 110 DateRangeParam theLastUpdated, 111 112 @IncludeParam 113 Set<Include> theIncludes, 114 115 @IncludeParam(reverse=true) 116 Set<Include> theRevIncludes, 117 118 @Sort 119 SortSpec theSort, 120 121 @ca.uhn.fhir.rest.annotation.Count 122 Integer theCount, 123 124 @ca.uhn.fhir.rest.annotation.Offset 125 Integer theOffset, 126 127 SummaryEnum theSummaryMode, 128 129 SearchTotalModeEnum theSearchTotalMode, 130 131 SearchContainedModeEnum theSearchContainedMode 132 133 ) { 134 startRequest(theServletRequest); 135 try { 136 SearchParameterMap paramMap = new SearchParameterMap(); 137 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter); 138 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent); 139 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText); 140 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag); 141 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity); 142 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile); 143 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE, theSearchForSource); 144 paramMap.add("_has", theHas); 145 paramMap.add("_id", the_id); 146 paramMap.add("author", theAuthor); 147 paramMap.add("authoring-time", theAuthoring_time); 148 paramMap.add("identifier", theIdentifier); 149 paramMap.add("patient", thePatient); 150 paramMap.add("selected-study", theSelected_study); 151 paramMap.add("title", theTitle); 152 paramMap.setRevIncludes(theRevIncludes); 153 paramMap.setLastUpdated(theLastUpdated); 154 paramMap.setIncludes(theIncludes); 155 paramMap.setSort(theSort); 156 paramMap.setCount(theCount); 157 paramMap.setOffset(theOffset); 158 paramMap.setSummaryMode(theSummaryMode); 159 paramMap.setSearchTotalMode(theSearchTotalMode); 160 paramMap.setSearchContainedMode(theSearchContainedMode); 161 162 getDao().translateRawParameters(theAdditionalRawParams, paramMap); 163 164 ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse); 165 return retVal; 166 } finally { 167 endRequest(theServletRequest); 168 } 169 } 170 171}