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