001package org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext30_50; 004import org.hl7.fhir.exceptions.FHIRException; 005 006public class Code30_50 { 007 public static org.hl7.fhir.r5.model.CodeType convertCode(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException { 008 org.hl7.fhir.r5.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CodeType(); 009 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 010 return tgt; 011 } 012 013 public static org.hl7.fhir.dstu3.model.CodeType convertCode(org.hl7.fhir.r5.model.CodeType src) throws FHIRException { 014 org.hl7.fhir.dstu3.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.CodeType(); 015 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 016 return tgt; 017 } 018 019 public static org.hl7.fhir.r5.model.CodeType convertStringToCode(org.hl7.fhir.dstu3.model.StringType src) throws FHIRException { 020 org.hl7.fhir.r5.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CodeType(src.getValue()) : new org.hl7.fhir.r5.model.CodeType(); 021 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 022 return tgt; 023 } 024 025 public static org.hl7.fhir.dstu3.model.StringType convertCodeToString(org.hl7.fhir.r5.model.CodeType src) throws FHIRException { 026 org.hl7.fhir.dstu3.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.StringType(src.getValue()) : new org.hl7.fhir.dstu3.model.StringType(); 027 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 028 return tgt; 029 } 030 031 public static org.hl7.fhir.dstu3.model.CodeType convertStringToCode(org.hl7.fhir.r5.model.StringType src) throws FHIRException { 032 org.hl7.fhir.dstu3.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu3.model.CodeType(); 033 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 034 return tgt; 035 } 036 037 public static org.hl7.fhir.r5.model.StringType convertCodeToString(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException { 038 org.hl7.fhir.r5.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.StringType(src.getValue()) : new org.hl7.fhir.r5.model.StringType(); 039 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 040 return tgt; 041 } 042 043 044// public static org.hl7.fhir.r5.model.Enumeration<AllResourceTypes> convertResourceEnum(org.hl7.fhir.dstu3.model.CodeType src) { 045// return new Enumeration<AllResourceTypes>(new org.hl7.fhir.r5.model.Enumerations.AllResourceTypesEnumFactory(), src.getValue()); 046// } 047// 048// public static org.hl7.fhir.dstu3.model.CodeType convertResourceEnum(org.hl7.fhir.r5.model.Enumeration<AllResourceTypes> src) { 049// return new org.hl7.fhir.dstu3.model.CodeType(src.getCode()); 050// } 051 052}