smart-on-fhir / cumulus-library

https://docs.smarthealthit.org/cumulus/library/
Apache License 2.0
2 stars 0 forks source link

Provide study test utilities #219

Open mikix opened 7 months ago

mikix commented 7 months ago

It might be nice to encourage unit tests in studies and provide some tooling for it.

In the hypertension study (and still-WIP data-metrics study), I've got a little test harness method that runs a study on some ndjson and compares the resulting tables against some csvs.

Super basic, but pretty useful. We could copy that into the Library, as a starting block.

dogversioning commented 5 months ago

Some discussion around this for posterity:

mikix commented 3 months ago

Matt and I just had a quick slack convo about this and I wanted to mention that we both are leaning away from exposing a way to create raw resource tables (like the Library testbed or the data-metrics harness do) and towards mocking/creating the core tables directly if we can.

Faster certainly, and also easier to mock edge cases directly.

Maybe its API looks similar to the testbed class (e.g. add_patient()), but it would just operate on the core tables instead of raw tables.