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