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);
for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "DocumentReference", "category", element.getCategory().get(i), i);
if (element.hasSubject())
composeReference(t, "DocumentReference", "subject", element.getSubject(), -1);
if (element.hasDateElement())
composeInstant(t, "DocumentReference", "date", element.getDateElement(), -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 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);
}
use of org.hl7.fhir.r4.model.DocumentReference in project eCRNow by drajer-health.
the class R4ResourcesDataTest method constructR4DocumentReferenceTest.
@Test
public void constructR4DocumentReferenceTest() {
R4ResourcesData dataObject = new R4ResourcesData();
String rrXml = TestUtils.getFileContentAsString("R4/Misc/TestRRXml.xml");
DocumentReference result = dataObject.constructR4DocumentReference(rrXml, "P123456", "E98765");
assertNotNull(result);
}
use of org.hl7.fhir.r4.model.DocumentReference in project MobileAccessGateway by i4mi.
the class Iti67RequestUpdateConverter method convertDocumentReferenceToDocumentEntry.
/**
* ITI-67 Response to ITI-57 request converter
*
* @param searchParameter
* @return
*/
public SubmitObjectsRequest convertDocumentReferenceToDocumentEntry(@Body DocumentReference documentReference) {
SubmissionSet submissionSet = new SubmissionSet();
submissionSet.setSubmissionTime(new Timestamp(ZonedDateTime.now(), Timestamp.Precision.SECOND));
Extension source = documentReference.getExtensionByUrl("http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-sourceId");
if (source != null && source.getValue() instanceof Identifier) {
submissionSet.setSourceId(noPrefix(((Identifier) source.getValue()).getValue()));
}
Extension designationType = documentReference.getExtensionByUrl("http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-designationType");
if (designationType != null && designationType.getValue() instanceof CodeableConcept) {
submissionSet.setContentTypeCode(transformCodeableConcept((CodeableConcept) designationType.getValue()));
}
Extension authorRoleExt = documentReference.getExtensionByUrl("http://fhir.ch/ig/ch-epr-mhealth/StructureDefinition/ch-ext-author-authorrole");
if (authorRoleExt != null) {
Identifiable identifiable = null;
if (authorRoleExt != null) {
Coding coding = authorRoleExt.castToCoding(authorRoleExt.getValue());
if (coding != null) {
identifiable = new Identifiable(coding.getCode(), new AssigningAuthority(noPrefix(coding.getSystem())));
}
}
submissionSet.setAuthor(transformAuthor(null, null, identifiable));
}
// TODO should be
RegisterDocumentSetBuilder builder = new RegisterDocumentSetBuilder(true, submissionSet);
// true?
DocumentEntry entry = new DocumentEntry();
processDocumentReference(documentReference, entry);
entry.setLogicalUuid(new URN(UUID.randomUUID()).toString());
submissionSet.setPatientId(entry.getPatientId());
submissionSet.assignEntryUuid();
builder.withDocument(entry);
builder.withAssociation(createHasMemberAssocationWithOriginalPreviousLabel(submissionSet, entry));
return EbXML30Converters.convert(builder.build());
}
Aggregations