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 EnrollmentResponse10_30 {
007
008    public static org.hl7.fhir.dstu3.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.dstu2.model.EnrollmentResponse src) throws FHIRException {
009        if (src == null || src.isEmpty())
010            return null;
011        org.hl7.fhir.dstu3.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu3.model.EnrollmentResponse();
012        VersionConvertor_10_30.copyDomainResource(src, tgt);
013        for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t));
014        if (src.hasRequest())
015            tgt.setRequest(VersionConvertor_10_30.convertReference(src.getRequest()));
016        if (src.hasDispositionElement())
017            tgt.setDispositionElement(VersionConvertor_10_30.convertString(src.getDispositionElement()));
018        if (src.hasCreatedElement())
019            tgt.setCreatedElement(VersionConvertor_10_30.convertDateTime(src.getCreatedElement()));
020        if (src.hasOrganization())
021            tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization()));
022        if (src.hasRequestProvider())
023            tgt.setRequestProvider(VersionConvertor_10_30.convertReference(src.getRequestProvider()));
024        if (src.hasRequestOrganization())
025            tgt.setRequestOrganization(VersionConvertor_10_30.convertReference(src.getRequestOrganization()));
026        return tgt;
027    }
028
029    public static org.hl7.fhir.dstu2.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.dstu3.model.EnrollmentResponse src) throws FHIRException {
030        if (src == null || src.isEmpty())
031            return null;
032        org.hl7.fhir.dstu2.model.EnrollmentResponse tgt = new org.hl7.fhir.dstu2.model.EnrollmentResponse();
033        VersionConvertor_10_30.copyDomainResource(src, tgt);
034        for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t));
035        if (src.hasDispositionElement())
036            tgt.setDispositionElement(VersionConvertor_10_30.convertString(src.getDispositionElement()));
037        if (src.hasCreatedElement())
038            tgt.setCreatedElement(VersionConvertor_10_30.convertDateTime(src.getCreatedElement()));
039        return tgt;
040    }
041}