diff --git a/frontend/src/app/components/list-generic-resource/list-care-plan.component.ts b/frontend/src/app/components/list-generic-resource/list-care-plan.component.ts index c0723ae3..f8b55109 100644 --- a/frontend/src/app/components/list-generic-resource/list-care-plan.component.ts +++ b/frontend/src/app/components/list-generic-resource/list-care-plan.component.ts @@ -1,7 +1,6 @@ import {Component} from '@angular/core'; import {GenericColumnDefn, ListGenericResourceComponent} from './list-generic-resource.component'; import {attributeXTime} from './utils'; -import {getPath} from '../../fhir/utils'; @Component({ selector: 'app-list-care-plan', @@ -13,8 +12,8 @@ export class ListCarePlanComponent extends ListGenericResourceComponent { { title: 'Category', versions: '*', format: 'code', getter: c => c.category[0].coding[0] }, { title: 'Reason', versions: '*', getter: c => { return (c.activity || []).map((a, i) => { - let reason = getPath(a, "detail.code.coding.0.display") || "" - return reason ? [reason, getPath(a, "detail.status") || "no data"] : [] + let reason = a.detail?.code?.coding[0]?.display || "" + return reason ? [reason, a.detail?.status || "no data"] : [] }) } }, { title: 'Period', versions: '*', format: 'period', getter: c => c.period },