use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Entry in project integration-adaptor-111 by nhsconnect.
the class ConsentMapper method extractDataPeriodFromDoc.
private void extractDataPeriodFromDoc(Consent consent, POCDMT000002UK01StructuredBody structuredBody) {
List<POCDMT000002UK01Entry> permissionEntries = getEntriesOfType(structuredBody);
if (permissionEntries.isEmpty()) {
return;
}
for (POCDMT000002UK01Entry permissionEntry : permissionEntries) {
Period dataPeriod = getDataPeriod(permissionEntry);
if (dataPeriod == null) {
continue;
}
consent.setDataPeriod(dataPeriod);
}
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Entry in project integration-adaptor-111 by nhsconnect.
the class EncounterMapperTest method mockEncounterTypeAndReason.
private void mockEncounterTypeAndReason() {
String encounterText = "Encounter text";
POCDMT000002UK01Component3[] componentArray = new POCDMT000002UK01Component3[1];
componentArray[0] = component3;
POCDMT000002UK01Entry[] entryArray = new POCDMT000002UK01Entry[1];
entryArray[0] = entry;
when(clinicalDocument.getComponent()).thenReturn(component2);
when(component2.isSetStructuredBody()).thenReturn(true);
when(component2.getStructuredBody()).thenReturn(structuredBody);
when(structuredBody.getComponentArray()).thenReturn(componentArray);
when(component3.getSection()).thenReturn(section01);
when(section01.getEntryArray()).thenReturn(entryArray);
when(entry.getEncounter()).thenReturn(encounter);
when(entry.isSetEncounter()).thenReturn(true);
when(encounter.isSetText()).thenReturn(true);
when(encounter.getText()).thenReturn(encounterTextED);
when(nodeUtil.getNodeValueString(any())).thenReturn(encounterText);
when(resourceUtil.newRandomUuid()).thenReturn(new IdType(RANDOM_UUID));
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Entry in project integration-adaptor-111 by nhsconnect.
the class AppointmentMapperTest method mockEntry.
private POCDMT000002UK01Entry mockEntry() {
POCDMT000002UK01Entry entry = mock(POCDMT000002UK01Entry.class);
POCDMT000002UK01Encounter encounter = mock(POCDMT000002UK01Encounter.class);
POCDMT000002UK01Participant2 participant = mock(POCDMT000002UK01Participant2.class);
POCDMT000002UK01ParticipantRole participantRole = mock(POCDMT000002UK01ParticipantRole.class);
when(entry.getEncounter()).thenReturn(encounter);
when(encounter.getParticipantArray()).thenReturn(new POCDMT000002UK01Participant2[] { participant });
when(participant.getParticipantRole()).thenReturn(participantRole);
when(entry.isSetEncounter()).thenReturn(true);
when(encounter.isSetCode()).thenReturn(true);
CDNPfITCDAUrl cdnPfITCDAUrl = mock(CDNPfITCDAUrl.class);
when(encounter.getCode()).thenReturn(cdnPfITCDAUrl);
when(cdnPfITCDAUrl.getDisplayName()).thenReturn(REASON);
return entry;
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Entry in project integration-adaptor-111 by nhsconnect.
the class ConditionMapper method mapCondition.
public Condition mapCondition(POCDMT000002UK01ClinicalDocument1 clinicalDocument, Encounter encounter, List<QuestionnaireResponse> questionnaireResponseList) {
Condition condition = new Condition();
condition.setIdElement(resourceUtil.newRandomUuid());
condition.setClinicalStatus(Condition.ConditionClinicalStatus.ACTIVE).setVerificationStatus(Condition.ConditionVerificationStatus.UNKNOWN).setSubject(encounter.getSubject()).setContext(resourceUtil.createReference(encounter));
if (questionnaireResponseList != null) {
condition.setEvidence(evidenceOf(questionnaireResponseList));
}
addConditionReason(clinicalDocument, condition);
if (clinicalDocument.getComponent().isSetStructuredBody()) {
for (POCDMT000002UK01Component3 component3 : clinicalDocument.getComponent().getStructuredBody().getComponentArray()) {
POCDMT000002UK01Section section = component3.getSection();
for (POCDMT000002UK01Entry entry : section.getEntryArray()) {
if (entry.isSetEncounter()) {
POCDMT000002UK01Encounter itkEncounter = entry.getEncounter();
if (itkEncounter.isSetEffectiveTime()) {
condition.setAssertedDateElement(DateUtil.parse(itkEncounter.getEffectiveTime().getValue()));
}
if (itkEncounter.isSetText()) {
condition.addCategory(new CodeableConcept().setText(nodeUtil.getAllText(itkEncounter.getText().getDomNode())));
}
}
}
for (POCDMT000002UK01Component5 component : section.getComponentArray()) {
if (component.getSection() != null) {
if (component.getSection().isSetLanguageCode()) {
if (component.getSection().getLanguageCode().isSetCode()) {
condition.setLanguage(component.getSection().getLanguageCode().getCode());
}
}
}
}
}
}
return condition;
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Entry in project integration-adaptor-111 by nhsconnect.
the class AppointmentServiceTest method mockAppointmentEntry.
private void mockAppointmentEntry(POCDMT000002UK01Section section) {
TemplateContent templateContent = mock(TemplateContent.class);
POCDMT000002UK01Entry sectionEntry = mock(POCDMT000002UK01Entry.class);
when(section.getEntryArray()).thenReturn(new POCDMT000002UK01Entry[] { sectionEntry });
when(sectionEntry.isSetContentId()).thenReturn(true);
when(sectionEntry.getContentId()).thenReturn(templateContent);
when(templateContent.getRoot()).thenReturn(NPFIT_CDA_CONTENT);
when(templateContent.getExtension()).thenReturn(APPOINTMENT_REFERENCE);
}
Aggregations