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 ActivityDefinitionResourceProvider extends 
20  	JpaResourceProviderR4<ActivityDefinition>
21  	{
22  
23  	@Override
24  	public Class<ActivityDefinition> getResourceType() {
25  		return ActivityDefinition.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="What resource is being referenced")
73  			@OptionalParam(name="composed-of", targetTypes={  } )
74  			ReferenceAndListParam theComposed_of, 
75    
76  			@Description(shortDefinition="A use context assigned to the activity definition")
77  			@OptionalParam(name="context")
78  			TokenAndListParam theContext,
79    
80  			@Description(shortDefinition="A quantity- or range-valued use context assigned to the activity definition")
81  			@OptionalParam(name="context-quantity")
82  			QuantityAndListParam theContext_quantity, 
83    
84  			@Description(shortDefinition="A type of use context assigned to the activity definition")
85  			@OptionalParam(name="context-type")
86  			TokenAndListParam theContext_type,
87    
88  			@Description(shortDefinition="A use context type and quantity- or range-based value assigned to the activity definition")
89  			@OptionalParam(name="context-type-quantity", compositeTypes= { TokenParam.class, QuantityParam.class })
90  			CompositeAndListParam<TokenParam, QuantityParam> theContext_type_quantity,
91    
92  			@Description(shortDefinition="A use context type and value assigned to the activity definition")
93  			@OptionalParam(name="context-type-value", compositeTypes= { TokenParam.class, TokenParam.class })
94  			CompositeAndListParam<TokenParam, TokenParam> theContext_type_value,
95    
96  			@Description(shortDefinition="The activity definition publication date")
97  			@OptionalParam(name="date")
98  			DateRangeParam theDate, 
99    
100 			@Description(shortDefinition="What resource is being referenced")
101 			@OptionalParam(name="depends-on", targetTypes={  } )
102 			ReferenceAndListParam theDepends_on, 
103   
104 			@Description(shortDefinition="What resource is being referenced")
105 			@OptionalParam(name="derived-from", targetTypes={  } )
106 			ReferenceAndListParam theDerived_from, 
107   
108 			@Description(shortDefinition="The description of the activity definition")
109 			@OptionalParam(name="description")
110 			StringAndListParam theDescription, 
111   
112 			@Description(shortDefinition="The time during which the activity definition is intended to be in use")
113 			@OptionalParam(name="effective")
114 			DateRangeParam theEffective, 
115   
116 			@Description(shortDefinition="External identifier for the activity definition")
117 			@OptionalParam(name="identifier")
118 			TokenAndListParam theIdentifier,
119   
120 			@Description(shortDefinition="Intended jurisdiction for the activity definition")
121 			@OptionalParam(name="jurisdiction")
122 			TokenAndListParam theJurisdiction,
123   
124 			@Description(shortDefinition="Computationally friendly name of the activity definition")
125 			@OptionalParam(name="name")
126 			StringAndListParam theName, 
127   
128 			@Description(shortDefinition="What resource is being referenced")
129 			@OptionalParam(name="predecessor", targetTypes={  } )
130 			ReferenceAndListParam thePredecessor, 
131   
132 			@Description(shortDefinition="Name of the publisher of the activity definition")
133 			@OptionalParam(name="publisher")
134 			StringAndListParam thePublisher, 
135   
136 			@Description(shortDefinition="The current status of the activity definition")
137 			@OptionalParam(name="status")
138 			TokenAndListParam theStatus,
139   
140 			@Description(shortDefinition="What resource is being referenced")
141 			@OptionalParam(name="successor", targetTypes={  } )
142 			ReferenceAndListParam theSuccessor, 
143   
144 			@Description(shortDefinition="The human-friendly name of the activity definition")
145 			@OptionalParam(name="title")
146 			StringAndListParam theTitle, 
147   
148 			@Description(shortDefinition="Topics associated with the module")
149 			@OptionalParam(name="topic")
150 			TokenAndListParam theTopic,
151   
152 			@Description(shortDefinition="The uri that identifies the activity definition")
153 			@OptionalParam(name="url")
154 			UriAndListParam theUrl, 
155   
156 			@Description(shortDefinition="The business version of the activity definition")
157 			@OptionalParam(name="version")
158 			TokenAndListParam theVersion,
159 
160 			@RawParam
161 			Map<String, List<String>> theAdditionalRawParams,
162 
163 			@IncludeParam(reverse=true)
164 			Set<Include> theRevIncludes,
165 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
166 			@OptionalParam(name="_lastUpdated")
167 			DateRangeParam theLastUpdated, 
168 
169 			@IncludeParam(allow= {
170 					"ActivityDefinition:composed-of" , 					"ActivityDefinition:depends-on" , 					"ActivityDefinition:derived-from" , 					"ActivityDefinition:predecessor" , 					"ActivityDefinition:successor" , 						"ActivityDefinition:composed-of" , 					"ActivityDefinition:depends-on" , 					"ActivityDefinition:derived-from" , 					"ActivityDefinition:predecessor" , 					"ActivityDefinition:successor" , 						"ActivityDefinition:composed-of" , 					"ActivityDefinition:depends-on" , 					"ActivityDefinition:derived-from" , 					"ActivityDefinition:predecessor" , 					"ActivityDefinition:successor" , 						"ActivityDefinition:composed-of" , 					"ActivityDefinition:depends-on" , 					"ActivityDefinition:derived-from" , 					"ActivityDefinition:predecessor" , 					"ActivityDefinition:successor" , 						"ActivityDefinition:composed-of" , 					"ActivityDefinition:depends-on" , 					"ActivityDefinition:derived-from" , 					"ActivityDefinition:predecessor" , 					"ActivityDefinition:successor" 					, "*"
171 			}) 
172 			Set<Include> theIncludes,
173 			
174 			@Sort 
175 			SortSpec theSort,
176 			
177 			@ca.uhn.fhir.rest.annotation.Count
178 			Integer theCount,
179 
180 			SummaryEnum theSummaryMode,
181 
182 			SearchTotalModeEnum theSearchTotalMode
183 
184 			) {
185 		startRequest(theServletRequest);
186 		try {
187 			SearchParameterMap paramMap = new SearchParameterMap();
188 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
189 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
190 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
191 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
192 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
193 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
194 			paramMap.add("_has", theHas);
195 			paramMap.add("_id", the_id);
196 			paramMap.add("_language", the_language);
197 			paramMap.add("composed-of", theComposed_of);
198 			paramMap.add("context", theContext);
199 			paramMap.add("context-quantity", theContext_quantity);
200 			paramMap.add("context-type", theContext_type);
201 			paramMap.add("context-type-quantity", theContext_type_quantity);
202 			paramMap.add("context-type-value", theContext_type_value);
203 			paramMap.add("date", theDate);
204 			paramMap.add("depends-on", theDepends_on);
205 			paramMap.add("derived-from", theDerived_from);
206 			paramMap.add("description", theDescription);
207 			paramMap.add("effective", theEffective);
208 			paramMap.add("identifier", theIdentifier);
209 			paramMap.add("jurisdiction", theJurisdiction);
210 			paramMap.add("name", theName);
211 			paramMap.add("predecessor", thePredecessor);
212 			paramMap.add("publisher", thePublisher);
213 			paramMap.add("status", theStatus);
214 			paramMap.add("successor", theSuccessor);
215 			paramMap.add("title", theTitle);
216 			paramMap.add("topic", theTopic);
217 			paramMap.add("url", theUrl);
218 			paramMap.add("version", theVersion);
219 			paramMap.setRevIncludes(theRevIncludes);
220 			paramMap.setLastUpdated(theLastUpdated);
221 			paramMap.setIncludes(theIncludes);
222 			paramMap.setSort(theSort);
223 			paramMap.setCount(theCount);
224 			paramMap.setSummaryMode(theSummaryMode);
225 			paramMap.setSearchTotalMode(theSearchTotalMode);
226 
227 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
228 
229 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
230 			return retVal;
231 		} finally {
232 			endRequest(theServletRequest);
233 		}
234 	}
235 
236 }