Skip to content

Commit 49f83fb

Browse files
author
Justin McReynolds
committed
Advance Directive - If resource.category doesn't exist, ignore the DR - DR's w/out that are simply signature DR's.
1 parent 56fb69f commit 49f83fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/FetchAD.svelte

+7
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@
203203
if (resources.length === 0) {
204204
console.warn("No advance directives found for patient "+patient.id);
205205
}
206+
207+
// If resource.category doesn't exist, ignore the DR - DR's w/out that are simply signature DR's.
208+
// Lambda function to check if resource.category exists
209+
const nonSignatureDR = dr => dr.category !== undefined;
210+
// Filter out resources that don't have a category
211+
resources = resources.filter(nonSignatureDR);
212+
206213
resources.unshift(patient);
207214
208215
result = {

0 commit comments

Comments
 (0)