Skip to content

ROCK-8328: Fix Manage Medications to use camp-specific GroupMember matrix#209

Open
jwakefield-secc wants to merge 2 commits intomasterfrom
ROCK-8328/fix-groupmember-matrix
Open

ROCK-8328: Fix Manage Medications to use camp-specific GroupMember matrix#209
jwakefield-secc wants to merge 2 commits intomasterfrom
ROCK-8328/fix-groupmember-matrix

Conversation

@jwakefield-secc
Copy link
Copy Markdown
Contributor

Summary

  • Fixed the Manage Medications modal to read/write from the camp-specific GroupMember matrix instead of the Person-level master medication list
  • Each camp registration creates its own medication matrix copy via the "Medication Information Request" workflow — edits from the camp medication page should be scoped to that copy
  • Previously, adding or deleting medications from the Manage Medications modal would modify the Person's global medication list, affecting all camps

What Changed

  • ManageMeds_Click now traces the matrix GUID from the clicked row's AttributeMatrixItemIdAttributeMatrix.Guid instead of querying PersonAttributeValue → matrix GUID
  • The downstream handlers (mdAddMedication_SaveClick, btnDeleteMed_Click) already use hfManageMedsMatrixGuid so they automatically work with the correct camp-specific matrix

Data Model Context

  • Person attribute (Medications, ID 67024): Master medication list on the Person entity
  • GroupMember attribute (Medications, ID 43299+): Camp-specific copy created per registration by workflow type 162 ("Medication Information Request")
  • The workflow's AttributeMatrixCopy action copies the Person matrix into a new matrix on the GroupMember at registration time

Test Plan

  • Open Medication Manager for a camp group
  • Click the pills icon (Manage) on a person's medication row
  • Verify the modal shows medications from the camp-specific matrix, not the Person's master list
  • Add a medication via the modal — verify it only appears in this camp's context
  • Delete a medication via the modal — verify the Person's master medication list is unchanged
  • Verify the main grid still displays and distributes correctly after modal changes

…trix

The Manage Medications modal was reading/writing from the Person-level
medication matrix instead of the camp-specific GroupMember copy. Each camp
registration creates its own matrix via the "Medication Information Request"
workflow, so edits should be scoped to that copy. This fix traces the matrix
from the clicked row's AttributeMatrixItem instead of querying the Person
attribute directly.
The medication grid displays from the Person-level matrix, but some camp
group types use a GroupMember-level copy (created via registration workflow)
while others do not. To prevent accidental deletion of Person master
medications from the camp page, the Manage Medications modal is now
view-only — Delete and Add buttons removed, with a note directing users
to manage medications through the registration process.
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.

1 participant