View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.dstu3;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.dstu3.*;
9   import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
10  import ca.uhn.fhir.model.api.Include;
11  import ca.uhn.fhir.model.api.annotation.*;
12  import org.hl7.fhir.dstu3.model.*;
13  import ca.uhn.fhir.rest.annotation.*;
14  import ca.uhn.fhir.rest.param.*;
15  import ca.uhn.fhir.rest.api.SortSpec;
16  import ca.uhn.fhir.rest.api.SummaryEnum;
17  import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
18  
19  public class ConditionResourceProvider extends 
20  	JpaResourceProviderDstu3<Condition>
21  	{
22  
23  	@Override
24  	public Class<Condition> getResourceType() {
25  		return Condition.class;
26  	}
27  
28  	@Search(allowUnknownParams=true)
29  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
30  			javax.servlet.http.HttpServletRequest theServletRequest,
31  			javax.servlet.http.HttpServletResponse theServletResponse,
32  
33  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
34  
35  			@Description(shortDefinition="Search the contents of the resource's data using a filter")
36  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_FILTER)
37  			StringAndListParam theFtFilter,
38  
39  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
40  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
41  			StringAndListParam theFtContent, 
42  
43  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
44  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
45  			StringAndListParam theFtText, 
46  
47  			@Description(shortDefinition="Search for resources which have the given tag")
48  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
49  			TokenAndListParam theSearchForTag, 
50  
51  			@Description(shortDefinition="Search for resources which have the given security labels")
52  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
53  			TokenAndListParam theSearchForSecurity, 
54    
55  			@Description(shortDefinition="Search for resources which have the given profile")
56  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
57  			UriAndListParam theSearchForProfile, 
58  
59  			@Description(shortDefinition="Return resources linked to by the given target")
60  			@OptionalParam(name="_has")
61  			HasAndListParam theHas, 
62  
63    
64  			@Description(shortDefinition="The ID of the resource")
65  			@OptionalParam(name="_id")
66  			TokenAndListParam the_id,
67    
68  			@Description(shortDefinition="The language of the resource")
69  			@OptionalParam(name="_language")
70  			StringAndListParam the_language, 
71    
72  			@Description(shortDefinition="Abatement as age or age range")
73  			@OptionalParam(name="abatement-age")
74  			QuantityAndListParam theAbatement_age, 
75    
76  			@Description(shortDefinition="Abatement boolean (boolean is true or non-boolean values are present)")
77  			@OptionalParam(name="abatement-boolean")
78  			TokenAndListParam theAbatement_boolean,
79    
80  			@Description(shortDefinition="Date-related abatements (dateTime and period)")
81  			@OptionalParam(name="abatement-date")
82  			DateRangeParam theAbatement_date, 
83    
84  			@Description(shortDefinition="Abatement as a string")
85  			@OptionalParam(name="abatement-string")
86  			StringAndListParam theAbatement_string, 
87    
88  			@Description(shortDefinition="Date record was believed accurate")
89  			@OptionalParam(name="asserted-date")
90  			DateRangeParam theAsserted_date, 
91    
92  			@Description(shortDefinition="Person who asserts this condition")
93  			@OptionalParam(name="asserter", targetTypes={  } )
94  			ReferenceAndListParam theAsserter, 
95    
96  			@Description(shortDefinition="Anatomical location, if relevant")
97  			@OptionalParam(name="body-site")
98  			TokenAndListParam theBody_site,
99    
100 			@Description(shortDefinition="The category of the condition")
101 			@OptionalParam(name="category")
102 			TokenAndListParam theCategory,
103   
104 			@Description(shortDefinition="The clinical status of the condition")
105 			@OptionalParam(name="clinical-status")
106 			TokenAndListParam theClinical_status,
107   
108 			@Description(shortDefinition="Code for the condition")
109 			@OptionalParam(name="code")
110 			TokenAndListParam theCode,
111   
112 			@Description(shortDefinition="Encounter or episode when condition first asserted")
113 			@OptionalParam(name="context", targetTypes={  } )
114 			ReferenceAndListParam theContext, 
115   
116 			@Description(shortDefinition="Encounter when condition first asserted")
117 			@OptionalParam(name="encounter", targetTypes={  } )
118 			ReferenceAndListParam theEncounter, 
119   
120 			@Description(shortDefinition="Manifestation/symptom")
121 			@OptionalParam(name="evidence")
122 			TokenAndListParam theEvidence,
123   
124 			@Description(shortDefinition="Supporting information found elsewhere")
125 			@OptionalParam(name="evidence-detail", targetTypes={  } )
126 			ReferenceAndListParam theEvidence_detail, 
127   
128 			@Description(shortDefinition="A unique identifier of the condition record")
129 			@OptionalParam(name="identifier")
130 			TokenAndListParam theIdentifier,
131   
132 			@Description(shortDefinition="Onsets as age or age range")
133 			@OptionalParam(name="onset-age")
134 			QuantityAndListParam theOnset_age, 
135   
136 			@Description(shortDefinition="Date related onsets (dateTime and Period)")
137 			@OptionalParam(name="onset-date")
138 			DateRangeParam theOnset_date, 
139   
140 			@Description(shortDefinition="Onsets as a string")
141 			@OptionalParam(name="onset-info")
142 			StringAndListParam theOnset_info, 
143   
144 			@Description(shortDefinition="Who has the condition?")
145 			@OptionalParam(name="patient", targetTypes={  } )
146 			ReferenceAndListParam thePatient, 
147   
148 			@Description(shortDefinition="The severity of the condition")
149 			@OptionalParam(name="severity")
150 			TokenAndListParam theSeverity,
151   
152 			@Description(shortDefinition="Simple summary (disease specific)")
153 			@OptionalParam(name="stage")
154 			TokenAndListParam theStage,
155   
156 			@Description(shortDefinition="Who has the condition?")
157 			@OptionalParam(name="subject", targetTypes={  } )
158 			ReferenceAndListParam theSubject, 
159   
160 			@Description(shortDefinition="provisional | differential | confirmed | refuted | entered-in-error | unknown")
161 			@OptionalParam(name="verification-status")
162 			TokenAndListParam theVerification_status,
163 
164 			@RawParam
165 			Map<String, List<String>> theAdditionalRawParams,
166 
167 			@IncludeParam(reverse=true)
168 			Set<Include> theRevIncludes,
169 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
170 			@OptionalParam(name="_lastUpdated")
171 			DateRangeParam theLastUpdated, 
172 
173 			@IncludeParam(allow= {
174 					"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" , 						"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" , 						"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" , 						"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" , 						"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" , 						"Condition:asserter" , 					"Condition:context" , 					"Condition:encounter" , 					"Condition:evidence-detail" , 					"Condition:patient" , 					"Condition:subject" 					, "*"
175 			}) 
176 			Set<Include> theIncludes,
177 			
178 			@Sort 
179 			SortSpec theSort,
180 			
181 			@ca.uhn.fhir.rest.annotation.Count
182 			Integer theCount,
183 
184 			SummaryEnum theSummaryMode,
185 
186 			SearchTotalModeEnum theSearchTotalMode
187 
188 			) {
189 		startRequest(theServletRequest);
190 		try {
191 			SearchParameterMap paramMap = new SearchParameterMap();
192 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
193 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
194 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
195 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
196 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
197 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
198 			paramMap.add("_has", theHas);
199 			paramMap.add("_id", the_id);
200 			paramMap.add("_language", the_language);
201 			paramMap.add("abatement-age", theAbatement_age);
202 			paramMap.add("abatement-boolean", theAbatement_boolean);
203 			paramMap.add("abatement-date", theAbatement_date);
204 			paramMap.add("abatement-string", theAbatement_string);
205 			paramMap.add("asserted-date", theAsserted_date);
206 			paramMap.add("asserter", theAsserter);
207 			paramMap.add("body-site", theBody_site);
208 			paramMap.add("category", theCategory);
209 			paramMap.add("clinical-status", theClinical_status);
210 			paramMap.add("code", theCode);
211 			paramMap.add("context", theContext);
212 			paramMap.add("encounter", theEncounter);
213 			paramMap.add("evidence", theEvidence);
214 			paramMap.add("evidence-detail", theEvidence_detail);
215 			paramMap.add("identifier", theIdentifier);
216 			paramMap.add("onset-age", theOnset_age);
217 			paramMap.add("onset-date", theOnset_date);
218 			paramMap.add("onset-info", theOnset_info);
219 			paramMap.add("patient", thePatient);
220 			paramMap.add("severity", theSeverity);
221 			paramMap.add("stage", theStage);
222 			paramMap.add("subject", theSubject);
223 			paramMap.add("verification-status", theVerification_status);
224 			paramMap.setRevIncludes(theRevIncludes);
225 			paramMap.setLastUpdated(theLastUpdated);
226 			paramMap.setIncludes(theIncludes);
227 			paramMap.setSort(theSort);
228 			paramMap.setCount(theCount);
229 			paramMap.setSummaryMode(theSummaryMode);
230 			paramMap.setSearchTotalMode(theSearchTotalMode);
231 
232 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
233 
234 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
235 			return retVal;
236 		} finally {
237 			endRequest(theServletRequest);
238 		}
239 	}
240 
241 }