001package org.hl7.fhir.convertors.conv30_50.datatypes30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Coding30_50;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class UsageContext30_50 {
008  public static org.hl7.fhir.r5.model.UsageContext convertUsageContext(org.hl7.fhir.dstu3.model.UsageContext src) throws FHIRException {
009    if (src == null) return null;
010    org.hl7.fhir.r5.model.UsageContext tgt = new org.hl7.fhir.r5.model.UsageContext();
011    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
012    if (src.hasCode()) tgt.setCode(Coding30_50.convertCoding(src.getCode()));
013    if (src.hasValue())
014      tgt.setValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getValue()));
015    return tgt;
016  }
017
018  public static org.hl7.fhir.dstu3.model.UsageContext convertUsageContext(org.hl7.fhir.r5.model.UsageContext src) throws FHIRException {
019    if (src == null) return null;
020    org.hl7.fhir.dstu3.model.UsageContext tgt = new org.hl7.fhir.dstu3.model.UsageContext();
021    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
022    if (src.hasCode()) tgt.setCode(Coding30_50.convertCoding(src.getCode()));
023    if (src.hasValue())
024      tgt.setValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getValue()));
025    return tgt;
026  }
027}