use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Section in project integration-adaptor-111 by nhsconnect.
the class ConsentMapper method extractTextBody.
private void extractTextBody(Consent consent, POCDMT000002UK01StructuredBody structuredBody) {
List<POCDMT000002UK01Section> sections = getSectionsOfType(structuredBody);
for (POCDMT000002UK01Section section : sections) {
Narrative narrative = new Narrative();
narrative.setStatus(GENERATED);
if (section.isSetText()) {
narrative.setDivAsString(Arrays.asList(DIV_START, section.getText().xmlText(), DIV_END).stream().collect(Collectors.joining()));
consent.setText(narrative);
}
}
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Section in project integration-adaptor-111 by nhsconnect.
the class ConsentMapper method extractConsentSource.
private void extractConsentSource(Consent consent, POCDMT000002UK01StructuredBody structuredBody) {
List<POCDMT000002UK01Section> sections = getSectionsOfType(structuredBody);
sections.stream().filter(POCDMT000002UK01Section::isSetId).forEach(section -> consent.setSource(new Identifier().setValue(section.getId().getRoot())));
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Section in project integration-adaptor-111 by nhsconnect.
the class ObservationMapper method mapObservations.
public List<Observation> mapObservations(POCDMT000002UK01ClinicalDocument1 clinicalDocument, Encounter encounter) {
List<Observation> observations = new ArrayList<>();
POCDMT000002UK01Component2 component = clinicalDocument.getComponent();
if (component.isSetStructuredBody()) {
POCDMT000002UK01Component3[] components = component.getStructuredBody().getComponentArray();
for (POCDMT000002UK01Component3 component3 : components) {
POCDMT000002UK01Section section = component3.getSection();
for (POCDMT000002UK01Component5 component5 : section.getComponentArray()) {
ST title = component5.getSection().getTitle();
if (nodeUtil.getNodeValueString(title).matches(PATIENTS_CONDITION_REGEXP)) {
StrucDocContent[] contentArray = component5.getSection().getText().getContentArray();
List<String> sectionText = stream(contentArray).map(it -> nodeUtil.getNodeValueString(it)).collect(toList());
observations.add(createObservation(encounter, sectionText));
}
}
}
}
return observations;
}
use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Section 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.POCDMT000002UK01Section in project integration-adaptor-111 by nhsconnect.
the class CompositionMapper method addSectionChildren.
private void addSectionChildren(SectionComponent component, POCDMT000002UK01Section section) {
for (POCDMT000002UK01Component5 component5 : section.getComponentArray()) {
POCDMT000002UK01Section innerSection = component5.getSection();
SectionComponent innerCompositionSection = getSectionText(innerSection);
component.addSection(innerCompositionSection);
if (isNotEmpty(innerSection.getComponentArray())) {
addSectionChildren(innerCompositionSection, innerSection);
}
}
}
Aggregations