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

Improve function io type checking #38

Merged
merged 12 commits into from
Jun 17, 2024

Conversation

jenniferjiangkells
Copy link
Member

@jenniferjiangkells jenniferjiangkells commented Jun 11, 2024

Addresses #30

CHANGES

  • Renamed DataGenerator to CdsDataGenrator - as the behaviour is highly specific to CDS FHIR generation so we might add other types of data generators.
  • Refactored OutputDataGenerator to CdsFhirData in models/data with default empty dict for context field and renamed resource field to prefetch for consistency. Also set default model_dump behaviour - exclude_none=True, exclude_unset=True, by_alias=True
  • More explicit function I/O in usage for service and client functions:
    • ehr client must return CdsFhirData Pydantic model
    • service takes in CdsRequest Pydantic model (although through type hinting it can also dynamically convert this model to str or Dict, but it's more of a fallback as it's better to keep consistent and use the pydantic model)
    • service returns a list of Card Pydantic model (if a single Card is returned, the wrapper will put it in a list)
  • Updated documentation
  • shorten sandbox id in save name

Tasks

  • Make service func io more explicit
  • Make client func io more explicit
  • Raise errors to check correct data type is being passed
  • Update documentation

@jenniferjiangkells jenniferjiangkells self-assigned this Jun 11, 2024
@jenniferjiangkells jenniferjiangkells linked an issue Jun 11, 2024 that may be closed by this pull request
@jenniferjiangkells jenniferjiangkells added the Issue: Feature Request ✨ New feature or improvement to existing feature label Jun 11, 2024
@jenniferjiangkells jenniferjiangkells merged commit 8aaaaf0 into main Jun 17, 2024
3 checks passed
@jenniferjiangkells jenniferjiangkells deleted the feature/improve-func-io-typing branch June 17, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request ✨ New feature or improvement to existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Clarify function signature and return type
2 participants