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