Skip to content

Feat/epic native table wiring#121

Merged
NeuroKoder3 merged 3 commits into
mainfrom
feat/epic-native-table-wiring
May 25, 2026
Merged

Feat/epic native table wiring#121
NeuroKoder3 merged 3 commits into
mainfrom
feat/epic-native-table-wiring

Conversation

@NeuroKoder3
Copy link
Copy Markdown
Owner

Description

Brief description of the changes.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe)

Testing

How has this been tested?

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated if needed
  • No new warnings introduced
  • Tests pass locally

Compliance Considerations

  • No PHI in code or comments
  • Audit logging maintained
  • Access controls respected

Screenshots

If applicable, add screenshots.

NeuroKoder3 and others added 3 commits May 23, 2026 14:35
…gyIntolerance into native tables

- Add migration 007_clinical_detail.sql: patient_conditions, patient_medications,
  patient_allergies tables with RLS, indexes, and updated_at triggers
- Add conditionService, medicationService, allergyService with create/listForPatient
  following the same org-scoped + audit pattern as labResultService
- Rewrite importPatient.js: Epic import now writes to fhir_resources AND
  materialises structured rows in all four native tables in a single call;
  adds materialised counts to the return value and audit log entry
- Add postCreate hooks to Condition, MedicationRequest, AllergyIntolerance in
  fhir/resources/index.js so direct FHIR API writes also materialise natively
- 6 new unit tests (15 total passing) covering all four resource types,
  edge cases (no value, code.text fallback, wrong resourceType skip)

Co-authored-by: Cursor <[email protected]>
…ent docs

- Confirmed token exchange against Epic May 2026 sandbox
  (Non-Production Client ID a8634931-c997-4516-90cd-21ec3a27813e)
- JWKS hosted at gist.githubusercontent.com/NeuroKoder3/.../raw/jwks.json
- All 5 core system scopes granted and verified: Patient, Observation,
  Condition, MedicationRequest, AllergyIntolerance
- Trim DEFAULT_SCOPES to the confirmed-granted set; Encounter, Immunization,
  Organization, Procedure registered in app and will be re-added once propagated
- Add scripts/epic-sandbox-check.mjs: full diagnostic (token, scopes, metadata,
  patient bundle fetch, native table materialisation preview)
- Add scripts/epic-key-check.mjs: keypair consistency validator

Co-authored-by: Cursor <[email protected]>
@NeuroKoder3 NeuroKoder3 merged commit 917d2ba into main May 25, 2026
15 checks passed
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.

1 participant