use of org.hl7.fhir.r4.model.Binary in project org.hl7.fhir.core by hapifhir.
the class BinaryRenderer method xml.
private void xml(XhtmlNode x, Binary bin) {
String content = "\r\n" + getBinContentAsString(bin);
XhtmlNode pre = x.pre("xml");
pre.code(content);
}
use of org.hl7.fhir.r4.model.Binary in project org.hl7.fhir.core by hapifhir.
the class Binary method copy.
public Binary copy() {
Binary dst = new Binary();
copyValues(dst);
dst.contentType = contentType == null ? null : contentType.copy();
dst.content = content == null ? null : content.copy();
return dst;
}
use of org.hl7.fhir.r4.model.Binary in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeBinary.
protected void composeBinary(Complex parent, String parentType, String name, Binary element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeResource(t, "Binary", name, element, index);
if (element.hasContentTypeElement())
composeCode(t, "Binary", "contentType", element.getContentTypeElement(), -1);
if (element.hasSecurityContext())
composeReference(t, "Binary", "securityContext", element.getSecurityContext(), -1);
if (element.hasContentElement())
composeBase64Binary(t, "Binary", "content", element.getContentElement(), -1);
}
use of org.hl7.fhir.r4.model.Binary in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImplementationGuide.
protected void composeImplementationGuide(Complex parent, String parentType, String name, ImplementationGuide element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "ImplementationGuide", name, element, index);
if (element.hasUrlElement())
composeUri(t, "ImplementationGuide", "url", element.getUrlElement(), -1);
if (element.hasVersionElement())
composeString(t, "ImplementationGuide", "version", element.getVersionElement(), -1);
if (element.hasNameElement())
composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
if (element.hasStatusElement())
composeEnum(t, "ImplementationGuide", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "ImplementationGuide", "experimental", element.getExperimentalElement(), -1);
if (element.hasDateElement())
composeDateTime(t, "ImplementationGuide", "date", element.getDateElement(), -1);
if (element.hasPublisherElement())
composeString(t, "ImplementationGuide", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "ImplementationGuide", "contact", element.getContact().get(i), i);
if (element.hasDescriptionElement())
composeMarkdown(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "ImplementationGuide", "useContext", element.getUseContext().get(i), i);
for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "ImplementationGuide", "jurisdiction", element.getJurisdiction().get(i), i);
if (element.hasCopyrightElement())
composeMarkdown(t, "ImplementationGuide", "copyright", element.getCopyrightElement(), -1);
if (element.hasFhirVersionElement())
composeId(t, "ImplementationGuide", "fhirVersion", element.getFhirVersionElement(), -1);
for (int i = 0; i < element.getDependency().size(); i++) composeImplementationGuideImplementationGuideDependencyComponent(t, "ImplementationGuide", "dependency", element.getDependency().get(i), i);
for (int i = 0; i < element.getPackage().size(); i++) composeImplementationGuideImplementationGuidePackageComponent(t, "ImplementationGuide", "package", element.getPackage().get(i), i);
for (int i = 0; i < element.getGlobal().size(); i++) composeImplementationGuideImplementationGuideGlobalComponent(t, "ImplementationGuide", "global", element.getGlobal().get(i), i);
for (int i = 0; i < element.getBinary().size(); i++) composeUri(t, "ImplementationGuide", "binary", element.getBinary().get(i), i);
if (element.hasPage())
composeImplementationGuideImplementationGuidePageComponent(t, "ImplementationGuide", "page", element.getPage(), -1);
}
use of org.hl7.fhir.r4.model.Binary 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);
}
Aggregations