001package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext43_50;
004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Extension43_50 {
008  public static org.hl7.fhir.r5.model.Extension convertExtension(org.hl7.fhir.r4b.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    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
012    if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
013    if (src.hasValue())
014      tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
015    return tgt;
016  }
017
018  public static org.hl7.fhir.r4b.model.Extension convertExtension(org.hl7.fhir.r5.model.Extension src) throws FHIRException {
019    if (src == null) return null;
020    org.hl7.fhir.r4b.model.Extension tgt = new org.hl7.fhir.r4b.model.Extension();
021    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
022    if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
023    if (src.hasValue())
024      tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
025    return tgt;
026  }
027}