ramses-antibiotics / ramses-package

R Package for Data-Driven Antimicrobial Stewardship & Surveillance in Hospitals
https://ramses-antibiotics.web.app/
GNU General Public License v3.0
10 stars 1 forks source link

method for function ‘longitudinal_table’ for signature ‘"Patient"’ #112

Open HOUSTONHA opened 1 year ago

HOUSTONHA commented 1 year ago

It would be useful to be able to create a longitudinal_table for a given patient which bridges encounters / therapy episodes (eg. t_start could be the timestamp of the first encounter). Also, it would be nice if clinical_feature_last could draw on inpatient and outpatient data (at the moment as I understand it, it pulls from the "inpatient_investigations" table.

peterdutey commented 1 year ago

Thanks for the request!

This could fit well in incoming release. Any chance you have a user story from a typical audit situation? Do you envisage the table should span between the earliest admission/prescription start date and the latest discharge/prescription end date? Or something else entirely?

Note that the data model in Ramses assumes encounter never overlap (this is enforced in validation checks). Therapy episodes, however, can overlap meaning multiple therapy_id in a given time slice. Fortunately the move to duckdb/Postgres means we now exclusively use SQL databases that support array/list columns.

Thanks