use of org.hl7.fhir.r4.model.DocumentReference in project Gravity-SDOH-Exchange-RI by FHIR.
the class RecordedSexGenderBundleFactory method onBundleCreated.
@Override
protected void onBundleCreated(Bundle bundle) {
Observation obs = (Observation) bundle.getEntry().get(0).getResource();
DocumentReference docRef = new DocumentReference().setStatus(Enumerations.DocumentReferenceStatus.CURRENT).setDate(new Date());
docRef.addAuthor(new Reference(new IdType(SmartOnFhirContext.get().getFhirUser()).toUnqualifiedVersionless()));
docRef.addContent().setAttachment(new Attachment().setTitle(derivedFromFileName).setContentType(MediaType.APPLICATION_PDF_VALUE).setData(derivedFromFile));
docRef.setId(IdType.newRandomUuid());
Bundle.BundleEntryComponent postEntry = FhirUtil.createPostEntry(docRef);
obs.addDerivedFrom(FhirUtil.toReference(DocumentReference.class, docRef.getIdElement().getIdPart()));
bundle.addEntry(postEntry);
}
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 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);
}
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);
if (element.hasEncounter())
composeReference(t, "DocumentReference", "encounter", element.getEncounter(), -1);
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++) composeDocumentReferenceDocumentReferenceContextRelatedComponent(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 RdfParser method composeDocumentReferenceDocumentReferenceContextRelatedComponent.
protected void composeDocumentReferenceDocumentReferenceContextRelatedComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContextRelatedComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "related", name, element, index);
if (element.hasIdentifier())
composeIdentifier(t, "DocumentReference", "identifier", element.getIdentifier(), -1);
if (element.hasRef())
composeReference(t, "DocumentReference", "ref", element.getRef(), -1);
}
Aggregations