001
002package ca.uhn.fhir.jpa.rp.r5;
003
004import java.util.*;
005
006import org.apache.commons.lang3.StringUtils;
007
008import ca.uhn.fhir.jpa.provider.r5.*;
009import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
010import ca.uhn.fhir.model.api.Include;
011import ca.uhn.fhir.model.api.annotation.*;
012import org.hl7.fhir.r5.model.*;
013import ca.uhn.fhir.rest.annotation.*;
014import ca.uhn.fhir.rest.param.*;
015import ca.uhn.fhir.rest.api.SortSpec;
016import ca.uhn.fhir.rest.api.SummaryEnum;
017import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
018import ca.uhn.fhir.rest.api.SearchContainedModeEnum;
019
020public class ConceptMap2ResourceProvider extends 
021        JpaResourceProviderR5<ConceptMap2>
022        {
023
024        @Override
025        public Class<ConceptMap2> getResourceType() {
026                return ConceptMap2.class;
027        }
028
029        @Search(allowUnknownParams=true)
030        public ca.uhn.fhir.rest.api.server.IBundleProvider search(
031                        javax.servlet.http.HttpServletRequest theServletRequest,
032                        javax.servlet.http.HttpServletResponse theServletResponse,
033
034                        ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
035
036                        @Description(shortDefinition="Search the contents of the resource's data using a filter")
037                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_FILTER)
038                        StringAndListParam theFtFilter,
039
040                        @Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
041                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
042                        StringAndListParam theFtContent, 
043
044                        @Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
045                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
046                        StringAndListParam theFtText, 
047
048                        @Description(shortDefinition="Search for resources which have the given tag")
049                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
050                        TokenAndListParam theSearchForTag, 
051
052                        @Description(shortDefinition="Search for resources which have the given security labels")
053                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
054                        TokenAndListParam theSearchForSecurity, 
055  
056                        @Description(shortDefinition="Search for resources which have the given profile")
057                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
058                        UriAndListParam theSearchForProfile,
059
060                        @Description(shortDefinition="Search for resources which have the given source value (Resource.meta.source)")
061                        @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE)
062                        UriAndListParam theSearchForSource,
063
064                        @Description(shortDefinition="Return resources linked to by the given target")
065                        @OptionalParam(name="_has")
066                        HasAndListParam theHas, 
067
068   
069
070                        @Description(shortDefinition="The ID of the resource")
071                        @OptionalParam(name="_id")
072                        TokenAndListParam the_id,
073   
074
075                        @Description(shortDefinition="Search on the narrative of the resource")
076                        @OptionalParam(name="_text")
077                        SpecialAndListParam the_text,
078   
079
080                        @Description(shortDefinition="A use context assigned to the concept map")
081                        @OptionalParam(name="context")
082                        TokenAndListParam theContext,
083   
084
085                        @Description(shortDefinition="A quantity- or range-valued use context assigned to the concept map")
086                        @OptionalParam(name="context-quantity")
087                        QuantityAndListParam theContext_quantity, 
088   
089
090                        @Description(shortDefinition="A type of use context assigned to the concept map")
091                        @OptionalParam(name="context-type")
092                        TokenAndListParam theContext_type,
093   
094
095                        @Description(shortDefinition="A use context type and quantity- or range-based value assigned to the concept map")
096                        @OptionalParam(name="context-type-quantity", compositeTypes= { TokenParam.class, QuantityParam.class })
097                        CompositeAndListParam<TokenParam, QuantityParam> theContext_type_quantity,
098   
099
100                        @Description(shortDefinition="A use context type and value assigned to the concept map")
101                        @OptionalParam(name="context-type-value", compositeTypes= { TokenParam.class, TokenParam.class })
102                        CompositeAndListParam<TokenParam, TokenParam> theContext_type_value,
103   
104
105                        @Description(shortDefinition="The concept map publication date")
106                        @OptionalParam(name="date")
107                        DateRangeParam theDate, 
108   
109
110                        @Description(shortDefinition="Reference to property mapping depends on")
111                        @OptionalParam(name="dependson")
112                        UriAndListParam theDependson, 
113   
114
115                        @Description(shortDefinition="The description of the concept map")
116                        @OptionalParam(name="description")
117                        StringAndListParam theDescription, 
118   
119
120                        @Description(shortDefinition="External identifier for the concept map")
121                        @OptionalParam(name="identifier")
122                        TokenAndListParam theIdentifier,
123   
124
125                        @Description(shortDefinition="Intended jurisdiction for the concept map")
126                        @OptionalParam(name="jurisdiction")
127                        TokenAndListParam theJurisdiction,
128   
129
130                        @Description(shortDefinition="Computationally friendly name of the concept map")
131                        @OptionalParam(name="name")
132                        StringAndListParam theName, 
133   
134
135                        @Description(shortDefinition="canonical reference to an additional ConceptMap2 to use for mapping if the source concept is unmapped")
136                        @OptionalParam(name="other", targetTypes={  } )
137                        ReferenceAndListParam theOther, 
138   
139
140                        @Description(shortDefinition="Reference to property mapping depends on")
141                        @OptionalParam(name="product")
142                        UriAndListParam theProduct, 
143   
144
145                        @Description(shortDefinition="Name of the publisher of the concept map")
146                        @OptionalParam(name="publisher")
147                        StringAndListParam thePublisher, 
148   
149
150                        @Description(shortDefinition="The source value set that contains the concepts that are being mapped")
151                        @OptionalParam(name="source", targetTypes={  } )
152                        ReferenceAndListParam theSource, 
153   
154
155                        @Description(shortDefinition="Identifies element being mapped")
156                        @OptionalParam(name="source-code")
157                        TokenAndListParam theSource_code,
158   
159
160                        @Description(shortDefinition="Source system where concepts to be mapped are defined")
161                        @OptionalParam(name="source-system")
162                        UriAndListParam theSource_system, 
163   
164
165                        @Description(shortDefinition="The source value set that contains the concepts that are being mapped")
166                        @OptionalParam(name="source-uri", targetTypes={  } )
167                        ReferenceAndListParam theSource_uri, 
168   
169
170                        @Description(shortDefinition="The current status of the concept map")
171                        @OptionalParam(name="status")
172                        TokenAndListParam theStatus,
173   
174
175                        @Description(shortDefinition="The target value set which provides context for the mappings")
176                        @OptionalParam(name="target", targetTypes={  } )
177                        ReferenceAndListParam theTarget, 
178   
179
180                        @Description(shortDefinition="Code that identifies the target element")
181                        @OptionalParam(name="target-code")
182                        TokenAndListParam theTarget_code,
183   
184
185                        @Description(shortDefinition="Target system that the concepts are to be mapped to")
186                        @OptionalParam(name="target-system")
187                        UriAndListParam theTarget_system, 
188   
189
190                        @Description(shortDefinition="The target value set which provides context for the mappings")
191                        @OptionalParam(name="target-uri", targetTypes={  } )
192                        ReferenceAndListParam theTarget_uri, 
193   
194
195                        @Description(shortDefinition="The human-friendly name of the concept map")
196                        @OptionalParam(name="title")
197                        StringAndListParam theTitle, 
198   
199
200                        @Description(shortDefinition="The uri that identifies the concept map")
201                        @OptionalParam(name="url")
202                        UriAndListParam theUrl, 
203   
204
205                        @Description(shortDefinition="The business version of the concept map")
206                        @OptionalParam(name="version")
207                        TokenAndListParam theVersion,
208
209                        @RawParam
210                        Map<String, List<String>> theAdditionalRawParams,
211
212                        @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
213                        @OptionalParam(name="_lastUpdated")
214                        DateRangeParam theLastUpdated, 
215
216                        @IncludeParam
217                        Set<Include> theIncludes,
218
219                        @IncludeParam(reverse=true)
220                        Set<Include> theRevIncludes,
221
222                        @Sort
223                        SortSpec theSort,
224                        
225                        @ca.uhn.fhir.rest.annotation.Count
226                        Integer theCount,
227
228                        @ca.uhn.fhir.rest.annotation.Offset
229                        Integer theOffset,
230
231                        SummaryEnum theSummaryMode,
232
233                        SearchTotalModeEnum theSearchTotalMode,
234
235                        SearchContainedModeEnum theSearchContainedMode
236
237                        ) {
238                startRequest(theServletRequest);
239                try {
240                        SearchParameterMap paramMap = new SearchParameterMap();
241                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter);
242                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
243                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
244                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
245                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
246                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
247                        paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE, theSearchForSource);
248                        paramMap.add("_has", theHas);
249                        paramMap.add("_id", the_id);
250                        paramMap.add("_text", the_text);
251                        paramMap.add("context", theContext);
252                        paramMap.add("context-quantity", theContext_quantity);
253                        paramMap.add("context-type", theContext_type);
254                        paramMap.add("context-type-quantity", theContext_type_quantity);
255                        paramMap.add("context-type-value", theContext_type_value);
256                        paramMap.add("date", theDate);
257                        paramMap.add("dependson", theDependson);
258                        paramMap.add("description", theDescription);
259                        paramMap.add("identifier", theIdentifier);
260                        paramMap.add("jurisdiction", theJurisdiction);
261                        paramMap.add("name", theName);
262                        paramMap.add("other", theOther);
263                        paramMap.add("product", theProduct);
264                        paramMap.add("publisher", thePublisher);
265                        paramMap.add("source", theSource);
266                        paramMap.add("source-code", theSource_code);
267                        paramMap.add("source-system", theSource_system);
268                        paramMap.add("source-uri", theSource_uri);
269                        paramMap.add("status", theStatus);
270                        paramMap.add("target", theTarget);
271                        paramMap.add("target-code", theTarget_code);
272                        paramMap.add("target-system", theTarget_system);
273                        paramMap.add("target-uri", theTarget_uri);
274                        paramMap.add("title", theTitle);
275                        paramMap.add("url", theUrl);
276                        paramMap.add("version", theVersion);
277                        paramMap.setRevIncludes(theRevIncludes);
278                        paramMap.setLastUpdated(theLastUpdated);
279                        paramMap.setIncludes(theIncludes);
280                        paramMap.setSort(theSort);
281                        paramMap.setCount(theCount);
282                        paramMap.setOffset(theOffset);
283                        paramMap.setSummaryMode(theSummaryMode);
284                        paramMap.setSearchTotalMode(theSearchTotalMode);
285                        paramMap.setSearchContainedMode(theSearchContainedMode);
286
287                        getDao().translateRawParameters(theAdditionalRawParams, paramMap);
288
289                        ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
290                        return retVal;
291                } finally {
292                        endRequest(theServletRequest);
293                }
294        }
295
296}