<?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%2FAllergy_Intolerance</id>
	<title>References/Allergy Intolerance - 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%2FAllergy_Intolerance"/>
	<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Allergy_Intolerance&amp;action=history"/>
	<updated>2026-07-06T05:18:35Z</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/Allergy_Intolerance&amp;diff=403&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/Allergy_Intolerance&amp;diff=403&amp;oldid=prev"/>
		<updated>2026-07-06T04:02:31Z</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:32, 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 268:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 268:&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;* The coded status fields (&amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;) accept only the enum values listed above; anything else is rejected on write.&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;* The coded status fields (&amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;) accept only the enum values listed above; anything else is rejected on write.&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;* Never send &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;copied_from&amp;lt;/code&amp;gt; — both are server-maintained.&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;* Never send &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;copied_from&amp;lt;/code&amp;gt; — both are server-maintained.&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/Allergy_Intolerance&amp;diff=137&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/Allergy_Intolerance&amp;diff=137&amp;oldid=prev"/>
		<updated>2026-07-04T22:44:15Z</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=Allergy Intolerance&lt;br /&gt;
|order=4&lt;br /&gt;
|introduced=3.0&lt;br /&gt;
|fhir=AllergyIntolerance&lt;br /&gt;
|model=AllergyIntolerance&lt;br /&gt;
|reference=References/Base models &amp;amp;amp; conventions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AllergyIntolerance&amp;lt;/code&amp;gt; records a patient&amp;#039;s allergy or intolerance to a substance, scoped to the encounter where it was captured. Care aligns it to FHIR &amp;lt;code&amp;gt;AllergyIntolerance&amp;lt;/code&amp;gt;. You touch this resource when recording a known allergy during an encounter or reading a patient&amp;#039;s allergy list.&lt;br /&gt;
&lt;br /&gt;
The Django model is the storage layer. Several of its fields are opaque &amp;lt;code&amp;gt;JSONField&amp;lt;/code&amp;gt;s whose real structure lives only in the Pydantic resource specs, which also define the enums, validation, the bound value set, and the read/write API schemas.&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/allergy_intolerance.py &amp;lt;code&amp;gt;care/emr/models/allergy_intolerance.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* Specs: [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/allergy_intolerance/spec.py &amp;lt;code&amp;gt;care/emr/resources/allergy_intolerance/spec.py&amp;lt;/code&amp;gt;] · [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/allergy_intolerance/valueset.py &amp;lt;code&amp;gt;valueset.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* Base resource: [&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;]&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;AllergyIntolerance&amp;lt;/code&amp;gt;&lt;br /&gt;
| Records a patient&amp;#039;s allergy or intolerance to a substance, scoped to an encounter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AllergyIntolerance&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;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;, soft-delete via &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;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;, and &amp;lt;code&amp;gt;history&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; JSON.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;AllergyIntolerance&amp;lt;/code&amp;gt; fields ==&lt;br /&gt;
&lt;br /&gt;
=== Clinical classification ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type (storage)&lt;br /&gt;
! Spec type / values&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Clinical classification|name=clinical_status|type=CharField(100), null|notes=&amp;lt;code&amp;gt;ClinicalStatusChoices&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Clinical classification|name=verification_status|type=CharField(100), null|notes=&amp;lt;code&amp;gt;VerificationStatusChoices&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Clinical classification|name=category|type=CharField(100), null|notes=&amp;lt;code&amp;gt;CategoryChoices&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Clinical classification|name=criticality|type=CharField(100), null|notes=&amp;lt;code&amp;gt;CriticalityChoices&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Clinical classification|name=allergy_intolerance_type|type=CharField(20), default &amp;amp;quot;allergy&amp;amp;quot;|notes=&amp;lt;code&amp;gt;AllergyIntoleranceTypeOptions&amp;lt;/code&amp;gt;}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Substance &amp;amp;amp; coding ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type (storage)&lt;br /&gt;
! Spec type / shape&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Substance &amp;amp;amp; coding|name=code|type=JSONField (default=dict, not null/blank)|notes=&amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; bound to value set &amp;lt;code&amp;gt;system-allergy-code&amp;lt;/code&amp;gt;}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; shape: &amp;lt;code&amp;gt;{ system?: str, version?: str, code: str (required), display?: str }&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;extra=&amp;amp;quot;forbid&amp;amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Timing ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type (storage)&lt;br /&gt;
! Spec type / shape&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Timing|name=onset|type=JSONField (default=dict)|notes=&amp;lt;code&amp;gt;AllergyIntoleranceOnSetSpec&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Timing|name=recorded_date|type=DateTimeField, null|notes=&amp;lt;code&amp;gt;datetime | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Timing|name=last_occurrence|type=DateTimeField, null|notes=&amp;lt;code&amp;gt;datetime | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AllergyIntoleranceOnSetSpec&amp;lt;/code&amp;gt; shape:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Sub-field&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
! Default&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onset_datetime&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datetime&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;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onset_age&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;int&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;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;onset_string&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;str&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;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Yes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| —&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Context &amp;amp;amp; notes ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type (storage)&lt;br /&gt;
! Spec type&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Context &amp;amp;amp; notes|name=patient|type=FK → Patient (CASCADE)|notes=excluded from specs}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Context &amp;amp;amp; notes|name=encounter|type=FK → Encounter (CASCADE)|notes=&amp;lt;code&amp;gt;UUID4&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Context &amp;amp;amp; notes|name=note|type=TextField, null|notes=&amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=AllergyIntolerance|section=Context &amp;amp;amp; notes|name=copied_from|type=BigIntegerField, null (default=None)|notes=not exposed}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enum values ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ClinicalStatusChoices&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;active&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;inactive&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;resolved&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;VerificationStatusChoices&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;unconfirmed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;presumed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;confirmed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;refuted&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;entered_in_error&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;CategoryChoices&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;food&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;environment&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;biologic&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;CriticalityChoices&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;low&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;high&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;unable_to_assess&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AllergyIntoleranceTypeOptions&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;allergy&amp;lt;/code&amp;gt; (default)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;intolerance&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bound value set ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value set&lt;br /&gt;
! Slug&lt;br /&gt;
! System&lt;br /&gt;
! Status&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CARE_ALLERGY_CODE_VALUESET&amp;lt;/code&amp;gt; (&amp;amp;quot;Allergy&amp;amp;quot;)&lt;br /&gt;
| &amp;lt;code&amp;gt;system-allergy-code&amp;lt;/code&amp;gt;&lt;br /&gt;
| SNOMED CT (&amp;lt;code&amp;gt;http://snomed.info/sct&amp;lt;/code&amp;gt;)&lt;br /&gt;
| &amp;lt;code&amp;gt;active&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On write, &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; binds to this value set via &amp;lt;code&amp;gt;ValueSetBoundCoding[...slug]&amp;lt;/code&amp;gt;, which validates the submitted &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; against the value set (&amp;lt;code&amp;gt;validate_valueset&amp;lt;/code&amp;gt;). The compose admits SNOMED CT concepts that are &amp;lt;code&amp;gt;is-a&amp;lt;/code&amp;gt; descendants of: &amp;lt;code&amp;gt;105590001&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;418038007&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;267425008&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;29736007&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;340519003&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;190753003&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;413427002&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;716186003&amp;lt;/code&amp;gt;. The value set is also registered as a system (&amp;lt;code&amp;gt;register_as_system()&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Resource specs (API schema) ==&lt;br /&gt;
&lt;br /&gt;
Every spec extends &amp;lt;code&amp;gt;EMRResource&amp;lt;/code&amp;gt; (&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; (DB object → pydantic, via &amp;lt;code&amp;gt;model_construct&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; (pydantic → DB object), plus 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;BaseAllergyIntoleranceSpec&amp;lt;/code&amp;gt; sets &amp;lt;code&amp;gt;__model__ = AllergyIntolerance&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;__exclude__ = [&amp;amp;quot;patient&amp;amp;quot;, &amp;amp;quot;encounter&amp;amp;quot;]&amp;lt;/code&amp;gt;; those two fields skip auto-mapping and are wired by the hooks instead. The base also carries &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; on every spec.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Spec class&lt;br /&gt;
! Role&lt;br /&gt;
! Fields exposed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;BaseAllergyIntoleranceSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| shared base&lt;br /&gt;
| &amp;lt;code&amp;gt;id: UUID4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AllergyIntoleranceWriteSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · create&lt;br /&gt;
| &amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;last_occurrence?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;recorded_date?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; (UUID4), &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; (bound Coding), &amp;lt;code&amp;gt;onset&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;{}&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;allergy_intolerance_type&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;allergy&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;note?&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AllergyIntoleranceUpdateSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · update&lt;br /&gt;
| &amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;last_occurrence?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;note?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; (UUID4), &amp;lt;code&amp;gt;allergy_intolerance_type&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;allergy&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AllergyIntoleranceReadSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| read · list &amp;amp;amp; detail&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; (Coding), &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; (UUID4), &amp;lt;code&amp;gt;onset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;last_occurrence?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;recorded_date?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;note?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;allergy_intolerance_type&amp;lt;/code&amp;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;, &amp;lt;code&amp;gt;created_date&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;modified_date&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AllergyIntoleranceOnSetSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| nested (shape of &amp;lt;code&amp;gt;onset&amp;lt;/code&amp;gt; JSON)&lt;br /&gt;
| &amp;lt;code&amp;gt;onset_datetime?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;onset_age?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;onset_string?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; (required)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;onset&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;recorded_date&amp;lt;/code&amp;gt; are accepted only on create (&amp;lt;code&amp;gt;AllergyIntoleranceWriteSpec&amp;lt;/code&amp;gt;) and absent from &amp;lt;code&amp;gt;AllergyIntoleranceUpdateSpec&amp;lt;/code&amp;gt; — once set, the update path cannot change them.&lt;br /&gt;
* &amp;lt;code&amp;gt;AllergyIntoleranceReadSpec&amp;lt;/code&amp;gt; types the coded fields as plain &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt;, and skips value-set re-validation, relying on &amp;lt;code&amp;gt;model_construct&amp;lt;/code&amp;gt; for speed.&lt;br /&gt;
&lt;br /&gt;
=== Validation ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; (both write specs): &amp;lt;code&amp;gt;validate_encounter_exists&amp;lt;/code&amp;gt; rejects with &amp;lt;code&amp;gt;&amp;amp;quot;Encounter not found&amp;amp;quot;&amp;lt;/code&amp;gt; when no &amp;lt;code&amp;gt;Encounter&amp;lt;/code&amp;gt; has that &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; (create): validated against value set &amp;lt;code&amp;gt;system-allergy-code&amp;lt;/code&amp;gt; — must be a permitted SNOMED CT allergy concept.&lt;br /&gt;
* &amp;lt;code&amp;gt;onset.note&amp;lt;/code&amp;gt; is required whenever an &amp;lt;code&amp;gt;onset&amp;lt;/code&amp;gt; object is supplied.&lt;br /&gt;
* &amp;lt;code&amp;gt;datetime&amp;lt;/code&amp;gt; fields are stored as-is. The base enforces tz-aware handling for period-style values through &amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; (start ≤ end, both tz-aware), but &amp;lt;code&amp;gt;AllergyIntolerance&amp;lt;/code&amp;gt; uses scalar datetimes rather than a &amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Server-side side effects ===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;AllergyIntoleranceWriteSpec.perform_extra_deserialization&amp;lt;/code&amp;gt;): resolves &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, sets &amp;lt;code&amp;gt;obj.encounter&amp;lt;/code&amp;gt;, then sets &amp;lt;code&amp;gt;obj.patient = obj.encounter.patient&amp;lt;/code&amp;gt;. The client never sends &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; directly.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Update&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;AllergyIntoleranceUpdateSpec.perform_extra_deserialization&amp;lt;/code&amp;gt;): when &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; is present, re-resolves it and sets &amp;lt;code&amp;gt;obj.encounter&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;AllergyIntoleranceReadSpec.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;, sets &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;obj.encounter.external_id&amp;lt;/code&amp;gt;, and serializes audit users (&amp;lt;code&amp;gt;created_by&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;updated_by&amp;lt;/code&amp;gt;) via &amp;lt;code&amp;gt;serialize_audit_users&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Methods &amp;amp;amp; save behaviour ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;serialize&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; are inherited from &amp;lt;code&amp;gt;EMRResource&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; maps only DB fields that are neither in &amp;lt;code&amp;gt;__exclude__&amp;lt;/code&amp;gt; nor &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, then calls &amp;lt;code&amp;gt;perform_extra_deserialization&amp;lt;/code&amp;gt; for the encounter/patient wiring above.&lt;br /&gt;
* &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; is always derived from the encounter on create; no client payload can set it.&lt;br /&gt;
* &amp;lt;code&amp;gt;copied_from&amp;lt;/code&amp;gt; is platform-maintained for propagated/copied records and belongs to no spec.&lt;br /&gt;
* &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; both &amp;lt;code&amp;gt;CASCADE&amp;lt;/code&amp;gt;-delete, so an allergy record never outlives its patient or encounter.&lt;br /&gt;
&lt;br /&gt;
== API integration notes ==&lt;br /&gt;
&lt;br /&gt;
* API field names follow the spec classes above. &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; is sent and returned as a UUID &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, not a numeric FK.&lt;br /&gt;
* Submit &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; as a &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; drawn from the bound value set &amp;lt;code&amp;gt;system-allergy-code&amp;lt;/code&amp;gt;, not free text, so allergies can be matched against medications and other business logic.&lt;br /&gt;
* The coded status fields (&amp;lt;code&amp;gt;clinical_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;verification_status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;criticality&amp;lt;/code&amp;gt;) accept only the enum values listed above; anything else is rejected on write.&lt;br /&gt;
* Never send &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;copied_from&amp;lt;/code&amp;gt; — both are server-maintained.&lt;br /&gt;
&lt;br /&gt;
{{Related}}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>