use of org.hl7.fhir.dstu3.model.Consent 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 org.hl7.fhir.dstu3.model.Consent 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 org.hl7.fhir.dstu3.model.Consent 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 org.hl7.fhir.dstu3.model.Consent 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 org.hl7.fhir.dstu3.model.Consent in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeConsentExceptComponent.
protected void composeConsentExceptComponent(Complex parent, String parentType, String name, Consent.ExceptComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "except", name, element, index);
if (element.hasTypeElement())
composeEnum(t, "Consent", "type", element.getTypeElement(), -1);
if (element.hasPeriod())
composePeriod(t, "Consent", "period", element.getPeriod(), -1);
for (int i = 0; i < element.getActor().size(); i++) composeConsentExceptActorComponent(t, "Consent", "actor", element.getActor().get(i), i);
for (int i = 0; i < element.getAction().size(); i++) composeCodeableConcept(t, "Consent", "action", element.getAction().get(i), i);
for (int i = 0; i < element.getSecurityLabel().size(); i++) composeCoding(t, "Consent", "securityLabel", element.getSecurityLabel().get(i), i);
for (int i = 0; i < element.getPurpose().size(); i++) composeCoding(t, "Consent", "purpose", element.getPurpose().get(i), i);
for (int i = 0; i < element.getClass_().size(); i++) composeCoding(t, "Consent", "class", element.getClass_().get(i), i);
for (int i = 0; i < element.getCode().size(); i++) composeCoding(t, "Consent", "code", element.getCode().get(i), i);
if (element.hasDataPeriod())
composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
for (int i = 0; i < element.getData().size(); i++) composeConsentExceptDataComponent(t, "Consent", "data", element.getData().get(i), i);
}
Aggregations