001package org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext30_50; 004import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50; 005import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.PositiveInt30_50; 006import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; 007import org.hl7.fhir.exceptions.FHIRException; 008 009public class SampledData30_50 { 010 public static org.hl7.fhir.r5.model.SampledData convertSampledData(org.hl7.fhir.dstu3.model.SampledData src) throws FHIRException { 011 if (src == null) return null; 012 org.hl7.fhir.r5.model.SampledData tgt = new org.hl7.fhir.r5.model.SampledData(); 013 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 014 if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity30_50.convertSimpleQuantity(src.getOrigin())); 015 if (src.hasPeriod()) tgt.setIntervalElement(Decimal30_50.convertDecimal(src.getPeriodElement())); 016 if (src.hasFactor()) tgt.setFactorElement(Decimal30_50.convertDecimal(src.getFactorElement())); 017 if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal30_50.convertDecimal(src.getLowerLimitElement())); 018 if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal30_50.convertDecimal(src.getUpperLimitElement())); 019 if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt30_50.convertPositiveInt(src.getDimensionsElement())); 020 if (src.hasData()) tgt.setDataElement(String30_50.convertString(src.getDataElement())); 021 return tgt; 022 } 023 024 public static org.hl7.fhir.dstu3.model.SampledData convertSampledData(org.hl7.fhir.r5.model.SampledData src) throws FHIRException { 025 if (src == null) return null; 026 org.hl7.fhir.dstu3.model.SampledData tgt = new org.hl7.fhir.dstu3.model.SampledData(); 027 ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); 028 if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity30_50.convertSimpleQuantity(src.getOrigin())); 029 if (src.hasInterval()) tgt.setPeriodElement(Decimal30_50.convertDecimal(src.getIntervalElement())); 030 if (src.hasFactor()) tgt.setFactorElement(Decimal30_50.convertDecimal(src.getFactorElement())); 031 if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal30_50.convertDecimal(src.getLowerLimitElement())); 032 if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal30_50.convertDecimal(src.getUpperLimitElement())); 033 if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt30_50.convertPositiveInt(src.getDimensionsElement())); 034 if (src.hasData()) tgt.setDataElement(String30_50.convertString(src.getDataElement())); 035 return tgt; 036 } 037}