Skip to content

Implement Immutable SOAP Clinical Notes (Append-Only)#148

Merged
inteee merged 5 commits intoCIVRA-INC:mainfrom
devdeen213:ft/soap
Mar 8, 2026
Merged

Implement Immutable SOAP Clinical Notes (Append-Only)#148
inteee merged 5 commits intoCIVRA-INC:mainfrom
devdeen213:ft/soap

Conversation

@devdeen213
Copy link
Contributor

This PR introduces the initial implementation of immutable clinical notes for the LumenHealth EHR to ensure medical auditability. On the backend (apps/api/src/modules/notes), a ClinicalNoteModel is added with strict append-only behavior—PATCH and DELETE operations are intentionally unsupported and return 405 Method Not Allowed. Notes are created via POST using a temporary hardcoded encounterId: "mock-enc-123". A CORRECTION note type is also supported, allowing doctors to issue a new note that visually supersedes a previous entry without modifying the original. On the frontend (apps/web/src/components/notes), this PR adds a segmented SOAP (Subjective, Objective, Assessment, Plan) editor using markdown or rich text, along with a chronological Notes Feed displaying author badges and timestamps for each entry. The feed visually represents CORRECTION notes (e.g., striking through the superseded note and referencing the new one). Form submission clears the editor and optimistically updates the feed. The API enforces that notes cannot be updated or deleted under any circumstances, ensuring a permanent audit trail.

closes #115


const encounterId = req.body.encounterId ?? "mock-enc-123";

if (req.body.type === "CORRECTION") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please block nested corrections: CORRECTION notes should not be allowed to target another CORRECTION note. Corrections must only reference original non-correction clinical notes to keep amendment chains clear and compliant.

Copy link
Contributor

@inteee inteee left a comment

Choose a reason for hiding this comment

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

Looks good to me. The changes are clear and well implemented. Approved.

@inteee inteee merged commit 744f690 into CIVRA-INC:main Mar 8, 2026
1 check passed
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.

Clinical SOAP Notes & Append-Only Engine

2 participants