use of org.hl7.v3.RCMRIN030000UK06Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageRCMR_WithAttachmentsNotReceived_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageRCMR_WithAttachmentsNotReceived_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
RCMRIN030000UK06Message payload = unmarshallString(readInboundMessagePayloadFromFile(), RCMRIN030000UK06Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_ATTACHMENTS_NOT_RECEIVED, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("31", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.RCMRIN030000UK06Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageRCMR_WithUnexpectedCondition_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageRCMR_WithUnexpectedCondition_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
RCMRIN030000UK06Message payload = unmarshallString(readInboundMessagePayloadFromFile(), RCMRIN030000UK06Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.UNEXPECTED_CONDITION, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("99", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.RCMRIN030000UK06Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageRCMR_WithClinicalSysIntegrationFailure_Expect_ShouldHaveCorrectNackCode.
@Test
public void When_SendNackMessageRCMR_WithClinicalSysIntegrationFailure_Expect_ShouldHaveCorrectNackCode() throws JAXBException {
RCMRIN030000UK06Message payload = unmarshallString(readInboundMessagePayloadFromFile(), RCMRIN030000UK06Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.CLINICAL_SYSTEM_INTEGRATION_FAILURE, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals("11", ackMessageDataCaptor.getValue().getNackCode());
}
use of org.hl7.v3.RCMRIN030000UK06Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class NackAckPreparationServiceTest method When_SendNackMessageRCMR_WithValidParameters_Expect_ShouldParseMessageDataCorrectly.
@Test
public void When_SendNackMessageRCMR_WithValidParameters_Expect_ShouldParseMessageDataCorrectly() throws JAXBException {
NACKMessageData expectedMessageData = NACKMessageData.builder().nackCode(TEST_NACK_CODE).toOdsCode(TEST_TO_ODS).toAsid(TEST_TO_ASID).fromAsid(TEST_FROM_ASID).conversationId(CONVERSATION_ID).messageRef(TEST_MESSAGE_REF).build();
RCMRIN030000UK06Message payload = unmarshallString(readInboundMessagePayloadFromFile(), RCMRIN030000UK06Message.class);
nackAckPreparationService.sendNackMessage(NACKReason.LARGE_MESSAGE_GENERAL_FAILURE, payload, CONVERSATION_ID);
verify(sendNACKMessageHandler).prepareAndSendMessage(ackMessageDataCaptor.capture());
assertEquals(expectedMessageData, ackMessageDataCaptor.getValue());
}
use of org.hl7.v3.RCMRIN030000UK06Message in project nia-patient-switching-standard-adaptor by NHSDigital.
the class JaxbTest method testUnmarshal.
@Test
public void testUnmarshal() throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(RCMRIN030000UK06Message.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<RCMRIN030000UK06Message> unmarshalledMessage = (JAXBElement) unmarshaller.unmarshal(TEST_FILE);
var ehrFolder = unmarshalledMessage.getValue().getControlActEvent().getSubject().getEhrExtract().getComponent().get(0).getEhrFolder();
var person = ehrFolder.getResponsibleParty().getAgentDirectory().getPart().get(2).getAgent().getAgentPerson();
var place = ehrFolder.getComponent().get(0).getEhrComposition().getLocation().getLocatedEntity().getLocatedPlace();
assertThat(person.getName().getFamily()).isEqualTo("Whitcombe");
assertThat(person.getName().getGiven()).isEqualTo("Peter");
assertThat(person.getName().getPrefix()).isEqualTo("Dr");
assertThat(person.getName().getValidTime().getCenter().getValue()).isEqualTo("20100114");
assertThat(place.getName()).isEqualTo("EMIS Test Practice Location");
}
Aggregations