001package org.hl7.fhir.convertors.conv40_50.resources40_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext40_50; 004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50; 005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Coding40_50; 006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_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.*; 010import org.hl7.fhir.exceptions.FHIRException; 011 012import java.util.stream.Collectors; 013 014/* 015 Copyright (c) 2011+, HL7, Inc. 016 All rights reserved. 017 018 Redistribution and use in source and binary forms, with or without modification, 019 are permitted provided that the following conditions are met: 020 021 * Redistributions of source code must retain the above copyright notice, this 022 list of conditions and the following disclaimer. 023 * Redistributions in binary form must reproduce the above copyright notice, 024 this list of conditions and the following disclaimer in the documentation 025 and/or other materials provided with the distribution. 026 * Neither the name of HL7 nor the names of its contributors may be used to 027 endorse or promote products derived from this software without specific 028 prior written permission. 029 030 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 031 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 032 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 033 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 034 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 035 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 036 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 037 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 038 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 039 POSSIBILITY OF SUCH DAMAGE. 040 041*/ 042// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 043public class CodeSystem40_50 { 044 045 public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4.model.CodeSystem src) throws FHIRException { 046 if (src == null) 047 return null; 048 org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem(); 049 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 050 if (src.hasUrl()) 051 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 052 for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) 053 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 054 if (src.hasVersion()) 055 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 056 if (src.hasName()) 057 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 058 if (src.hasTitle()) 059 tgt.setTitleElement(String40_50.convertString(src.getTitleElement())); 060 if (src.hasStatus()) 061 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 062 if (src.hasExperimental()) 063 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 064 if (src.hasDate()) 065 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 066 if (src.hasPublisher()) 067 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 068 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 069 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 070 if (src.hasDescription()) 071 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 072 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 073 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 074 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 075 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 076 if (src.hasPurpose()) 077 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 078 if (src.hasCopyright()) 079 tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement())); 080 if (src.hasCaseSensitive()) 081 tgt.setCaseSensitiveElement(Boolean40_50.convertBoolean(src.getCaseSensitiveElement())); 082 if (src.hasValueSet()) 083 tgt.setValueSetElement(Canonical40_50.convertCanonical(src.getValueSetElement())); 084 if (src.hasHierarchyMeaning()) 085 tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement())); 086 if (src.hasCompositional()) 087 tgt.setCompositionalElement(Boolean40_50.convertBoolean(src.getCompositionalElement())); 088 if (src.hasVersionNeeded()) 089 tgt.setVersionNeededElement(Boolean40_50.convertBoolean(src.getVersionNeededElement())); 090 if (src.hasContent()) 091 tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement())); 092 if (src.hasSupplements()) 093 tgt.setSupplementsElement(Canonical40_50.convertCanonical(src.getSupplementsElement())); 094 if (src.hasCount()) 095 tgt.setCountElement(UnsignedInt40_50.convertUnsignedInt(src.getCountElement())); 096 for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) 097 tgt.addFilter(convertCodeSystemFilterComponent(t)); 098 for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) 099 tgt.addProperty(convertPropertyComponent(t)); 100 for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) 101 tgt.addConcept(convertConceptDefinitionComponent(t)); 102 return tgt; 103 } 104 105 public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException { 106 if (src == null) 107 return null; 108 org.hl7.fhir.r4.model.CodeSystem tgt = new org.hl7.fhir.r4.model.CodeSystem(); 109 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 110 if (src.hasUrl()) 111 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 112 for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) 113 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 114 if (src.hasVersion()) 115 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 116 if (src.hasName()) 117 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 118 if (src.hasTitle()) 119 tgt.setTitleElement(String40_50.convertString(src.getTitleElement())); 120 if (src.hasStatus()) 121 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 122 if (src.hasExperimental()) 123 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 124 if (src.hasDate()) 125 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 126 if (src.hasPublisher()) 127 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 128 for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) 129 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 130 if (src.hasDescription()) 131 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 132 for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) 133 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 134 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) 135 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 136 if (src.hasPurpose()) 137 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 138 if (src.hasCopyright()) 139 tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement())); 140 if (src.hasCaseSensitive()) 141 tgt.setCaseSensitiveElement(Boolean40_50.convertBoolean(src.getCaseSensitiveElement())); 142 if (src.hasValueSet()) 143 tgt.setValueSetElement(Canonical40_50.convertCanonical(src.getValueSetElement())); 144 if (src.hasHierarchyMeaning()) 145 tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement())); 146 if (src.hasCompositional()) 147 tgt.setCompositionalElement(Boolean40_50.convertBoolean(src.getCompositionalElement())); 148 if (src.hasVersionNeeded()) 149 tgt.setVersionNeededElement(Boolean40_50.convertBoolean(src.getVersionNeededElement())); 150 if (src.hasContent()) 151 tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement())); 152 if (src.hasSupplements()) 153 tgt.setSupplementsElement(Canonical40_50.convertCanonical(src.getSupplementsElement())); 154 if (src.hasCount()) 155 tgt.setCountElement(UnsignedInt40_50.convertUnsignedInt(src.getCountElement())); 156 for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) 157 tgt.addFilter(convertCodeSystemFilterComponent(t)); 158 for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) 159 tgt.addProperty(convertPropertyComponent(t)); 160 for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) 161 tgt.addConcept(convertConceptDefinitionComponent(t)); 162 return tgt; 163 } 164 165 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException { 166 if (src == null || src.isEmpty()) 167 return null; 168 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); 169 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 170 switch (src.getValue()) { 171 case GROUPEDBY: 172 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); 173 break; 174 case ISA: 175 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); 176 break; 177 case PARTOF: 178 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); 179 break; 180 case CLASSIFIEDWITH: 181 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); 182 break; 183 default: 184 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); 185 break; 186 } 187 return tgt; 188 } 189 190 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException { 191 if (src == null || src.isEmpty()) 192 return null; 193 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory()); 194 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 195 switch (src.getValue()) { 196 case GROUPEDBY: 197 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY); 198 break; 199 case ISA: 200 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA); 201 break; 202 case PARTOF: 203 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF); 204 break; 205 case CLASSIFIEDWITH: 206 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH); 207 break; 208 default: 209 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL); 210 break; 211 } 212 return tgt; 213 } 214 215 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException { 216 if (src == null || src.isEmpty()) 217 return null; 218 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentModeEnumFactory()); 219 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 220 switch (src.getValue()) { 221 case NOTPRESENT: 222 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); 223 break; 224 case EXAMPLE: 225 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE); 226 break; 227 case FRAGMENT: 228 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT); 229 break; 230 case COMPLETE: 231 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE); 232 break; 233 case SUPPLEMENT: 234 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); 235 break; 236 default: 237 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NULL); 238 break; 239 } 240 return tgt; 241 } 242 243 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException { 244 if (src == null || src.isEmpty()) 245 return null; 246 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory()); 247 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 248 switch (src.getValue()) { 249 case NOTPRESENT: 250 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); 251 break; 252 case EXAMPLE: 253 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE); 254 break; 255 case FRAGMENT: 256 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT); 257 break; 258 case COMPLETE: 259 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE); 260 break; 261 case SUPPLEMENT: 262 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); 263 break; 264 default: 265 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL); 266 break; 267 } 268 return tgt; 269 } 270 271 public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { 272 if (src == null) 273 return null; 274 org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent(); 275 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 276 if (src.hasCode()) 277 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 278 if (src.hasDescription()) 279 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 280 tgt.setOperator(src.getOperator().stream() 281 .map(CodeSystem40_50::convertFilterOperator) 282 .collect(Collectors.toList())); 283 if (src.hasValue()) 284 tgt.setValueElement(String40_50.convertString(src.getValueElement())); 285 return tgt; 286 } 287 288 public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { 289 if (src == null) 290 return null; 291 org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent(); 292 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 293 if (src.hasCode()) 294 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 295 if (src.hasDescription()) 296 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 297 tgt.setOperator(src.getOperator().stream() 298 .map(CodeSystem40_50::convertFilterOperator) 299 .collect(Collectors.toList())); 300 if (src.hasValue()) 301 tgt.setValueElement(String40_50.convertString(src.getValueElement())); 302 return tgt; 303 } 304 305 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> src) throws FHIRException { 306 if (src == null || src.isEmpty()) 307 return null; 308 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()); 309 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 310 switch (src.getValue()) { 311 case EQUAL: 312 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL); 313 break; 314 case ISA: 315 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA); 316 break; 317 case DESCENDENTOF: 318 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF); 319 break; 320 case ISNOTA: 321 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA); 322 break; 323 case REGEX: 324 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX); 325 break; 326 case IN: 327 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN); 328 break; 329 case NOTIN: 330 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN); 331 break; 332 case GENERALIZES: 333 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES); 334 break; 335 case EXISTS: 336 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS); 337 break; 338 default: 339 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL); 340 break; 341 } 342 return tgt; 343 } 344 345 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> convertFilterOperator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> src) throws FHIRException { 346 if (src == null || src.isEmpty()) 347 return null; 348 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory()); 349 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 350 switch (src.getValue()) { 351 case EQUAL: 352 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL); 353 break; 354 case ISA: 355 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA); 356 break; 357 case DESCENDENTOF: 358 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF); 359 break; 360 case ISNOTA: 361 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA); 362 break; 363 case REGEX: 364 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX); 365 break; 366 case IN: 367 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN); 368 break; 369 case NOTIN: 370 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN); 371 break; 372 case GENERALIZES: 373 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES); 374 break; 375 case EXISTS: 376 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS); 377 break; 378 default: 379 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL); 380 break; 381 } 382 return tgt; 383 } 384 385 public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.PropertyComponent src) throws FHIRException { 386 if (src == null) 387 return null; 388 org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent(); 389 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 390 if (src.hasCode()) 391 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 392 if (src.hasUri()) 393 tgt.setUriElement(Uri40_50.convertUri(src.getUriElement())); 394 if (src.hasDescription()) 395 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 396 if (src.hasType()) 397 tgt.setTypeElement(convertPropertyType(src.getTypeElement())); 398 return tgt; 399 } 400 401 public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException { 402 if (src == null) 403 return null; 404 org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent(); 405 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 406 if (src.hasCode()) 407 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 408 if (src.hasUri()) 409 tgt.setUriElement(Uri40_50.convertUri(src.getUriElement())); 410 if (src.hasDescription()) 411 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 412 if (src.hasType()) 413 tgt.setTypeElement(convertPropertyType(src.getTypeElement())); 414 return tgt; 415 } 416 417 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> src) throws FHIRException { 418 if (src == null || src.isEmpty()) 419 return null; 420 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory()); 421 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 422 switch (src.getValue()) { 423 case CODE: 424 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE); 425 break; 426 case CODING: 427 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING); 428 break; 429 case STRING: 430 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING); 431 break; 432 case INTEGER: 433 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER); 434 break; 435 case BOOLEAN: 436 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN); 437 break; 438 case DATETIME: 439 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME); 440 break; 441 case DECIMAL: 442 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL); 443 break; 444 default: 445 tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL); 446 break; 447 } 448 return tgt; 449 } 450 451 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> src) throws FHIRException { 452 if (src == null || src.isEmpty()) 453 return null; 454 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory()); 455 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 456 switch (src.getValue()) { 457 case CODE: 458 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE); 459 break; 460 case CODING: 461 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING); 462 break; 463 case STRING: 464 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING); 465 break; 466 case INTEGER: 467 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER); 468 break; 469 case BOOLEAN: 470 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN); 471 break; 472 case DATETIME: 473 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME); 474 break; 475 case DECIMAL: 476 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL); 477 break; 478 default: 479 tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL); 480 break; 481 } 482 return tgt; 483 } 484 485 public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { 486 if (src == null) 487 return null; 488 org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent(); 489 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 490 if (src.hasCode()) 491 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 492 if (src.hasDisplay()) 493 tgt.setDisplayElement(String40_50.convertString(src.getDisplayElement())); 494 if (src.hasDefinition()) 495 tgt.setDefinitionElement(String40_50.convertString(src.getDefinitionElement())); 496 for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) 497 tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); 498 for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) 499 tgt.addProperty(convertConceptPropertyComponent(t)); 500 for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) 501 tgt.addConcept(convertConceptDefinitionComponent(t)); 502 return tgt; 503 } 504 505 public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { 506 if (src == null) 507 return null; 508 org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent(); 509 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 510 if (src.hasCode()) 511 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 512 if (src.hasDisplay()) 513 tgt.setDisplayElement(String40_50.convertString(src.getDisplayElement())); 514 if (src.hasDefinition()) 515 tgt.setDefinitionElement(String40_50.convertString(src.getDefinitionElement())); 516 for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) 517 tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); 518 for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) 519 tgt.addProperty(convertConceptPropertyComponent(t)); 520 for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) 521 tgt.addConcept(convertConceptDefinitionComponent(t)); 522 return tgt; 523 } 524 525 public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { 526 if (src == null) 527 return null; 528 org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent(); 529 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 530 if (src.hasLanguage()) 531 tgt.setLanguageElement(Code40_50.convertCode(src.getLanguageElement())); 532 if (src.hasUse()) 533 tgt.setUse(Coding40_50.convertCoding(src.getUse())); 534 if (src.hasValue()) 535 tgt.setValueElement(String40_50.convertString(src.getValueElement())); 536 return tgt; 537 } 538 539 public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { 540 if (src == null) 541 return null; 542 org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent(); 543 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 544 if (src.hasLanguage()) 545 tgt.setLanguageElement(Code40_50.convertCode(src.getLanguageElement())); 546 if (src.hasUse()) 547 tgt.setUse(Coding40_50.convertCoding(src.getUse())); 548 if (src.hasValue()) 549 tgt.setValueElement(String40_50.convertString(src.getValueElement())); 550 return tgt; 551 } 552 553 public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { 554 if (src == null) 555 return null; 556 org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent(); 557 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 558 if (src.hasCode()) 559 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 560 if (src.hasValue()) 561 tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue())); 562 return tgt; 563 } 564 565 public static org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { 566 if (src == null) 567 return null; 568 org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent(); 569 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 570 if (src.hasCode()) 571 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 572 if (src.hasValue()) 573 tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue())); 574 return tgt; 575 } 576}