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 ConceptMapResourceProvider extends 
21  	JpaResourceProviderDstu2<ConceptMap>
22  	{
23  
24  	@Override
25  	public Class<ConceptMap> getResourceType() {
26  		return ConceptMap.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="A use context assigned to the concept map")
70  			@OptionalParam(name="context")
71  			TokenAndListParam theContext,
72    
73  			@Description(shortDefinition="The concept map publication date")
74  			@OptionalParam(name="date")
75  			DateRangeParam theDate, 
76    
77  			@Description(shortDefinition="")
78  			@OptionalParam(name="dependson")
79  			UriAndListParam theDependson, 
80    
81  			@Description(shortDefinition="Text search in the description of the concept map")
82  			@OptionalParam(name="description")
83  			StringAndListParam theDescription, 
84    
85  			@Description(shortDefinition="Additional identifier for the concept map")
86  			@OptionalParam(name="identifier")
87  			TokenAndListParam theIdentifier,
88    
89  			@Description(shortDefinition="Name of the concept map")
90  			@OptionalParam(name="name")
91  			StringAndListParam theName, 
92    
93  			@Description(shortDefinition="")
94  			@OptionalParam(name="product")
95  			UriAndListParam theProduct, 
96    
97  			@Description(shortDefinition="Name of the publisher of the concept map")
98  			@OptionalParam(name="publisher")
99  			StringAndListParam thePublisher, 
100   
101 			@Description(shortDefinition="")
102 			@OptionalParam(name="source", targetTypes={  } )
103 			ReferenceAndListParam theSource, 
104   
105 			@Description(shortDefinition="")
106 			@OptionalParam(name="sourcecode")
107 			TokenAndListParam theSourcecode,
108   
109 			@Description(shortDefinition="")
110 			@OptionalParam(name="sourcesystem")
111 			UriAndListParam theSourcesystem, 
112   
113 			@Description(shortDefinition="")
114 			@OptionalParam(name="sourceuri", targetTypes={  } )
115 			ReferenceAndListParam theSourceuri, 
116   
117 			@Description(shortDefinition="Status of the concept map")
118 			@OptionalParam(name="status")
119 			TokenAndListParam theStatus,
120   
121 			@Description(shortDefinition="")
122 			@OptionalParam(name="target", targetTypes={  } )
123 			ReferenceAndListParam theTarget, 
124   
125 			@Description(shortDefinition="")
126 			@OptionalParam(name="targetcode")
127 			TokenAndListParam theTargetcode,
128   
129 			@Description(shortDefinition="")
130 			@OptionalParam(name="targetsystem")
131 			UriAndListParam theTargetsystem, 
132   
133 			@Description(shortDefinition="The URL of the concept map")
134 			@OptionalParam(name="url")
135 			UriAndListParam theUrl, 
136   
137 			@Description(shortDefinition="The version identifier of the concept map")
138 			@OptionalParam(name="version")
139 			TokenAndListParam theVersion,
140 
141 			@RawParam
142 			Map<String, List<String>> theAdditionalRawParams,
143 
144 			@IncludeParam(reverse=true)
145 			Set<Include> theRevIncludes,
146 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
147 			@OptionalParam(name="_lastUpdated")
148 			DateRangeParam theLastUpdated, 
149 
150 			@IncludeParam(allow= {
151 					"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" , 						"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" , 						"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" 					, "*"
152 			}) 
153 			Set<Include> theIncludes,
154 			
155 			@Sort 
156 			SortSpec theSort,
157 			
158 			@ca.uhn.fhir.rest.annotation.Count
159 			Integer theCount,
160 
161 			SummaryEnum theSummaryMode,
162 
163 			SearchTotalModeEnum theSearchTotalMode
164 
165 			) {
166 		startRequest(theServletRequest);
167 		try {
168 			SearchParameterMap paramMap = new SearchParameterMap();
169 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
170 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
171 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
172 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
173 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
174 			paramMap.add("_has", theHas);
175 			paramMap.add("_id", the_id);
176 			paramMap.add("_language", the_language);
177 			paramMap.add("context", theContext);
178 			paramMap.add("date", theDate);
179 			paramMap.add("dependson", theDependson);
180 			paramMap.add("description", theDescription);
181 			paramMap.add("identifier", theIdentifier);
182 			paramMap.add("name", theName);
183 			paramMap.add("product", theProduct);
184 			paramMap.add("publisher", thePublisher);
185 			paramMap.add("source", theSource);
186 			paramMap.add("sourcecode", theSourcecode);
187 			paramMap.add("sourcesystem", theSourcesystem);
188 			paramMap.add("sourceuri", theSourceuri);
189 			paramMap.add("status", theStatus);
190 			paramMap.add("target", theTarget);
191 			paramMap.add("targetcode", theTargetcode);
192 			paramMap.add("targetsystem", theTargetsystem);
193 			paramMap.add("url", theUrl);
194 			paramMap.add("version", theVersion);
195 			paramMap.setRevIncludes(theRevIncludes);
196 			paramMap.setLastUpdated(theLastUpdated);
197 			paramMap.setIncludes(theIncludes);
198 			paramMap.setSort(theSort);
199 			paramMap.setCount(theCount);
200 			paramMap.setSummaryMode(theSummaryMode);
201 			paramMap.setSearchTotalMode(theSearchTotalMode);
202 
203 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
204 
205 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
206 			return retVal;
207 		} finally {
208 			endRequest(theServletRequest);
209 		}
210 	}
211 
212 }