Search in sources :

Example 1 with POCDMT000002UK01Participant1

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

the class ParticipantMapperTest method shouldMapParticipant.

@Test
public void shouldMapParticipant() {
    POCDMT000002UK01Participant1 encounterParticipant = mock(POCDMT000002UK01Participant1.class);
    POCDMT000002UK01AssociatedEntity associatedEntity = mock(POCDMT000002UK01AssociatedEntity.class);
    IVLTS time = mock(IVLTS.class);
    when(encounterParticipant.getTypeCode()).thenReturn("CON");
    when(encounterParticipant.getAssociatedEntity()).thenReturn(associatedEntity);
    when(encounterParticipant.isSetTime()).thenReturn(true);
    when(encounterParticipant.getTime()).thenReturn(time);
    when(periodMapper.mapPeriod(ArgumentMatchers.isA(IVLTS.class))).thenReturn(period);
    when(practitionerMapper.mapPractitioner(ArgumentMatchers.isA(POCDMT000002UK01AssociatedEntity.class))).thenReturn(practitioner);
    when(resourceUtil.createReference(practitioner)).thenReturn(new Reference(practitioner));
    Encounter.EncounterParticipantComponent participantComponent = participantMapper.mapEncounterParticipant(encounterParticipant);
    assertThat(participantComponent.getIndividualTarget()).isEqualTo(practitioner);
    assertThat(participantComponent.getPeriod()).isEqualTo(period);
    assertThat(participantComponent.getType().get(0).getText()).isEqualTo("CON");
}
Also used : IVLTS(uk.nhs.connect.iucds.cda.ucr.IVLTS) Reference(org.hl7.fhir.dstu3.model.Reference) POCDMT000002UK01Participant1(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Participant1) Encounter(org.hl7.fhir.dstu3.model.Encounter) POCDMT000002UK01AssociatedEntity(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssociatedEntity) Test(org.junit.jupiter.api.Test)

Aggregations

Encounter (org.hl7.fhir.dstu3.model.Encounter)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 Test (org.junit.jupiter.api.Test)1 IVLTS (uk.nhs.connect.iucds.cda.ucr.IVLTS)1 POCDMT000002UK01AssociatedEntity (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssociatedEntity)1 POCDMT000002UK01Participant1 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Participant1)1