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 Basic10_30 {
007
008    public static org.hl7.fhir.dstu2.model.Basic convertBasic(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
009        if (src == null || src.isEmpty())
010            return null;
011        org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic();
012        VersionConvertor_10_30.copyDomainResource(src, tgt);
013        for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t));
014        if (src.hasCode())
015            tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode()));
016        if (src.hasSubject())
017            tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject()));
018        if (src.hasCreatedElement())
019            tgt.setCreatedElement(VersionConvertor_10_30.convertDate(src.getCreatedElement()));
020        if (src.hasAuthor())
021            tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor()));
022        return tgt;
023    }
024
025    public static org.hl7.fhir.dstu3.model.Basic convertBasic(org.hl7.fhir.dstu2.model.Basic src) throws FHIRException {
026        if (src == null || src.isEmpty())
027            return null;
028        org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic();
029        VersionConvertor_10_30.copyDomainResource(src, tgt);
030        for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t));
031        if (src.hasCode())
032            tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode()));
033        if (src.hasSubject())
034            tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject()));
035        if (src.hasCreatedElement())
036            tgt.setCreatedElement(VersionConvertor_10_30.convertDate(src.getCreatedElement()));
037        if (src.hasAuthor())
038            tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor()));
039        return tgt;
040    }
041}