Search in sources :

Example 6 with Signature

use of org.hl7.fhir.r4b.model.Signature in project org.hl7.fhir.core by hapifhir.

the class Bundle method copy.

public Bundle copy() {
    Bundle dst = new Bundle();
    copyValues(dst);
    dst.type = type == null ? null : type.copy();
    dst.total = total == null ? null : total.copy();
    if (link != null) {
        dst.link = new ArrayList<BundleLinkComponent>();
        for (BundleLinkComponent i : link) dst.link.add(i.copy());
    }
    ;
    if (entry != null) {
        dst.entry = new ArrayList<BundleEntryComponent>();
        for (BundleEntryComponent i : entry) dst.entry.add(i.copy());
    }
    ;
    dst.signature = signature == null ? null : signature.copy();
    return dst;
}
Also used : IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle)

Example 7 with Signature

use of org.hl7.fhir.r4b.model.Signature in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeProvenance.

protected void composeProvenance(Complex parent, String parentType, String name, Provenance element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Provenance", name, element, index);
    for (int i = 0; i < element.getTarget().size(); i++) composeReference(t, "Provenance", "target", element.getTarget().get(i), i);
    if (element.hasPeriod())
        composePeriod(t, "Provenance", "period", element.getPeriod(), -1);
    if (element.hasRecordedElement())
        composeInstant(t, "Provenance", "recorded", element.getRecordedElement(), -1);
    for (int i = 0; i < element.getPolicy().size(); i++) composeUri(t, "Provenance", "policy", element.getPolicy().get(i), i);
    if (element.hasLocation())
        composeReference(t, "Provenance", "location", element.getLocation(), -1);
    for (int i = 0; i < element.getReason().size(); i++) composeCoding(t, "Provenance", "reason", element.getReason().get(i), i);
    if (element.hasActivity())
        composeCoding(t, "Provenance", "activity", element.getActivity(), -1);
    for (int i = 0; i < element.getAgent().size(); i++) composeProvenanceProvenanceAgentComponent(t, "Provenance", "agent", element.getAgent().get(i), i);
    for (int i = 0; i < element.getEntity().size(); i++) composeProvenanceProvenanceEntityComponent(t, "Provenance", "entity", element.getEntity().get(i), i);
    for (int i = 0; i < element.getSignature().size(); i++) composeSignature(t, "Provenance", "signature", element.getSignature().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 8 with Signature

use of org.hl7.fhir.r4b.model.Signature in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeSignature.

protected void composeSignature(Complex parent, String parentType, String name, Signature element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeElement(t, "Signature", name, element, index);
    for (int i = 0; i < element.getType().size(); i++) composeCoding(t, "Signature", "type", element.getType().get(i), i);
    if (element.hasWhenElement())
        composeInstant(t, "Signature", "when", element.getWhenElement(), -1);
    if (element.hasWho())
        composeType(t, "Signature", "who", element.getWho(), -1);
    if (element.hasOnBehalfOf())
        composeType(t, "Signature", "onBehalfOf", element.getOnBehalfOf(), -1);
    if (element.hasContentTypeElement())
        composeCode(t, "Signature", "contentType", element.getContentTypeElement(), -1);
    if (element.hasBlobElement())
        composeBase64Binary(t, "Signature", "blob", element.getBlobElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 9 with Signature

use of org.hl7.fhir.r4b.model.Signature in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeBundle.

protected void composeBundle(Complex parent, String parentType, String name, Bundle element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeResource(t, "Bundle", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "Bundle", "identifier", element.getIdentifier(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "Bundle", "type", element.getTypeElement(), -1);
    if (element.hasTotalElement())
        composeUnsignedInt(t, "Bundle", "total", element.getTotalElement(), -1);
    for (int i = 0; i < element.getLink().size(); i++) composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
    for (int i = 0; i < element.getEntry().size(); i++) composeBundleBundleEntryComponent(t, "Bundle", "entry", element.getEntry().get(i), i);
    if (element.hasSignature())
        composeSignature(t, "Bundle", "signature", element.getSignature(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 10 with Signature

use of org.hl7.fhir.r4b.model.Signature in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeBundle.

protected void composeBundle(Complex parent, String parentType, String name, Bundle element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeResource(t, "Bundle", name, element, index);
    if (element.hasTypeElement())
        composeEnum(t, "Bundle", "type", element.getTypeElement(), -1);
    if (element.hasTotalElement())
        composeUnsignedInt(t, "Bundle", "total", element.getTotalElement(), -1);
    for (int i = 0; i < element.getLink().size(); i++) composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
    for (int i = 0; i < element.getEntry().size(); i++) composeBundleBundleEntryComponent(t, "Bundle", "entry", element.getEntry().get(i), i);
    if (element.hasSignature())
        composeSignature(t, "Bundle", "signature", element.getSignature(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)6 OutputStream (java.io.OutputStream)6 Reference (javax.xml.crypto.dsig.Reference)6 SignedInfo (javax.xml.crypto.dsig.SignedInfo)6 XMLSignature (javax.xml.crypto.dsig.XMLSignature)6 XMLSignatureFactory (javax.xml.crypto.dsig.XMLSignatureFactory)6 DOMSignContext (javax.xml.crypto.dsig.dom.DOMSignContext)6 KeyInfo (javax.xml.crypto.dsig.keyinfo.KeyInfo)6 KeyInfoFactory (javax.xml.crypto.dsig.keyinfo.KeyInfoFactory)6 KeyValue (javax.xml.crypto.dsig.keyinfo.KeyValue)6 C14NMethodParameterSpec (javax.xml.crypto.dsig.spec.C14NMethodParameterSpec)6 DocumentBuilder (javax.xml.parsers.DocumentBuilder)6 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)6 NotImplementedException (org.apache.commons.lang3.NotImplementedException)6 XmlGenerator (org.hl7.fhir.utilities.xml.XmlGenerator)6 Document (org.w3c.dom.Document)6 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)4 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)4 FileOutputStream (java.io.FileOutputStream)3 IOException (java.io.IOException)3