Fix Record Treatment link to pass schedule slot date as scheduledDate#4
Open
labkey-martyp wants to merge 1 commit into
Open
Fix Record Treatment link to pass schedule slot date as scheduledDate#4labkey-martyp wants to merge 1 commit into
labkey-martyp wants to merge 1 commit into
Conversation
The Record Treatment link on study.treatment_order passed the order's start date as scheduledDate, so every recording against an order got the same value and the second one tripped the duplicate-treatment trigger in study/drug.js while the schedule still showed the slot as unrecorded. The link on treatment_order no longer passes scheduledDate; a new link column on study.treatmentSchedule passes the actual slot date, ISO-formatted, replacing the passthrough column previously inherited from treatment_order. The inline display column is extracted to TreatmentDisplayColumnFactory, which also gains a null guard on category. Claude-Session: https://claude.ai/code/session_01TPAAEmPYGaFTG31hRvq358
|
Would it make sense to centralize the pieces of this that are common across centers into ehrModules/DefaultEHRCustomizer so we have one place to maintain them? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
The Record Treatment link on study.treatment_order passed the order's start date as the scheduledDate URL parameter, so every treatment recorded through it carried the same scheduledDate regardless of which schedule slot was being recorded. The second recording against an order then tripped the duplicate-treatment trigger in study/drug.js ("A treatment has already been entered for this order for this date and time.") while the treatmentSchedule grid still showed the slot as unrecorded, since its status join compares the computed slot time against the stored scheduledDate.
Related Pull Requests
Changes
https://claude.ai/code/session_01TPAAEmPYGaFTG31hRvq358