Skip to content

Create nbri_ehr module#1

Merged
labkey-martyp merged 3 commits into
release26.7-SNAPSHOTfrom
26.7_fb_create_nbri_ehr_module
Jul 15, 2026
Merged

Create nbri_ehr module#1
labkey-martyp merged 3 commits into
release26.7-SNAPSHOTfrom
26.7_fb_create_nbri_ehr_module

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

Rationale

Seeds the new nbriEHRModules repository with a working EHR module so NBRI development can proceed from a functioning baseline.

Related Pull Requests

None.

Changes

  • Added the initial nbri_ehr module tree (~1,060 files: Java, JS, SQL, XML, HTML, TSV, gradle/properties, sample data), including the org.labkey.nbri_ehr Java package, NBRI_EHR* classes, and the NBRI_EHR folder type.
  • Updated the GitHub workflow files with permissions blocks required by the release automation.
  • Updated .gitignore to exclude referenceStudy ETL logs.

Seeds the new nbriEHRModules repository from the nircEHRModules module tree, with every occurrence of nirc replaced by nbri (casing-matched: NIRC→NBRI, Nirc→Nbri, nirc→nbri) in file contents, file names, and directory names.

Also carries over the nircEHRModules versions of the GitHub workflow files (adding permissions blocks) and .gitignore (ignoring referenceStudy ETL logs).

@labkey-bpatel labkey-bpatel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall looks like a good starting point.

I am sure we'll trim and iterate as development progresses, but a few things stood out on this initial pass:

  1. Are we planning to ETL data into this module? If not, the ETL queries and definitions and go.
  2. Area/Building-specific .qview.xml files - there are quite a few of these with hardcoded location names (e.g. activeBehaviorCases/Building 10.qview.xml). Since these are site-specific and easy to recreate from the UI, I think we can drop them.
  3. Two nbri_ehr DB scripts - any reason not to combine these into a single script?
  4. nbri_ehr/resources/web/nbri_ehr/images/ull-logo-main-subsite.png - should be removed.
  5. Death/Necropsy workflow - the combined form is complex and quite center-specific. Would it be worth splitting into two separate forms (a simpler Death form and a separate Necropsy form) as a baseline?
  6. Copyright headers - Since this is the initial commit, normalize 'Copyright (c) 2024-2026 LabKey Corporation' (and other date-range variants) to 'Copyright (c) 2026 LabKey Corporation' across the new files.

Revised comments from claude code review:

  1. Remove the duplicate CagematesDemographicsProvider registration.
  2. Escape HL7 delimiters in the Orchard file writer.
  3. Null-check birth before formatting in the Orchard file writer.
  4. Guard isProcedureOrderEntered against empty result and null qcstate.
  5. Delete datasetBirth.tsv~.
  6. Non-blocker: Three workflows (branch_release.yml, merge_release.yml, validate_pr.yml) each add a top-level permissions: block that matches what the reusable actions require. actions/checkout@v3 is used in two of them - GitHub has been recommending v4 for a while; not blocking, but consider bumping to keep parity with the newer LabKey repos.

Comment thread nbri_ehr/src/org/labkey/nbri_ehr/NBRI_EHRSchema.java Outdated
Comment thread nbri_ehr/src/org/labkey/nbri_ehr/query/NBRI_EHRTriggerHelper.java Outdated
Comment thread nbri_ehr/src/org/labkey/nbri_ehr/NBRI_EHRModule.java Outdated
Remove the ETL surface: etls/ definitions, dbo source queries, the CasesTemp staging table, the casesSource/casesTemp staging pieces, and the now-unreferenced NBRIUserCreateTransform column transform.

Remove the Orchard/HL7 integration: NBRIOrchardFileGenerator, the orchardData and orchardIdsForTaskid queries, the NBRIOrchardFileLocation module property, the trigger helper method and its JS trigger call sites, and the Selenium test coverage.

Drop the 250 building/area-specific .qview.xml saved views, combine the two DB scripts into nbri_ehr-0.000-25.001.sql, and remove ull-logo-main-subsite.png along with its page references.

Rename NBRI_EHRSchema.get_instance() to getInstance(), remove the unused category param from canCloseCase(), remove the duplicate CagematesDemographicsProvider registration, and guard isProcedureOrderEntered() against missing rows and null qcstate.

Replace leftover NIRC branding (page headings, folder type description) with NBRI, normalize copyright headers to 2026, delete datasetBirth.tsv~, gitignore folder_load logs, and bump actions/checkout to v4.
@labkey-martyp

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review — all of this is addressed in 3f602e0 except the Death/Necropsy split:

  1. ETLs: No ETL planned for this module, so the ETL definitions, dbo source queries, the CasesTemp staging table, and the now-unreferenced NBRIUserCreateTransform are all removed. We also removed the Orchard/HL7 integration entirely (generator, queries, module property, trigger calls, test coverage), which moots the escaping/null-check items.
  2. Location qviews: All 250 Building/Area .qview.xml files are dropped.
  3. DB scripts: Combined into a single nbri_ehr-0.000-25.001.sql.
  4. Logo: Removed, along with its page references and other leftover NIRC branding.
  5. Death/Necropsy: Agreed the combined form is complex — splitting it into a simpler Death form and a separate Necropsy form is bigger than this seeding PR, so we'd like to defer it to a follow-up issue and keep this PR as the working baseline.
  6. Copyright headers: Normalized to 2026 across the module.

The inline comments (get_instance() rename, unused category param, duplicate CagematesDemographicsProvider) and the remaining code-review items (isProcedureOrderEntered guard, datasetBirth.tsv~, checkout@v4) are also fixed.

Fix NBRI_EHRTest failures: resolve the vet-tech role by class name (NBRIEHRVetTechRole) since its "EHR Veterinarian Technician" display name collides with NIRC's role and can otherwise assign the wrong module's role (hiding the necropsy-review button); re-assert form fields that get dropped when EHR form sections rebuild (case Subjective, behavior-case Remark, Clinical Case Problem Area) so lingering required/comment warnings don't block submit; set the medication-order Ordered By directly in the grid instead of via the bulk-edit combo, which trips an Ext4 onTypeAhead null client error that can leave the field unset; and scope the active-clinical-cases assertion to the test animal so other tests' open cases don't inflate the count.

Also correct the pairing_formation_types row in editable_lookups.tsv to the standard column layout (Behavior category, proper label and description).
@labkey-martyp labkey-martyp merged commit 7c72a6e into release26.7-SNAPSHOT Jul 15, 2026
@labkey-martyp labkey-martyp deleted the 26.7_fb_create_nbri_ehr_module branch July 15, 2026 01:35
labkey-martyp added a commit to LabKey/server that referenced this pull request Jul 15, 2026
## Rationale

The new nbriEHRModules repository needs to be included in the EHR
TeamCity test distribution so its nbri_ehr module is built and tested.

## Related Pull Requests

-
[LabKey/nbriEHRModules#1](LabKey/nbriEHRModules#1)

## Changes

- Added server/modules/nbriEHRModules to the ehrModulesDirs list in
gradle/settings/ehr.gradle.
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