
001package org.hl7.fhir.convertors.conv10_30; 002 003import org.hl7.fhir.convertors.VersionConvertor_10_30; 004import org.hl7.fhir.exceptions.FHIRException; 005 006public class Binary10_30 { 007 008 public static org.hl7.fhir.dstu2.model.Binary convertBinary(org.hl7.fhir.dstu3.model.Binary src) throws FHIRException { 009 if (src == null || src.isEmpty()) 010 return null; 011 org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary(); 012 VersionConvertor_10_30.copyResource(src, tgt); 013 if (src.hasContentTypeElement()) 014 tgt.setContentTypeElement(VersionConvertor_10_30.convertCode(src.getContentTypeElement())); 015 if (src.hasContentElement()) 016 tgt.setContentElement(VersionConvertor_10_30.convertBase64Binary(src.getContentElement())); 017 return tgt; 018 } 019 020 public static org.hl7.fhir.dstu3.model.Binary convertBinary(org.hl7.fhir.dstu2.model.Binary src) throws FHIRException { 021 if (src == null || src.isEmpty()) 022 return null; 023 org.hl7.fhir.dstu3.model.Binary tgt = new org.hl7.fhir.dstu3.model.Binary(); 024 VersionConvertor_10_30.copyResource(src, tgt); 025 if (src.hasContentTypeElement()) 026 tgt.setContentTypeElement(VersionConvertor_10_30.convertCode(src.getContentTypeElement())); 027 if (src.hasContentElement()) 028 tgt.setContentElement(VersionConvertor_10_30.convertBase64Binary(src.getContentElement())); 029 return tgt; 030 } 031}