001package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext10_30;
004import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Extension10_30 {
008  public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2.model.Extension src) throws FHIRException {
009    if (src == null || src.isEmpty()) return null;
010    org.hl7.fhir.dstu3.model.Extension tgt = new org.hl7.fhir.dstu3.model.Extension();
011    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
012    if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
013    if (src.hasValue())
014      tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue()));
015    return tgt;
016  }
017
018  public static org.hl7.fhir.dstu2.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException {
019    if (src == null || src.isEmpty()) return null;
020    org.hl7.fhir.dstu2.model.Extension tgt = new org.hl7.fhir.dstu2.model.Extension();
021    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
022    if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
023    if (src.hasValue())
024      tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue()));
025    return tgt;
026  }
027}