Search in sources :

Example 1 with POCDMT000002UK01DataEnterer

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01DataEnterer in project integration-adaptor-111 by nhsconnect.

the class DataEntererMapperTest method shouldMapDataEntererToParticipantComponent.

@Test
public void shouldMapDataEntererToParticipantComponent() {
    POCDMT000002UK01DataEnterer dataEnterer = mock(POCDMT000002UK01DataEnterer.class);
    POCDMT000002UK01AssignedEntity assignedEntity = mock(POCDMT000002UK01AssignedEntity.class);
    TS time = mock(TS.class);
    when(dataEnterer.getAssignedEntity()).thenReturn(assignedEntity);
    when(dataEnterer.isSetTime()).thenReturn(true);
    when(dataEnterer.getTime()).thenReturn(time);
    when(dataEnterer.getTypeCode()).thenReturn("CON");
    when(practitionerMapper.mapPractitioner(isA(POCDMT000002UK01AssignedEntity.class))).thenReturn(practitioner);
    when(periodMapper.mapPeriod(isA(TS.class))).thenReturn(period);
    when(resourceUtil.createReference(practitioner)).thenReturn(new Reference(practitioner));
    Encounter.EncounterParticipantComponent participantComponent = dataEntererMapper.mapDataEntererIntoParticipantComponent(dataEnterer);
    assertThat(participantComponent.getIndividualTarget()).isEqualTo(practitioner);
    assertThat(participantComponent.getPeriod()).isEqualTo(period);
    assertThat(participantComponent.getType().get(0).getText()).isEqualTo("CON");
}
Also used : POCDMT000002UK01DataEnterer(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01DataEnterer) Reference(org.hl7.fhir.dstu3.model.Reference) Encounter(org.hl7.fhir.dstu3.model.Encounter) POCDMT000002UK01AssignedEntity(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedEntity) TS(uk.nhs.connect.iucds.cda.ucr.TS) Test(org.junit.jupiter.api.Test)

Example 2 with POCDMT000002UK01DataEnterer

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01DataEnterer in project integration-adaptor-111 by nhsconnect.

the class EncounterMapperTest method mockParticipantWithAuthorInformantAndDataEnterer.

private void mockParticipantWithAuthorInformantAndDataEnterer(POCDMT000002UK01ClinicalDocument1 clinicalDocument) {
    mockParticipant(clinicalDocument);
    POCDMT000002UK01Informant12 informant = mock(POCDMT000002UK01Informant12.class);
    POCDMT000002UK01DataEnterer dataEnterer = mock(POCDMT000002UK01DataEnterer.class);
    when(clinicalDocument.sizeOfInformantArray()).thenReturn(1);
    when(clinicalDocument.getInformantArray()).thenReturn(new POCDMT000002UK01Informant12[] { informant });
    when(clinicalDocument.isSetDataEnterer()).thenReturn(true);
    when(clinicalDocument.getDataEnterer()).thenReturn(dataEnterer);
    when(informantMapper.mapInformantIntoParticipantComponent(any())).thenReturn(Optional.of(encounterParticipantComponent));
    when(dataEntererMapper.mapDataEntererIntoParticipantComponent(any())).thenReturn(encounterParticipantComponent);
    when(participantMapper.mapEncounterRelatedPerson(any(), any())).thenReturn(encounterParticipantComponent);
}
Also used : POCDMT000002UK01Informant12(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Informant12) POCDMT000002UK01DataEnterer(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01DataEnterer)

Aggregations

POCDMT000002UK01DataEnterer (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01DataEnterer)2 Encounter (org.hl7.fhir.dstu3.model.Encounter)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 Test (org.junit.jupiter.api.Test)1 POCDMT000002UK01AssignedEntity (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedEntity)1 POCDMT000002UK01Informant12 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Informant12)1 TS (uk.nhs.connect.iucds.cda.ucr.TS)1