Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make client function return request directly instead of data objects? #86

Open
jenniferjiangkells opened this issue Oct 17, 2024 · 0 comments
Labels
Component: Data Generator Issue/PR that addresses DataGenerator methods Component: Sandbox Issue/PRs that deal with the client and server components of the sandbox

Comments

@jenniferjiangkells
Copy link
Member

Description

Currently the client function requires that a specific type of data object is returned, e.g. CdsFhirData or CcdData. Would it be better to be more explicit to modify the usage so that the client returns the request object directly, which the service receives? I think it's a little less confusing.

Current:

    @hc.ehr(workflow="encounter-discharge")
    def load_data_in_client(self) -> CdsFhirData:
        cds_fhir_data = self.data_generator.generate()
        return cds_fhir_data

    @hc.api
    def my_service(self, request: CDSRequest) -> CDSResponse:
        cds_response = self.pipeline(request)
        return cds_response

Suggested:

    @hc.ehr(workflow="encounter-discharge")
    def load_data_in_client(self) -> CDSRequest:
        # either 
        cds_request = CdsLoader('/path/')
        # or
        cds_request = self.data_generator.generate()
       
        return cds_request

    @hc.api
    def my_service(self, request: CDSRequest) -> CDSResponse:
        cds_response = self.pipeline(request)
        return cds_response
@jenniferjiangkells jenniferjiangkells added Component: Data Generator Issue/PR that addresses DataGenerator methods Component: Sandbox Issue/PRs that deal with the client and server components of the sandbox labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Data Generator Issue/PR that addresses DataGenerator methods Component: Sandbox Issue/PRs that deal with the client and server components of the sandbox
Projects
Status: Todo
Development

No branches or pull requests

1 participant