Search in sources :

Example 6 with MessageHeader

use of org.hl7.fhir.r4.model.MessageHeader in project integration-adaptor-111 by nhsconnect.

the class EncounterReportBundleService method addMessageHeader.

private void addMessageHeader(Bundle bundle, MessageHeader messageHeader) {
    Bundle.BundleEntryResponseComponent responseComponent = new Bundle.BundleEntryResponseComponent().setStatus("success").setLastModifiedElement(new InstantType(new Date(), MILLI, getTimeZone(UTC)));
    bundle.addEntry().setFullUrl(createFullUrl(messageHeader)).setResource(messageHeader).setResponse(responseComponent);
}
Also used : Bundle(org.hl7.fhir.dstu3.model.Bundle) InstantType(org.hl7.fhir.dstu3.model.InstantType) Date(java.util.Date)

Example 7 with MessageHeader

use of org.hl7.fhir.r4.model.MessageHeader in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeader.

protected void composeMessageHeader(Complex parent, String parentType, String name, MessageHeader element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MessageHeader", name, element, index);
    if (element.hasEvent())
        composeCoding(t, "MessageHeader", "event", element.getEvent(), -1);
    for (int i = 0; i < element.getDestination().size(); i++) composeMessageHeaderMessageDestinationComponent(t, "MessageHeader", "destination", element.getDestination().get(i), i);
    if (element.hasReceiver())
        composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
    if (element.hasSender())
        composeReference(t, "MessageHeader", "sender", element.getSender(), -1);
    if (element.hasTimestampElement())
        composeInstant(t, "MessageHeader", "timestamp", element.getTimestampElement(), -1);
    if (element.hasEnterer())
        composeReference(t, "MessageHeader", "enterer", element.getEnterer(), -1);
    if (element.hasAuthor())
        composeReference(t, "MessageHeader", "author", element.getAuthor(), -1);
    if (element.hasSource())
        composeMessageHeaderMessageSourceComponent(t, "MessageHeader", "source", element.getSource(), -1);
    if (element.hasResponsible())
        composeReference(t, "MessageHeader", "responsible", element.getResponsible(), -1);
    if (element.hasReason())
        composeCodeableConcept(t, "MessageHeader", "reason", element.getReason(), -1);
    if (element.hasResponse())
        composeMessageHeaderMessageHeaderResponseComponent(t, "MessageHeader", "response", element.getResponse(), -1);
    for (int i = 0; i < element.getFocus().size(); i++) composeReference(t, "MessageHeader", "focus", element.getFocus().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 8 with MessageHeader

use of org.hl7.fhir.r4.model.MessageHeader in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeaderMessageSourceComponent.

protected void composeMessageHeaderMessageSourceComponent(Complex parent, String parentType, String name, MessageHeader.MessageSourceComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "source", name, element, index);
    if (element.hasNameElement())
        composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
    if (element.hasSoftwareElement())
        composeString(t, "MessageHeader", "software", element.getSoftwareElement(), -1);
    if (element.hasVersionElement())
        composeString(t, "MessageHeader", "version", element.getVersionElement(), -1);
    if (element.hasContact())
        composeContactPoint(t, "MessageHeader", "contact", element.getContact(), -1);
    if (element.hasEndpointElement())
        composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 9 with MessageHeader

use of org.hl7.fhir.r4.model.MessageHeader in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeaderMessageHeaderResponseComponent.

protected void composeMessageHeaderMessageHeaderResponseComponent(Complex parent, String parentType, String name, MessageHeader.MessageHeaderResponseComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "response", name, element, index);
    if (element.hasIdentifierElement())
        composeId(t, "MessageHeader", "identifier", element.getIdentifierElement(), -1);
    if (element.hasCodeElement())
        composeEnum(t, "MessageHeader", "code", element.getCodeElement(), -1);
    if (element.hasDetails())
        composeReference(t, "MessageHeader", "details", element.getDetails(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 10 with MessageHeader

use of org.hl7.fhir.r4.model.MessageHeader in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeader.

protected void composeMessageHeader(Complex parent, String parentType, String name, MessageHeader element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MessageHeader", name, element, index);
    if (element.hasTimestampElement())
        composeInstant(t, "MessageHeader", "timestamp", element.getTimestampElement(), -1);
    if (element.hasEvent())
        composeCoding(t, "MessageHeader", "event", element.getEvent(), -1);
    if (element.hasResponse())
        composeMessageHeaderMessageHeaderResponseComponent(t, "MessageHeader", "response", element.getResponse(), -1);
    if (element.hasSource())
        composeMessageHeaderMessageSourceComponent(t, "MessageHeader", "source", element.getSource(), -1);
    for (int i = 0; i < element.getDestination().size(); i++) composeMessageHeaderMessageDestinationComponent(t, "MessageHeader", "destination", element.getDestination().get(i), i);
    if (element.hasEnterer())
        composeReference(t, "MessageHeader", "enterer", element.getEnterer(), -1);
    if (element.hasAuthor())
        composeReference(t, "MessageHeader", "author", element.getAuthor(), -1);
    if (element.hasReceiver())
        composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
    if (element.hasResponsible())
        composeReference(t, "MessageHeader", "responsible", element.getResponsible(), -1);
    if (element.hasReason())
        composeCodeableConcept(t, "MessageHeader", "reason", element.getReason(), -1);
    for (int i = 0; i < element.getData().size(); i++) composeReference(t, "MessageHeader", "data", element.getData().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)11 Bundle (org.hl7.fhir.r4.model.Bundle)10 MessageHeader (org.hl7.fhir.r4.model.MessageHeader)8 Resource (org.hl7.fhir.r4.model.Resource)7 Test (org.junit.jupiter.api.Test)7 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)6 InvalidRequestException (ca.uhn.fhir.rest.server.exceptions.InvalidRequestException)5 ArrayList (java.util.ArrayList)5 Reference (org.hl7.fhir.r4.model.Reference)5 Date (java.util.Date)4 CS (net.ihe.gazelle.hl7v3.datatypes.CS)4 PRPAMT201301UV02Patient (net.ihe.gazelle.hl7v3.prpamt201301UV02.PRPAMT201301UV02Patient)4 Patient (org.hl7.fhir.r4.model.Patient)4 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)4 FHIRContext (io.github.linuxforhealth.fhir.FHIRContext)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 COCTMT090003UV01AssignedEntity (net.ihe.gazelle.hl7v3.coctmt090003UV01.COCTMT090003UV01AssignedEntity)3 COCTMT090003UV01Organization (net.ihe.gazelle.hl7v3.coctmt090003UV01.COCTMT090003UV01Organization)3 COCTMT150003UV03ContactParty (net.ihe.gazelle.hl7v3.coctmt150003UV03.COCTMT150003UV03ContactParty)3 COCTMT150003UV03Organization (net.ihe.gazelle.hl7v3.coctmt150003UV03.COCTMT150003UV03Organization)3