Skip to content

Add data loaders utility function for sandbox #72

Closed as not planned
Closed as not planned
@jenniferjiangkells

Description

@jenniferjiangkells

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
  • some configs on the order to pick files (random, in order)

Context

just less faff innit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: SandboxIssue/PRs that deal with the client and server components of the sandboxIssue: Feature Request ✨New feature or improvement to existing feature

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions