ohcnetwork / care_fe

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://care.ohc.network
MIT License
249 stars 430 forks source link

Migrated Scribe to a CARE App + Context #8469

Open shivankacker opened 2 months ago

shivankacker commented 2 months ago

Proposed Changes

Moves Scribe to https://github.com/ohcnetwork/care_scribe_fe

https://github.com/user-attachments/assets/8bbfe6d7-c8be-4a14-bdb5-30ccad3dc4e7

Requires care_scribe backend plugin pointing to https://github.com/ohcnetwork/care_scribe/pull/12

Make sure to add the SCRIBE_ENABLED flag through Django Admin to your user

Requires the care_scribe_fe frontend appp. Add that by updating your env to include REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe,ohcnetwork/care_scribe_fe"

NOTE: Cannot update non arbitrary fields like symptoms, diagnoses for now.

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

Summary by CodeRabbit

Release Notes

netlify[bot] commented 2 months ago

Deploy Preview for care-ohc ready!

Name Link
Latest commit
Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/672bcc65dff07e3bed14af2a
Deploy Preview https://deploy-preview-8469--care-ohc.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 2 months ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

cypress[bot] commented 1 month ago

CARE    Run #3834

Run Properties:  status check passed Passed #3834  •  git commit 2771ec63fc: Migrated Scribe to a CARE App + Context
Project CARE
Branch Review scribe-context
Run status status check passed Passed #3834
Run duration 04m 35s
Commit git commit 2771ec63fc: Migrated Scribe to a CARE App + Context
Committer Shivank Kacker
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 125
View all changes introduced in this branch ↗︎
github-actions[bot] commented 1 month ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

bodhish commented 1 month ago

@shivankacker please close pending PR's before opening others.

shivankacker commented 1 month ago

@bodhish working on this currently

cloudflare-workers-and-pages[bot] commented 3 weeks ago

Deploying care-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2771ec6
Status: ✅  Deploy successful!
Preview URL: https://16504526.care-fe.pages.dev
Branch Preview URL: https://scribe-context.care-fe.pages.dev

View logs

github-actions[bot] commented 2 weeks ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

github-actions[bot] commented 1 week ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

github-actions[bot] commented 1 week ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

coderabbitai[bot] commented 3 days ago

Walkthrough

The pull request introduces multiple enhancements across various components in the application. Key changes include the addition of new hooks and components for improved keyboard shortcut handling, audio recording management, and value observation in form fields. The Scribe component has been completely removed, along with associated API routes, indicating a significant shift in how audio and form data are managed. Other modifications involve updates to existing components for better user experience and responsiveness, particularly in relation to input handling and data synchronization.

Changes

