<?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%2FMedication_Statement</id>
	<title>References/Medication Statement - 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%2FMedication_Statement"/>
	<link rel="alternate" type="text/html" href="https://ohcnwiki.tellmey.fyi/index.php?title=References/Medication_Statement&amp;action=history"/>
	<updated>2026-07-06T05:19:21Z</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/Medication_Statement&amp;diff=447&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/Medication_Statement&amp;diff=447&amp;oldid=prev"/>
		<updated>2026-07-06T04:16:20Z</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:46, 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 214:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 214:&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;information_source&amp;lt;/code&amp;gt; is what separates a self-reported or third-party statement from an actively managed prescription ([[References/Medication Request|&amp;lt;code&amp;gt;MedicationRequest&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;* &amp;lt;code&amp;gt;information_source&amp;lt;/code&amp;gt; is what separates a self-reported or third-party statement from an actively managed prescription ([[References/Medication Request|&amp;lt;code&amp;gt;MedicationRequest&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;external_id&amp;lt;/code&amp;gt; (UUID), &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;, &amp;lt;code&amp;gt;history&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; are platform-maintained — 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;external_id&amp;lt;/code&amp;gt; (UUID), &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;, &amp;lt;code&amp;gt;history&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; are platform-maintained — 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 medications}}&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/Medication_Statement&amp;diff=166&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/Medication_Statement&amp;diff=166&amp;oldid=prev"/>
		<updated>2026-07-04T22:45:26Z</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=medications&lt;br /&gt;
|title=Medication Statement&lt;br /&gt;
|order=4&lt;br /&gt;
|introduced=3.0&lt;br /&gt;
|model=MedicationStatement&lt;br /&gt;
|reference=References/Base models &amp;amp;amp; conventions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;MedicationStatement&amp;lt;/code&amp;gt; records a medication the patient is taking, has taken, or intends to take, as reported by the patient, a relative, or a clinician rather than actively prescribed or dispensed. Reach for it when you&amp;#039;re capturing a medication history rather than driving an order. It aligns with the FHIR &amp;lt;code&amp;gt;MedicationStatement&amp;lt;/code&amp;gt; resource.&lt;br /&gt;
&lt;br /&gt;
The Django model stores &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt; as opaque &amp;lt;code&amp;gt;JSONField&amp;lt;/code&amp;gt;s. Their real structure comes from the Pydantic resource specs in &amp;lt;code&amp;gt;care/emr/resources/medication/statement/&amp;lt;/code&amp;gt;, which define the enums, nested JSON shapes, validation, the value-set binding on &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt;, and the read/write API schemas. This page covers both layers.&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/medication_statement.py &amp;lt;code&amp;gt;care/emr/models/medication_statement.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* Spec: [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/medication/statement/spec.py &amp;lt;code&amp;gt;care/emr/resources/medication/statement/spec.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* Value set: [&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/medication/valueset/medication.py &amp;lt;code&amp;gt;care/emr/resources/medication/valueset/medication.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;MedicationStatement&amp;lt;/code&amp;gt;&lt;br /&gt;
| A record of a medication the patient is taking, has taken, or intends to take — as reported rather than actively prescribed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MedicationStatement&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 supplies &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt;, 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;, &amp;lt;code&amp;gt;history&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; JSON, and soft-delete semantics.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;code&amp;gt;MedicationStatement&amp;lt;/code&amp;gt; fields ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039; is the Django storage type. &amp;#039;&amp;#039;&amp;#039;Spec shape&amp;#039;&amp;#039;&amp;#039; is the structured shape the Pydantic resource spec enforces when reading and writing over the API.&lt;br /&gt;
&lt;br /&gt;
=== Statement details ===&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;
! Spec shape&lt;br /&gt;
! Notes&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=status|type=CharField(100)|notes=&amp;lt;code&amp;gt;MedicationStatementStatus&amp;lt;/code&amp;gt; enum}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=reason|type=CharField(100)|notes=&amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=medication|type=JSONField (default=dict)|notes=&amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; bound to the &amp;lt;code&amp;gt;system-medication&amp;lt;/code&amp;gt; value set}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=information_source|type=CharField(100)|notes=&amp;lt;code&amp;gt;MedicationStatementInformationSourceType&amp;lt;/code&amp;gt; enum | &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=effective_period|type=JSONField (default=dict)|notes=&amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; | &amp;lt;code&amp;gt;None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=dosage_text|type=TextField|notes=&amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Statement details|name=note|type=TextField|notes=&amp;lt;code&amp;gt;str | None&amp;lt;/code&amp;gt;}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Relationships ===&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=MedicationStatement|section=Relationships|name=patient|type=FK → Patient|notes=&amp;lt;code&amp;gt;on_delete=CASCADE&amp;lt;/code&amp;gt;. The patient the statement is about. Derived server-side from the encounter — never accepted from clients.}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Relationships|name=encounter|type=FK → Encounter|notes=&amp;lt;code&amp;gt;on_delete=CASCADE&amp;lt;/code&amp;gt;. The encounter the statement was recorded in. Supplied as a UUID on create.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;patient   → FK Patient   (CASCADE)&lt;br /&gt;
encounter → FK Encounter (CASCADE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Deleting a patient or encounter deletes its medication statements.&lt;br /&gt;
&lt;br /&gt;
== Enum values ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;MedicationStatementStatus&amp;lt;/code&amp;gt; values ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MedicationStatementStatus(str, Enum)&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;spec.py&amp;lt;/code&amp;gt;, bound to &amp;lt;code&amp;gt;status&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;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;active&amp;lt;/code&amp;gt;&lt;br /&gt;
| The medication is being taken&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;on_hold&amp;lt;/code&amp;gt;&lt;br /&gt;
| Taking has been paused&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;completed&amp;lt;/code&amp;gt;&lt;br /&gt;
| The course has finished&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stopped&amp;lt;/code&amp;gt;&lt;br /&gt;
| The medication was stopped&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;unknown&amp;lt;/code&amp;gt;&lt;br /&gt;
| Status is not known&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;entered_in_error&amp;lt;/code&amp;gt;&lt;br /&gt;
| The record was entered in error&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;not_taken&amp;lt;/code&amp;gt;&lt;br /&gt;
| The patient is not taking the medication&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;intended&amp;lt;/code&amp;gt;&lt;br /&gt;
| The patient intends to take the medication&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;MedicationStatementInformationSourceType&amp;lt;/code&amp;gt; values ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MedicationStatementInformationSourceType(str, Enum)&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;spec.py&amp;lt;/code&amp;gt;, bound to &amp;lt;code&amp;gt;information_source&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;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;related_person&amp;lt;/code&amp;gt;&lt;br /&gt;
| A relative or related person reported it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;practitioner&amp;lt;/code&amp;gt;&lt;br /&gt;
| A clinician reported it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt;&lt;br /&gt;
| The patient self-reported it&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Nested JSON shapes ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; shape ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; is stored as JSON but typed as a single &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; (from &amp;lt;code&amp;gt;care/emr/resources/common/coding.py&amp;lt;/code&amp;gt;), not a &amp;lt;code&amp;gt;CodeableConcept&amp;lt;/code&amp;gt;. The spec sets &amp;lt;code&amp;gt;extra=&amp;amp;quot;forbid&amp;amp;quot;&amp;lt;/code&amp;gt;, so unrecognized keys are rejected.&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=MedicationStatement|section=Coding shape|name=system|type=str | None|notes=Code system URI (e.g. &amp;lt;code&amp;gt;http://snomed.info/sct&amp;lt;/code&amp;gt;)}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Coding shape|name=version|type=str | None|notes=Code-system version}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Coding shape|name=code|type=str|notes=Required. Validated against the bound value set}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=Coding shape|name=display|type=str | None|notes=Human-readable label}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Bound value set ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; is declared as &amp;lt;code&amp;gt;ValueSetBoundCoding[CARE_MEDICATION_VALUESET.slug]&amp;lt;/code&amp;gt;. On write, &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; is validated against the &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;system-medication&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; value set ([&amp;lt;nowiki/&amp;gt;https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/medication/valueset/medication.py &amp;lt;code&amp;gt;medication.py&amp;lt;/code&amp;gt;]), which includes SNOMED CT concepts under the constraint &amp;lt;code&amp;gt;&amp;amp;lt;&amp;amp;lt; 763158003 |Medicinal product|&amp;lt;/code&amp;gt;. Any code outside the set is rejected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The &amp;lt;code&amp;gt;care/emr/resources/medication/valueset/&amp;lt;/code&amp;gt; directory holds further value sets for other medication resources (route, body site, administration method, additional instruction, as-needed reason, medication-not-given reason). &amp;lt;code&amp;gt;MedicationStatement&amp;lt;/code&amp;gt; binds only &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;system-medication&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
=== &amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; shape ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt; is stored as JSON but typed as &amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; (from &amp;lt;code&amp;gt;care/emr/resources/base.py&amp;lt;/code&amp;gt;).&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=MedicationStatement|section=PeriodSpec shape|name=start|type=datetime | None|notes=Must be timezone-aware if present; naive datetimes are rejected}}&lt;br /&gt;
{{Field|model=MedicationStatement|section=PeriodSpec shape|name=end|type=datetime | None|notes=Must be timezone-aware if present}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;validate_period&amp;lt;/code&amp;gt; (mode &amp;lt;code&amp;gt;after&amp;lt;/code&amp;gt;) rejects a naive &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; and requires &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; to be no greater than &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Resource specs (API schema) ==&lt;br /&gt;
&lt;br /&gt;
Every spec subclasses &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) and &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; (pydantic → DB object). &amp;lt;code&amp;gt;__model__ = MedicationStatement&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; holds those two fields out of the generic field copy so the extra hooks set them instead.&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;BaseMedicationStatementSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| shared base&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dosage_text&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;information_source&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;MedicationStatementSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · create&lt;br /&gt;
| Inherits &amp;lt;code&amp;gt;BaseMedicationStatementSpec&amp;lt;/code&amp;gt;; adds &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; existence validation + extra deserialization&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MedicationStatementUpdateSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| write · update&lt;br /&gt;
| &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MedicationStatementReadSpec&amp;lt;/code&amp;gt;&lt;br /&gt;
| read · list &amp;amp;amp; detail&lt;br /&gt;
| Inherits base; adds &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;UserSpec&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;
&lt;br /&gt;
What the specs validate and maintain on your behalf:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; must exist&amp;#039;&amp;#039;&amp;#039; — &amp;lt;code&amp;gt;MedicationStatementSpec.validate_encounter_exists&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;field_validator&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt;, raises &amp;lt;code&amp;gt;&amp;amp;quot;Encounter not found&amp;amp;quot;&amp;lt;/code&amp;gt; unless an &amp;lt;code&amp;gt;Encounter&amp;lt;/code&amp;gt; with that &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; exists.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; is derived server-side&amp;#039;&amp;#039;&amp;#039; — &amp;lt;code&amp;gt;MedicationStatementSpec.perform_extra_deserialization&amp;lt;/code&amp;gt; runs only on create (&amp;lt;code&amp;gt;is_update&amp;lt;/code&amp;gt; false): it resolves the &amp;lt;code&amp;gt;Encounter&amp;lt;/code&amp;gt; from the supplied UUID and sets &amp;lt;code&amp;gt;obj.patient = obj.encounter.patient&amp;lt;/code&amp;gt;. Clients never send &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Updates are narrow&amp;#039;&amp;#039;&amp;#039; — &amp;lt;code&amp;gt;MedicationStatementUpdateSpec&amp;lt;/code&amp;gt; accepts only &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dosage_text&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;information_source&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; can&amp;#039;t be changed through it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Read serialization&amp;#039;&amp;#039;&amp;#039; — &amp;lt;code&amp;gt;MedicationStatementReadSpec.perform_extra_serialization&amp;lt;/code&amp;gt; sets &amp;lt;code&amp;gt;id = obj.external_id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;encounter = obj.encounter.external_id&amp;lt;/code&amp;gt;, and serializes audit users via &amp;lt;code&amp;gt;serialize_audit_users&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; as &amp;lt;code&amp;gt;UserSpec&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; value-set check&amp;#039;&amp;#039;&amp;#039; — runs at validation time against &amp;lt;code&amp;gt;Coding.code&amp;lt;/code&amp;gt; (see [[#bound-value-set|Bound value set]]).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt; tz-awareness and ordering&amp;#039;&amp;#039;&amp;#039; — enforced by &amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; (see [[#periodspec-shape|&amp;lt;code&amp;gt;PeriodSpec&amp;lt;/code&amp;gt; shape]]).&lt;br /&gt;
&lt;br /&gt;
There is no &amp;lt;code&amp;gt;status_history&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; is a single current value, not an appended log.&lt;br /&gt;
&lt;br /&gt;
== Methods &amp;amp;amp; save behaviour ==&lt;br /&gt;
&lt;br /&gt;
* From [[References/Base models &amp;amp;amp; conventions|&amp;lt;code&amp;gt;EMRBaseModel&amp;lt;/code&amp;gt;]]: &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (UUID), audit fields, soft delete. Deletes are soft — a removed statement stays in the table with &amp;lt;code&amp;gt;deleted=True&amp;lt;/code&amp;gt; and is hidden by the default manager.&lt;br /&gt;
* Create flow: client sends &amp;lt;code&amp;gt;MedicationStatementSpec&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;de_serialize&amp;lt;/code&amp;gt; copies scalar/JSON fields → &amp;lt;code&amp;gt;perform_extra_deserialization&amp;lt;/code&amp;gt; resolves &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; and back-fills &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; → model saved.&lt;br /&gt;
* Read flow: &amp;lt;code&amp;gt;MedicationStatementReadSpec.serialize(obj)&amp;lt;/code&amp;gt; copies fields, then &amp;lt;code&amp;gt;perform_extra_serialization&amp;lt;/code&amp;gt; injects &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; (as UUIDs), and audit users.&lt;br /&gt;
&lt;br /&gt;
== API integration notes ==&lt;br /&gt;
&lt;br /&gt;
* Exposed through Care&amp;#039;s REST API, aligned with FHIR &amp;lt;code&amp;gt;MedicationStatement&amp;lt;/code&amp;gt;. Use the spec field names above for payloads.&lt;br /&gt;
* &amp;lt;code&amp;gt;medication&amp;lt;/code&amp;gt; is a single SNOMED CT &amp;lt;code&amp;gt;Coding&amp;lt;/code&amp;gt; object whose &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt; must be in the &amp;lt;code&amp;gt;system-medication&amp;lt;/code&amp;gt; value set — not a free CodeableConcept, and not a scalar string.&lt;br /&gt;
* &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt; datetimes must be timezone-aware and ordered (&amp;lt;code&amp;gt;start ≤ end&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;code&amp;gt;encounter&amp;lt;/code&amp;gt; goes in as a UUID; &amp;lt;code&amp;gt;patient&amp;lt;/code&amp;gt; is derived from it server-side and must not be sent.&lt;br /&gt;
* Updates flow through &amp;lt;code&amp;gt;MedicationStatementUpdateSpec&amp;lt;/code&amp;gt; and can touch only &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;effective_period&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;information_source&amp;lt;/code&amp;gt; is what separates a self-reported or third-party statement from an actively managed prescription ([[References/Medication Request|&amp;lt;code&amp;gt;MedicationRequest&amp;lt;/code&amp;gt;]]).&lt;br /&gt;
* &amp;lt;code&amp;gt;external_id&amp;lt;/code&amp;gt; (UUID), &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;, &amp;lt;code&amp;gt;history&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; are platform-maintained — 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>