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 DiagnosticOrderResourceProvider extends 
21  	JpaResourceProviderDstu2<DiagnosticOrder>
22  	{
23  
24  	@Override
25  	public Class<DiagnosticOrder> getResourceType() {
26  		return DiagnosticOrder.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="")
70  			@OptionalParam(name="actor", targetTypes={  } )
71  			ReferenceAndListParam theActor, 
72    
73  			@Description(shortDefinition="")
74  			@OptionalParam(name="bodysite")
75  			TokenAndListParam theBodysite,
76    
77  			@Description(shortDefinition="")
78  			@OptionalParam(name="code")
79  			TokenAndListParam theCode,
80    
81  			@Description(shortDefinition="")
82  			@OptionalParam(name="encounter", targetTypes={  } )
83  			ReferenceAndListParam theEncounter, 
84    
85  			@Description(shortDefinition="")
86  			@OptionalParam(name="event-date")
87  			DateRangeParam theEvent_date, 
88    
89  			@Description(shortDefinition="")
90  			@OptionalParam(name="event-status")
91  			TokenAndListParam theEvent_status,
92    
93  			@Description(shortDefinition="A combination of past-status and date")
94  			@OptionalParam(name="event-status-event-date", compositeTypes= { TokenParam.class, DateParam.class })
95  			CompositeAndListParam<TokenParam, DateParam> theEvent_status_event_date,
96    
97  			@Description(shortDefinition="")
98  			@OptionalParam(name="identifier")
99  			TokenAndListParam theIdentifier,
100   
101 			@Description(shortDefinition="")
102 			@OptionalParam(name="item-date")
103 			DateRangeParam theItem_date, 
104   
105 			@Description(shortDefinition="")
106 			@OptionalParam(name="item-past-status")
107 			TokenAndListParam theItem_past_status,
108   
109 			@Description(shortDefinition="A combination of item-past-status and item-date")
110 			@OptionalParam(name="item-past-status-item-date", compositeTypes= { TokenParam.class, DateParam.class })
111 			CompositeAndListParam<TokenParam, DateParam> theItem_past_status_item_date,
112   
113 			@Description(shortDefinition="")
114 			@OptionalParam(name="item-status")
115 			TokenAndListParam theItem_status,
116   
117 			@Description(shortDefinition="")
118 			@OptionalParam(name="orderer", targetTypes={  } )
119 			ReferenceAndListParam theOrderer, 
120   
121 			@Description(shortDefinition="")
122 			@OptionalParam(name="patient", targetTypes={  } )
123 			ReferenceAndListParam thePatient, 
124   
125 			@Description(shortDefinition="")
126 			@OptionalParam(name="specimen", targetTypes={  } )
127 			ReferenceAndListParam theSpecimen, 
128   
129 			@Description(shortDefinition="")
130 			@OptionalParam(name="status")
131 			TokenAndListParam theStatus,
132   
133 			@Description(shortDefinition="")
134 			@OptionalParam(name="subject", targetTypes={  } )
135 			ReferenceAndListParam theSubject, 
136 
137 			@RawParam
138 			Map<String, List<String>> theAdditionalRawParams,
139 
140 			@IncludeParam(reverse=true)
141 			Set<Include> theRevIncludes,
142 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
143 			@OptionalParam(name="_lastUpdated")
144 			DateRangeParam theLastUpdated, 
145 
146 			@IncludeParam(allow= {
147 					"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" , 						"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" , 						"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" , 						"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" , 						"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" , 						"DiagnosticOrder:actor" , 					"DiagnosticOrder:encounter" , 					"DiagnosticOrder:orderer" , 					"DiagnosticOrder:patient" , 					"DiagnosticOrder:specimen" , 					"DiagnosticOrder:subject" 					, "*"
148 			}) 
149 			Set<Include> theIncludes,
150 			
151 			@Sort 
152 			SortSpec theSort,
153 			
154 			@ca.uhn.fhir.rest.annotation.Count
155 			Integer theCount,
156 
157 			SummaryEnum theSummaryMode,
158 
159 			SearchTotalModeEnum theSearchTotalMode
160 
161 			) {
162 		startRequest(theServletRequest);
163 		try {
164 			SearchParameterMap paramMap = new SearchParameterMap();
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("actor", theActor);
174 			paramMap.add("bodysite", theBodysite);
175 			paramMap.add("code", theCode);
176 			paramMap.add("encounter", theEncounter);
177 			paramMap.add("event-date", theEvent_date);
178 			paramMap.add("event-status", theEvent_status);
179 			paramMap.add("event-status-event-date", theEvent_status_event_date);
180 			paramMap.add("identifier", theIdentifier);
181 			paramMap.add("item-date", theItem_date);
182 			paramMap.add("item-past-status", theItem_past_status);
183 			paramMap.add("item-past-status-item-date", theItem_past_status_item_date);
184 			paramMap.add("item-status", theItem_status);
185 			paramMap.add("orderer", theOrderer);
186 			paramMap.add("patient", thePatient);
187 			paramMap.add("specimen", theSpecimen);
188 			paramMap.add("status", theStatus);
189 			paramMap.add("subject", theSubject);
190 			paramMap.setRevIncludes(theRevIncludes);
191 			paramMap.setLastUpdated(theLastUpdated);
192 			paramMap.setIncludes(theIncludes);
193 			paramMap.setSort(theSort);
194 			paramMap.setCount(theCount);
195 			paramMap.setSummaryMode(theSummaryMode);
196 			paramMap.setSearchTotalMode(theSearchTotalMode);
197 
198 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
199 
200 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
201 			return retVal;
202 		} finally {
203 			endRequest(theServletRequest);
204 		}
205 	}
206 
207 }