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 RequestGroupResourceProvider extends 
18  	JpaResourceProviderDstu3<RequestGroup>
19  	{
20  
21  	@Override
22  	public Class<RequestGroup> getResourceType() {
23  		return RequestGroup.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 author of the request group")
67  			@OptionalParam(name="author", targetTypes={  } )
68  			ReferenceAndListParam theAuthor, 
69    
70  			@Description(shortDefinition="The date the request group was authored")
71  			@OptionalParam(name="authored")
72  			DateRangeParam theAuthored, 
73    
74  			@Description(shortDefinition="The context the request group applies to")
75  			@OptionalParam(name="context", targetTypes={  } )
76  			ReferenceAndListParam theContext, 
77    
78  			@Description(shortDefinition="The definition from which the request group is realized")
79  			@OptionalParam(name="definition", targetTypes={  } )
80  			ReferenceAndListParam theDefinition, 
81    
82  			@Description(shortDefinition="The encounter the request group applies to")
83  			@OptionalParam(name="encounter", targetTypes={  } )
84  			ReferenceAndListParam theEncounter, 
85    
86  			@Description(shortDefinition="The group identifier for the request group")
87  			@OptionalParam(name="group-identifier")
88  			TokenAndListParam theGroup_identifier, 
89    
90  			@Description(shortDefinition="External identifiers for the request group")
91  			@OptionalParam(name="identifier")
92  			TokenAndListParam theIdentifier, 
93    
94  			@Description(shortDefinition="The intent of the request group")
95  			@OptionalParam(name="intent")
96  			TokenAndListParam theIntent, 
97    
98  			@Description(shortDefinition="The participant in the requests in the group")
99  			@OptionalParam(name="participant", targetTypes={  } )
100 			ReferenceAndListParam theParticipant, 
101   
102 			@Description(shortDefinition="The identity of a patient to search for request groups")
103 			@OptionalParam(name="patient", targetTypes={  } )
104 			ReferenceAndListParam thePatient, 
105   
106 			@Description(shortDefinition="The priority of the request group")
107 			@OptionalParam(name="priority")
108 			TokenAndListParam thePriority, 
109   
110 			@Description(shortDefinition="The status of the request group")
111 			@OptionalParam(name="status")
112 			TokenAndListParam theStatus, 
113   
114 			@Description(shortDefinition="The subject that the request group is about")
115 			@OptionalParam(name="subject", targetTypes={  } )
116 			ReferenceAndListParam theSubject, 
117 
118 			@RawParam
119 			Map<String, List<String>> theAdditionalRawParams,
120 
121 			@IncludeParam(reverse=true)
122 			Set<Include> theRevIncludes,
123 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
124 			@OptionalParam(name="_lastUpdated")
125 			DateRangeParam theLastUpdated, 
126 
127 			@IncludeParam(allow= {
128 					"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" , 						"RequestGroup:author" , 					"RequestGroup:context" , 					"RequestGroup:definition" , 					"RequestGroup:encounter" , 					"RequestGroup:participant" , 					"RequestGroup:patient" , 					"RequestGroup:subject" 					, "*"
129 			}) 
130 			Set<Include> theIncludes,
131 			
132 			@Sort 
133 			SortSpec theSort,
134 			
135 			@ca.uhn.fhir.rest.annotation.Count
136 			Integer theCount
137 	) {
138 		startRequest(theServletRequest);
139 		try {
140 			SearchParameterMap paramMap = new SearchParameterMap();
141 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
142 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
143 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
144 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
145 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
146 			paramMap.add("_has", theHas);
147 			paramMap.add("_id", the_id);
148 			paramMap.add("_language", the_language);
149 			paramMap.add("author", theAuthor);
150 			paramMap.add("authored", theAuthored);
151 			paramMap.add("context", theContext);
152 			paramMap.add("definition", theDefinition);
153 			paramMap.add("encounter", theEncounter);
154 			paramMap.add("group-identifier", theGroup_identifier);
155 			paramMap.add("identifier", theIdentifier);
156 			paramMap.add("intent", theIntent);
157 			paramMap.add("participant", theParticipant);
158 			paramMap.add("patient", thePatient);
159 			paramMap.add("priority", thePriority);
160 			paramMap.add("status", theStatus);
161 			paramMap.add("subject", theSubject);
162 			paramMap.setRevIncludes(theRevIncludes);
163 			paramMap.setLastUpdated(theLastUpdated);
164 			paramMap.setIncludes(theIncludes);
165 			paramMap.setSort(theSort);
166 			paramMap.setCount(theCount);
167 
168 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
169 
170 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
171 			return retVal;
172 		} finally {
173 			endRequest(theServletRequest);
174 		}
175 	}
176 
177 }