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