001package org.hl7.fhir.convertors.conv43_50.resources43_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext43_50; 004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; 005import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; 006import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; 007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; 008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; 009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; 010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; 011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; 012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; 013import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; 014import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50; 015import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50; 016import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; 017import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; 018import org.hl7.fhir.exceptions.FHIRException; 019 020/* 021 Copyright (c) 2011+, HL7, Inc. 022 All rights reserved. 023 024 Redistribution and use in source and binary forms, with or without modification, 025 are permitted provided that the following conditions are met: 026 027 * Redistributions of source code must retain the above copyright notice, this 028 list of conditions and the following disclaimer. 029 * Redistributions in binary form must reproduce the above copyright notice, 030 this list of conditions and the following disclaimer in the documentation 031 and/or other materials provided with the distribution. 032 * Neither the name of HL7 nor the names of its contributors may be used to 033 endorse or promote products derived from this software without specific 034 prior written permission. 035 036 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 037 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 038 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 039 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 040 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 041 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 042 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 043 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 044 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 045 POSSIBILITY OF SUCH DAMAGE. 046 047*/ 048// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 049public class ValueSet43_50 { 050 051 public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.r4b.model.ValueSet src) throws FHIRException { 052 if (src == null) 053 return null; 054 org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); 055 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); 056 if (src.hasUrl()) 057 tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); 058 for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) 059 tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); 060 if (src.hasVersion()) 061 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 062 if (src.hasName()) 063 tgt.setNameElement(String43_50.convertString(src.getNameElement())); 064 if (src.hasTitle()) 065 tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); 066 if (src.hasStatus()) 067 tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); 068 if (src.hasExperimental()) 069 tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); 070 if (src.hasDate()) 071 tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); 072 if (src.hasPublisher()) 073 tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); 074 for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) 075 tgt.addContact(ContactDetail43_50.convertContactDetail(t)); 076 if (src.hasDescription()) 077 tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); 078 for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) 079 tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); 080 for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) 081 tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); 082 if (src.hasImmutable()) 083 tgt.setImmutableElement(Boolean43_50.convertBoolean(src.getImmutableElement())); 084 if (src.hasPurpose()) 085 tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); 086 if (src.hasCopyright()) 087 tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); 088 if (src.hasCompose()) 089 tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); 090 if (src.hasExpansion()) 091 tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); 092 return tgt; 093 } 094 095 public static org.hl7.fhir.r4b.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException { 096 if (src == null) 097 return null; 098 org.hl7.fhir.r4b.model.ValueSet tgt = new org.hl7.fhir.r4b.model.ValueSet(); 099 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); 100 if (src.hasUrl()) 101 tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); 102 for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) 103 tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); 104 if (src.hasVersion()) 105 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 106 if (src.hasName()) 107 tgt.setNameElement(String43_50.convertString(src.getNameElement())); 108 if (src.hasTitle()) 109 tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); 110 if (src.hasStatus()) 111 tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); 112 if (src.hasExperimental()) 113 tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); 114 if (src.hasDate()) 115 tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); 116 if (src.hasPublisher()) 117 tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); 118 for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) 119 tgt.addContact(ContactDetail43_50.convertContactDetail(t)); 120 if (src.hasDescription()) 121 tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); 122 for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) 123 tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); 124 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) 125 tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); 126 if (src.hasImmutable()) 127 tgt.setImmutableElement(Boolean43_50.convertBoolean(src.getImmutableElement())); 128 if (src.hasPurpose()) 129 tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); 130 if (src.hasCopyright()) 131 tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); 132 if (src.hasCompose()) 133 tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); 134 if (src.hasExpansion()) 135 tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); 136 return tgt; 137 } 138 139 public static org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { 140 if (src == null) 141 return null; 142 org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); 143 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 144 if (src.hasLockedDate()) 145 tgt.setLockedDateElement(Date43_50.convertDate(src.getLockedDateElement())); 146 if (src.hasInactive()) 147 tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); 148 for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent t : src.getInclude()) 149 tgt.addInclude(convertConceptSetComponent(t)); 150 for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent t : src.getExclude()) 151 tgt.addExclude(convertConceptSetComponent(t)); 152 return tgt; 153 } 154 155 public static org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { 156 if (src == null) 157 return null; 158 org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent(); 159 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 160 if (src.hasLockedDate()) 161 tgt.setLockedDateElement(Date43_50.convertDate(src.getLockedDateElement())); 162 if (src.hasInactive()) 163 tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); 164 for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) 165 tgt.addInclude(convertConceptSetComponent(t)); 166 for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) 167 tgt.addExclude(convertConceptSetComponent(t)); 168 return tgt; 169 } 170 171 public static org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent src) throws FHIRException { 172 if (src == null) 173 return null; 174 org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); 175 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 176 if (src.hasSystem()) 177 tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); 178 if (src.hasVersion()) 179 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 180 for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) 181 tgt.addConcept(convertConceptReferenceComponent(t)); 182 for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) 183 tgt.addFilter(convertConceptSetFilterComponent(t)); 184 for (org.hl7.fhir.r4b.model.CanonicalType t : src.getValueSet()) 185 tgt.getValueSet().add(Canonical43_50.convertCanonical(t)); 186 return tgt; 187 } 188 189 public static org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent src) throws FHIRException { 190 if (src == null) 191 return null; 192 org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent(); 193 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 194 if (src.hasSystem()) 195 tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); 196 if (src.hasVersion()) 197 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 198 for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) 199 tgt.addConcept(convertConceptReferenceComponent(t)); 200 for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) 201 tgt.addFilter(convertConceptSetFilterComponent(t)); 202 for (org.hl7.fhir.r5.model.CanonicalType t : src.getValueSet()) 203 tgt.getValueSet().add(Canonical43_50.convertCanonical(t)); 204 return tgt; 205 } 206 207 public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { 208 if (src == null) 209 return null; 210 org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); 211 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 212 if (src.hasCode()) 213 tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); 214 if (src.hasDisplay()) 215 tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); 216 for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 217 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 218 return tgt; 219 } 220 221 public static org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { 222 if (src == null) 223 return null; 224 org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent(); 225 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 226 if (src.hasCode()) 227 tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); 228 if (src.hasDisplay()) 229 tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); 230 for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 231 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 232 return tgt; 233 } 234 235 public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { 236 if (src == null) 237 return null; 238 org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent(); 239 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 240 if (src.hasLanguage()) 241 tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); 242 if (src.hasUse()) 243 tgt.setUse(Coding43_50.convertCoding(src.getUse())); 244 if (src.hasValue()) 245 tgt.setValueElement(String43_50.convertString(src.getValueElement())); 246 return tgt; 247 } 248 249 public static org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { 250 if (src == null) 251 return null; 252 org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent(); 253 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 254 if (src.hasLanguage()) 255 tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); 256 if (src.hasUse()) 257 tgt.setUse(Coding43_50.convertCoding(src.getUse())); 258 if (src.hasValue()) 259 tgt.setValueElement(String43_50.convertString(src.getValueElement())); 260 return tgt; 261 } 262 263 public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { 264 if (src == null) 265 return null; 266 org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); 267 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 268 if (src.hasProperty()) 269 tgt.setPropertyElement(Code43_50.convertCode(src.getPropertyElement())); 270 if (src.hasOp()) 271 tgt.setOpElement(convertFilterOperator(src.getOpElement())); 272 if (src.hasValue()) 273 tgt.setValueElement(String43_50.convertString(src.getValueElement())); 274 return tgt; 275 } 276 277 public static org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { 278 if (src == null) 279 return null; 280 org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent(); 281 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 282 if (src.hasProperty()) 283 tgt.setPropertyElement(Code43_50.convertCode(src.getPropertyElement())); 284 if (src.hasOp()) 285 tgt.setOpElement(convertFilterOperator(src.getOpElement())); 286 if (src.hasValue()) 287 tgt.setValueElement(String43_50.convertString(src.getValueElement())); 288 return tgt; 289 } 290 291 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> src) throws FHIRException { 292 if (src == null || src.isEmpty()) 293 return null; 294 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory()); 295 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 296 switch (src.getValue()) { 297 case EQUAL: 298 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); 299 break; 300 case ISA: 301 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); 302 break; 303 case DESCENDENTOF: 304 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); 305 break; 306 case ISNOTA: 307 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); 308 break; 309 case REGEX: 310 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); 311 break; 312 case IN: 313 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); 314 break; 315 case NOTIN: 316 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); 317 break; 318 case GENERALIZES: 319 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); 320 break; 321 case EXISTS: 322 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); 323 break; 324 default: 325 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); 326 break; 327 } 328 return tgt; 329 } 330 331 static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> src) throws FHIRException { 332 if (src == null || src.isEmpty()) 333 return null; 334 org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory()); 335 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 336 switch (src.getValue()) { 337 case EQUAL: 338 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL); 339 break; 340 case ISA: 341 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA); 342 break; 343 case DESCENDENTOF: 344 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF); 345 break; 346 case ISNOTA: 347 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA); 348 break; 349 case REGEX: 350 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX); 351 break; 352 case IN: 353 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN); 354 break; 355 case NOTIN: 356 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN); 357 break; 358 case GENERALIZES: 359 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES); 360 break; 361 case EXISTS: 362 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS); 363 break; 364 default: 365 tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL); 366 break; 367 } 368 return tgt; 369 } 370 371 public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { 372 if (src == null) 373 return null; 374 org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); 375 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 376 if (src.hasIdentifier()) 377 tgt.setIdentifierElement(Uri43_50.convertUri(src.getIdentifierElement())); 378 if (src.hasTimestamp()) 379 tgt.setTimestampElement(DateTime43_50.convertDateTime(src.getTimestampElement())); 380 if (src.hasTotal()) 381 tgt.setTotalElement(Integer43_50.convertInteger(src.getTotalElement())); 382 if (src.hasOffset()) 383 tgt.setOffsetElement(Integer43_50.convertInteger(src.getOffsetElement())); 384 for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) 385 tgt.addParameter(convertValueSetExpansionParameterComponent(t)); 386 for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 387 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 388 return tgt; 389 } 390 391 public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { 392 if (src == null) 393 return null; 394 org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent(); 395 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 396 if (src.hasIdentifier()) 397 tgt.setIdentifierElement(Uri43_50.convertUri(src.getIdentifierElement())); 398 if (src.hasTimestamp()) 399 tgt.setTimestampElement(DateTime43_50.convertDateTime(src.getTimestampElement())); 400 if (src.hasTotal()) 401 tgt.setTotalElement(Integer43_50.convertInteger(src.getTotalElement())); 402 if (src.hasOffset()) 403 tgt.setOffsetElement(Integer43_50.convertInteger(src.getOffsetElement())); 404 for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) 405 tgt.addParameter(convertValueSetExpansionParameterComponent(t)); 406 for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 407 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 408 return tgt; 409 } 410 411 public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { 412 if (src == null) 413 return null; 414 org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); 415 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 416 if (src.hasName()) 417 tgt.setNameElement(String43_50.convertString(src.getNameElement())); 418 if (src.hasValue()) 419 tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); 420 return tgt; 421 } 422 423 public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { 424 if (src == null) 425 return null; 426 org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent(); 427 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 428 if (src.hasName()) 429 tgt.setNameElement(String43_50.convertString(src.getNameElement())); 430 if (src.hasValue()) 431 tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); 432 return tgt; 433 } 434 435 public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { 436 if (src == null) 437 return null; 438 org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent(); 439 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 440 if (src.hasSystem()) 441 tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); 442 if (src.hasAbstract()) 443 tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); 444 if (src.hasInactive()) 445 tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); 446 if (src.hasVersion()) 447 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 448 if (src.hasCode()) 449 tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); 450 if (src.hasDisplay()) 451 tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); 452 for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 453 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 454 for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 455 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 456 return tgt; 457 } 458 459 public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { 460 if (src == null) 461 return null; 462 org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent(); 463 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); 464 if (src.hasSystem()) 465 tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); 466 if (src.hasAbstract()) 467 tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); 468 if (src.hasInactive()) 469 tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); 470 if (src.hasVersion()) 471 tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); 472 if (src.hasCode()) 473 tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); 474 if (src.hasDisplay()) 475 tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); 476 for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 477 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 478 for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 479 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 480 return tgt; 481 } 482}