Skip to content

Test branch zella - #123

Draft
skeating wants to merge 72 commits into
developfrom
test_branch_zella
Draft

Test branch zella#123
skeating wants to merge 72 commits into
developfrom
test_branch_zella

Conversation

@skeating

Copy link
Copy Markdown
Contributor

No description provided.

stefpiatek and others added 30 commits May 16, 2025 10:36
Adds functionality to extract and utilize the admission type
information from the PV1 segment of HL7 messages. This includes
defining a getter method and adding a unit test to verify the correct
extraction of the admission type value..
@skeating
skeating changed the base branch from main to develop October 28, 2025 16:24
skeating and others added 12 commits October 28, 2025 16:25
The ADT-triggered fallback that inserts a planned_movement row on a real
subspeciality change previously only fired for the custom Z99 message,
so admissions (A01) and demographics updates (A08/A28/A31) either showed
the correct subspeciality hours late or, for A&E admissions, never at all
(see #166). AdmitPatient and UpdatePatientInfo now
implement HospitalService and feed the same fallback, deduplicated
against the last known value per encounter.

Also fixes two bugs the new tests surfaced: PV1Wrap.getHospitalService()
had no guard for a missing PV1 segment (A08 can legitimately omit one),
and UpdatePatientInfo never creates its own HospitalVisit so the
fallback needs an explicit lookup for an existing visit. Bumps
emap-star's pinned Lombok version, which was incompatible with JDK 21.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ADT^A11 (CancelAdmitPatient) previously had zero effect on
planned_movement, so a hospital-service-fallback edit created by a
now-cancelled admission was left stale in the table. On A11, find the
most recent planned_movement row for that visit+location and, only if
it's an EDIT/HOSPITAL_SERVICE_CHANGE row, mark it cancelled - mirroring
the existing CancelPendingTransfer/CancelPendingDischarge pattern of
marking rather than deleting. Rows from a real pending transfer/
discharge request are left untouched, since they may still represent a
valid plan regardless of this one ADT message.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…SFER rows

PendingTransfer always labels its planned_movement row TRANSFER
(PendingType.ADMIT is unused), so a confirmed admission was left
showing as TRANSFER forever, and admissions with no preceding pending
transfer (e.g. direct A&E) never got a row at all despite carrying the
correct hospital service on arrival.

AdmitPatient no longer shares the diff-based hospital-service fallback
with UpdatePatientInfo. It now always inserts (or idempotently reuses)
its own ADMISSION row via the new PendingAdtController.processAdmission,
linking to whatever it fulfils via matchedMovementId without ever
modifying that row. processAdmissionCancellation is updated to match:
A11 now cancels the ADMISSION row it created rather than an
EDIT/HOSPITAL_SERVICE_CHANGE row.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extend planned_movement hospital service fallback to ADT^A01 and ADT^A08
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.

3 participants