File Path Change Summary
src/CAREUI/interactive/KeyboardShortcut.tsx Added KeyboardShortcutKey function to render keyboard shortcuts with optional short key display.
src/Routers/AppRouter.tsx Added data-cui-page attribute to the main <div> element.
src/Utils/useValueInjectionObserver.tsx Introduced a new hook to observe changes to a specified DOM element's attribute.
src/Utils/useVoiceRecorder.ts Implemented a custom hook for audio recording management with state handling and permissions.
src/components/Common/DateInputV2.tsx Integrated useValueInjectionObserver for improved date input responsiveness.
src/components/Common/prescription-builder/PrescriptionDropdown.tsx Added key prop to dropdown options for rendering performance.
src/components/Files/AudioCaptureDialog.tsx Refactored to use useVoiceRecorder hook for audio recording management.
src/components/Form/FormFields/Autocomplete.tsx Enhanced value management with useValueInjectionObserver and improved accessibility.
src/components/Form/FormFields/AutocompleteMultiselect.tsx Updated to use useValueInjectionObserver for dropdown value observation.
src/components/Form/FormFields/RadioFormField.tsx Changed unselect radio input's value from undefined to "__NULL__".
src/components/Form/FormFields/RangeAutocompleteFormField.tsx Made Threshold interface public.
src/components/Form/FormFields/TextFormField.tsx Added optional thresholds property for enhanced validation.
src/components/Form/SelectMenuV2.tsx Enhanced responsiveness with useValueInjectionObserver.
src/components/Patient/DailyRounds.tsx Significant refactor, replacing several components and updating form handling logic.
src/components/Scribe/Scribe.tsx Complete removal of the Scribe component.
src/components/Scribe/formDetails.ts Removed DAILY_ROUND_FORM_SCRIBE_DATA structure and SCRIBE_FORMS export.
src/components/Symptoms/SymptomsBuilder.tsx Updated to improve user interaction and added tracking attributes.
src/pluginTypes.ts Added new type ScribeComponentType and included it in SupportedPluginComponents.
tailwind.config.js Simplified content property format in Tailwind CSS configuration.
cypress/pageobject/Patient/PatientLogupdate.ts Updated input handling methods for pulse, respiratory rate, and SpO2.
src/components/Common/BloodPressureFormField.tsx Adjusted separator styling between input fields.
src/components/Common/TemperatureFormField.tsx Enhanced input handling and conversion logic for temperature.
src/Utils/useSegmentedRecorder.ts Added microphoneAccess state to manage microphone permission status.
cypress/e2e/assets_spec/AssetHomepage.cy.ts Reordered import statements for better organization.
cypress/e2e/assets_spec/AssetsCreation.cy.ts Reordered import statements for clarity.
cypress/e2e/assets_spec/AssetsManage.cy.ts Reordered import statements without functional changes.
cypress/e2e/facility_spec/FacilityCreation.cy.ts Reordered import statements for better organization.
cypress/e2e/facility_spec/FacilityHomepage.cy.ts Updated imports and added pagination-related tests.
cypress/e2e/facility_spec/FacilityInventory.cy.ts Reordered import statements for better organization.
cypress/e2e/facility_spec/FacilityManage.cy.ts Reordered import statements for clarity.
cypress/e2e/patient_spec/PatientBedManagement.cy.ts Activated import for PatientConsultationPage for enhanced test capabilities.
cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts Reorganized import statements for better readability.
cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts Introduced a new test suite for patient-doctor connection functionality.
cypress/e2e/patient_spec/PatientFileUpload.ts Added tests for audio and file uploads in patient management.
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts Re-added import for PatientLogupdate class.
cypress/e2e/patient_spec/PatientPrescription.cy.ts Re-added import for PatientPrescription class.
cypress/e2e/patient_spec/PatientRegistration.cy.ts Enhanced import organization and patient transfer functionality.
cypress/e2e/resource_spec/ResourcesHomepage.cy.ts Reordered import statements for better organization.
cypress/e2e/users_spec/UsersCreation.cy.ts Reorganized import statements and added utility function.
cypress/e2e/users_spec/UsersManage.cy.ts Added import for UserPage to enhance user management functionality.
public/locale/en.json Added new key-value pairs for enhanced localization support.
src/Utils/request/api.tsx Removed several API routes related to "Scribe" functionalities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant Scribe
    User->>App: Interact with form
    App->>Scribe: Manage audio and form data
    Scribe-->>App: Provide feedback
    App-->>User: Display updated form

Assessment against linked issues

Objective Addressed Explanation
Make Scribe Aware of already present form data (#8134) Scribe component has been completely removed.
Enhancement to the CARE Scribe (#8285) Scribe functionalities have been removed entirely.
Replace unnecessary range auto complete form fields in Daily Rounds with integer fields (#8978) Form fields replaced as per the issue requirements.
Scribe is malfunctioning in iphone (#8227) Removal of Scribe component does not address this.

Possibly related PRs

Suggested labels

tested, good to merge

Poem

🐇 In the land of code where bunnies play,
New features hop in, brightening the day.
With shortcuts and voices, our tasks are a breeze,
Removing the Scribe, we do it with ease.
So here's to the changes, both big and small,
In our code garden, we cherish them all! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 2 days ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

shivankacker commented 2 days ago

Will merge conflicts once PR is tested and approved

nihal467 commented 2 days ago

@shivankacker can you clear the merge conflict, to get it ready for review

shivankacker commented 2 days ago

@nihal467 resolved merge conflicts, deploy preview failing due to cache issue, nothing else.

github-actions[bot] commented 2 hours ago

:wave: Hi, @shivankacker, Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.