feat(labs): NASS-1879: Lab test secondary results#9012
feat(labs): NASS-1879: Lab test secondary results#9012
Conversation
- Add supportsSecondaryResults field to LabTestType model (default: false) - Add secondaryResult field to LabTest model (text, nullable) - Include migrations for both server and mobile databases - Update TypeScript model definitions for server and mobile Co-authored-by: thomascodling <thomascodling@bes.au>
- Add secondary result input field in LabTestResultsModal (shown only when lab test type supports it) - Display secondary result in LabTestResultModal details view - Add tooltip on hover in lab results table to show secondary result - Show secondary result in brackets in PDF printout Co-authored-by: thomascodling <thomascodling@bes.au>
- Add supportsSecondaryResults to ILabTestType interface - Add secondaryResult to ILabTest interface Co-authored-by: thomascodling <thomascodling@bes.au>
|
Cursor Agent can help with this pull request. Just |
Summary of ChangesHello @tcodling, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's capability to handle more nuanced lab test data by introducing support for secondary results. This involves fundamental changes to the data models, ensuring that the application can store this new information, and comprehensive updates to the user interface and reporting features to display and manage these secondary results effectively. The changes provide a more complete picture of lab test outcomes where additional data points are relevant. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for secondary results for lab tests, with comprehensive changes across the database, mobile, and web applications. The implementation is solid, with new fields added via migrations, models updated accordingly, and UI components adjusted to display and edit the new data. The conditional logic based on the supportsSecondaryResults flag is consistently applied. I've included a couple of suggestions to improve the efficiency of the mobile database migrations.
packages/mobile/App/migrations/1768527821000-addSecondaryResultToLabTest.ts
Show resolved
Hide resolved
packages/mobile/App/migrations/1768527821000-addSupportsSecondaryResultsToLabTestType.ts
Show resolved
Hide resolved
|
bugbot run |
packages/web/app/views/patients/components/LabRequestResultsTable.jsx
Outdated
Show resolved
Hide resolved
packages/web/app/views/patients/components/LabTestResultsModal.jsx
Outdated
Show resolved
Hide resolved
| referenceDataId={labTestTypeId} | ||
| referenceDataCategory="labTestType" | ||
| /> | ||
| <ConditionalTooltip |
There was a problem hiding this comment.
This tooltop is the only change. The rest is formatting
|
Android builds 📱
|
🍹
|
|
bugbot run |
…tps://github.com/beyondessential/tamanu into cursor/NASS-1879-lab-test-secondary-results-139d
| name={LAB_TEST_PROPERTIES.LAB_TEST_METHOD_ID} | ||
| component={SuggesterSelectField} | ||
| tabIndex={tabIndex(1, i)} | ||
| tabIndex={tabIndex(2, i)} |
There was a problem hiding this comment.
Dev tested and these tab indexes work fine with the conditional column
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
rohan-bes
left a comment
There was a problem hiding this comment.
Looks great! Nice stuff
Changes
This PR introduces support for secondary results for lab tests (NASS-1879).
Key changes include:
supportsSecondaryResultsboolean field toLabTestType(defaultfalse) to control if a lab test type can have a secondary result.secondaryResulttext field toLabTestto store the secondary result.Deploys
Tests
Remember to...
Linear Issue: NASS-1879
Note
Medium Risk
Touches schema and syncable lab models plus result-entry UI validation and API authorization checks; failures could impact lab result editing/display across clients, but changes are additive and gated by a default-off flag.
Overview
Adds data-model support for recording an additional lab test value by introducing
lab_test_types.supports_secondary_results(non-null, defaultfalse) andlab_tests.secondary_result(nullable), with accompanying DBT docs and Sequelize/TypeORM migrations.Updates lab result workflows to surface this field end-to-end: the web results entry modal conditionally shows a Secondary result column (disabled when unsupported) and adds validation requiring a primary result if a secondary result is entered; result display (details modal, results table tooltip) and PDF printout now include the secondary value when supported.
Extends the facility-server
PUT labRequest/:id/testspermission check to treat changes tosecondaryResultthe same as primaryresultchanges forLabTestResultauthorization.Written by Cursor Bugbot for commit b316c17. This will update automatically on new commits. Configure here.