Sandbox/ModelFork/Prod/AcmeCare/PatientModel: Difference between revisions
From OHC Network Wiki
More languages
More actions
Content deleted Content added
Automated edit (via update-page on MediaWiki MCP Server) |
Automated edit (via update-page on MediaWiki MCP Server) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Doc header |
{{Doc header |
||
|type=guide |
|type=guide |
||
|domain=platform |
|||
|title=AcmeCare PatientModel |
|title=AcmeCare PatientModel |
||
|order=999 |
|order=999 |
||
| Line 18: | Line 17: | ||
* '''Upstream:''' [[Sandbox/ModelFork/DevEntity/PatientModel|DevEntity PatientModel]] |
* '''Upstream:''' [[Sandbox/ModelFork/DevEntity/PatientModel|DevEntity PatientModel]] |
||
* '''Forked from:''' v1.0.0 |
* '''Forked from:''' v1.0.0 |
||
* '''Last synced:''' v1.0.0 ( |
* '''Last synced:''' v1.0.0 (behind by 1 major version) |
||
== Fields == |
== Fields == |
||
| Line 37: | Line 36: | ||
|} |
|} |
||
== |
== How the sync works == |
||
A sync operation pulls in upstream changes without touching custom fields. Here is the step-by-step procedure: |
|||
When AcmeCare decides to sync from upstream v2.0.0, each change would be evaluated independently: |
|||
=== Step 1 — Diff upstream === |
|||
Compute the delta between the upstream version you last synced from (v1.0.0) and the target version (v2.0.0): |
|||
{| class="wikitable" |
{| class="wikitable" |
||
! Change !! Upstream v2.0.0 |
|||
| ⚫ | |||
|- |
|- |
||
| '''Added''' || <code>blood_type</code>, <code>preferred_language</code> |
|||
| ⚫ | |||
|- |
|- |
||
| '''Removed''' || <code>gender</code> |
|||
| ⚫ | |||
|- |
|- |
||
| '''Modified''' || <code>phone</code> → required |
|||
| ⚫ | |||
|- |
|- |
||
| '''Unchanged''' || <code>patient_id</code>, <code>first_name</code>, <code>last_name</code>, <code>date_of_birth</code>, <code>email</code>, <code>address</code> |
|||
| ⚫ | |||
|} |
|} |
||
=== Step 2 — Evaluate each change === |
|||
This demonstrates the '''selective sync''' model: downstream consumers are not forced to accept every upstream change. They cherry-pick what works for their context and keep their own customizations. |
|||
{| class="wikitable" |
|||
! Change !! Conflict? !! Decision |
|||
|- |
|||
| Add <code>blood_type</code> || None — new field, no collision || '''ADOPT''' — add to table |
|||
|- |
|||
| Add <code>preferred_language</code> || None — new field, no collision || '''ADOPT''' — add to table |
|||
|- |
|||
| Remove <code>gender</code> || '''Yes''' — AcmeCare has and uses this field || '''DECLINE''' — keep gender, document divergence |
|||
|- |
|||
| Make <code>phone</code> required || '''Yes''' — AcmeCare currently allows optional phone || '''PARTIAL''' — require for new patients only; existing stay optional |
|||
|- |
|||
| <code>patient_id</code> through <code>address</code> || None — unchanged || Inherit automatically |
|||
|- |
|||
| '''Custom fields''' (insurance_provider, insurance_id, primary_care_physician) || None — upstream doesn't know about them || '''Preserved automatically''' |
|||
|} |
|||
=== Step 3 — Apply === |
|||
Edit this page's field table to reflect the decisions: add the adopted fields, update the phone constraint note, and bump the "Last synced" version to v2.0.0. Custom fields stay in the table untouched. The resulting model after sync: |
|||
{| class="wikitable" |
|||
! Field !! Type !! Origin |
|||
|- |
|||
| <code>patient_id</code> || UUID || Upstream v1.0.0+ |
|||
|- |
|||
| <code>first_name</code> || String(100) || Upstream v1.0.0+ |
|||
|- |
|||
| <code>last_name</code> || String(100) || Upstream v1.0.0+ |
|||
|- |
|||
| <code>date_of_birth</code> || Date || Upstream v1.0.0+ |
|||
|- |
|||
| <code>gender</code> || String(1) || '''Kept''' (upstream removed in v2.0.0) |
|||
|- |
|||
| <code>phone</code> || String(20) || Required for new patients (upstream made required) |
|||
|- |
|||
| <code>email</code> || String(254) || Upstream v1.0.0+ |
|||
|- |
|||
| <code>address</code> || Text || Upstream v1.0.0+ |
|||
|- |
|||
| <code>blood_type</code> || String(5) || '''Synced from upstream v2.0.0''' |
|||
|- |
|||
| <code>preferred_language</code> || String(50) || '''Synced from upstream v2.0.0''' |
|||
|- |
|||
| <code>insurance_provider</code> || String(100) || '''Custom — preserved''' |
|||
|- |
|||
| <code>insurance_id</code> || String(50) || '''Custom — preserved''' |
|||
|- |
|||
| <code>primary_care_physician</code> || String(100) || '''Custom — preserved''' |
|||
|} |
|||
=== Why custom changes never break === |
|||
Because each fork is its own wiki page: |
|||
* Upstream fields and custom fields live in the same table — there is no separate "override file" that can get stale |
|||
* A sync is just a page edit: add new rows, update notes on changed rows, leave custom rows alone |
|||
* Upstream removal of a field has zero effect on the fork — the fork simply chooses not to delete the row |
|||
* There is no automated merge, no rebase, no conflict markers — every decision is explicit and recorded in the page history |
|||
This is the wiki equivalent of a '''manual three-way merge''' where the fork author is the resolver. |
|||
== Upstream v2.0.0 — sync decision table == |
|||
{| class="wikitable" |
|||
| ⚫ | |||
|- |
|||
| ⚫ | |||
|- |
|||
| ⚫ | |||
|- |
|||
| ⚫ | |||
|- |
|||
| ⚫ | |||
|} |
|||
== Diff summary vs upstream v2.0.0 == |
== Diff summary vs upstream v2.0.0 == |
||
| Line 62: | Line 140: | ||
| 8 || Shared fields (inherited from upstream, potentially modified) |
| 8 || Shared fields (inherited from upstream, potentially modified) |
||
|- |
|- |
||
| 3 || Custom fields (AcmeCare-only |
| 3 || Custom fields (AcmeCare-only) |
||
|- |
|- |
||
| 1 || Retained field (gender — removed by upstream) |
| 1 || Retained field (gender — removed by upstream) |
||