dotimplement / HealthChain

Simplify testing and validating AI and NLP applications in a healthcare context 💫 🏥
https://dotimplement.github.io/HealthChain/
Apache License 2.0
25 stars 15 forks source link

Add data loaders utility function for sandbox #72

Open jenniferjiangkells opened 1 month ago

jenniferjiangkells commented 1 month ago

Description

Currently if the user doesn't use DataGenerator, you end up with something like:

    @hc.ehr(workflow="sign-note-inpatient")
    def load_data_in_client(self) -> CcdData:
        with open("/path/to/cda/data.xml", "r") as file:
            xml_string = file.read()

        return CcdData(cda_xml=xml_string)

It would be nice to abstract this away into a utility function so it will look something more like:

    from healthchain.loaders.ccdloader import CcdLoader

    @hc.ehr(workflow="sign-note-inpatient")
    def load_data_in_client(self) -> CcdData:
        cda_test_data = CcdLoader('path/to/directory/of/cda/xmls')

        return cda_test_data

Context

just less faff innit