Search in sources :

Example 1 with CE

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

the class RelatedPersonMapperTest method createCode.

private CE createCode() {
    CE code = CE.Factory.newInstance();
    code.setDisplayName(CODE_DISPLAY_NAME);
    code.setCode(CODE);
    code.setCodeSystem(CODE_SYSTEM);
    return code;
}
Also used : CE(uk.nhs.connect.iucds.cda.ucr.CE)

Example 2 with CE

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

the class PractitionerRoleMapperTest method mockAuthors.

private void mockAuthors() {
    when(author.getTypeCode()).thenReturn(AUTHOR_TYPE_CODE);
    POCDMT000002UK01AssignedAuthor assignedAuthor = mock(POCDMT000002UK01AssignedAuthor.class);
    when(author.getAssignedAuthor()).thenReturn(assignedAuthor);
    CE ce = mockCode();
    when(assignedAuthor.getCode()).thenReturn(ce);
    when(assignedAuthor.getRepresentedOrganization()).thenReturn(mock(POCDMT000002UK01Organization.class));
    when(organizationMapper.mapOrganization(any(POCDMT000002UK01Organization.class))).thenReturn(organization);
    when(practitionerMapper.mapPractitioner(any(POCDMT000002UK01AssignedAuthor.class))).thenReturn(practitioner);
}
Also used : POCDMT000002UK01AssignedAuthor(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedAuthor) CE(uk.nhs.connect.iucds.cda.ucr.CE) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization)

Example 3 with CE

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

the class PractitionerRoleMapperTest method mockCode.

private CE mockCode() {
    CE ce = mock(CE.class);
    when(ce.getCode()).thenReturn(CODE);
    when(ce.getCodeSystem()).thenReturn(CODE_SYSTEM);
    when(ce.getDisplayName()).thenReturn(DISPLAY_NAME);
    return ce;
}
Also used : CE(uk.nhs.connect.iucds.cda.ucr.CE)

Example 4 with CE

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

the class PractitionerRoleMapperTest method mockResponsibleParty.

private void mockResponsibleParty() {
    when(clinicalDocument.isSetComponentOf()).thenReturn(true);
    POCDMT000002UK01Component1 component1 = mock(POCDMT000002UK01Component1.class);
    when(clinicalDocument.getComponentOf()).thenReturn(component1);
    POCDMT000002UK01EncompassingEncounter encompassingEncounter = mock(POCDMT000002UK01EncompassingEncounter.class);
    when(component1.getEncompassingEncounter()).thenReturn(encompassingEncounter);
    when(encompassingEncounter.isSetResponsibleParty()).thenReturn(true);
    POCDMT000002UK01ResponsibleParty responsibleParty = mock(POCDMT000002UK01ResponsibleParty.class);
    when(encompassingEncounter.getResponsibleParty()).thenReturn(responsibleParty);
    POCDMT000002UK01AssignedEntity assignedEntity = mock(POCDMT000002UK01AssignedEntity.class);
    when(assignedEntity.isSetRepresentedOrganization()).thenReturn(true);
    when(assignedEntity.getRepresentedOrganization()).thenReturn(mock(POCDMT000002UK01Organization.class));
    CE ce = mockCode();
    when(assignedEntity.getCode()).thenReturn(ce);
    when(responsibleParty.getAssignedEntity()).thenReturn(assignedEntity);
    when(organizationMapper.mapOrganization(any(POCDMT000002UK01Organization.class))).thenReturn(organization);
    when(practitionerMapper.mapPractitioner(any(POCDMT000002UK01AssignedEntity.class))).thenReturn(practitioner);
}
Also used : POCDMT000002UK01Component1(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component1) CE(uk.nhs.connect.iucds.cda.ucr.CE) POCDMT000002UK01EncompassingEncounter(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01EncompassingEncounter) POCDMT000002UK01ResponsibleParty(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01ResponsibleParty) POCDMT000002UK01AssignedEntity(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedEntity) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization)

