Skip to content

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

@jenniferjiangkells

Description

@jenniferjiangkells

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: SandboxIssue/PRs that deal with the SandboxClient

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions