View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.dstu2;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.*;
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 ca.uhn.fhir.model.dstu2.composite.*;
13  import ca.uhn.fhir.model.dstu2.resource.*; //
14  import ca.uhn.fhir.rest.annotation.*;
15  import ca.uhn.fhir.rest.param.*;
16  import ca.uhn.fhir.rest.api.SortSpec;
17  import ca.uhn.fhir.rest.api.SummaryEnum;
18  import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
19  
20  public class StructureDefinitionResourceProvider extends 
21  	JpaResourceProviderDstu2<StructureDefinition>
22  	{
23  
24  	@Override
25  	public Class<StructureDefinition> getResourceType() {
26  		return StructureDefinition.class;
27  	}
28  
29  	@Search(allowUnknownParams=true)
30  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
31  			javax.servlet.http.HttpServletRequest theServletRequest,
32  			javax.servlet.http.HttpServletResponse theServletResponse,
33  
34  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
35  			
36  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
37  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
38  			StringAndListParam theFtContent, 
39  
40  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
41  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
42  			StringAndListParam theFtText, 
43  
44  			@Description(shortDefinition="Search for resources which have the given tag")
45  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
46  			TokenAndListParam theSearchForTag, 
47  
48  			@Description(shortDefinition="Search for resources which have the given security labels")
49  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
50  			TokenAndListParam theSearchForSecurity, 
51    
52  			@Description(shortDefinition="Search for resources which have the given profile")
53  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
54  			UriAndListParam theSearchForProfile, 
55  
56  			@Description(shortDefinition="Return resources linked to by the given target")
57  			@OptionalParam(name="_has")
58  			HasAndListParam theHas, 
59  
60    
61  			@Description(shortDefinition="The ID of the resource")
62  			@OptionalParam(name="_id")
63  			StringAndListParam the_id, 
64    
65  			@Description(shortDefinition="The language of the resource")
66  			@OptionalParam(name="_language")
67  			StringAndListParam the_language, 
68    
69  			@Description(shortDefinition="")
70  			@OptionalParam(name="abstract")
71  			TokenAndListParam theAbstract,
72    
73  			@Description(shortDefinition="")
74  			@OptionalParam(name="base")
75  			UriAndListParam theBase, 
76    
77  			@Description(shortDefinition="")
78  			@OptionalParam(name="base-path")
79  			TokenAndListParam theBase_path,
80    
81  			@Description(shortDefinition="A code for the profile")
82  			@OptionalParam(name="code")
83  			TokenAndListParam theCode,
84    
85  			@Description(shortDefinition="A use context assigned to the structure")
86  			@OptionalParam(name="context")
87  			TokenAndListParam theContext,
88    
89  			@Description(shortDefinition="")
90  			@OptionalParam(name="context-type")
91  			TokenAndListParam theContext_type,
92    
93  			@Description(shortDefinition="The profile publication date")
94  			@OptionalParam(name="date")
95  			DateRangeParam theDate, 
96    
97  			@Description(shortDefinition="Text search in the description of the profile")
98  			@OptionalParam(name="description")
99  			StringAndListParam theDescription, 
100   
101 			@Description(shortDefinition="")
102 			@OptionalParam(name="display")
103 			StringAndListParam theDisplay, 
104   
105 			@Description(shortDefinition="")
106 			@OptionalParam(name="experimental")
107 			TokenAndListParam theExperimental,
108   
109 			@Description(shortDefinition="")
110 			@OptionalParam(name="ext-context")
111 			StringAndListParam theExt_context, 
112   
113 			@Description(shortDefinition="The identifier of the profile")
114 			@OptionalParam(name="identifier")
115 			TokenAndListParam theIdentifier,
116   
117 			@Description(shortDefinition="")
118 			@OptionalParam(name="kind")
119 			TokenAndListParam theKind,
120   
121 			@Description(shortDefinition="Name of the profile")
122 			@OptionalParam(name="name")
123 			StringAndListParam theName, 
124   
125 			@Description(shortDefinition="A path that is constrained in the profile")
126 			@OptionalParam(name="path")
127 			TokenAndListParam thePath,
128   
129 			@Description(shortDefinition="Name of the publisher of the profile")
130 			@OptionalParam(name="publisher")
131 			StringAndListParam thePublisher, 
132   
133 			@Description(shortDefinition="The current status of the profile")
134 			@OptionalParam(name="status")
135 			TokenAndListParam theStatus,
136   
137 			@Description(shortDefinition="")
138 			@OptionalParam(name="type")
139 			TokenAndListParam theType,
140   
141 			@Description(shortDefinition="")
142 			@OptionalParam(name="url")
143 			UriAndListParam theUrl, 
144   
145 			@Description(shortDefinition="A vocabulary binding reference")
146 			@OptionalParam(name="valueset", targetTypes={  } )
147 			ReferenceAndListParam theValueset, 
148   
149 			@Description(shortDefinition="The version identifier of the profile")
150 			@OptionalParam(name="version")
151 			TokenAndListParam theVersion,
152 
153 			@RawParam
154 			Map<String, List<String>> theAdditionalRawParams,
155 
156 			@IncludeParam(reverse=true)
157 			Set<Include> theRevIncludes,
158 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
159 			@OptionalParam(name="_lastUpdated")
160 			DateRangeParam theLastUpdated, 
161 
162 			@IncludeParam(allow= {
163 					"StructureDefinition:valueset" 					, "*"
164 			}) 
165 			Set<Include> theIncludes,
166 			
167 			@Sort 
168 			SortSpec theSort,
169 			
170 			@ca.uhn.fhir.rest.annotation.Count
171 			Integer theCount,
172 
173 			SummaryEnum theSummaryMode,
174 
175 			SearchTotalModeEnum theSearchTotalMode
176 
177 			) {
178 		startRequest(theServletRequest);
179 		try {
180 			SearchParameterMap paramMap = new SearchParameterMap();
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("abstract", theAbstract);
190 			paramMap.add("base", theBase);
191 			paramMap.add("base-path", theBase_path);
192 			paramMap.add("code", theCode);
193 			paramMap.add("context", theContext);
194 			paramMap.add("context-type", theContext_type);
195 			paramMap.add("date", theDate);
196 			paramMap.add("description", theDescription);
197 			paramMap.add("display", theDisplay);
198 			paramMap.add("experimental", theExperimental);
199 			paramMap.add("ext-context", theExt_context);
200 			paramMap.add("identifier", theIdentifier);
201 			paramMap.add("kind", theKind);
202 			paramMap.add("name", theName);
203 			paramMap.add("path", thePath);
204 			paramMap.add("publisher", thePublisher);
205 			paramMap.add("status", theStatus);
206 			paramMap.add("type", theType);
207 			paramMap.add("url", theUrl);
208 			paramMap.add("valueset", theValueset);
209 			paramMap.add("version", theVersion);
210 			paramMap.setRevIncludes(theRevIncludes);
211 			paramMap.setLastUpdated(theLastUpdated);
212 			paramMap.setIncludes(theIncludes);
213 			paramMap.setSort(theSort);
214 			paramMap.setCount(theCount);
215 			paramMap.setSummaryMode(theSummaryMode);
216 			paramMap.setSearchTotalMode(theSearchTotalMode);
217 
218 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
219 
220 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
221 			return retVal;
222 		} finally {
223 			endRequest(theServletRequest);
224 		}
225 	}
226 
227 }