View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.r4;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.r4.*;
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.r4.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 AllergyIntoleranceResourceProvider extends 
20  	JpaResourceProviderR4<AllergyIntolerance>
21  	{
22  
23  	@Override
24  	public Class<AllergyIntolerance> getResourceType() {
25  		return AllergyIntolerance.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="Source of the information about the allergy")
73  			@OptionalParam(name="asserter", targetTypes={  } )
74  			ReferenceAndListParam theAsserter, 
75    
76  			@Description(shortDefinition="food | medication | environment | biologic")
77  			@OptionalParam(name="category")
78  			TokenAndListParam theCategory,
79    
80  			@Description(shortDefinition="active | inactive | resolved")
81  			@OptionalParam(name="clinical-status")
82  			TokenAndListParam theClinical_status,
83    
84  			@Description(shortDefinition="Code that identifies the allergy or intolerance")
85  			@OptionalParam(name="code")
86  			TokenAndListParam theCode,
87    
88  			@Description(shortDefinition="low | high | unable-to-assess")
89  			@OptionalParam(name="criticality")
90  			TokenAndListParam theCriticality,
91    
92  			@Description(shortDefinition="Date first version of the resource instance was recorded")
93  			@OptionalParam(name="date")
94  			DateRangeParam theDate, 
95    
96  			@Description(shortDefinition="External ids for this item")
97  			@OptionalParam(name="identifier")
98  			TokenAndListParam theIdentifier,
99    
100 			@Description(shortDefinition="Date(/time) of last known occurrence of a reaction")
101 			@OptionalParam(name="last-date")
102 			DateRangeParam theLast_date, 
103   
104 			@Description(shortDefinition="Clinical symptoms/signs associated with the Event")
105 			@OptionalParam(name="manifestation")
106 			TokenAndListParam theManifestation,
107   
108 			@Description(shortDefinition="Date(/time) when manifestations showed")
109 			@OptionalParam(name="onset")
110 			DateRangeParam theOnset, 
111   
112 			@Description(shortDefinition="Who the sensitivity is for")
113 			@OptionalParam(name="patient", targetTypes={  } )
114 			ReferenceAndListParam thePatient, 
115   
116 			@Description(shortDefinition="Who recorded the sensitivity")
117 			@OptionalParam(name="recorder", targetTypes={  } )
118 			ReferenceAndListParam theRecorder, 
119   
120 			@Description(shortDefinition="How the subject was exposed to the substance")
121 			@OptionalParam(name="route")
122 			TokenAndListParam theRoute,
123   
124 			@Description(shortDefinition="mild | moderate | severe (of event as a whole)")
125 			@OptionalParam(name="severity")
126 			TokenAndListParam theSeverity,
127   
128 			@Description(shortDefinition="allergy | intolerance - Underlying mechanism (if known)")
129 			@OptionalParam(name="type")
130 			TokenAndListParam theType,
131   
132 			@Description(shortDefinition="unconfirmed | confirmed | refuted | entered-in-error")
133 			@OptionalParam(name="verification-status")
134 			TokenAndListParam theVerification_status,
135 
136 			@RawParam
137 			Map<String, List<String>> theAdditionalRawParams,
138 
139 			@IncludeParam(reverse=true)
140 			Set<Include> theRevIncludes,
141 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
142 			@OptionalParam(name="_lastUpdated")
143 			DateRangeParam theLastUpdated, 
144 
145 			@IncludeParam(allow= {
146 					"AllergyIntolerance:asserter" , 					"AllergyIntolerance:patient" , 					"AllergyIntolerance:recorder" , 						"AllergyIntolerance:asserter" , 					"AllergyIntolerance:patient" , 					"AllergyIntolerance:recorder" , 						"AllergyIntolerance:asserter" , 					"AllergyIntolerance:patient" , 					"AllergyIntolerance:recorder" 					, "*"
147 			}) 
148 			Set<Include> theIncludes,
149 			
150 			@Sort 
151 			SortSpec theSort,
152 			
153 			@ca.uhn.fhir.rest.annotation.Count
154 			Integer theCount,
155 
156 			SummaryEnum theSummaryMode,
157 
158 			SearchTotalModeEnum theSearchTotalMode
159 
160 			) {
161 		startRequest(theServletRequest);
162 		try {
163 			SearchParameterMap paramMap = new SearchParameterMap();
164 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
165 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
166 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
167 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
168 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
169 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
170 			paramMap.add("_has", theHas);
171 			paramMap.add("_id", the_id);
172 			paramMap.add("_language", the_language);
173 			paramMap.add("asserter", theAsserter);
174 			paramMap.add("category", theCategory);
175 			paramMap.add("clinical-status", theClinical_status);
176 			paramMap.add("code", theCode);
177 			paramMap.add("criticality", theCriticality);
178 			paramMap.add("date", theDate);
179 			paramMap.add("identifier", theIdentifier);
180 			paramMap.add("last-date", theLast_date);
181 			paramMap.add("manifestation", theManifestation);
182 			paramMap.add("onset", theOnset);
183 			paramMap.add("patient", thePatient);
184 			paramMap.add("recorder", theRecorder);
185 			paramMap.add("route", theRoute);
186 			paramMap.add("severity", theSeverity);
187 			paramMap.add("type", theType);
188 			paramMap.add("verification-status", theVerification_status);
189 			paramMap.setRevIncludes(theRevIncludes);
190 			paramMap.setLastUpdated(theLastUpdated);
191 			paramMap.setIncludes(theIncludes);
192 			paramMap.setSort(theSort);
193 			paramMap.setCount(theCount);
194 			paramMap.setSummaryMode(theSummaryMode);
195 			paramMap.setSearchTotalMode(theSearchTotalMode);
196 
197 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
198 
199 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
200 			return retVal;
201 		} finally {
202 			endRequest(theServletRequest);
203 		}
204 	}
205 
206 }