Skip to content

Export write-path fixes: PUT-by-id + sanitize exported identifiers - #75

Merged
mherman22 merged 2 commits into
mainfrom
fix/export-put-by-id
Jul 23, 2026
Merged

mherman22 merged 2 commits into
mainfrom
fix/export-put-by-id

Conversation

@mherman22

Copy link
Copy Markdown

Two fixes to the EMR → Client Registry (OpenCR) write path:

  1. PUT-by-id instead of FHIR conditional-update (OpenCR 404s on PUT /Patient?identifier=...). Idempotent upsert keyed on the in-resource source-key, converging with the batch feed.
  2. Sanitize the exported identifier set in exportPatient: drop UUID-valued identifiers (the local ECID/golden id and any imported record UUID — internal MPI ids, never site identifiers) and dedupe by system, before the PUT. Prevents re-exports from corrupting the OpenCR source record with UUID-valued ids and duplicates.

Root-cause context: records had accumulated multiple source-keys, duplicate identifiers, and UUID-valued identifiers because the local record picked up foreign ids (import) and export shipped them verbatim. Paired with an import-side fix in the iSantePlus module.

🤖 Generated with Claude Code

…404s on PUT /Patient?identifier=...); fixes the EMR->Client Registry write path
…(ECID/golden/record id) and dedupe by system so re-exports don't corrupt the OpenCR source record
@mherman22
mherman22 merged commit f12b501 into main Jul 23, 2026
1 check passed
@mherman22
mherman22 deleted the fix/export-put-by-id branch July 23, 2026 23:00
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