
001package org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_40; 004import org.hl7.fhir.dstu2.model.PositiveIntType; 005import org.hl7.fhir.exceptions.FHIRException; 006import org.hl7.fhir.r4.model.UnsignedIntType; 007 008public class UnsignedInt10_40 { 009 public static org.hl7.fhir.r4.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.dstu2.model.UnsignedIntType src) throws FHIRException { 010 org.hl7.fhir.r4.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r4.model.UnsignedIntType(); 011 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 012 return tgt; 013 } 014 015 public static org.hl7.fhir.dstu2.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.r4.model.UnsignedIntType src) throws FHIRException { 016 org.hl7.fhir.dstu2.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.UnsignedIntType(); 017 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 018 return tgt; 019 } 020 021 public static UnsignedIntType convertUnsignedIntToPositive(PositiveIntType src) { 022 UnsignedIntType tgt = src.hasValue() ? new UnsignedIntType(src.getValueAsString()) : new UnsignedIntType(); 023 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 024 return tgt; 025 } 026}