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

issue-with-healthie-create-patient #522

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

sharlotta93
Copy link
Contributor

@sharlotta93 sharlotta93 commented Nov 14, 2024

PR Type

bug_fix
isEmpty returns true sometimes when it shouldn't I want a specific check to avoid weird behaviours


Description

  • Fixed a bug in the createPatient action where the logic to determine if an email should be skipped was incorrect.
  • Updated the condition to explicitly check if the email field is undefined or an empty string.

Changes walkthrough 📝

Relevant files
Bug fix
createPatient.ts
Fix email skipping logic in patient creation                         

extensions/healthie/actions/createPatient/createPatient.ts

  • Fixed the condition to determine if the email is skipped.
  • Replaced isEmpty(fields.email) with a more explicit check for
    undefined or empty string.
  • +2/-2     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Logic Change
    The logic for handling empty emails has changed. Ensure that this new condition correctly handles all edge cases and integrates well with the rest of the system.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Ensure correct usage of the skipped_email flag in API mutation arguments

    Ensure that the skipped_email variable is used appropriately in the mutation
    arguments. Currently, it is added as a boolean flag directly, which might not be
    intended for the backend API. If it's meant to control behavior, consider using it
    in a conditional statement or clarify its purpose in the API.

    extensions/healthie/actions/createPatient/createPatient.ts [47]

    -skipped_email,
    +...(conditional usage based on skipped_email)...
    Suggestion importance[1-10]: 5

    Why: The suggestion correctly identifies a potential misuse of the skipped_email variable in the mutation arguments, which could lead to unintended behavior if the backend does not expect a boolean flag in this context. However, the suggestion lacks a specific improved code example, making it less actionable.

    5

    @sharlotta93 sharlotta93 merged commit 1fb3cb3 into main Nov 14, 2024
    2 of 3 checks passed
    @sharlotta93 sharlotta93 deleted the issue-with-healthie-create-patient branch November 14, 2024 12:45
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants