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.dao.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  
18  public class ConceptMapResourceProvider extends 
19  	JpaResourceProviderDstu2<ConceptMap>
20  	{
21  
22  	@Override
23  	public Class<ConceptMap> getResourceType() {
24  		return ConceptMap.class;
25  	}
26  
27  	@Search(allowUnknownParams=true)
28  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
29  			javax.servlet.http.HttpServletRequest theServletRequest,
30  			javax.servlet.http.HttpServletResponse theServletResponse,
31  
32  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
33  			
34  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
35  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
36  			StringAndListParam theFtContent, 
37  
38  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
39  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
40  			StringAndListParam theFtText, 
41  
42  			@Description(shortDefinition="Search for resources which have the given tag")
43  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
44  			TokenAndListParam theSearchForTag, 
45  
46  			@Description(shortDefinition="Search for resources which have the given security labels")
47  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
48  			TokenAndListParam theSearchForSecurity, 
49    
50  			@Description(shortDefinition="Search for resources which have the given profile")
51  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
52  			UriAndListParam theSearchForProfile, 
53  
54  			@Description(shortDefinition="Return resources linked to by the given target")
55  			@OptionalParam(name="_has")
56  			HasAndListParam theHas, 
57  
58    
59  			@Description(shortDefinition="The ID of the resource")
60  			@OptionalParam(name="_id")
61  			StringAndListParam the_id, 
62    
63  			@Description(shortDefinition="The language of the resource")
64  			@OptionalParam(name="_language")
65  			StringAndListParam the_language, 
66    
67  			@Description(shortDefinition="A use context assigned to the concept map")
68  			@OptionalParam(name="context")
69  			TokenAndListParam theContext, 
70    
71  			@Description(shortDefinition="The concept map publication date")
72  			@OptionalParam(name="date")
73  			DateRangeParam theDate, 
74    
75  			@Description(shortDefinition="")
76  			@OptionalParam(name="dependson")
77  			UriAndListParam theDependson, 
78    
79  			@Description(shortDefinition="Text search in the description of the concept map")
80  			@OptionalParam(name="description")
81  			StringAndListParam theDescription, 
82    
83  			@Description(shortDefinition="Additional identifier for the concept map")
84  			@OptionalParam(name="identifier")
85  			TokenAndListParam theIdentifier, 
86    
87  			@Description(shortDefinition="Name of the concept map")
88  			@OptionalParam(name="name")
89  			StringAndListParam theName, 
90    
91  			@Description(shortDefinition="")
92  			@OptionalParam(name="product")
93  			UriAndListParam theProduct, 
94    
95  			@Description(shortDefinition="Name of the publisher of the concept map")
96  			@OptionalParam(name="publisher")
97  			StringAndListParam thePublisher, 
98    
99  			@Description(shortDefinition="")
100 			@OptionalParam(name="source", targetTypes={  } )
101 			ReferenceAndListParam theSource, 
102   
103 			@Description(shortDefinition="")
104 			@OptionalParam(name="sourcecode")
105 			TokenAndListParam theSourcecode, 
106   
107 			@Description(shortDefinition="")
108 			@OptionalParam(name="sourcesystem")
109 			UriAndListParam theSourcesystem, 
110   
111 			@Description(shortDefinition="")
112 			@OptionalParam(name="sourceuri", targetTypes={  } )
113 			ReferenceAndListParam theSourceuri, 
114   
115 			@Description(shortDefinition="Status of the concept map")
116 			@OptionalParam(name="status")
117 			TokenAndListParam theStatus, 
118   
119 			@Description(shortDefinition="")
120 			@OptionalParam(name="target", targetTypes={  } )
121 			ReferenceAndListParam theTarget, 
122   
123 			@Description(shortDefinition="")
124 			@OptionalParam(name="targetcode")
125 			TokenAndListParam theTargetcode, 
126   
127 			@Description(shortDefinition="")
128 			@OptionalParam(name="targetsystem")
129 			UriAndListParam theTargetsystem, 
130   
131 			@Description(shortDefinition="The URL of the concept map")
132 			@OptionalParam(name="url")
133 			UriAndListParam theUrl, 
134   
135 			@Description(shortDefinition="The version identifier of the concept map")
136 			@OptionalParam(name="version")
137 			TokenAndListParam theVersion, 
138 
139 			@RawParam
140 			Map<String, List<String>> theAdditionalRawParams,
141 
142 			@IncludeParam(reverse=true)
143 			Set<Include> theRevIncludes,
144 			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
145 			@OptionalParam(name="_lastUpdated")
146 			DateRangeParam theLastUpdated, 
147 
148 			@IncludeParam(allow= {
149 					"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" , 						"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" , 						"ConceptMap:source" , 					"ConceptMap:sourceuri" , 					"ConceptMap:target" 					, "*"
150 			}) 
151 			Set<Include> theIncludes,
152 			
153 			@Sort 
154 			SortSpec theSort,
155 			
156 			@ca.uhn.fhir.rest.annotation.Count
157 			Integer theCount
158 	) {
159 		startRequest(theServletRequest);
160 		try {
161 			SearchParameterMap paramMap = new SearchParameterMap();
162 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
163 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
164 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
165 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
166 			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
167 			paramMap.add("_has", theHas);
168 			paramMap.add("_id", the_id);
169 			paramMap.add("_language", the_language);
170 			paramMap.add("context", theContext);
171 			paramMap.add("date", theDate);
172 			paramMap.add("dependson", theDependson);
173 			paramMap.add("description", theDescription);
174 			paramMap.add("identifier", theIdentifier);
175 			paramMap.add("name", theName);
176 			paramMap.add("product", theProduct);
177 			paramMap.add("publisher", thePublisher);
178 			paramMap.add("source", theSource);
179 			paramMap.add("sourcecode", theSourcecode);
180 			paramMap.add("sourcesystem", theSourcesystem);
181 			paramMap.add("sourceuri", theSourceuri);
182 			paramMap.add("status", theStatus);
183 			paramMap.add("target", theTarget);
184 			paramMap.add("targetcode", theTargetcode);
185 			paramMap.add("targetsystem", theTargetsystem);
186 			paramMap.add("url", theUrl);
187 			paramMap.add("version", theVersion);
188 			paramMap.setRevIncludes(theRevIncludes);
189 			paramMap.setLastUpdated(theLastUpdated);
190 			paramMap.setIncludes(theIncludes);
191 			paramMap.setSort(theSort);
192 			paramMap.setCount(theCount);
193 
194 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
195 
196 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
197 			return retVal;
198 		} finally {
199 			endRequest(theServletRequest);
200 		}
201 	}
202 
203 }