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 CapabilityStatementResourceProvider extends 
18  	JpaResourceProviderDstu3<CapabilityStatement>
19  	{
20  
21  	@Override
22  	public Class<CapabilityStatement> getResourceType() {
23  		return CapabilityStatement.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="The capability statement publication date")
67  			@OptionalParam(name="date")
68  			DateRangeParam theDate, 
69    
70  			@Description(shortDefinition="The description of the capability statement")
71  			@OptionalParam(name="description")
72  			StringAndListParam theDescription, 
73    
74  			@Description(shortDefinition="Event code in a capability statement")
75  			@OptionalParam(name="event")
76  			TokenAndListParam theEvent, 
77    
78  			@Description(shortDefinition="The version of FHIR")
79  			@OptionalParam(name="fhirversion")
80  			TokenAndListParam theFhirversion, 
81    
82  			@Description(shortDefinition="formats supported (xml | json | ttl | mime type)")
83  			@OptionalParam(name="format")
84  			TokenAndListParam theFormat, 
85    
86  			@Description(shortDefinition="Implementation guides supported")
87  			@OptionalParam(name="guide")
88  			UriAndListParam theGuide, 
89    
90  			@Description(shortDefinition="Intended jurisdiction for the capability statement")
91  			@OptionalParam(name="jurisdiction")
92  			TokenAndListParam theJurisdiction, 
93    
94  			@Description(shortDefinition="Mode - restful (server/client) or messaging (sender/receiver)")
95  			@OptionalParam(name="mode")
96  			TokenAndListParam theMode, 
97    
98  			@Description(shortDefinition="Computationally friendly name of the capability statement")
99  			@OptionalParam(name="name")
100 			StringAndListParam theName, 
101   
102 			@Description(shortDefinition="Name of the publisher of the capability statement")
103 			@OptionalParam(name="publisher")
104 			StringAndListParam thePublisher, 
105   
106 			@Description(shortDefinition="Name of a resource mentioned in a capability statement")
107 			@OptionalParam(name="resource")
108 			TokenAndListParam theResource, 
109   
110 			@Description(shortDefinition="A profile id invoked in a capability statement")
111 			@OptionalParam(name="resource-profile", targetTypes={  } )
112 			ReferenceAndListParam theResource_profile, 
113   
114 			@Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates")
115 			@OptionalParam(name="security-service")
116 			TokenAndListParam theSecurity_service, 
117   
118 			@Description(shortDefinition="Part of a the name of a software application")
119 			@OptionalParam(name="software")
120 			StringAndListParam theSoftware, 
121   
122 			@Description(shortDefinition="The current status of the capability statement")
123 			@OptionalParam(name="status")
124 			TokenAndListParam theStatus, 
125   
126 			@Description(shortDefinition="Profiles for use cases supported")
127 			@OptionalParam(name="supported-profile", targetTypes={  } )
128 			ReferenceAndListParam theSupported_profile, 
129   
130 			@Description(shortDefinition="The human-friendly name of the capability statement")
131 			@OptionalParam(name="title")
132 			StringAndListParam theTitle, 
133   
134 			@Description(shortDefinition="The uri that identifies the capability statement")
135 			@OptionalParam(name="url")
136 			UriAndListParam theUrl, 
137   
138 			@Description(shortDefinition="The business version of the capability statement")
139 			@OptionalParam(name="version")
140 			TokenAndListParam theVersion, 
141 
142 			@RawParam
143 			Map<String, List<String>> theAdditionalRawParams,
144 
145 			@IncludeParam(reverse=true)
146 			Set<Include> theRevIncludes,
147 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
148 			@OptionalParam(name="_lastUpdated")
149 			DateRangeParam theLastUpdated, 
150 
151 			@IncludeParam(allow= {
152 					"CapabilityStatement:resource-profile" , 					"CapabilityStatement:supported-profile" , 						"CapabilityStatement:resource-profile" , 					"CapabilityStatement:supported-profile" 					, "*"
153 			}) 
154 			Set<Include> theIncludes,
155 			
156 			@Sort 
157 			SortSpec theSort,
158 			
159 			@ca.uhn.fhir.rest.annotation.Count
160 			Integer theCount
161 	) {
162 		startRequest(theServletRequest);
163 		try {
164 			SearchParameterMap paramMap = new SearchParameterMap();
165 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
166 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
167 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
168 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
169 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
170 			paramMap.add("_has", theHas);
171 			paramMap.add("_id", the_id);
172 			paramMap.add("_language", the_language);
173 			paramMap.add("date", theDate);
174 			paramMap.add("description", theDescription);
175 			paramMap.add("event", theEvent);
176 			paramMap.add("fhirversion", theFhirversion);
177 			paramMap.add("format", theFormat);
178 			paramMap.add("guide", theGuide);
179 			paramMap.add("jurisdiction", theJurisdiction);
180 			paramMap.add("mode", theMode);
181 			paramMap.add("name", theName);
182 			paramMap.add("publisher", thePublisher);
183 			paramMap.add("resource", theResource);
184 			paramMap.add("resource-profile", theResource_profile);
185 			paramMap.add("security-service", theSecurity_service);
186 			paramMap.add("software", theSoftware);
187 			paramMap.add("status", theStatus);
188 			paramMap.add("supported-profile", theSupported_profile);
189 			paramMap.add("title", theTitle);
190 			paramMap.add("url", theUrl);
191 			paramMap.add("version", theVersion);
192 			paramMap.setRevIncludes(theRevIncludes);
193 			paramMap.setLastUpdated(theLastUpdated);
194 			paramMap.setIncludes(theIncludes);
195 			paramMap.setSort(theSort);
196 			paramMap.setCount(theCount);
197 
198 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
199 
200 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
201 			return retVal;
202 		} finally {
203 			endRequest(theServletRequest);
204 		}
205 	}
206 
207 }