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 HealthcareServiceResourceProvider extends 
20  	JpaResourceProviderR4<HealthcareService>
21  	{
22  
23  	@Override
24  	public Class<HealthcareService> getResourceType() {
25  		return HealthcareService.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="The Healthcare Service is currently marked as active")
73  			@OptionalParam(name="active")
74  			TokenAndListParam theActive,
75    
76  			@Description(shortDefinition="One of the HealthcareService's characteristics")
77  			@OptionalParam(name="characteristic")
78  			TokenAndListParam theCharacteristic,
79    
80  			@Description(shortDefinition="Location(s) service is intended for/available to")
81  			@OptionalParam(name="coverage-area", targetTypes={  } )
82  			ReferenceAndListParam theCoverage_area, 
83    
84  			@Description(shortDefinition="Technical endpoints providing access to electronic services operated for the healthcare service")
85  			@OptionalParam(name="endpoint", targetTypes={  } )
86  			ReferenceAndListParam theEndpoint, 
87    
88  			@Description(shortDefinition="External identifiers for this item")
89  			@OptionalParam(name="identifier")
90  			TokenAndListParam theIdentifier,
91    
92  			@Description(shortDefinition="The location of the Healthcare Service")
93  			@OptionalParam(name="location", targetTypes={  } )
94  			ReferenceAndListParam theLocation, 
95    
96  			@Description(shortDefinition="A portion of the Healthcare service name")
97  			@OptionalParam(name="name")
98  			StringAndListParam theName, 
99    
100 			@Description(shortDefinition="The organization that provides this Healthcare Service")
101 			@OptionalParam(name="organization", targetTypes={  } )
102 			ReferenceAndListParam theOrganization, 
103   
104 			@Description(shortDefinition="One of the Programs supported by this HealthcareService")
105 			@OptionalParam(name="program")
106 			TokenAndListParam theProgram,
107   
108 			@Description(shortDefinition="Service Category of the Healthcare Service")
109 			@OptionalParam(name="service-category")
110 			TokenAndListParam theService_category,
111   
112 			@Description(shortDefinition="The type of service provided by this healthcare service")
113 			@OptionalParam(name="service-type")
114 			TokenAndListParam theService_type,
115   
116 			@Description(shortDefinition="The specialty of the service provided by this healthcare service")
117 			@OptionalParam(name="specialty")
118 			TokenAndListParam theSpecialty,
119 
120 			@RawParam
121 			Map<String, List<String>> theAdditionalRawParams,
122 
123 			@IncludeParam(reverse=true)
124 			Set<Include> theRevIncludes,
125 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
126 			@OptionalParam(name="_lastUpdated")
127 			DateRangeParam theLastUpdated, 
128 
129 			@IncludeParam(allow= {
130 					"HealthcareService:coverage-area" , 					"HealthcareService:endpoint" , 					"HealthcareService:location" , 					"HealthcareService:organization" , 						"HealthcareService:coverage-area" , 					"HealthcareService:endpoint" , 					"HealthcareService:location" , 					"HealthcareService:organization" , 						"HealthcareService:coverage-area" , 					"HealthcareService:endpoint" , 					"HealthcareService:location" , 					"HealthcareService:organization" , 						"HealthcareService:coverage-area" , 					"HealthcareService:endpoint" , 					"HealthcareService:location" , 					"HealthcareService:organization" 					, "*"
131 			}) 
132 			Set<Include> theIncludes,
133 			
134 			@Sort 
135 			SortSpec theSort,
136 			
137 			@ca.uhn.fhir.rest.annotation.Count
138 			Integer theCount,
139 
140 			SummaryEnum theSummaryMode,
141 
142 			SearchTotalModeEnum theSearchTotalMode
143 
144 			) {
145 		startRequest(theServletRequest);
146 		try {
147 			SearchParameterMap paramMap = new SearchParameterMap();
148 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
149 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
150 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
151 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
152 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
153 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
154 			paramMap.add("_has", theHas);
155 			paramMap.add("_id", the_id);
156 			paramMap.add("_language", the_language);
157 			paramMap.add("active", theActive);
158 			paramMap.add("characteristic", theCharacteristic);
159 			paramMap.add("coverage-area", theCoverage_area);
160 			paramMap.add("endpoint", theEndpoint);
161 			paramMap.add("identifier", theIdentifier);
162 			paramMap.add("location", theLocation);
163 			paramMap.add("name", theName);
164 			paramMap.add("organization", theOrganization);
165 			paramMap.add("program", theProgram);
166 			paramMap.add("service-category", theService_category);
167 			paramMap.add("service-type", theService_type);
168 			paramMap.add("specialty", theSpecialty);
169 			paramMap.setRevIncludes(theRevIncludes);
170 			paramMap.setLastUpdated(theLastUpdated);
171 			paramMap.setIncludes(theIncludes);
172 			paramMap.setSort(theSort);
173 			paramMap.setCount(theCount);
174 			paramMap.setSummaryMode(theSummaryMode);
175 			paramMap.setSearchTotalMode(theSearchTotalMode);
176 
177 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
178 
179 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
180 			return retVal;
181 		} finally {
182 			endRequest(theServletRequest);
183 		}
184 	}
185 
186 }