View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.dstu3;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.dstu3.*;
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 org.hl7.fhir.dstu3.model.*;
13  import ca.uhn.fhir.rest.annotation.*;
14  import ca.uhn.fhir.rest.param.*;
15  import ca.uhn.fhir.rest.api.SortSpec;
16  
17  public class ChargeItemResourceProvider extends 
18  	JpaResourceProviderDstu3<ChargeItem>
19  	{
20  
21  	@Override
22  	public Class<ChargeItem> getResourceType() {
23  		return ChargeItem.class;
24  	}
25  
26  	@Search(allowUnknownParams=true)
27  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
28  			javax.servlet.http.HttpServletRequest theServletRequest,
29  			javax.servlet.http.HttpServletResponse theServletResponse,
30  
31  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
32  			
33  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
34  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
35  			StringAndListParam theFtContent, 
36  
37  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
38  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
39  			StringAndListParam theFtText, 
40  
41  			@Description(shortDefinition="Search for resources which have the given tag")
42  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
43  			TokenAndListParam theSearchForTag, 
44  
45  			@Description(shortDefinition="Search for resources which have the given security labels")
46  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
47  			TokenAndListParam theSearchForSecurity, 
48    
49  			@Description(shortDefinition="Search for resources which have the given profile")
50  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
51  			UriAndListParam theSearchForProfile, 
52  
53  			@Description(shortDefinition="Return resources linked to by the given target")
54  			@OptionalParam(name="_has")
55  			HasAndListParam theHas, 
56  
57    
58  			@Description(shortDefinition="The ID of the resource")
59  			@OptionalParam(name="_id")
60  			TokenAndListParam the_id, 
61    
62  			@Description(shortDefinition="The language of the resource")
63  			@OptionalParam(name="_language")
64  			StringAndListParam the_language, 
65    
66  			@Description(shortDefinition="Account to place this charge")
67  			@OptionalParam(name="account", targetTypes={  } )
68  			ReferenceAndListParam theAccount, 
69    
70  			@Description(shortDefinition="A code that identifies the charge, like a billing code")
71  			@OptionalParam(name="code")
72  			TokenAndListParam theCode, 
73    
74  			@Description(shortDefinition="Encounter / Episode associated with event")
75  			@OptionalParam(name="context", targetTypes={  } )
76  			ReferenceAndListParam theContext, 
77    
78  			@Description(shortDefinition="Date the charge item was entered")
79  			@OptionalParam(name="entered-date")
80  			DateRangeParam theEntered_date, 
81    
82  			@Description(shortDefinition="Individual who was entering")
83  			@OptionalParam(name="enterer", targetTypes={  } )
84  			ReferenceAndListParam theEnterer, 
85    
86  			@Description(shortDefinition="Factor overriding the associated rules")
87  			@OptionalParam(name="factor-override")
88  			NumberAndListParam theFactor_override, 
89    
90  			@Description(shortDefinition="Business Identifier for item")
91  			@OptionalParam(name="identifier")
92  			TokenAndListParam theIdentifier, 
93    
94  			@Description(shortDefinition="When the charged service was applied")
95  			@OptionalParam(name="occurrence")
96  			DateRangeParam theOccurrence, 
97    
98  			@Description(shortDefinition="Individual who was performing")
99  			@OptionalParam(name="participant-actor", targetTypes={  } )
100 			ReferenceAndListParam theParticipant_actor, 
101   
102 			@Description(shortDefinition="What type of performance was done")
103 			@OptionalParam(name="participant-role")
104 			TokenAndListParam theParticipant_role, 
105   
106 			@Description(shortDefinition="Individual service was done for/to")
107 			@OptionalParam(name="patient", targetTypes={  } )
108 			ReferenceAndListParam thePatient, 
109   
110 			@Description(shortDefinition="Organization providing the charged sevice")
111 			@OptionalParam(name="performing-organization", targetTypes={  } )
112 			ReferenceAndListParam thePerforming_organization, 
113   
114 			@Description(shortDefinition="Price overriding the associated rules")
115 			@OptionalParam(name="price-override")
116 			QuantityAndListParam thePrice_override, 
117   
118 			@Description(shortDefinition="Quantity of which the charge item has been serviced")
119 			@OptionalParam(name="quantity")
120 			QuantityAndListParam theQuantity, 
121   
122 			@Description(shortDefinition="Organization requesting the charged service")
123 			@OptionalParam(name="requesting-organization", targetTypes={  } )
124 			ReferenceAndListParam theRequesting_organization, 
125   
126 			@Description(shortDefinition="Which rendered service is being charged?")
127 			@OptionalParam(name="service", targetTypes={  } )
128 			ReferenceAndListParam theService, 
129   
130 			@Description(shortDefinition="Individual service was done for/to")
131 			@OptionalParam(name="subject", targetTypes={  } )
132 			ReferenceAndListParam theSubject, 
133 
134 			@RawParam
135 			Map<String, List<String>> theAdditionalRawParams,
136 
137 			@IncludeParam(reverse=true)
138 			Set<Include> theRevIncludes,
139 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
140 			@OptionalParam(name="_lastUpdated")
141 			DateRangeParam theLastUpdated, 
142 
143 			@IncludeParam(allow= {
144 					"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" , 						"ChargeItem:account" , 					"ChargeItem:context" , 					"ChargeItem:enterer" , 					"ChargeItem:participant-actor" , 					"ChargeItem:patient" , 					"ChargeItem:performing-organization" , 					"ChargeItem:requesting-organization" , 					"ChargeItem:service" , 					"ChargeItem:subject" 					, "*"
145 			}) 
146 			Set<Include> theIncludes,
147 			
148 			@Sort 
149 			SortSpec theSort,
150 			
151 			@ca.uhn.fhir.rest.annotation.Count
152 			Integer theCount
153 	) {
154 		startRequest(theServletRequest);
155 		try {
156 			SearchParameterMap paramMap = new SearchParameterMap();
157 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
158 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
159 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
160 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
161 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
162 			paramMap.add("_has", theHas);
163 			paramMap.add("_id", the_id);
164 			paramMap.add("_language", the_language);
165 			paramMap.add("account", theAccount);
166 			paramMap.add("code", theCode);
167 			paramMap.add("context", theContext);
168 			paramMap.add("entered-date", theEntered_date);
169 			paramMap.add("enterer", theEnterer);
170 			paramMap.add("factor-override", theFactor_override);
171 			paramMap.add("identifier", theIdentifier);
172 			paramMap.add("occurrence", theOccurrence);
173 			paramMap.add("participant-actor", theParticipant_actor);
174 			paramMap.add("participant-role", theParticipant_role);
175 			paramMap.add("patient", thePatient);
176 			paramMap.add("performing-organization", thePerforming_organization);
177 			paramMap.add("price-override", thePrice_override);
178 			paramMap.add("quantity", theQuantity);
179 			paramMap.add("requesting-organization", theRequesting_organization);
180 			paramMap.add("service", theService);
181 			paramMap.add("subject", theSubject);
182 			paramMap.setRevIncludes(theRevIncludes);
183 			paramMap.setLastUpdated(theLastUpdated);
184 			paramMap.setIncludes(theIncludes);
185 			paramMap.setSort(theSort);
186 			paramMap.setCount(theCount);
187 
188 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
189 
190 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
191 			return retVal;
192 		} finally {
193 			endRequest(theServletRequest);
194 		}
195 	}
196 
197 }