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  import ca.uhn.fhir.rest.api.SummaryEnum;
17  import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
18  
19  public class StructureDefinitionResourceProvider extends 
20  	JpaResourceProviderDstu3<StructureDefinition>
21  	{
22  
23  	@Override
24  	public Class<StructureDefinition> getResourceType() {
25  		return StructureDefinition.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 fulltext search")
36  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
37  			StringAndListParam theFtContent, 
38  
39  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
40  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
41  			StringAndListParam theFtText, 
42  
43  			@Description(shortDefinition="Search for resources which have the given tag")
44  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
45  			TokenAndListParam theSearchForTag, 
46  
47  			@Description(shortDefinition="Search for resources which have the given security labels")
48  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
49  			TokenAndListParam theSearchForSecurity, 
50    
51  			@Description(shortDefinition="Search for resources which have the given profile")
52  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
53  			UriAndListParam theSearchForProfile, 
54  
55  			@Description(shortDefinition="Return resources linked to by the given target")
56  			@OptionalParam(name="_has")
57  			HasAndListParam theHas, 
58  
59    
60  			@Description(shortDefinition="The ID of the resource")
61  			@OptionalParam(name="_id")
62  			TokenAndListParam the_id,
63    
64  			@Description(shortDefinition="The language of the resource")
65  			@OptionalParam(name="_language")
66  			StringAndListParam the_language, 
67    
68  			@Description(shortDefinition="Whether the structure is abstract")
69  			@OptionalParam(name="abstract")
70  			TokenAndListParam theAbstract,
71    
72  			@Description(shortDefinition="Definition that this type is constrained/specialized from")
73  			@OptionalParam(name="base")
74  			UriAndListParam theBase, 
75    
76  			@Description(shortDefinition="Path that identifies the base element")
77  			@OptionalParam(name="base-path")
78  			TokenAndListParam theBase_path,
79    
80  			@Description(shortDefinition="resource | datatype | extension")
81  			@OptionalParam(name="context-type")
82  			TokenAndListParam theContext_type,
83    
84  			@Description(shortDefinition="The structure definition publication date")
85  			@OptionalParam(name="date")
86  			DateRangeParam theDate, 
87    
88  			@Description(shortDefinition="specialization | constraint - How relates to base definition")
89  			@OptionalParam(name="derivation")
90  			TokenAndListParam theDerivation,
91    
92  			@Description(shortDefinition="The description of the structure definition")
93  			@OptionalParam(name="description")
94  			StringAndListParam theDescription, 
95    
96  			@Description(shortDefinition="For testing purposes, not real usage")
97  			@OptionalParam(name="experimental")
98  			TokenAndListParam theExperimental,
99    
100 			@Description(shortDefinition="Where the extension can be used in instances")
101 			@OptionalParam(name="ext-context")
102 			StringAndListParam theExt_context, 
103   
104 			@Description(shortDefinition="External identifier for the structure definition")
105 			@OptionalParam(name="identifier")
106 			TokenAndListParam theIdentifier,
107   
108 			@Description(shortDefinition="Intended jurisdiction for the structure definition")
109 			@OptionalParam(name="jurisdiction")
110 			TokenAndListParam theJurisdiction,
111   
112 			@Description(shortDefinition="A code for the profile")
113 			@OptionalParam(name="keyword")
114 			TokenAndListParam theKeyword,
115   
116 			@Description(shortDefinition="primitive-type | complex-type | resource | logical")
117 			@OptionalParam(name="kind")
118 			TokenAndListParam theKind,
119   
120 			@Description(shortDefinition="Computationally friendly name of the structure definition")
121 			@OptionalParam(name="name")
122 			StringAndListParam theName, 
123   
124 			@Description(shortDefinition="A path that is constrained in the profile")
125 			@OptionalParam(name="path")
126 			TokenAndListParam thePath,
127   
128 			@Description(shortDefinition="Name of the publisher of the structure definition")
129 			@OptionalParam(name="publisher")
130 			StringAndListParam thePublisher, 
131   
132 			@Description(shortDefinition="The current status of the structure definition")
133 			@OptionalParam(name="status")
134 			TokenAndListParam theStatus,
135   
136 			@Description(shortDefinition="The human-friendly name of the structure definition")
137 			@OptionalParam(name="title")
138 			StringAndListParam theTitle, 
139   
140 			@Description(shortDefinition="Type defined or constrained by this structure")
141 			@OptionalParam(name="type")
142 			TokenAndListParam theType,
143   
144 			@Description(shortDefinition="The uri that identifies the structure definition")
145 			@OptionalParam(name="url")
146 			UriAndListParam theUrl, 
147   
148 			@Description(shortDefinition="A vocabulary binding reference")
149 			@OptionalParam(name="valueset", targetTypes={  } )
150 			ReferenceAndListParam theValueset, 
151   
152 			@Description(shortDefinition="The business version of the structure definition")
153 			@OptionalParam(name="version")
154 			TokenAndListParam theVersion,
155 
156 			@RawParam
157 			Map<String, List<String>> theAdditionalRawParams,
158 
159 			@IncludeParam(reverse=true)
160 			Set<Include> theRevIncludes,
161 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
162 			@OptionalParam(name="_lastUpdated")
163 			DateRangeParam theLastUpdated, 
164 
165 			@IncludeParam(allow= {
166 					"StructureDefinition:valueset" 					, "*"
167 			}) 
168 			Set<Include> theIncludes,
169 			
170 			@Sort 
171 			SortSpec theSort,
172 			
173 			@ca.uhn.fhir.rest.annotation.Count
174 			Integer theCount,
175 
176 			SummaryEnum theSummaryMode,
177 
178 			SearchTotalModeEnum theSearchTotalMode
179 
180 			) {
181 		startRequest(theServletRequest);
182 		try {
183 			SearchParameterMap paramMap = new SearchParameterMap();
184 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
185 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
186 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
187 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
188 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
189 			paramMap.add("_has", theHas);
190 			paramMap.add("_id", the_id);
191 			paramMap.add("_language", the_language);
192 			paramMap.add("abstract", theAbstract);
193 			paramMap.add("base", theBase);
194 			paramMap.add("base-path", theBase_path);
195 			paramMap.add("context-type", theContext_type);
196 			paramMap.add("date", theDate);
197 			paramMap.add("derivation", theDerivation);
198 			paramMap.add("description", theDescription);
199 			paramMap.add("experimental", theExperimental);
200 			paramMap.add("ext-context", theExt_context);
201 			paramMap.add("identifier", theIdentifier);
202 			paramMap.add("jurisdiction", theJurisdiction);
203 			paramMap.add("keyword", theKeyword);
204 			paramMap.add("kind", theKind);
205 			paramMap.add("name", theName);
206 			paramMap.add("path", thePath);
207 			paramMap.add("publisher", thePublisher);
208 			paramMap.add("status", theStatus);
209 			paramMap.add("title", theTitle);
210 			paramMap.add("type", theType);
211 			paramMap.add("url", theUrl);
212 			paramMap.add("valueset", theValueset);
213 			paramMap.add("version", theVersion);
214 			paramMap.setRevIncludes(theRevIncludes);
215 			paramMap.setLastUpdated(theLastUpdated);
216 			paramMap.setIncludes(theIncludes);
217 			paramMap.setSort(theSort);
218 			paramMap.setCount(theCount);
219 			paramMap.setSummaryMode(theSummaryMode);
220 			paramMap.setSearchTotalMode(theSearchTotalMode);
221 
222 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
223 
224 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
225 			return retVal;
226 		} finally {
227 			endRequest(theServletRequest);
228 		}
229 	}
230 
231 }