001package org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_40;
004import org.hl7.fhir.exceptions.FHIRException;
005
006public class Range30_40 {
007  public static org.hl7.fhir.r4.model.Range convertRange(org.hl7.fhir.dstu3.model.Range src) throws FHIRException {
008    if (src == null) return null;
009    org.hl7.fhir.r4.model.Range tgt = new org.hl7.fhir.r4.model.Range();
010    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
011    if (src.hasLow()) tgt.setLow(SimpleQuantity30_40.convertSimpleQuantity(src.getLow()));
012    if (src.hasHigh()) tgt.setHigh(SimpleQuantity30_40.convertSimpleQuantity(src.getHigh()));
013    return tgt;
014  }
015
016  public static org.hl7.fhir.dstu3.model.Range convertRange(org.hl7.fhir.r4.model.Range src) throws FHIRException {
017    if (src == null) return null;
018    org.hl7.fhir.dstu3.model.Range tgt = new org.hl7.fhir.dstu3.model.Range();
019    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
020    if (src.hasLow()) tgt.setLow(SimpleQuantity30_40.convertSimpleQuantity(src.getLow()));
021    if (src.hasHigh()) tgt.setHigh(SimpleQuantity30_40.convertSimpleQuantity(src.getHigh()));
022    return tgt;
023  }
024}