dotimplement / HealthChain

Simplify prototyping and testing LLM applications in healthcare context 💫 🏥
https://dotimplement.github.io/HealthChain/
Apache License 2.0
10 stars 1 forks source link

Fhir Resources and Data generator #6

Closed adamkells closed 3 months ago

adamkells commented 4 months ago

What is the purpose of this PR?

This PR introduces the concepts of Data Resources and Data Generators.

It adds resources, generators and tests for the Patient, Practitioner and Encounter resources.

What are data resources?

Data resources are pydantic models which encode some relevant data structure (in this case FHIR V5 resources)/

What are data generators?

Data generators are objects which are logged to a registery and can produce data which will pass validation for a corresponding data resource.

These generators will range from producing data meeting the bare minimum requirements (i.e. returning a string for a text field) to more appropriate/realistic data (i.e. returning an actual FHIR code for a particular codeable concept).

These generators are logged to a global generator registry by use of a register_generator decorator.

Next steps not covered in PR

adamkells commented 3 months ago

Modifying data post-generator is easy. Best way to do this is to define a number of a user templates and overlay these on the random data post-hoc.

To avoid further PR bloat, will branch off and add any additional resources templates in new PR.