001package org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext40_50;
004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Extension40_50 {
008  public static org.hl7.fhir.r5.model.Extension convertExtension(org.hl7.fhir.r4.model.Extension src) throws FHIRException {
009    if (src == null) return null;
010    org.hl7.fhir.r5.model.Extension tgt = new org.hl7.fhir.r5.model.Extension();
011    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
012    if (src.hasUrl()) tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
013    if (src.hasValue())
014      tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
015    return tgt;
016  }
017
018  public static org.hl7.fhir.r4.model.Extension convertExtension(org.hl7.fhir.r5.model.Extension src) throws FHIRException {
019    if (src == null) return null;
020    org.hl7.fhir.r4.model.Extension tgt = new org.hl7.fhir.r4.model.Extension();
021    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
022    if (src.hasUrl()) tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
023    if (src.hasValue())
024      tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
025    return tgt;
026  }
027}