← All endpoints

Inbound EForm webhook console

Fire the EForm gateway's inbound requests — the examination & prescription webhooks and the PAP lookup — at ArmedARIS. This mock plays the gateway; requests are sent server-side with the x-eform-secretheader, so there's no CORS and the secret never reaches the browser. Further down, outbound response overrides pin what this mock returns when ArmedARIS calls it back.

Local ArmedARIS → http://localhost:3000. Paths like /api/eform/webhook/examination are appended.
Blank = server default. Must match ArmedARIS's EFORM_WEBHOOK_SECRET.
Suffixes eformId / prescriptionId only — patientId stays C_PID-1001 so PAP still resolves.

Identity overrides — optional; blank = each scenario's default

→ origin.patientId + the PAP path
examination scenarios only
prescription scenarios only

Examination webhook

POST/api/eform/webhook/examinationexpect 201

1a. Full payload (creates a ghost patient + examination)

201 → { success: true, data: { examinationId } }

Flat fields (clinic, summary, *History, presentIllness, treatmentGiven, physicalExam.*) are stored as-is; medicalHistory (string) is wrapped as [{ name, date:'' }]. currentMedications (object) and the labResults / imageResults / clinicalTests strings are accepted but NOT stored — those structured sections come only from the full visit pipeline + CLS.
Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/examinationexpect 201

1b. Minimal valid payload (origin + admissionDate only)

201 — omitted text fields default to '', sections stored empty

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/examinationexpect 400

1c. Error — null origin

400 → { success: false, error: "origin is required" }

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/examinationexpect 400

1d. Error — missing admissionDate

400 → { success: false, error: "admissionDate is required" }

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.

Prescription webhook

POST/api/eform/webhook/prescriptionexpect 201

2a. items as nested objects (two drugs)

201 → { success: true, data: { prescriptionId } }

The nested Pharmacies[] are flattened into structured PrescriptionItem[]: name ← PharmacyName, dose ← UsageEn, unit/route parsed from Quantity/Usage, durationDays parsed from DurationEn (null → 0).
Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/prescriptionexpect 201

2b. items as a JSON string (raw EForm 'Value')

201 — the string is JSON.parse-d, then flattened to one item

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/prescriptionexpect 400

2c. Error — null origin

400 → { success: false, error: "origin is required" }

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.
POST/api/eform/webhook/prescriptionexpect 400

2d. Error — missing prescribedAt

400 → { success: false, error: "prescribedAt is required" }

Edit payload (preset)
Sent instead of the preset. Identity overrides & Randomize ids still apply on top.

PAP lookup

GET/api/pap/C_PID-1001expect 200

3. PAP lookup by C_PID

200 → { success: true, data: { allergens[], presentIllness } }

Resolves the patient by originPatientIds.origin_id === C_PID (default C_PID-1001) — the ghost patient scenario 1a/1b create. allergens is [] (not 404) when the patient has none; presentIllness is the newest examination's summary, or null.

Outbound response overrides

Pin what this mock returns when ArmedARIS calls the VinAllergy / CLS endpoints. While an override is active, every request to that endpoint — any pid / visitCode / sid — gets the stored status + body verbatim (no envelope is added). Lab-results can also be overridden per SID (fill the sid field), since each SID returns a different single test. In-memory only: cleared on server restart. Tip: Load current fetches the generated response so you can tweak a real example instead of typing from scratch.

GET/orient-health/api/v1/patients/{pid}/visits/{visitCode}/specimens

1. Specimens (SIDs) for a visit — §7

ArmedARIS client fn: fetchVinAllergySpecimens

GET/orient-health/api/v1/lab-results/{sid}

2. Lab result by SID — §7 labResults

ArmedARIS client fn: fetchVinAllergyLabResults

With a sid (e.g. 010124-7558730), Set/Clear/Load target just that id — it wins over the every-sid override. Blank = endpoint-wide.
GET/orient-health/api/v1/patients/{pid}/visits/{visitCode}/radiology-reports

3. Radiology (CĐHA) reports — §8 imageResults

ArmedARIS client fn: fetchVinAllergyRadiologyReports

GET/hospital-info/api/v1/emr/diagnostic-reports/conclusions?visitCode={visitCode}&visitType={visitType}

4. TDCN/PHCN diagnostic-report conclusions

ArmedARIS client fn: fetchVinAllergyDiagnosticConclusions

GET/api/SyncLabAndXrayResultsByPid/{site}/{pid}

5. CLS results by patient id — §9 clinicalTests

ArmedARIS client fn: fetchEformClsResults