<?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%2FMeta_Artifact</id>
	<title>References/Meta Artifact - 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%2FMeta_Artifact"/>
	<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Meta_Artifact&amp;action=history"/>
	<updated>2026-07-06T05:19:26Z</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/Meta_Artifact&amp;diff=470&amp;oldid=prev</id>
		<title>Admin: Add Navbox platform (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Meta_Artifact&amp;diff=470&amp;oldid=prev"/>
		<updated>2026-07-06T04:23:24Z</updated>

		<summary type="html">&lt;p&gt;Add Navbox platform (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:53, 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 209:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 209:&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;* After creation, &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; are fixed. Only &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; can change, via &amp;lt;code&amp;gt;MetaArtifactUpdateSpec&amp;lt;/code&amp;gt;.&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;* After creation, &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; are fixed. Only &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; can change, via &amp;lt;code&amp;gt;MetaArtifactUpdateSpec&amp;lt;/code&amp;gt;.&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;EMRBaseModel&amp;lt;/code&amp;gt; maintains the audit fields (&amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;), the public &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (exposed as &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;), and soft-delete (&amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;). Don&#039;t set them 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;EMRBaseModel&amp;lt;/code&amp;gt; maintains the audit fields (&amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;), the public &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (exposed as &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;), and soft-delete (&amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;). Don&#039;t set them 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 platform}}&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;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://ohcnwiki.tellmey.fyi/index.php?title=References/Meta_Artifact&amp;diff=169&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/Meta_Artifact&amp;diff=169&amp;oldid=prev"/>
		<updated>2026-07-04T22:45:31Z</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=platform&lt;br /&gt;
|title=Meta Artifact&lt;br /&gt;
|order=2&lt;br /&gt;
|introduced=3.0&lt;br /&gt;
|model=MetaArtifact&lt;br /&gt;
|reference=References/Encounter&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt; attaches a freeform metadata payload to any Care object without a dedicated foreign key. You reach for it when a feature needs to hang structured data — a drawing on a patient, say — off an existing record without adding a column or a join table.&lt;br /&gt;
&lt;br /&gt;
Storage and schema split across two layers. The Django model stays loose: &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; is an opaque &amp;lt;code&amp;gt;JSONField&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt; are bare &amp;lt;code&amp;gt;CharField&amp;lt;/code&amp;gt;s. The Pydantic resource specs constrain those values to known enums and define the request/response shapes the API accepts.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Model: [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/models/meta_artifact.py &amp;lt;code&amp;gt;care/emr/models/meta_artifact.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* Resource specs: [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/meta_artifact/spec.py &amp;lt;code&amp;gt;care/emr/resources/meta_artifact/spec.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
== Models ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Model&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Generic, polymorphic metadata record attached to any Care object by type + external ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt; extends [[References/Base models &amp;amp;amp; conventions|&amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt;]], the shared Care EMR base that provides &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, the audit fields &amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;, and the soft-delete flag &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt; fields ==&lt;br /&gt;
&lt;br /&gt;
=== Association ===&lt;br /&gt;
&lt;br /&gt;
There is no Django &amp;lt;code&amp;gt;ForeignKey&amp;lt;/code&amp;gt; to a parent. A &amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt; points at its target by storing the target&amp;#039;s type and &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=MetaArtifact|section=Association|name=associating_type|type=CharField(255)|notes=Non-null. The kind of object this artifact hangs off. API-constrained to [[#metaartifactassociatingtypechoices-values}}&lt;br /&gt;
{{Field|model=MetaArtifact|section=Association|name=associating_external_id|type=UUIDField|notes=Non-null. The parent&amp;#039;s &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;. Set server-side from the spec&amp;#039;s &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt; (see [[#resource-specs-api-schema}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A composite database index covers these two fields (see [[#methods--save-behaviour|Methods &amp;amp;amp; save behaviour]]), so looking up every artifact for a given parent stays cheap.&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=MetaArtifact|section=Content|name=name|type=CharField(255)|notes=Spec rejects blank/whitespace-only on create}}&lt;br /&gt;
{{Field|model=MetaArtifact|section=Content|name=object_type|type=CharField(255)|notes=Names the shape held in &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt;. API-constrained to [[#metaartifactobjecttypechoices-values}}&lt;br /&gt;
{{Field|model=MetaArtifact|section=Content|name=object_value|type=JSONField|notes=The payload. Spec types it as &amp;lt;code&amp;gt;dict | list&amp;lt;/code&amp;gt;, required with no default}}&lt;br /&gt;
{{Field|model=MetaArtifact|section=Content|name=note|type=TextField|notes=Nullable. Spec: &amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;, default &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enum values ==&lt;br /&gt;
&lt;br /&gt;
Two &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt; enums constrain &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt; at the API layer. Both live in &amp;lt;code&amp;gt;spec.py&amp;lt;/code&amp;gt; — this resource has no separate &amp;lt;code&amp;gt;constants.py&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;valueset.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;MetaArtifactAssociatingTypeChoices&amp;lt;/code&amp;gt; values ===&lt;br /&gt;
&lt;br /&gt;
Binds &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;MetaArtifactObjectTypeChoices&amp;lt;/code&amp;gt; values ===&lt;br /&gt;
&lt;br /&gt;
Binds &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;drawing&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Resource specs (API schema) ==&lt;br /&gt;
&lt;br /&gt;
All specs extend &amp;lt;code&amp;gt;EMRResource&amp;lt;/code&amp;gt; ([&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/base.py &amp;lt;code&amp;gt;care/emr/resources/base.py&amp;lt;/code&amp;gt;]), which provides &amp;lt;code&amp;gt;serialize&amp;lt;/code&amp;gt; (model → pydantic) and &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; (pydantic → model) along with the &amp;lt;code&amp;gt;perform_extra_serialization&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;perform_extra_deserialization&amp;lt;/code&amp;gt; hooks. &amp;lt;code&amp;gt;__model__ = MetaArtifact&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Spec&lt;br /&gt;
! Role&lt;br /&gt;
! Fields exposed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactBaseSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| shared&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;UUID4 | None&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;dict | list&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactCreateSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · create&lt;br /&gt;
| base + &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;UUID4&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactUpdateSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · update&lt;br /&gt;
| identical to &amp;lt;code&amp;gt;MetaArtifactBaseSpec&amp;lt;/code&amp;gt; (only &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; are mutable; association and type are fixed after create)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactReadSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| read · detail/list&lt;br /&gt;
| base + &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;dict | None&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;dict | None&amp;lt;/code&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Field-level details and validation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Spec type&lt;br /&gt;
! Required&lt;br /&gt;
! Default&lt;br /&gt;
! Validation / behaviour&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;UUID4 | None&amp;lt;/code&amp;gt;&lt;br /&gt;
| optional&lt;br /&gt;
| &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;&lt;br /&gt;
| Read-only; populated from &amp;lt;code&amp;gt;obj.external_id&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;perform_extra_serialization&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;dict | list&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes&lt;br /&gt;
| —&lt;br /&gt;
| Arbitrary JSON object or array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;&lt;br /&gt;
| no&lt;br /&gt;
| &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;&lt;br /&gt;
| Free text&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactAssociatingTypeChoices&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes (create)&lt;br /&gt;
| —&lt;br /&gt;
| &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;UUID4&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes (create)&lt;br /&gt;
| —&lt;br /&gt;
| Parent&amp;#039;s &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;; copied to model field &amp;lt;code&amp;gt;associating_external_id&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;perform_extra_deserialization&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MetaArtifactObjectTypeChoices&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes (create)&lt;br /&gt;
| —&lt;br /&gt;
| &amp;lt;code&amp;gt;drawing&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt;&lt;br /&gt;
| yes (create)&lt;br /&gt;
| —&lt;br /&gt;
| &amp;lt;code&amp;gt;validate_name&amp;lt;/code&amp;gt; rejects blank/whitespace-only with &amp;lt;code&amp;gt;&amp;amp;quot;Name cannot be empty&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datetime&amp;lt;/code&amp;gt;&lt;br /&gt;
| read&lt;br /&gt;
| —&lt;br /&gt;
| From &amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datetime&amp;lt;/code&amp;gt;&lt;br /&gt;
| read&lt;br /&gt;
| —&lt;br /&gt;
| From &amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;dict | None&amp;lt;/code&amp;gt;&lt;br /&gt;
| read&lt;br /&gt;
| &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;&lt;br /&gt;
| Serialized via &amp;lt;code&amp;gt;serialize_audit_users&amp;lt;/code&amp;gt; (cached &amp;lt;code&amp;gt;UserSpec&amp;lt;/code&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Server-maintained behaviour:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;MetaArtifactCreateSpec.perform_extra_deserialization&amp;lt;/code&amp;gt;): sets &amp;lt;code&amp;gt;obj.associating_external_id = self.associating_id&amp;lt;/code&amp;gt;. Clients send the parent&amp;#039;s &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;; the model stores it under &amp;lt;code&amp;gt;associating_external_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Read&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;MetaArtifactReadSpec.perform_extra_serialization&amp;lt;/code&amp;gt;): sets &amp;lt;code&amp;gt;mapping[&amp;amp;quot;id&amp;amp;quot;] = obj.external_id&amp;lt;/code&amp;gt; and calls &amp;lt;code&amp;gt;serialize_audit_users&amp;lt;/code&amp;gt; to attach &amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Update&amp;#039;&amp;#039;&amp;#039;: &amp;lt;code&amp;gt;MetaArtifactUpdateSpec&amp;lt;/code&amp;gt; exposes only &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; (plus the inherited optional &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;). It never re-accepts &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, so association and classification are immutable once the record exists.&lt;br /&gt;
&lt;br /&gt;
No field on this resource binds to a value set (there is no &amp;lt;code&amp;gt;valueset.py&amp;lt;/code&amp;gt;); the only constrained vocabularies are the two &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt; enums above.&lt;br /&gt;
&lt;br /&gt;
== Methods &amp;amp;amp; save behaviour ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MetaArtifact&amp;lt;/code&amp;gt; adds no custom methods and overrides neither &amp;lt;code&amp;gt;save()&amp;lt;/code&amp;gt; nor &amp;lt;code&amp;gt;delete()&amp;lt;/code&amp;gt;. Audit and soft-delete behaviour come entirely from [[References/Base models &amp;amp;amp; conventions|&amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
Its &amp;lt;code&amp;gt;Meta&amp;lt;/code&amp;gt; declares one composite index to back parent-object lookups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;Index(fields=[&amp;quot;associating_type&amp;quot;, &amp;quot;associating_external_id&amp;quot;])&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== API integration notes ==&lt;br /&gt;
&lt;br /&gt;
* Reference the target by its &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (UUID), never its internal primary key, and pass it as &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt; on create. The &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;associating_external_id&amp;lt;/code&amp;gt; pair lets one table hold metadata for many Care object types without per-type foreign keys.&lt;br /&gt;
* Add a new association or artifact kind by extending the &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt; enums in &amp;lt;code&amp;gt;spec.py&amp;lt;/code&amp;gt; — no schema migration, since the underlying &amp;lt;code&amp;gt;CharField&amp;lt;/code&amp;gt;s are already open.&lt;br /&gt;
* &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; accepts any &amp;lt;code&amp;gt;dict | list&amp;lt;/code&amp;gt;, so payloads carry feature-specific structure without migrations; &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt; records which shape to expect (e.g. &amp;lt;code&amp;gt;drawing&amp;lt;/code&amp;gt;).&lt;br /&gt;
* After creation, &amp;lt;code&amp;gt;associating_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;associating_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;object_type&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; are fixed. Only &amp;lt;code&amp;gt;object_value&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; can change, via &amp;lt;code&amp;gt;MetaArtifactUpdateSpec&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt; maintains the audit fields (&amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;), the public &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (exposed as &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;), and soft-delete (&amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;). Don&amp;#039;t set them from clients.&lt;br /&gt;
&lt;br /&gt;
{{Related}}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>