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.String10_30; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Reference10_30 { 008 public static org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.dstu2.model.Reference src) throws FHIRException { 009 if (src == null || src.isEmpty()) return null; 010 org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference(); 011 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 012 if (src.hasReference()) tgt.setReference(src.getReference()); 013 if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement())); 014 return tgt; 015 } 016 017 public static org.hl7.fhir.dstu2.model.Reference convertReference(org.hl7.fhir.dstu3.model.Reference src) throws FHIRException { 018 if (src == null || src.isEmpty()) return null; 019 org.hl7.fhir.dstu2.model.Reference tgt = new org.hl7.fhir.dstu2.model.Reference(); 020 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 021 if (src.hasReference()) tgt.setReference(src.getReference()); 022 if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement())); 023 return tgt; 024 } 025}