001package org.hl7.fhir.convertors.conv40_50.resources40_50;
002
003import java.util.stream.Collectors;
004
005import org.hl7.fhir.convertors.context.ConversionContext40_50;
006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50;
007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50;
008import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50;
009import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
010import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50;
011import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Code40_50;
012import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50;
013import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.MarkDown40_50;
014import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
015import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
016import org.hl7.fhir.exceptions.FHIRException;
017import org.hl7.fhir.r5.model.Enumeration;
018import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAll;
019import org.hl7.fhir.r5.model.Enumerations.VersionIndependentResourceTypesAllEnumFactory;
020
021/*
022  Copyright (c) 2011+, HL7, Inc.
023  All rights reserved.
024  
025  Redistribution and use in source and binary forms, with or without modification, 
026  are permitted provided that the following conditions are met:
027  
028   * Redistributions of source code must retain the above copyright notice, this 
029     list of conditions and the following disclaimer.
030   * Redistributions in binary form must reproduce the above copyright notice, 
031     this list of conditions and the following disclaimer in the documentation 
032     and/or other materials provided with the distribution.
033   * Neither the name of HL7 nor the names of its contributors may be used to 
034     endorse or promote products derived from this software without specific 
035     prior written permission.
036  
037  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
038  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
039  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
040  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
041  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
042  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
043  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
044  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
045  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
046  POSSIBILITY OF SUCH DAMAGE.
047  
048*/
049// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
050public class SearchParameter40_50 {
051
052  public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4.model.SearchParameter src) throws FHIRException {
053    if (src == null)
054      return null;
055    org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter();
056    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
057    if (src.hasUrl())
058      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
059    if (src.hasVersion())
060      tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
061    if (src.hasName())
062      tgt.setNameElement(String40_50.convertString(src.getNameElement()));
063    if (src.hasDerivedFrom())
064      tgt.setDerivedFromElement(Canonical40_50.convertCanonical(src.getDerivedFromElement()));
065    if (src.hasStatus())
066      tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
067    if (src.hasExperimental())
068      tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement()));
069    if (src.hasDate())
070      tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement()));
071    if (src.hasPublisher())
072      tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement()));
073    for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
074      tgt.addContact(ContactDetail40_50.convertContactDetail(t));
075    if (src.hasDescription())
076      tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
077    for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
078      tgt.addUseContext(UsageContext40_50.convertUsageContext(t));
079    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
080      tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t));
081    if (src.hasPurpose())
082      tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement()));
083    if (src.hasCode())
084      tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement()));
085    for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.getBase().add(new Enumeration<VersionIndependentResourceTypesAll>(new VersionIndependentResourceTypesAllEnumFactory(), Code40_50.convertCode(t)));
086    if (src.hasType())
087      tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement()));
088    if (src.hasExpression())
089      tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement()));
090//    if (src.hasXpath())
091//      tgt.setXpathElement(String40_50.convertString(src.getXpathElement()));
092    if (src.hasXpathUsage())
093      tgt.setProcessingModeElement(convertXPathUsageType(src.getXpathUsageElement()));
094    for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.getTarget().add(new Enumeration<VersionIndependentResourceTypesAll>(new VersionIndependentResourceTypesAllEnumFactory(), Code40_50.convertCode(t)));
095    if (src.hasMultipleOr())
096      tgt.setMultipleOrElement(Boolean40_50.convertBoolean(src.getMultipleOrElement()));
097    if (src.hasMultipleAnd())
098      tgt.setMultipleAndElement(Boolean40_50.convertBoolean(src.getMultipleAndElement()));
099    tgt.setComparator(src.getComparator().stream()
100      .map(SearchParameter40_50::convertSearchComparator)
101      .collect(Collectors.toList()));
102    tgt.setModifier(src.getModifier().stream()
103      .map(SearchParameter40_50::convertSearchModifierCode)
104      .collect(Collectors.toList()));
105    for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.getChain().add(String40_50.convertString(t));
106    for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent())
107      tgt.addComponent(convertSearchParameterComponentComponent(t));
108    return tgt;
109  }
110
111  public static org.hl7.fhir.r4.model.SearchParameter convertSearchParameter(org.hl7.fhir.r5.model.SearchParameter src) throws FHIRException {
112    if (src == null)
113      return null;
114    org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter();
115    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
116    if (src.hasUrl())
117      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
118    if (src.hasVersion())
119      tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
120    if (src.hasName())
121      tgt.setNameElement(String40_50.convertString(src.getNameElement()));
122    if (src.hasDerivedFrom())
123      tgt.setDerivedFromElement(Canonical40_50.convertCanonical(src.getDerivedFromElement()));
124    if (src.hasStatus())
125      tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
126    if (src.hasExperimental())
127      tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement()));
128    if (src.hasDate())
129      tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement()));
130    if (src.hasPublisher())
131      tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement()));
132    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
133      tgt.addContact(ContactDetail40_50.convertContactDetail(t));
134    if (src.hasDescription())
135      tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
136    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
137      tgt.addUseContext(UsageContext40_50.convertUsageContext(t));
138    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
139      tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t));
140    if (src.hasPurpose())
141      tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement()));
142    if (src.hasCode())
143      tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement()));
144    for (Enumeration<VersionIndependentResourceTypesAll> t : src.getBase()) tgt.getBase().add(Code40_50.convertCode(t.getCodeType()));
145    if (src.hasType())
146      tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement()));
147    if (src.hasExpression())
148      tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement()));
149//    if (src.hasXpath())
150//      tgt.setXpathElement(String40_50.convertString(src.getXpathElement()));
151    if (src.hasProcessingMode())
152      tgt.setXpathUsageElement(convertXPathUsageType(src.getProcessingModeElement()));
153    for (Enumeration<VersionIndependentResourceTypesAll> t : src.getTarget()) tgt.getTarget().add(Code40_50.convertCode(t.getCodeType()));
154    if (src.hasMultipleOr())
155      tgt.setMultipleOrElement(Boolean40_50.convertBoolean(src.getMultipleOrElement()));
156    if (src.hasMultipleAnd())
157      tgt.setMultipleAndElement(Boolean40_50.convertBoolean(src.getMultipleAndElement()));
158    tgt.setComparator(src.getComparator().stream()
159      .map(SearchParameter40_50::convertSearchComparator)
160      .collect(Collectors.toList()));
161    tgt.setModifier(src.getModifier().stream()
162      .map(SearchParameter40_50::convertSearchModifierCode)
163      .collect(Collectors.toList()));
164    for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.getChain().add(String40_50.convertString(t));
165    for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent())
166      tgt.addComponent(convertSearchParameterComponentComponent(t));
167    return tgt;
168  }
169
170  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType> convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> src) throws FHIRException {
171    if (src == null || src.isEmpty())
172      return null;
173    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeTypeEnumFactory());
174    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
175    switch (src.getValue()) {
176      case NORMAL:
177        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NORMAL);
178        break;
179      case PHONETIC:
180        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.PHONETIC);
181        break;
182      case NEARBY:
183        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER);
184        break;
185      case DISTANCE:
186        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER);
187        break;
188      case OTHER:
189        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.OTHER);
190        break;
191      default:
192        tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType.NULL);
193        break;
194    }
195    return tgt;
196  }
197
198  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchProcessingModeType> src) throws FHIRException {
199    if (src == null || src.isEmpty())
200      return null;
201    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory());
202    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
203    switch (src.getValue()) {
204      case NORMAL:
205        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL);
206        break;
207      case PHONETIC:
208        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC);
209        break;
210      case OTHER:
211        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER);
212        break;
213      default:
214        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL);
215        break;
216    }
217    return tgt;
218  }
219
220  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator> convertSearchComparator(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> src) throws FHIRException {
221    if (src == null || src.isEmpty())
222      return null;
223    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory());
224    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
225    switch (src.getValue()) {
226      case EQ:
227        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ);
228        break;
229      case NE:
230        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE);
231        break;
232      case GT:
233        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT);
234        break;
235      case LT:
236        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT);
237        break;
238      case GE:
239        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE);
240        break;
241      case LE:
242        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE);
243        break;
244      case SA:
245        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA);
246        break;
247      case EB:
248        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB);
249        break;
250      case AP:
251        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP);
252        break;
253      default:
254        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL);
255        break;
256    }
257    return tgt;
258  }
259
260  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> convertSearchComparator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator> src) throws FHIRException {
261    if (src == null || src.isEmpty())
262      return null;
263    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchComparatorEnumFactory());
264    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
265    switch (src.getValue()) {
266      case EQ:
267        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ);
268        break;
269      case NE:
270        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE);
271        break;
272      case GT:
273        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT);
274        break;
275      case LT:
276        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT);
277        break;
278      case GE:
279        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE);
280        break;
281      case LE:
282        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE);
283        break;
284      case SA:
285        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA);
286        break;
287      case EB:
288        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB);
289        break;
290      case AP:
291        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP);
292        break;
293      default:
294        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL);
295        break;
296    }
297    return tgt;
298  }
299
300  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> src) throws FHIRException {
301    if (src == null || src.isEmpty())
302      return null;
303    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory());
304    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
305    switch (src.getValue()) {
306      case MISSING:
307        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.MISSING);
308        break;
309      case EXACT:
310        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.EXACT);
311        break;
312      case CONTAINS:
313        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.CONTAINS);
314        break;
315      case NOT:
316        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOT);
317        break;
318      case TEXT:
319        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TEXT);
320        break;
321      case IN:
322        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN);
323        break;
324      case NOTIN:
325        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN);
326        break;
327      case BELOW:
328        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW);
329        break;
330      case ABOVE:
331        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE);
332        break;
333      case TYPE:
334        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.TYPE);
335        break;
336      case IDENTIFIER:
337        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IDENTIFIER);
338        break;
339      case OFTYPE:
340        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.OFTYPE);
341        break;
342      default:
343        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL);
344        break;
345    }
346    return tgt;
347  }
348
349  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode> src) throws FHIRException {
350    if (src == null || src.isEmpty())
351      return null;
352    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory());
353    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
354    switch (src.getValue()) {
355      case MISSING:
356        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING);
357        break;
358      case EXACT:
359        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT);
360        break;
361      case CONTAINS:
362        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS);
363        break;
364      case NOT:
365        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT);
366        break;
367      case TEXT:
368        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT);
369        break;
370      case IN:
371        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN);
372        break;
373      case NOTIN:
374        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN);
375        break;
376      case BELOW:
377        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW);
378        break;
379      case ABOVE:
380        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE);
381        break;
382      case TYPE:
383        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE);
384        break;
385      case IDENTIFIER:
386        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER);
387        break;
388      case OFTYPE:
389        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE);
390        break;
391      default:
392        tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL);
393        break;
394    }
395    return tgt;
396  }
397
398  public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException {
399    if (src == null)
400      return null;
401    org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent();
402    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
403    if (src.hasDefinition())
404      tgt.setDefinitionElement(Canonical40_50.convertCanonical(src.getDefinitionElement()));
405    if (src.hasExpression())
406      tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement()));
407    return tgt;
408  }
409
410  public static org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException {
411    if (src == null)
412      return null;
413    org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent();
414    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
415    if (src.hasDefinition())
416      tgt.setDefinitionElement(Canonical40_50.convertCanonical(src.getDefinitionElement()));
417    if (src.hasExpression())
418      tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement()));
419    return tgt;
420  }
421}