001package org.hl7.fhir.convertors.conv10_50.resources10_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_50; 004import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Code10_50; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Binary10_50 { 008 009 public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.dstu2.model.Binary src) throws FHIRException { 010 if (src == null || src.isEmpty()) 011 return null; 012 org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary(); 013 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyResource(src, tgt); 014 if (src.hasContentTypeElement()) 015 tgt.setContentTypeElement(Code10_50.convertCode(src.getContentTypeElement())); 016 if (src.hasContent()) 017 tgt.setContent(src.getContent()); 018 return tgt; 019 } 020 021 public static org.hl7.fhir.dstu2.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException { 022 if (src == null || src.isEmpty()) 023 return null; 024 org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary(); 025 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyResource(src, tgt); 026 if (src.hasContentTypeElement()) 027 tgt.setContentTypeElement(Code10_50.convertCode(src.getContentTypeElement())); 028 tgt.setContent(src.getContent()); 029 return tgt; 030 } 031}