Search in sources :

Example 21 with Binary

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);
}
Also used : XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 22 with Binary

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;
}
Also used : IBaseBinary(org.hl7.fhir.instance.model.api.IBaseBinary)

Example 23 with Binary

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);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 24 with Binary

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);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 25 with Binary

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);
}
Also used : DocumentReferenceContextComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent) DocumentReferenceContentComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent)

Aggregations

XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)11 IBaseBinary (org.hl7.fhir.instance.model.api.IBaseBinary)5 ArrayList (java.util.ArrayList)4 FhirContext (ca.uhn.fhir.context.FhirContext)3 IOException (java.io.IOException)3 Test (org.junit.jupiter.api.Test)3 FhirVersionEnum (ca.uhn.fhir.context.FhirVersionEnum)2 CascadingDeleteInterceptor (ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor)2 DefaultThymeleafNarrativeGenerator (ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator)2 FileInputStream (java.io.FileInputStream)2 HashMap (java.util.HashMap)2 ResourceDefn (org.hl7.fhir.definitions.model.ResourceDefn)2 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)2 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)2 Attachment (org.hl7.fhir.r4.model.Attachment)2 Binary (org.hl7.fhir.r4.model.Binary)2 Bundle (org.hl7.fhir.r4.model.Bundle)2 BundleType (org.hl7.fhir.r4.model.Bundle.BundleType)2 DocumentReference (org.hl7.fhir.r4.model.DocumentReference)2 ListResource (org.hl7.fhir.r4.model.ListResource)2