<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ohcnwiki.tellmey.fyi/index.php?action=history&amp;feed=atom&amp;title=References%2FPatient</id>
	<title>References/Patient - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ohcnwiki.tellmey.fyi/index.php?action=history&amp;feed=atom&amp;title=References%2FPatient"/>
	<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;action=history"/>
	<updated>2026-07-06T05:20:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=385&amp;oldid=prev</id>
		<title>Admin: Automated edit (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=385&amp;oldid=prev"/>
		<updated>2026-07-06T04:01:06Z</updated>

		<summary type="html">&lt;p&gt;Automated edit (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:31, 6 July 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 144:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 144:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;extensions&amp;lt;/code&amp;gt; is the supported place for custom key-value data without schema migrations.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;extensions&amp;lt;/code&amp;gt; is the supported place for custom key-value data without schema migrations.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;users_cache&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;organization_cache&amp;lt;/code&amp;gt; are maintained by the platform — do not set them directly from clients.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;users_cache&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;organization_cache&amp;lt;/code&amp;gt; are maintained by the platform — do not set them directly from clients.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Navbox clinical}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Related}}&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Related}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Wiki: ohcnwiki.tellmey.fyi&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=183&amp;oldid=prev</id>
		<title>Admin: OHC identity seed</title>
		<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=183&amp;oldid=prev"/>
		<updated>2026-07-04T22:46:15Z</updated>

		<summary type="html">&lt;p&gt;OHC identity seed&lt;/p&gt;
&lt;a href=&quot;https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;amp;diff=183&amp;amp;oldid=144&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=144&amp;oldid=prev</id>
		<title>Admin: OHC identity seed</title>
		<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=144&amp;oldid=prev"/>
		<updated>2026-07-04T22:44:30Z</updated>

		<summary type="html">&lt;p&gt;OHC identity seed&lt;/p&gt;
&lt;a href=&quot;https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;amp;diff=144&amp;amp;oldid=80&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=80&amp;oldid=prev</id>
		<title>Admin: OHC identity seed</title>
		<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Patient&amp;diff=80&amp;oldid=prev"/>
		<updated>2026-07-04T22:31:20Z</updated>

		<summary type="html">&lt;p&gt;OHC identity seed&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Doc header&lt;br /&gt;
