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 ChargeItemResourceProvider extends 
20  	JpaResourceProviderR4<ChargeItem>
21  	{
22  
23  	@Override
24  	public Class<ChargeItem> getResourceType() {
25  		return ChargeItem.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="Account to place this charge")
73  			@OptionalParam(name="account", targetTypes={  } )
74  			ReferenceAndListParam theAccount, 
75    
76  			@Description(shortDefinition="A code that identifies the charge, like a billing code")
77  			@OptionalParam(name="code")
78  			TokenAndListParam theCode,
79    
80  			@Description(shortDefinition="Encounter / Episode associated with event")
81  			@OptionalParam(name="context", targetTypes={  } )
82  			ReferenceAndListParam theContext, 
83    
84  			@Description(shortDefinition="Date the charge item was entered")
85  			@OptionalParam(name="entered-date")
86  			DateRangeParam theEntered_date, 
87    
88  			@Description(shortDefinition="Individual who was entering")
89  			@OptionalParam(name="enterer", targetTypes={  } )
90  			ReferenceAndListParam theEnterer, 
91    
92  			@Description(shortDefinition="Factor overriding the associated rules")
93  			@OptionalParam(name="factor-override")
94  			NumberAndListParam theFactor_override, 
95    
96  			@Description(shortDefinition="Business Identifier for item")
97  			@OptionalParam(name="identifier")
98  			TokenAndListParam theIdentifier,
99    
100 			@Description(shortDefinition="When the charged service was applied")
101 			@OptionalParam(name="occurrence")
102 			DateRangeParam theOccurrence, 
103   
104 			@Description(shortDefinition="Individual service was done for/to")
105 			@OptionalParam(name="patient", targetTypes={  } )
106 			ReferenceAndListParam thePatient, 
107   
108 			@Description(shortDefinition="Individual who was performing")
109 			@OptionalParam(name="performer-actor", targetTypes={  } )
110 			ReferenceAndListParam thePerformer_actor, 
111   
112 			@Description(shortDefinition="What type of performance was done")
113 			@OptionalParam(name="performer-function")
114 			TokenAndListParam thePerformer_function,
115   
116 			@Description(shortDefinition="Organization providing the charged service")
117 			@OptionalParam(name="performing-organization", targetTypes={  } )
118 			ReferenceAndListParam thePerforming_organization, 
119   
120 			@Description(shortDefinition="Price overriding the associated rules")
121 			@OptionalParam(name="price-override")
122 			QuantityAndListParam thePrice_override, 
123   
124 			@Description(shortDefinition="Quantity of which the charge item has been serviced")
125 			@OptionalParam(name="quantity")
126 			QuantityAndListParam theQuantity, 
127   
128 			@Description(shortDefinition="Organization requesting the charged service")
129 			@OptionalParam(name="requesting-organization", targetTypes={  } )
130 			ReferenceAndListParam theRequesting_organization, 
131   
132 			@Description(shortDefinition="Which rendered service is being charged?")
133 			@OptionalParam(name="service", targetTypes={  } )
134 			ReferenceAndListParam theService, 
135   
136 			@Description(shortDefinition="Individual service was done for/to")
137 			@OptionalParam(name="subject", targetTypes={  } )
138 			ReferenceAndListParam theSubject, 
139 
140 			@RawParam
141 			Map<String, List<String>> theAdditionalRawParams,
142 
143 			@IncludeParam(reverse=true)
144 			Set<Include> theRevIncludes,
145 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
146 			@OptionalParam(name="_lastUpdated")
147 			DateRangeParam theLastUpdated, 
148 
149 			@IncludeParam(allow= {
150 					"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:patient" , 					"ChargeItem:performer-actor" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" 					, "*"
151 			}) 
152 			Set<Include> theIncludes,
153 			
154 			@Sort 
155 			SortSpec theSort,
156 			
157 			@ca.uhn.fhir.rest.annotation.Count
158 			Integer theCount,
159 
160 			SummaryEnum theSummaryMode,
161 
162 			SearchTotalModeEnum theSearchTotalMode
163 
164 			) {
165 		startRequest(theServletRequest);
166 		try {
167 			SearchParameterMap paramMap = new SearchParameterMap();
168 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
169 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
170 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
171 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
172 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
173 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
174 			paramMap.add("_has", theHas);
175 			paramMap.add("_id", the_id);
176 			paramMap.add("_language", the_language);
177 			paramMap.add("account", theAccount);
178 			paramMap.add("code", theCode);
179 			paramMap.add("context", theContext);
180 			paramMap.add("entered-date", theEntered_date);
181 			paramMap.add("enterer", theEnterer);
182 			paramMap.add("factor-override", theFactor_override);
183 			paramMap.add("identifier", theIdentifier);
184 			paramMap.add("occurrence", theOccurrence);
185 			paramMap.add("patient", thePatient);
186 			paramMap.add("performer-actor", thePerformer_actor);
187 			paramMap.add("performer-function", thePerformer_function);
188 			paramMap.add("performing-organization", thePerforming_organization);
189 			paramMap.add("price-override", thePrice_override);
190 			paramMap.add("quantity", theQuantity);
191 			paramMap.add("requesting-organization", theRequesting_organization);
192 			paramMap.add("service", theService);
193 			paramMap.add("subject", theSubject);
194 			paramMap.setRevIncludes(theRevIncludes);
195 			paramMap.setLastUpdated(theLastUpdated);
196 			paramMap.setIncludes(theIncludes);
197 			paramMap.setSort(theSort);
198 			paramMap.setCount(theCount);
199 			paramMap.setSummaryMode(theSummaryMode);
200 			paramMap.setSearchTotalMode(theSearchTotalMode);
201 
202 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
203 
204 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
205 			return retVal;
206 		} finally {
207 			endRequest(theServletRequest);
208 		}
209 	}
210 
211 }