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