ramses-antibiotics/ramses-package

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

HOUSTONHA opened this issue · 1 comments

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.

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