KMCH HIS Wiki
สแกนเพื่อเปิดบนมือถือ

MEDHIS Server-Side Gates

Concept Verified Wed Apr 29 2026 00:00:00 GMT+0000 (Coordinated Universal Time) For: DoctorNurseOPDAdminSystem Source: live UAT 2026-04-29 Updated Wed Apr 29 2026 00:00:00 GMT+0000 (Coordinated Universal Time)

MEDHIS Server-Side Gates

Catalog of MEDHIS server-side validation gates that block flow even when the UI appears willing. Surfaced during the TCK-001 UAT walkthrough (uat-recon/agent-uat-handoff) — these are the points where the wiki + the manual silently disagree with reality.

Why this matters

Several MEDHIS workflows have business-rule checks that fire only on the server, not in the Angular controllers. The UI offers the action; the server says no with an HTTP 500 and a structured error code. Knowing the catalog ahead of time lets agents and trainees recognize the symptom and know exactly which prerequisite is missing.

Gate catalog

ERRORS.ICD10ISMANDATORYFORMEDICALDISCHARGE

FieldValue
TriggerPOST /mpi/patientvisit/logvisitjourney with statusuid: VSTSTS6 (Medical Discharge)
Pre-flight checkAt least one diagnosis row in emr.diagnosis for this visit
HTTP status500
Wire format{"errorcode": "ERRORS.ICD10ISMANDATORYFORMEDICALDISCHARGE", ...}
Surface symptom”Medical Discharge ทำไม่ได้” — status menu accepts the click but visit stays at Consultation Completed. Generic error toast may appear.
FixSee ICD Coding. Verify with POST /emr/diagnosis/getdetails {patientvisituid} — empty diagnosis: [] confirms gate.

Browser back-navigation security policy popup

FieldValue
Triggerhistory.back() / location.hash mutation / browser back button
Surface symptomModal: “As per the security policy, System does not process with back button navigation.”
FixDismiss with OK. Use Angular $state.go('<state-name>') for all navigation. See uat-recon/agent-uat-handoff §2.3.

Idle session lock

FieldValue
Trigger~5 min idle with no user input from MEDHIS’s perspective. Long agent operations also count.
Surface symptomCentered modal: “Welcome back <user>. Your session is locked. Enter your password to log in again.” with NO, SIGN ME OUT / YES, KEEP ME SIGNED IN buttons. All page content gone — document.body.innerText no longer contains MRNs.
Detectiondocument.body.innerText.includes('Your session is locked')
FixUser re-auths. Agents must NOT type the password. After re-auth, re-establish state via the §5 Phase 2 Step 0 recipe — server state is durable, only Angular scope is lost.

isopdvisitclosed pre-flight before Start consultation

FieldValue
TriggerDoctor Worklist START button (vm.startConsultation)
Pre-flight endpointPOST /mpi/patientvisit/isopdvisitclosed
Surface symptomSTART fails silently if the visit is already closed; banner shows stale state.
FixRefresh the worklist; pick a visit at Screening Completed status (VSTSTS3).

Settle-bill GL coverage check

FieldValue
TriggerPOST /billing/generatebill/settle
Pre-flight endpointPOST /billing/generatebill/verifyGLcoverageexceeds (per item)
Surface symptomSettle fails if any line item exceeds payor’s GL coverage and no override is provided.
FixFor self-pay (payor ชำระเงินเอง), no GL — gate is a no-op. For agreement payors, fix coverage allocation in Generate Bill Screen.

Anti-patterns observed in UAT

เนื้อหาที่เกี่ยวข้อง / Related