001package org.hl7.fhir.convertors.conv14_30.datatypes14_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext14_30; 004import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Extension14_30 { 008 public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2016may.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 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 012 if (src.hasUrlElement()) tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement())); 013 if (src.hasValue()) 014 tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue())); 015 return tgt; 016 } 017 018 public static org.hl7.fhir.dstu2016may.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException { 019 if (src == null || src.isEmpty()) return null; 020 org.hl7.fhir.dstu2016may.model.Extension tgt = new org.hl7.fhir.dstu2016may.model.Extension(); 021 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 022 if (src.hasUrlElement()) tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement())); 023 if (src.hasValue()) 024 tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue())); 025 return tgt; 026 } 027}