001package org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.exceptions.FHIRException;
005
006public class Ratio30_50 {
007  public static org.hl7.fhir.r5.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException {
008    if (src == null) return null;
009    org.hl7.fhir.r5.model.Ratio tgt = new org.hl7.fhir.r5.model.Ratio();
010    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
011    if (src.hasNumerator()) tgt.setNumerator(Quantity30_50.convertQuantity(src.getNumerator()));
012    if (src.hasDenominator()) tgt.setDenominator(Quantity30_50.convertQuantity(src.getDenominator()));
013    return tgt;
014  }
015
016  public static org.hl7.fhir.dstu3.model.Ratio convertRatio(org.hl7.fhir.r5.model.Ratio src) throws FHIRException {
017    if (src == null) return null;
018    org.hl7.fhir.dstu3.model.Ratio tgt = new org.hl7.fhir.dstu3.model.Ratio();
019    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
020    if (src.hasNumerator()) tgt.setNumerator(Quantity30_50.convertQuantity(src.getNumerator()));
021    if (src.hasDenominator()) tgt.setDenominator(Quantity30_50.convertQuantity(src.getDenominator()));
022    return tgt;
023  }
024}