001package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.exceptions.FHIRException; 005 006public class Ratio10_30 { 007 public static org.hl7.fhir.dstu3.model.Ratio convertRatio(org.hl7.fhir.dstu2.model.Ratio src) throws FHIRException { 008 if (src == null || src.isEmpty()) return null; 009 org.hl7.fhir.dstu3.model.Ratio tgt = new org.hl7.fhir.dstu3.model.Ratio(); 010 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 011 if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator())); 012 if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator())); 013 return tgt; 014 } 015 016 public static org.hl7.fhir.dstu2.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException { 017 if (src == null || src.isEmpty()) return null; 018 org.hl7.fhir.dstu2.model.Ratio tgt = new org.hl7.fhir.dstu2.model.Ratio(); 019 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 020 if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator())); 021 if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator())); 022 return tgt; 023 } 024}