Skip to content

Refactor/remove patient email; fix patient add modal#33

Merged
ipuppet merged 3 commits intomainfrom
refactor/remove-patient-email
Oct 14, 2025
Merged

Refactor/remove patient email; fix patient add modal#33
ipuppet merged 3 commits intomainfrom
refactor/remove-patient-email

Conversation

@ipuppet
Copy link
Copy Markdown
Contributor

@ipuppet ipuppet commented Oct 14, 2025

This pull request makes several important changes to how patient data and vital sign configurations are handled in the application. The most significant updates include removing the email field from patient forms and models, introducing new required fields (mrn, ward, bed) for patient creation and editing, centralizing vital sign configuration usage, and improving error message handling for API responses.

Patient Data Model and Forms

  • Removed the email field from the Patient and PatientCreate interfaces in src/lib/api-client-v2.ts, and updated all patient-related forms and components to no longer display or require an email. Added new required fields: mrn, ward, and bed to patient creation and editing forms. ([[1]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-25d7d235ff75b5aeec13f71e30d6068565cf16d0f18a71331106fe1f76dcd4b9L243), [[2]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-25d7d235ff75b5aeec13f71e30d6068565cf16d0f18a71331106fe1f76dcd4b9L258), [[3]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-9429d77e917e1f5f528a9cffb2612259ac835df9108b11a9d79270f7fefe94faL31-R33), [[4]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-9429d77e917e1f5f528a9cffb2612259ac835df9108b11a9d79270f7fefe94faL53-R57), [[5]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-9429d77e917e1f5f528a9cffb2612259ac835df9108b11a9d79270f7fefe94faL124-R157), [[6]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-77cf31196ada9fc5e7edb45768d1196746105e1fc198d5e7c822552800e2d7c3L33-R35), [[7]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-77cf31196ada9fc5e7edb45768d1196746105e1fc198d5e7c822552800e2d7c3L48-R52), [[8]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-77cf31196ada9fc5e7edb45768d1196746105e1fc198d5e7c822552800e2d7c3L84-R90), [[9]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-77cf31196ada9fc5e7edb45768d1196746105e1fc198d5e7c822552800e2d7c3L144-R179), [[10]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-b1bae156025b415dca5e991c5a74f0709747e860385b249a8a64dd4fdf84ee60L96-L99), [[11]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-6831c5eec7bc17281cf483708a3e3a269c09fa7a00f5ea4a36494679f2b71480L180-L183))

Vital Sign Configuration

  • Updated the bulk vital signs form to use centralized configuration values from @/lib/vital-signs, ensuring consistent labels, units, input types, and placeholders. Removed the deprecated local vital sign config file. ([[1]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-3cd706a776e4903bfc7357099b920d8139ff0f2d2e987993022e0ab4f2df7165R7), [[2]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-3cd706a776e4903bfc7357099b920d8139ff0f2d2e987993022e0ab4f2df7165L155-R256), [[3]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-dad755e32f7df8305ad530a5f1f647c5d3dbf8b0ad53a858dfdbd9246551c148L1-L34), [[4]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-122ceb17fe25908bd433fbd1aa66581e83b57474806ac2ca4beec1f3c0bf062bL92-R92), [[5]](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-122ceb17fe25908bd433fbd1aa66581e83b57474806ac2ca4beec1f3c0bf062bL102-R102))

Error Handling

  • Improved the getErrorMessage helper in src/lib/error-utils.ts to better handle and flatten error messages from Django REST Framework responses, including nested and field-specific errors. ([src/lib/error-utils.tsL6-R46](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-4dbdc7fdb7e39f787fc8c5d1fc5832b4978f323ca16e927d9106f2664f13bd69L6-R46))

Minor UI Improvements

  • Updated the admission file info message in src/components/patients/file-management.tsx for clarity. ([src/components/patients/file-management.tsxL194-R194](https://github.com/UWA-CITS5206-DMR/react-ui/pull/33/files#diff-752fcccf8a53d71c0ff6ab6815d81516305c4b05709cc2b77835c040e98fbbb0L194-R194))

…e display; centralize vital sign configs

- Add MRN, ward, and bed fields to patient forms
- Display phone number instead of email in patient overview
- Improve DRF error message handling
- Centralize vital sign configurations and update placeholders
- Remove deprecated vital sign config file
@ipuppet ipuppet merged commit dedcc87 into main Oct 14, 2025
1 check passed
@ipuppet ipuppet deleted the refactor/remove-patient-email branch October 14, 2025 13:30
Copy link
Copy Markdown
Contributor

@zhuzilinaba zhuzilinaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good modify in functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants