Search in sources :

Example 1 with POCDMT000002UK01Authorization

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

the class ConsentMapper method extractAuthCodesFromDoc.

private void extractAuthCodesFromDoc(Consent consent, POCDMT000002UK01ClinicalDocument1 clinicalDocument) {
    if (clinicalDocument.sizeOfAuthorizationArray() > 0) {
        for (POCDMT000002UK01Authorization auth : clinicalDocument.getAuthorizationArray()) {
            POCDMT000002UK01Consent authConsent = auth.getConsent();
            if (authConsent.isSetCode()) {
                Optional<CodeableConcept> codeableConcept = getCodingFromCE(authConsent.getCode());
                codeableConcept.ifPresent(consent::addAction);
            }
        }
    }
}
Also used : POCDMT000002UK01Consent(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Consent) POCDMT000002UK01Authorization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Authorization) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 2 with POCDMT000002UK01Authorization

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

the class ConsentMapperTest method setUp.

@BeforeEach
public void setUp() {
    POCDMT000002UK01Component2 component2 = mock(POCDMT000002UK01Component2.class);
    POCDMT000002UK01Component3 component3 = mock(POCDMT000002UK01Component3.class);
    POCDMT000002UK01Authorization authorization = mock(POCDMT000002UK01Authorization.class);
    POCDMT000002UK01StructuredBody structuredBody = mock(POCDMT000002UK01StructuredBody.class);
    code = CE.Factory.newInstance();
    code.setCodeSystem(ITK_SNOMED);
    code.setCode(INFORMATION_ADVICE_GIVEN);
    code.setDisplayName(CODE_DISPLAY_NAME);
    title.setLanguage(LANG);
    cs.setCode(LANG);
    when(clinicalDocument.getComponent()).thenReturn(component2);
    when(clinicalDocument.sizeOfAuthorizationArray()).thenReturn(1);
    when(clinicalDocument.getAuthorizationArray()).thenReturn(new POCDMT000002UK01Authorization[] { authorization });
    when(authorization.getConsent()).thenReturn(authConsent);
    when(authConsent.isSetCode()).thenReturn(true);
    when(authConsent.getCode()).thenReturn(code);
    when(component2.getStructuredBody()).thenReturn(structuredBody);
    when(component3.getSection()).thenReturn(section);
    when(component5.getSection()).thenReturn(section);
    when(structuredBody.getComponentArray()).thenReturn(new POCDMT000002UK01Component3[] { component3 });
    when(resourceUtil.newRandomUuid()).thenReturn(new IdType(RANDOM_UUID));
}
Also used : POCDMT000002UK01Component2(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component2) POCDMT000002UK01StructuredBody(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01StructuredBody) POCDMT000002UK01Component3(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component3) POCDMT000002UK01Authorization(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Authorization) IdType(org.hl7.fhir.dstu3.model.IdType) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

POCDMT000002UK01Authorization (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Authorization)2 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)1 IdType (org.hl7.fhir.dstu3.model.IdType)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 POCDMT000002UK01Component2 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component2)1 POCDMT000002UK01Component3 (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Component3)1 POCDMT000002UK01Consent (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Consent)1 POCDMT000002UK01StructuredBody (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01StructuredBody)1