Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Sandbox/ModelFork/Prod/AcmeCare/PatientModel: Difference between revisions

From OHC Network Wiki
More languages
Content deleted Content added
Automated edit (via create-page on MediaWiki MCP Server)
 
Automated edit (via update-page on MediaWiki MCP Server)
 
(2 intermediate revisions 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 (never synced — behind by 1 major version)
* '''Last synced:''' v1.0.0 (behind by 1 major version)


== Fields ==
== Fields ==


{| class="wikitable"
{| class="wikitable"
! Field !! Type !! Required !! Origin
! Field !! Type !! Origin
{{Field|model=PatientModel_AcmeCare|section=Identity|name=patient_id|type=UUID|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=patient_id|type=UUID|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=first_name|type=String(100)|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=first_name|type=String(100)|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=last_name|type=String(100)|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=last_name|type=String(100)|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=date_of_birth|type=Date|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=date_of_birth|type=Date|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=gender|type=String(1)|notes='''Kept''' — upstream removed in v2.0.0, AcmeCare still requires it}}
{{Field|model=PatientModel_AcmeCare|section=Identity|name=gender|type=String(1)|notes='''Kept''' — upstream removed in v2.0.0; AcmeCare still requires it}}
{{Field|model=PatientModel_AcmeCare|section=Contact|name=phone|type=String(20)|notes='''Kept as optional''' — upstream made required in v2.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Contact|name=phone|type=String(20)|notes='''Kept as optional''' — upstream made required in v2.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Contact|name=email|type=String(254)|notes=Inherited from upstream v1.0.0}}
{{Field|model=PatientModel_AcmeCare|section=Contact|name=email|type=String(254)|notes=Inherited from upstream v1.0.0}}
Line 37: Line 36:
|}
|}


== Upstream v2.0.0 — sync decision table ==
== 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
! Upstream change !! Decision !! Rationale
|-
|-
| '''Added''' || <code>blood_type</code>, <code>preferred_language</code>
| <code>blood_type</code> (new) || {{yes|'''Adopt'''}} || Valuable clinical field, no conflict with existing fields
|-
|-
| '''Removed''' || <code>gender</code>
| <code>preferred_language</code> (new) || {{yes|'''Adopt'''}} || Needed for patient communications, no conflict
|-
|-
| '''Modified''' || <code>phone</code> → required
| <code>gender</code> (removed) || {{no|'''Keep'''}} || AcmeCare's billing system requires gender — declining upstream removal
|-
|-
| '''Unchanged''' || <code>patient_id</code>, <code>first_name</code>, <code>last_name</code>, <code>date_of_birth</code>, <code>email</code>, <code>address</code>
| <code>phone</code> → required || {{partial|'''Partial'''}} || Make required for new patients; existing patients grandfathered
|}
|}


=== 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"
! Upstream change !! Decision !! Rationale
|-
| <code>blood_type</code> (new) || '''ADOPT''' || Valuable clinical field, no conflict
|-
| <code>preferred_language</code> (new) || '''ADOPT''' || Needed for patient communications
|-
| <code>gender</code> (removed) || '''DECLINE''' || Billing system requires it
|-
| <code>phone</code> → required || '''PARTIAL''' || Required for new patients; existing grandfathered
|}


== 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: insurance_provider, insurance_id, primary_care_physician)
| 3 || Custom fields (AcmeCare-only)
|-
|-
| 1 || Retained field (gender — removed by upstream)
| 1 || Retained field (gender — removed by upstream)