Skip to content

Disable Id on Exam forms when case created.#1707

Open
labkey-martyp wants to merge 7 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_disable_id_on_case
Open

Disable Id on Exam forms when case created.#1707
labkey-martyp wants to merge 7 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_disable_id_on_case

Conversation

@labkey-martyp
Copy link
Copy Markdown
Contributor

Rationale

Ticket 54568: Exams/Cases allows creation of observation linked to another animal's case.

This PR disables the Animal Id data entry field in the SOAP (clinremarks) section of Exams/Cases and BSU Exam when a case is created. When a case is created the caseid is attached to all records in the form. The only way to change the Id in the forms (which could cause multiple Ids on the same case) is via the SOAP section Id, so disabling it when a case is associated with the records ensures no other Ids can be entered for the case.

Changes

  • Disable the Id field if there is already a caseid in the record
  • Disable the Id field when the 'casecreated' event is fired
  • Remove duplicate remark metadata
  • Remove CagemateClinicalReportFormType as it is unused
  • Create automated tests

labkey-bpatel
labkey-bpatel previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@labkey-bpatel labkey-bpatel 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, please review my comment.

var rec = EHR.DataEntryUtils.getBoundRecord(field);
var readOnly = !!(rec && rec.get('caseid'));
field.setReadOnly(readOnly);
setTooltip(readOnly);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to gray out the disabled Id? so that it doesn't look like it is available for updating - just a little better visually/user experience, imo.

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