Skip to content

Instantly share code, notes, and snippets.

@ir4y
Created October 4, 2024 04:53
Show Gist options
  • Save ir4y/a6bfe5c27a9a84e4cd3259c10da5dfb6 to your computer and use it in GitHub Desktop.
Save ir4y/a6bfe5c27a9a84e4cd3259c10da5dfb6 to your computer and use it in GitHub Desktop.
Example of precompiled fhirpath utils
function compile<SRC extends Resource,DST = any>(expression:string){
const path = fhirpath.compile(expression);
return (s:SRC) => path(s) as Array<DST>;
}
const vmoName = compile<Appointment,string>("Appointment.participant.where('22232009' in type.coding.code).actor.display");
const vmoStaus = compile<Appointment,string>("Appointment.participant.where('22232009' in type.coding.code).status");
...
const columns =[
{
title: 'Hospital',
key: 'Hospital',
render: with_status(vmoName,vmoStaus),
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment