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