![](/hapi-fhir/images/logos/raccoon-forwards.png)
001package org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_40; 004import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Decimal10_40; 005import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.PositiveInt10_40; 006import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; 007import org.hl7.fhir.exceptions.FHIRException; 008 009public class SampledData10_40 { 010 public static org.hl7.fhir.r4.model.SampledData convertSampledData(org.hl7.fhir.dstu2.model.SampledData src) throws FHIRException { 011 if (src == null || src.isEmpty()) return null; 012 org.hl7.fhir.r4.model.SampledData tgt = new org.hl7.fhir.r4.model.SampledData(); 013 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 014 if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_40.convertSimpleQuantity(src.getOrigin())); 015 if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_40.convertDecimal(src.getPeriodElement())); 016 if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_40.convertDecimal(src.getFactorElement())); 017 if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_40.convertDecimal(src.getLowerLimitElement())); 018 if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_40.convertDecimal(src.getUpperLimitElement())); 019 if (src.hasDimensionsElement()) 020 tgt.setDimensionsElement(PositiveInt10_40.convertPositiveInt(src.getDimensionsElement())); 021 if (src.hasDataElement()) tgt.setDataElement(String10_40.convertString(src.getDataElement())); 022 return tgt; 023 } 024 025 public static org.hl7.fhir.dstu2.model.SampledData convertSampledData(org.hl7.fhir.r4.model.SampledData src) throws FHIRException { 026 if (src == null || src.isEmpty()) return null; 027 org.hl7.fhir.dstu2.model.SampledData tgt = new org.hl7.fhir.dstu2.model.SampledData(); 028 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 029 if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_40.convertSimpleQuantity(src.getOrigin())); 030 if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_40.convertDecimal(src.getPeriodElement())); 031 if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_40.convertDecimal(src.getFactorElement())); 032 if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_40.convertDecimal(src.getLowerLimitElement())); 033 if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_40.convertDecimal(src.getUpperLimitElement())); 034 if (src.hasDimensionsElement()) 035 tgt.setDimensionsElement(PositiveInt10_40.convertPositiveInt(src.getDimensionsElement())); 036 if (src.hasDataElement()) tgt.setDataElement(String10_40.convertString(src.getDataElement())); 037 return tgt; 038 } 039}