(feat) O3-5255 Implemented a free text field to allow entering a discharge note when discharging a patient#2166
(feat) O3-5255 Implemented a free text field to allow entering a discharge note when discharging a patient#2166sourav-jyoti wants to merge 8 commits intoopenmrs:mainfrom
Conversation
...app/src/ward-workspace/patient-discharge/modal/patient-discharge-confirmation.modal.test.tsx
Outdated
Show resolved
Hide resolved
| import styles from './patient-discharge.scss'; | ||
|
|
||
| const createNoteSchema = (translate: (key: string, defaultMessage: string) => string) => | ||
| z.object({ |
There was a problem hiding this comment.
I think this field should be optional. Encounters can be created without observations, so the backend won't enforce this client-side constraint.
There was a problem hiding this comment.
i have applied this check currently on the frontend as mentioned by anish_dhodari in the ticket " A mandatory discharge note field to record the reason for discharge."
so should i remove it completely
There was a problem hiding this comment.
@denniskigen I don't think this note field should be mandatory and it would be good if it was configurable. We have a separate Discharge form where the clinicians capture discharge notes and other details. cc: @chibongho
packages/esm-ward-app/src/ward-workspace/patient-discharge/patient-discharge.workspace.tsx
Outdated
Show resolved
Hide resolved
...ward-app/src/ward-workspace/patient-discharge/modal/patient-discharge-confirmation.modal.tsx
Outdated
Show resolved
Hide resolved
|
|
||
| const onSubmit = useCallback( | ||
| (data: DischargeData) => { | ||
| const dispose = showModal('PatientDischargeConfirmationModal', { |
There was a problem hiding this comment.
We usually don't have an additional confirmation modal when submitting a form in a workspace, since the form has a cancel button already as well.
There was a problem hiding this comment.
i have added this confirmation as suggested by anish_dhodari in the ticket "A confirmation (page or popup) before finalizing a discharge"
@chibongho should i remove it ?
| } | ||
| }) | ||
| .then((response) => { | ||
| if (!response?.ok) { |
There was a problem hiding this comment.
I know the old code had this response.ok check, but I don't think we need it.
https://o3-docs.openmrs.org/docs/coding-conventions/error-handling.en-US
c5933b2 to
e5458f3
Compare
|
@denniskigen i have updated the according to the new requirements
Updated screenrecordingScreencast.From.2025-12-20.01-19-45.mp4 |
|
@denniskigen could you pls review this pr |
|
Hi @denniskigen @chibongho, could you help review this PR when you get a chance? Thanks! |
Requirements
Summary
Currently, in the discharge patient section the implementaion is one click button to discharge a patient.
In this Pr i have implemented
Screenrecording
Before
Screencast.From.2025-12-16.01-49-21.mp4
After
Screencast.From.2025-12-16.01-53-18.mp4
Related Issue
https://openmrs.atlassian.net/issues/O3-5255