Search in sources :

Example 21 with MessageHeader

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

the class MessageHeaderService method createMessageHeader.

public MessageHeader createMessageHeader(ItkReportHeader itkHeader, String messageId, String effectiveTime) {
    MessageHeader header = new MessageHeader();
    header.setIdElement(new IdType(messageId));
    header.setEvent(getEvent(itkHeader.getSpecVal()));
    header.setSource(getSource());
    header.setTimestampElement(DateUtil.parseToInstantType(effectiveTime));
    header.setReason(new CodeableConcept().addCoding(new Coding().setCode(itkHeader.getSpecVal()).setSystem(itkHeader.getSpecKey())));
    header.setDestination(itkHeader.getAddressList().stream().map(it -> new MessageDestinationComponent().setEndpoint(it)).collect(toList()));
    return header;
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) MessageHeader(org.hl7.fhir.dstu3.model.MessageHeader) MessageDestinationComponent(org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent) IdType(org.hl7.fhir.dstu3.model.IdType) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 22 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.dstu2016may.formats.RdfGenerator.Complex)

Example 23 with MessageHeader

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

the class RdfParser method composeMessageHeaderMessageDestinationComponent.

protected void composeMessageHeaderMessageDestinationComponent(Complex parent, String parentType, String name, MessageHeader.MessageDestinationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "destination", name, element, index);
    if (element.hasNameElement())
        composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
    if (element.hasTarget())
        composeReference(t, "MessageHeader", "target", element.getTarget(), -1);
    if (element.hasEndpointElement())
        composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 24 with MessageHeader

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

the class RdfParser method composeMessageHeaderMessageDestinationComponent.

protected void composeMessageHeaderMessageDestinationComponent(Complex parent, String parentType, String name, MessageHeader.MessageDestinationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "destination", name, element, index);
    if (element.hasNameElement())
        composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
    if (element.hasTarget())
        composeReference(t, "MessageHeader", "target", element.getTarget(), -1);
    if (element.hasEndpointElement())
        composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 25 with MessageHeader

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

the class RdfParser method composeMessageHeaderMessageDestinationComponent.

protected void composeMessageHeaderMessageDestinationComponent(Complex parent, String parentType, String name, MessageHeader.MessageDestinationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "destination", name, element, index);
    if (element.hasNameElement())
        composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
    if (element.hasTarget())
        composeReference(t, "MessageHeader", "target", element.getTarget(), -1);
    if (element.hasEndpointElement())
        composeUrl(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
    if (element.hasReceiver())
        composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.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