001 002package ca.uhn.fhir.jpa.rp.dstu3; 003 004import java.util.*; 005 006import org.apache.commons.lang3.StringUtils; 007 008import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; 009import ca.uhn.fhir.model.api.Include; 010import ca.uhn.fhir.model.api.annotation.*; 011import org.hl7.fhir.dstu3.model.*; 012import ca.uhn.fhir.rest.annotation.*; 013import ca.uhn.fhir.rest.param.*; 014import ca.uhn.fhir.rest.api.SortSpec; 015import ca.uhn.fhir.rest.api.SummaryEnum; 016import ca.uhn.fhir.rest.api.SearchTotalModeEnum; 017import ca.uhn.fhir.rest.api.SearchContainedModeEnum; 018 019public class ProcedureRequestResourceProvider extends 020 ca.uhn.fhir.jpa.provider.BaseJpaResourceProvider<ProcedureRequest> 021 { 022 023 @Override 024 public Class<ProcedureRequest> getResourceType() { 025 return ProcedureRequest.class; 026 } 027 028 @Search(allowUnknownParams=true) 029 public ca.uhn.fhir.rest.api.server.IBundleProvider search( 030 jakarta.servlet.http.HttpServletRequest theServletRequest, 031 jakarta.servlet.http.HttpServletResponse theServletResponse, 032 033 ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, 034 035 @Description(shortDefinition="Search the contents of the resource's data using a filter") 036 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_FILTER) 037 StringAndListParam theFtFilter, 038 039 @Description(shortDefinition="Search the contents of the resource's data using a fulltext search") 040 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) 041 StringAndListParam theFtContent, 042 043 @Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search") 044 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) 045 StringAndListParam theFtText, 046 047 @Description(shortDefinition="Search for resources which have the given tag") 048 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) 049 TokenAndListParam theSearchForTag, 050 051 @Description(shortDefinition="Search for resources which have the given security labels") 052 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) 053 TokenAndListParam theSearchForSecurity, 054 055 @Description(shortDefinition="Search for resources which have the given profile") 056 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) 057 UriAndListParam theSearchForProfile, 058 059 @Description(shortDefinition="Search the contents of the resource's data using a list") 060 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_LIST) 061 StringAndListParam theList, 062 063 @Description(shortDefinition="The language of the resource") 064 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_LANGUAGE) 065 TokenAndListParam theResourceLanguage, 066 067 @Description(shortDefinition="Search for resources which have the given source value (Resource.meta.source)") 068 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE) 069 UriAndListParam theSearchForSource, 070 071 @Description(shortDefinition="Return resources linked to by the given target") 072 @OptionalParam(name="_has") 073 HasAndListParam theHas, 074 075 076 077 @Description(shortDefinition="The ID of the resource") 078 @OptionalParam(name="_id") 079 TokenAndListParam the_id, 080 081 082 @Description(shortDefinition="Date request signed") 083 @OptionalParam(name="authored") 084 DateRangeParam theAuthored, 085 086 087 @Description(shortDefinition="What request fulfills") 088 @OptionalParam(name="based-on", targetTypes={ } ) 089 ReferenceAndListParam theBased_on, 090 091 092 @Description(shortDefinition="Where procedure is going to be done") 093 @OptionalParam(name="body-site") 094 TokenAndListParam theBody_site, 095 096 097 @Description(shortDefinition="What is being requested/ordered") 098 @OptionalParam(name="code") 099 TokenAndListParam theCode, 100 101 102 @Description(shortDefinition="Encounter or Episode during which request was created") 103 @OptionalParam(name="context", targetTypes={ } ) 104 ReferenceAndListParam theContext, 105 106 107 @Description(shortDefinition="Protocol or definition") 108 @OptionalParam(name="definition", targetTypes={ } ) 109 ReferenceAndListParam theDefinition, 110 111 112 @Description(shortDefinition="An encounter in which this request is made") 113 @OptionalParam(name="encounter", targetTypes={ } ) 114 ReferenceAndListParam theEncounter, 115 116 117 @Description(shortDefinition="Identifiers assigned to this order") 118 @OptionalParam(name="identifier") 119 TokenAndListParam theIdentifier, 120 121 122 @Description(shortDefinition="proposal | plan | order +") 123 @OptionalParam(name="intent") 124 TokenAndListParam theIntent, 125 126 127 @Description(shortDefinition="When procedure should occur") 128 @OptionalParam(name="occurrence") 129 DateRangeParam theOccurrence, 130 131 132 @Description(shortDefinition="Search by subject - a patient") 133 @OptionalParam(name="patient", targetTypes={ } ) 134 ReferenceAndListParam thePatient, 135 136 137 @Description(shortDefinition="Requested perfomer") 138 @OptionalParam(name="performer", targetTypes={ } ) 139 ReferenceAndListParam thePerformer, 140 141 142 @Description(shortDefinition="Performer role") 143 @OptionalParam(name="performer-type") 144 TokenAndListParam thePerformer_type, 145 146 147 @Description(shortDefinition="routine | urgent | asap | stat") 148 @OptionalParam(name="priority") 149 TokenAndListParam thePriority, 150 151 152 @Description(shortDefinition="What request replaces") 153 @OptionalParam(name="replaces", targetTypes={ } ) 154 ReferenceAndListParam theReplaces, 155 156 157 @Description(shortDefinition="Individual making the request") 158 @OptionalParam(name="requester", targetTypes={ } ) 159 ReferenceAndListParam theRequester, 160 161 162 @Description(shortDefinition="Composite Request ID") 163 @OptionalParam(name="requisition") 164 TokenAndListParam theRequisition, 165 166 167 @Description(shortDefinition="Specimen to be tested") 168 @OptionalParam(name="specimen", targetTypes={ } ) 169 ReferenceAndListParam theSpecimen, 170 171 172 @Description(shortDefinition="draft | active | suspended | completed | entered-in-error | cancelled") 173 @OptionalParam(name="status") 174 TokenAndListParam theStatus, 175 176 177 @Description(shortDefinition="Search by subject") 178 @OptionalParam(name="subject", targetTypes={ } ) 179 ReferenceAndListParam theSubject, 180 181 @RawParam 182 Map<String, List<String>> theAdditionalRawParams, 183 184 @Description(shortDefinition="Only return resources which were last updated as specified by the given range") 185 @OptionalParam(name="_lastUpdated") 186 DateRangeParam theLastUpdated, 187 188 @IncludeParam 189 Set<Include> theIncludes, 190 191 @IncludeParam(reverse=true) 192 Set<Include> theRevIncludes, 193 194 @Sort 195 SortSpec theSort, 196 197 @ca.uhn.fhir.rest.annotation.Count 198 Integer theCount, 199 200 @ca.uhn.fhir.rest.annotation.Offset 201 Integer theOffset, 202 203 SummaryEnum theSummaryMode, 204 205 SearchTotalModeEnum theSearchTotalMode, 206 207 SearchContainedModeEnum theSearchContainedMode 208 209 ) { 210 startRequest(theServletRequest); 211 try { 212 SearchParameterMap paramMap = new SearchParameterMap(); 213 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter); 214 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent); 215 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText); 216 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag); 217 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity); 218 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile); 219 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE, theSearchForSource); 220 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LIST, theList); 221 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LANGUAGE, theResourceLanguage); 222 223 paramMap.add("_has", theHas); 224 paramMap.add("_id", the_id); 225 paramMap.add("authored", theAuthored); 226 paramMap.add("based-on", theBased_on); 227 paramMap.add("body-site", theBody_site); 228 paramMap.add("code", theCode); 229 paramMap.add("context", theContext); 230 paramMap.add("definition", theDefinition); 231 paramMap.add("encounter", theEncounter); 232 paramMap.add("identifier", theIdentifier); 233 paramMap.add("intent", theIntent); 234 paramMap.add("occurrence", theOccurrence); 235 paramMap.add("patient", thePatient); 236 paramMap.add("performer", thePerformer); 237 paramMap.add("performer-type", thePerformer_type); 238 paramMap.add("priority", thePriority); 239 paramMap.add("replaces", theReplaces); 240 paramMap.add("requester", theRequester); 241 paramMap.add("requisition", theRequisition); 242 paramMap.add("specimen", theSpecimen); 243 paramMap.add("status", theStatus); 244 paramMap.add("subject", theSubject); 245 paramMap.setRevIncludes(theRevIncludes); 246 paramMap.setLastUpdated(theLastUpdated); 247 paramMap.setIncludes(theIncludes); 248 paramMap.setSort(theSort); 249 paramMap.setCount(theCount); 250 paramMap.setOffset(theOffset); 251 paramMap.setSummaryMode(theSummaryMode); 252 paramMap.setSearchTotalMode(theSearchTotalMode); 253 paramMap.setSearchContainedMode(theSearchContainedMode); 254 255 getDao().translateRawParameters(theAdditionalRawParams, paramMap); 256 257 ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse); 258 return retVal; 259 } finally { 260 endRequest(theServletRequest); 261 } 262 } 263 264}