use of org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent in project org.hl7.fhir.core by hapifhir.
the class DocumentReference10_50 method convertDocumentReference.
public static org.hl7.fhir.dstu2.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference();
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
// tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_50.convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(Reference10_50.convertReference(src.getSubject()));
if (src.hasType())
tgt.setType(CodeableConcept10_50.convertCodeableConcept(src.getType()));
if (src.hasCategory())
tgt.setClass_(CodeableConcept10_50.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasCustodian())
tgt.setCustodian(Reference10_50.convertReference(src.getCustodian()));
for (DocumentReferenceAttesterComponent t : src.getAttester()) {
if (t.getMode() == DocumentAttestationMode.OFFICIAL)
tgt.setAuthenticator(Reference10_50.convertReference(t.getParty()));
}
if (src.hasDate())
tgt.setCreated(src.getDate());
if (src.hasStatus())
tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement()));
if (src.hasDocStatus())
tgt.setDocStatus(convertDocStatus(src.getDocStatus()));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(CodeableConcept10_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t));
convertDocumentReferenceContextComponent(tgt.getContext(), src);
return tgt;
}
use of org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent in project org.hl7.fhir.core by hapifhir.
the class DocumentReference30_50 method convertDocumentReference.
public static org.hl7.fhir.dstu3.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.DocumentReference tgt = new org.hl7.fhir.dstu3.model.DocumentReference();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
// tgt.setMasterIdentifier(VersionConvertor_30_50.convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement()));
if (src.hasDocStatus())
tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept30_50.convertCodeableConcept(src.getType()));
if (src.hasCategory())
tgt.setClass_(CodeableConcept30_50.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasSubject())
tgt.setSubject(Reference30_50.convertReference(src.getSubject()));
if (src.hasDate())
tgt.setCreated(src.getDate());
for (DocumentReferenceAttesterComponent t : src.getAttester()) {
if (t.getMode() == DocumentAttestationMode.OFFICIAL)
tgt.setAuthenticator(Reference30_50.convertReference(t.getParty()));
}
if (src.hasCustodian())
tgt.setCustodian(Reference30_50.convertReference(src.getCustodian()));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(CodeableConcept30_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t));
convertDocumentReferenceContextComponent(src, tgt.getContext());
return tgt;
}
use of org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent in project org.hl7.fhir.core by hapifhir.
the class DocumentReference40_50 method convertDocumentReference.
public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference();
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
// tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(Enumerations40_50.convertDocumentReferenceStatus(src.getStatusElement()));
if (src.hasDocStatus())
tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(Instant40_50.convertInstant(src.getDateElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference40_50.convertReference(t));
for (DocumentReferenceAttesterComponent t : src.getAttester()) {
if (t.getMode() == DocumentAttestationMode.OFFICIAL)
tgt.setAuthenticator(Reference40_50.convertReference(t.getParty()));
}
if (src.hasCustodian())
tgt.setCustodian(Reference40_50.convertReference(src.getCustodian()));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(CodeableConcept40_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) tgt.addContent(convertDocumentReferenceContentComponent(t));
convertDocumentReferenceContextComponent(src, tgt.getContext());
return tgt;
}
Aggregations