|type=reference&lt;br /&gt;
|domain=clinical&lt;br /&gt;
|title=Patient (reference)&lt;br /&gt;
|summary=Technical reference for the Patient module in Care EMR — models, fields, relationships, and save behaviour.&lt;br /&gt;
|order=1&lt;br /&gt;
|introduced=3.0&lt;br /&gt;
|fhir=Patient&lt;br /&gt;
|model=Patient&lt;br /&gt;
|source=care/emr/models/patient.py&lt;br /&gt;
|concept=Concepts/Patient&lt;br /&gt;
|flow=Flows/Create a patient&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Technical reference for the &amp;lt;code&amp;gt;Patient&amp;lt;/code&amp;gt; module in Care EMR. For a product-oriented overview, see the [[Concepts/Patient|Patient concept]].&lt;br /&gt;
&lt;br /&gt;
== Models ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Model !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Patient&amp;lt;/code&amp;gt; || Core patient record&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PatientOrganization&amp;lt;/code&amp;gt; || Links a patient to an &amp;lt;code&amp;gt;Organization&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PatientUser&amp;lt;/code&amp;gt; || Grants a &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; access to a patient with a &amp;lt;code&amp;gt;RoleModel&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PatientIdentifierConfig&amp;lt;/code&amp;gt; || Defines identifier types (instance-wide or per-facility)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; || Stores an identifier value for a patient&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All models extend &amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt; (shared Care EMR base with &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, audit fields, and soft-delete semantics).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;Patient&amp;lt;/code&amp;gt; fields ==&lt;br /&gt;
&lt;br /&gt;
=== Demographics ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Type !! Notes&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=name|type=CharField(200)|notes=Display name}}&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=gender|type=CharField(35)|notes=Administrative gender}}&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=date_of_birth|type=DateField|notes=Nullable; preferred when known}}&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=year_of_birth|type=IntegerField|notes=Min 1900; used when full DOB is unknown. Auto-set from &amp;lt;code&amp;gt;date_of_birth&amp;lt;/code&amp;gt; on save}}&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=deceased_datetime|type=DateTimeField|notes=Set when patient is marked deceased; affects age calculation}}&lt;br /&gt;
{{Field|model=Patient|section=Demographics|name=blood_group|type=CharField(16)|notes=}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Contact &amp;amp; address ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Type !! Notes&lt;br /&gt;
{{Field|model=Patient|section=Contact &amp;amp; address|name=phone_number|type=CharField(14)|notes=Validated with &amp;lt;code&amp;gt;mobile_or_landline_number_validator&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=Patient|section=Contact &amp;amp; address|name=emergency_phone_number|type=CharField(14)|notes=Same validator}}&lt;br /&gt;
{{Field|model=Patient|section=Contact &amp;amp; address|name=address|type=TextField|notes=Current address}}&lt;br /&gt;
{{Field|model=Patient|section=Contact &amp;amp; address|name=permanent_address|type=TextField|notes=}}&lt;br /&gt;
{{Field|model=Patient|section=Contact &amp;amp; address|name=pincode|type=IntegerField|notes=Nullable}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Organization &amp;amp; access caches ===&lt;br /&gt;
&lt;br /&gt;
These are &amp;#039;&amp;#039;&amp;#039;denormalized caches&amp;#039;&amp;#039;&amp;#039; rebuilt on every &amp;lt;code&amp;gt;Patient.save()&amp;lt;/code&amp;gt; for fast filtering without deep joins.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Type !! Notes&lt;br /&gt;
{{Field|model=Patient|section=Organization &amp;amp; access caches|name=geo_organization|type=FK → Organization|notes=Geographic/administrative org assignment}}&lt;br /&gt;
{{Field|model=Patient|section=Organization &amp;amp; access caches|name=organization_cache|type=ArrayField[int]|notes=Rebuilt by &amp;lt;code&amp;gt;rebuild_organization_cache()&amp;lt;/code&amp;gt; — includes &amp;lt;code&amp;gt;geo_organization&amp;lt;/code&amp;gt; parent chain and all linked &amp;lt;code&amp;gt;PatientOrganization&amp;lt;/code&amp;gt; orgs}}&lt;br /&gt;
{{Field|model=Patient|section=Organization &amp;amp; access caches|name=users_cache|type=ArrayField[int]|notes=Rebuilt by &amp;lt;code&amp;gt;rebuild_users_cache()&amp;lt;/code&amp;gt; — user IDs from &amp;lt;code&amp;gt;PatientUser&amp;lt;/code&amp;gt; rows}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Identifiers &amp;amp; tags ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Type !! Notes&lt;br /&gt;
{{Field|model=Patient|section=Identifiers &amp;amp; tags|name=instance_identifiers|type=JSONField|notes=List of &amp;lt;code&amp;gt;{config, value}&amp;lt;/code&amp;gt; built from &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; rows (instance-scoped configs)}}&lt;br /&gt;
{{Field|model=Patient|section=Identifiers &amp;amp; tags|name=facility_identifiers|type=JSONField|notes=Dict keyed by &amp;lt;code&amp;gt;facility_id&amp;lt;/code&amp;gt; → list of &amp;lt;code&amp;gt;{config, value}&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=Patient|section=Identifiers &amp;amp; tags|name=instance_tags|type=ArrayField[int]|notes=Instance-level tag IDs}}&lt;br /&gt;
{{Field|model=Patient|section=Identifiers &amp;amp; tags|name=facility_tags|type=JSONField|notes=Dict keyed by facility → tag IDs}}&lt;br /&gt;
{{Field|model=Patient|section=Identifiers &amp;amp; tags|name=extensions|type=JSONField|notes=Open extension bag for deployment-specific metadata}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Identifier values live in &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; and are materialized into the JSON caches via &amp;lt;code&amp;gt;build_instance_identifiers()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;build_facility_identifiers(facility_id)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Related models ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;PatientOrganization&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
patient  → FK Patient&lt;br /&gt;
organization → FK Organization&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Saving a &amp;lt;code&amp;gt;PatientOrganization&amp;lt;/code&amp;gt; triggers &amp;lt;code&amp;gt;patient.save()&amp;lt;/code&amp;gt;, which rebuilds &amp;lt;code&amp;gt;organization_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;PatientUser&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Grants a Care user access to a patient record.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user   → FK User&lt;br /&gt;
patient → FK Patient&lt;br /&gt;
role   → FK RoleModel (PROTECT)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Saving a &amp;lt;code&amp;gt;PatientUser&amp;lt;/code&amp;gt; triggers &amp;lt;code&amp;gt;patient.save()&amp;lt;/code&amp;gt;, which rebuilds &amp;lt;code&amp;gt;users_cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;PatientIdentifierConfig&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PatientIdentifierConfig&amp;lt;/code&amp;gt; defines what identifiers exist (status, optional facility scope, JSON config). &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; stores the actual value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
patient → FK Patient&lt;br /&gt;
config  → FK PatientIdentifierConfig&lt;br /&gt;
facility → FK Facility (nullable)&lt;br /&gt;
value   → CharField(1024), indexed&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PatientIdentifierConfigCache&amp;lt;/code&amp;gt; provides in-process caching for configs (&amp;lt;code&amp;gt;get_instance_config()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_facility_config(facility_id)&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Methods &amp;amp; save behaviour ==&lt;br /&gt;
&lt;br /&gt;
=== Age ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;get_age() → str&amp;lt;/code&amp;gt; — human-readable age (years, months, days) relative to &amp;lt;code&amp;gt;deceased_datetime&amp;lt;/code&amp;gt; or now&lt;br /&gt;
* &amp;lt;code&amp;gt;age → int&amp;lt;/code&amp;gt; — whole years only&lt;br /&gt;
&lt;br /&gt;
Both use &amp;lt;code&amp;gt;date_of_birth&amp;lt;/code&amp;gt; when present, otherwise &amp;lt;code&amp;gt;year_of_birth&amp;lt;/code&amp;gt; (January 1).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;save()&amp;lt;/code&amp;gt; side effects ===&lt;br /&gt;
&lt;br /&gt;
On every save:&lt;br /&gt;
&lt;br /&gt;
# If &amp;lt;code&amp;gt;date_of_birth&amp;lt;/code&amp;gt; is set and &amp;lt;code&amp;gt;year_of_birth&amp;lt;/code&amp;gt; is empty → &amp;lt;code&amp;gt;year_of_birth&amp;lt;/code&amp;gt; is derived&lt;br /&gt;
# &amp;lt;code&amp;gt;rebuild_organization_cache()&amp;lt;/code&amp;gt; runs&lt;br /&gt;
# &amp;lt;code&amp;gt;rebuild_users_cache()&amp;lt;/code&amp;gt; runs&lt;br /&gt;
# A second &amp;lt;code&amp;gt;save(update_fields=[&amp;quot;organization_cache&amp;quot;, &amp;quot;users_cache&amp;quot;])&amp;lt;/code&amp;gt; persists the caches&lt;br /&gt;
&lt;br /&gt;
Integrators should expect &amp;#039;&amp;#039;&amp;#039;two write passes&amp;#039;&amp;#039;&amp;#039; when creating or updating patients through the ORM.&lt;br /&gt;
&lt;br /&gt;
== API integration notes ==&lt;br /&gt;
&lt;br /&gt;
* Patient records are exposed through Care&amp;#039;s REST API and FHIR &amp;lt;code&amp;gt;Patient&amp;lt;/code&amp;gt; resources; field names in API payloads may differ from Django model names.&lt;br /&gt;
* Use &amp;lt;code&amp;gt;instance_identifiers&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;facility_identifiers&amp;lt;/code&amp;gt; JSON for read-optimized identifier lookup; write through &amp;lt;code&amp;gt;PatientIdentifier&amp;lt;/code&amp;gt; for consistency.&lt;br /&gt;
* &amp;lt;code&amp;gt;extensions&amp;lt;/code&amp;gt; is the supported place for custom key-value data without schema migrations.&lt;br /&gt;
* &amp;lt;code&amp;gt;users_cache&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;organization_cache&amp;lt;/code&amp;gt; are maintained by the platform — do not set them directly from clients.&lt;br /&gt;
&lt;br /&gt;
{{Related}}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>