Example 5 with CE

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

the class OrganizationMapperTest method mockItkOrganization.

private POCDMT000002UK01Organization mockItkOrganization() {
    POCDMT000002UK01Organization itkOrganization = mock(POCDMT000002UK01Organization.class);
    AD itkAddress = mock(AD.class);
    TEL itkTelecom = mock(TEL.class);
    CE codeEntity = mock(CE.class);
    II[] iiArray = new II[] { ii };
    when(itkOrganization.getIdArray()).thenReturn(iiArray);
    when(ii.isSetExtension()).thenReturn(true);
    when(ii.getExtension()).thenReturn(ODS_CODE);
    when(itkOrganization.sizeOfIdArray()).thenReturn(1);
    when(itkOrganization.getAddrArray()).thenReturn(new AD[] { itkAddress });
    when(itkOrganization.getTelecomArray()).thenReturn(new TEL[] { itkTelecom });
    when(itkOrganization.isSetStandardIndustryClassCode()).thenReturn(true);
    when(itkOrganization.getStandardIndustryClassCode()).thenReturn(codeEntity);
    when(codeEntity.getDisplayName()).thenReturn(GP_PRACTICE);
    when(contactPointMapper.mapContactPoint(any())).thenReturn(contactPoint);
    when(addressMapper.mapAddress(any())).thenReturn(address);
    when(nodeUtil.getNodeValueString(itkOrganization.getNameArray(0))).thenReturn(ORGANIZATION_NAME);
    when(resourceUtil.newRandomUuid()).thenReturn(new IdType(RANDOM_UUID));
    Organization organization = organizationMapper.mapOrganization(itkOrganization);
    assertThat(organization.getName()).isEqualTo(ORGANIZATION_NAME);
    assertThat(organization.getAddressFirstRep()).isEqualTo(address);
    assertThat(organization.getTelecomFirstRep()).isEqualTo(contactPoint);
    assertThat(organization.getTypeFirstRep().getText()).isEqualTo(GP_PRACTICE);
    assertThat(organization.getIdentifierFirstRep().getValue()).isEqualTo(ODS_CODE);
    assertThat(organization.getIdElement().getValue()).isEqualTo(RANDOM_UUID);
    return itkOrganization;
}
Also used : II(uk.nhs.connect.iucds.cda.ucr.II) CE(uk.nhs.connect.iucds.cda.ucr.CE) AD(uk.nhs.connect.iucds.cda.ucr.AD) Organization(org.hl7.fhir.dstu3.model.Organization) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization) TEL(uk.nhs.connect.iucds.cda.ucr.TEL) POCDMT000002UK01Organization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization) IdType(org.hl7.fhir.dstu3.model.IdType)

Aggregations

CE (uk.nhs.connect.iucds.cda.ucr.CE)13 POCDMT000002UK01Organization (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Organization)3 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)2 Coding (org.hl7.fhir.dstu3.model.Coding)2 IdType (org.hl7.fhir.dstu3.model.IdType)1 Organization (org.hl7.fhir.dstu3.model.Organization)1 ProcedureRequest (org.hl7.fhir.dstu3.model.ProcedureRequest)1 AD (uk.nhs.connect.iucds.cda.ucr.AD)1 II (uk.nhs.connect.iucds.cda.ucr.II)1 POCDMT000002UK01AssignedAuthor (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedAuthor)1 POCDMT000002UK01AssignedEntity (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01AssignedEntity)1 POCDMT000002UK01Component1 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component1)1 POCDMT000002UK01Component5 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component5)1 POCDMT000002UK01EncompassingEncounter (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01EncompassingEncounter)1 POCDMT000002UK01ResponsibleParty (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01ResponsibleParty)1 POCDMT000002UK01Section (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Section)1 TEL (uk.nhs.connect.iucds.cda.ucr.TEL)1