View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.dstu2;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.*;
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 ca.uhn.fhir.model.dstu2.composite.*;
13  import ca.uhn.fhir.model.dstu2.resource.*; //
14  import ca.uhn.fhir.rest.annotation.*;
15  import ca.uhn.fhir.rest.param.*;
16  import ca.uhn.fhir.rest.api.SortSpec;
17  import ca.uhn.fhir.rest.api.SummaryEnum;
18  import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
19  
20  public class ImmunizationResourceProvider extends 
21  	JpaResourceProviderDstu2<Immunization>
22  	{
23  
24  	@Override
25  	public Class<Immunization> getResourceType() {
26  		return Immunization.class;
27  	}
28  
29  	@Search(allowUnknownParams=true)
30  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
31  			javax.servlet.http.HttpServletRequest theServletRequest,
32  			javax.servlet.http.HttpServletResponse theServletResponse,
33  
34  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
35  			
36  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
37  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
38  			StringAndListParam theFtContent, 
39  
40  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
41  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
42  			StringAndListParam theFtText, 
43  
44  			@Description(shortDefinition="Search for resources which have the given tag")
45  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
46  			TokenAndListParam theSearchForTag, 
47  
48  			@Description(shortDefinition="Search for resources which have the given security labels")
49  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
50  			TokenAndListParam theSearchForSecurity, 
51    
52  			@Description(shortDefinition="Search for resources which have the given profile")
53  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
54  			UriAndListParam theSearchForProfile, 
55  
56  			@Description(shortDefinition="Return resources linked to by the given target")
57  			@OptionalParam(name="_has")
58  			HasAndListParam theHas, 
59  
60    
61  			@Description(shortDefinition="The ID of the resource")
62  			@OptionalParam(name="_id")
63  			StringAndListParam the_id, 
64    
65  			@Description(shortDefinition="The language of the resource")
66  			@OptionalParam(name="_language")
67  			StringAndListParam the_language, 
68    
69  			@Description(shortDefinition="Vaccination  (non)-Administration Date")
70  			@OptionalParam(name="date")
71  			DateRangeParam theDate, 
72    
73  			@Description(shortDefinition="")
74  			@OptionalParam(name="dose-sequence")
75  			NumberAndListParam theDose_sequence, 
76    
77  			@Description(shortDefinition="")
78  			@OptionalParam(name="identifier")
79  			TokenAndListParam theIdentifier,
80    
81  			@Description(shortDefinition="The service delivery location or facility in which the vaccine was / was to be administered")
82  			@OptionalParam(name="location", targetTypes={  } )
83  			ReferenceAndListParam theLocation, 
84    
85  			@Description(shortDefinition="Vaccine Lot Number")
86  			@OptionalParam(name="lot-number")
87  			StringAndListParam theLot_number, 
88    
89  			@Description(shortDefinition="Vaccine Manufacturer")
90  			@OptionalParam(name="manufacturer", targetTypes={  } )
91  			ReferenceAndListParam theManufacturer, 
92    
93  			@Description(shortDefinition="Administrations which were not given")
94  			@OptionalParam(name="notgiven")
95  			TokenAndListParam theNotgiven,
96    
97  			@Description(shortDefinition="The patient for the vaccination record")
98  			@OptionalParam(name="patient", targetTypes={  } )
99  			ReferenceAndListParam thePatient, 
100   
101 			@Description(shortDefinition="The practitioner who administered the vaccination")
102 			@OptionalParam(name="performer", targetTypes={  } )
103 			ReferenceAndListParam thePerformer, 
104   
105 			@Description(shortDefinition="")
106 			@OptionalParam(name="reaction", targetTypes={  } )
107 			ReferenceAndListParam theReaction, 
108   
109 			@Description(shortDefinition="")
110 			@OptionalParam(name="reaction-date")
111 			DateRangeParam theReaction_date, 
112   
113 			@Description(shortDefinition="")
114 			@OptionalParam(name="reason")
115 			TokenAndListParam theReason,
116   
117 			@Description(shortDefinition="Explanation of reason vaccination was not administered")
118 			@OptionalParam(name="reason-not-given")
119 			TokenAndListParam theReason_not_given,
120   
121 			@Description(shortDefinition="The practitioner who ordered the vaccination")
122 			@OptionalParam(name="requester", targetTypes={  } )
123 			ReferenceAndListParam theRequester, 
124   
125 			@Description(shortDefinition="Immunization event status")
126 			@OptionalParam(name="status")
127 			TokenAndListParam theStatus,
128   
129 			@Description(shortDefinition="Vaccine Product Administered")
130 			@OptionalParam(name="vaccine-code")
131 			TokenAndListParam theVaccine_code,
132 
133 			@RawParam
134 			Map<String, List<String>> theAdditionalRawParams,
135 
136 			@IncludeParam(reverse=true)
137 			Set<Include> theRevIncludes,
138 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
139 			@OptionalParam(name="_lastUpdated")
140 			DateRangeParam theLastUpdated, 
141 
142 			@IncludeParam(allow= {
143 					"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" , 						"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" , 						"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" , 						"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" , 						"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" , 						"Immunization:location" , 					"Immunization:manufacturer" , 					"Immunization:patient" , 					"Immunization:performer" , 					"Immunization:reaction" , 					"Immunization:requester" 					, "*"
144 			}) 
145 			Set<Include> theIncludes,
146 			
147 			@Sort 
148 			SortSpec theSort,
149 			
150 			@ca.uhn.fhir.rest.annotation.Count
151 			Integer theCount,
152 
153 			SummaryEnum theSummaryMode,
154 
155 			SearchTotalModeEnum theSearchTotalMode
156 
157 			) {
158 		startRequest(theServletRequest);
159 		try {
160 			SearchParameterMap paramMap = new SearchParameterMap();
161 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
162 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
163 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
164 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
165 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
166 			paramMap.add("_has", theHas);
167 			paramMap.add("_id", the_id);
168 			paramMap.add("_language", the_language);
169 			paramMap.add("date", theDate);
170 			paramMap.add("dose-sequence", theDose_sequence);
171 			paramMap.add("identifier", theIdentifier);
172 			paramMap.add("location", theLocation);
173 			paramMap.add("lot-number", theLot_number);
174 			paramMap.add("manufacturer", theManufacturer);
175 			paramMap.add("notgiven", theNotgiven);
176 			paramMap.add("patient", thePatient);
177 			paramMap.add("performer", thePerformer);
178 			paramMap.add("reaction", theReaction);
179 			paramMap.add("reaction-date", theReaction_date);
180 			paramMap.add("reason", theReason);
181 			paramMap.add("reason-not-given", theReason_not_given);
182 			paramMap.add("requester", theRequester);
183 			paramMap.add("status", theStatus);
184 			paramMap.add("vaccine-code", theVaccine_code);
185 			paramMap.setRevIncludes(theRevIncludes);
186 			paramMap.setLastUpdated(theLastUpdated);
187 			paramMap.setIncludes(theIncludes);
188 			paramMap.setSort(theSort);
189 			paramMap.setCount(theCount);
190 			paramMap.setSummaryMode(theSummaryMode);
191 			paramMap.setSearchTotalMode(theSearchTotalMode);
192 
193 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
194 
195 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
196 			return retVal;
197 		} finally {
198 			endRequest(theServletRequest);
199 		}
200 	}
201 
202 }