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