001package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext43_50; 004import org.hl7.fhir.exceptions.FHIRException; 005 006public class Range43_50 { 007 public static org.hl7.fhir.r5.model.Range convertRange(org.hl7.fhir.r4b.model.Range src) throws FHIRException { 008 if (src == null) return null; 009 org.hl7.fhir.r5.model.Range tgt = new org.hl7.fhir.r5.model.Range(); 010 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 011 if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); 012 if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); 013 return tgt; 014 } 015 016 public static org.hl7.fhir.r4b.model.Range convertRange(org.hl7.fhir.r5.model.Range src) throws FHIRException { 017 if (src == null) return null; 018 org.hl7.fhir.r4b.model.Range tgt = new org.hl7.fhir.r4b.model.Range(); 019 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 020 if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); 021 if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); 022 return tgt; 023 } 024}