use of org.hl7.fhir.r4.model.DocumentReference in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDocumentReference.
protected void composeDocumentReference(Complex parent, String parentType, String name, DocumentReference element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "DocumentReference", name, element, index);
if (element.hasMasterIdentifier())
composeIdentifier(t, "DocumentReference", "masterIdentifier", element.getMasterIdentifier(), -1);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "DocumentReference", "identifier", element.getIdentifier().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "DocumentReference", "status", element.getStatusElement(), -1);
if (element.hasDocStatusElement())
composeEnum(t, "DocumentReference", "docStatus", element.getDocStatusElement(), -1);
if (element.hasType())
composeCodeableConcept(t, "DocumentReference", "type", element.getType(), -1);
if (element.hasClass_())
composeCodeableConcept(t, "DocumentReference", "class", element.getClass_(), -1);
if (element.hasSubject())
composeReference(t, "DocumentReference", "subject", element.getSubject(), -1);
if (element.hasCreatedElement())
composeDateTime(t, "DocumentReference", "created", element.getCreatedElement(), -1);
if (element.hasIndexedElement())
composeInstant(t, "DocumentReference", "indexed", element.getIndexedElement(), -1);
for (int i = 0; i < element.getAuthor().size(); i++) composeReference(t, "DocumentReference", "author", element.getAuthor().get(i), i);
if (element.hasAuthenticator())
composeReference(t, "DocumentReference", "authenticator", element.getAuthenticator(), -1);
if (element.hasCustodian())
composeReference(t, "DocumentReference", "custodian", element.getCustodian(), -1);
for (int i = 0; i < element.getRelatesTo().size(); i++) composeDocumentReferenceDocumentReferenceRelatesToComponent(t, "DocumentReference", "relatesTo", element.getRelatesTo().get(i), i);
if (element.hasDescriptionElement())
composeString(t, "DocumentReference", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getSecurityLabel().size(); i++) composeCodeableConcept(t, "DocumentReference", "securityLabel", element.getSecurityLabel().get(i), i);
for (int i = 0; i < element.getContent().size(); i++) composeDocumentReferenceDocumentReferenceContentComponent(t, "DocumentReference", "content", element.getContent().get(i), i);
if (element.hasContext())
composeDocumentReferenceDocumentReferenceContextComponent(t, "DocumentReference", "context", element.getContext(), -1);
}
use of org.hl7.fhir.r4.model.DocumentReference in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDocumentReferenceDocumentReferenceRelatesToComponent.
protected void composeDocumentReferenceDocumentReferenceRelatesToComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceRelatesToComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "relatesTo", name, element, index);
if (element.hasCodeElement())
composeEnum(t, "DocumentReference", "code", element.getCodeElement(), -1);
if (element.hasTarget())
composeReference(t, "DocumentReference", "target", element.getTarget(), -1);
}
use of org.hl7.fhir.r4.model.DocumentReference in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDocumentReferenceDocumentReferenceContextComponent.
protected void composeDocumentReferenceDocumentReferenceContextComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContextComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "context", name, element, index);
for (int i = 0; i < element.getEncounter().size(); i++) composeReference(t, "DocumentReference", "encounter", element.getEncounter().get(i), i);
for (int i = 0; i < element.getEvent().size(); i++) composeCodeableConcept(t, "DocumentReference", "event", element.getEvent().get(i), i);
if (element.hasPeriod())
composePeriod(t, "DocumentReference", "period", element.getPeriod(), -1);
if (element.hasFacilityType())
composeCodeableConcept(t, "DocumentReference", "facilityType", element.getFacilityType(), -1);
if (element.hasPracticeSetting())
composeCodeableConcept(t, "DocumentReference", "practiceSetting", element.getPracticeSetting(), -1);
if (element.hasSourcePatientInfo())
composeReference(t, "DocumentReference", "sourcePatientInfo", element.getSourcePatientInfo(), -1);
for (int i = 0; i < element.getRelated().size(); i++) composeReference(t, "DocumentReference", "related", element.getRelated().get(i), i);
}
use of org.hl7.fhir.r4.model.DocumentReference in project org.hl7.fhir.core by hapifhir.
the class ArgonautConverter method makeDocumentReference.
private void makeDocumentReference(CDAUtilities cda, Convert convert, Element doc, Context context) throws Exception {
scanSection("document", doc);
DocumentReference ref = new DocumentReference();
ref.setId(context.getBaseId() + "-document");
ref.setMasterIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "id")));
ref.setSubject(context.getSubjectRef());
ref.setType(inspectCode(convert.makeCodeableConceptFromCD(cda.getChild(doc, "code")), null));
ref.addAuthor(context.getAuthorRef());
ref.setCreatedElement(convert.makeDateTimeFromTS(cda.getChild(doc, "effectiveTime")));
ref.setIndexedElement(InstantType.now());
ref.setStatus(DocumentReferenceStatus.CURRENT);
ref.addSecurityLabel(inspectCode(convert.makeCodeableConceptFromCD(cda.getChild(doc, "confidentialityCode")), null));
DocumentReferenceContentComponent cnt = ref.addContent();
cnt.getAttachment().setContentType("application/hl7-v3+xml").setUrl("Binary/" + context.getBaseId()).setLanguage(convertLanguage(cda.getChild(doc, "language")));
// for (Element ti : cda.getChildren(doc, "templateId"))
// cnt.addFormat().setSystem("urn:oid:1.3.6.1.4.1.19376.1.2.3").setCode(value)("urn:oid:"+ti.getAttribute("root"));
ref.setContext(new DocumentReferenceContextComponent());
ref.getContext().setPeriod(convert.makePeriodFromIVL(cda.getChild(cda.getChild(doc, "serviceEvent"), "effectiveTime")));
for (CodeableConcept cc : context.getEncounter().getType()) ref.getContext().addEvent(cc);
ref.setDescription(cda.getChild(doc, "title").getTextContent());
ref.setCustodian(new Reference().setReference("Organization/" + processOrganization(cda.getDescendent(doc, "custodian/assignedCustodian/representedCustodianOrganization"), cda, convert, context).getId()));
Practitioner p = processPerformer(cda, convert, context, cda.getChild(doc, "legalAuthenticator"), "assignedEntity", "assignedPerson");
ref.setAuthenticator(new Reference().setReference("Practitioner/" + p.getId()).setDisplay(p.getUserString("display")));
saveResource(ref);
}
use of org.hl7.fhir.r4.model.DocumentReference in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDocumentReferenceDocumentReferenceContentComponent.
protected void composeDocumentReferenceDocumentReferenceContentComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContentComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "content", name, element, index);
if (element.hasAttachment())
composeAttachment(t, "DocumentReference", "attachment", element.getAttachment(), -1);
if (element.hasFormat())
composeCoding(t, "DocumentReference", "format", element.getFormat(), -1);
}
Aggregations