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;
}
Aggregations