Search in sources :

Example 1 with MessageDestinationComponent

use of org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent 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)

Aggregations

CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)1 Coding (org.hl7.fhir.dstu3.model.Coding)1 IdType (org.hl7.fhir.dstu3.model.IdType)1 MessageHeader (org.hl7.fhir.dstu3.model.MessageHeader)1 MessageDestinationComponent (org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent)1