diff --git a/static/media/clinical/observation/chart-observations-over-time-1.png b/static/media/clinical/observation/chart-observations-over-time-1.png
new file mode 100644
index 00000000..390e6a6b
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-1.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-2.png b/static/media/clinical/observation/chart-observations-over-time-2.png
new file mode 100644
index 00000000..8fce9c14
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-2.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-3.png b/static/media/clinical/observation/chart-observations-over-time-3.png
new file mode 100644
index 00000000..0d8a9b96
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-3.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-4.png b/static/media/clinical/observation/chart-observations-over-time-4.png
new file mode 100644
index 00000000..aaad8ba7
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-4.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-5.png b/static/media/clinical/observation/chart-observations-over-time-5.png
new file mode 100644
index 00000000..205bc798
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-5.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-6.png b/static/media/clinical/observation/chart-observations-over-time-6.png
new file mode 100644
index 00000000..4a3f2fb7
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-6.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-7.png b/static/media/clinical/observation/chart-observations-over-time-7.png
new file mode 100644
index 00000000..6781a69f
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-7.png differ
diff --git a/static/media/clinical/observation/chart-observations-over-time-8.png b/static/media/clinical/observation/chart-observations-over-time-8.png
new file mode 100644
index 00000000..22c187c3
Binary files /dev/null and b/static/media/clinical/observation/chart-observations-over-time-8.png differ
diff --git a/static/media/clinical/observation/check-vital-signs-1.png b/static/media/clinical/observation/check-vital-signs-1.png
new file mode 100644
index 00000000..c7f96f50
Binary files /dev/null and b/static/media/clinical/observation/check-vital-signs-1.png differ
diff --git a/static/media/clinical/observation/check-vital-signs-2.png b/static/media/clinical/observation/check-vital-signs-2.png
new file mode 100644
index 00000000..849d13db
Binary files /dev/null and b/static/media/clinical/observation/check-vital-signs-2.png differ
diff --git a/static/media/clinical/observation/check-vital-signs-3.png b/static/media/clinical/observation/check-vital-signs-3.png
new file mode 100644
index 00000000..725c0819
Binary files /dev/null and b/static/media/clinical/observation/check-vital-signs-3.png differ
diff --git a/static/media/clinical/observation/check-vital-signs-4.png b/static/media/clinical/observation/check-vital-signs-4.png
new file mode 100644
index 00000000..9cce6313
Binary files /dev/null and b/static/media/clinical/observation/check-vital-signs-4.png differ
diff --git a/static/media/clinical/observation/check-vital-signs-5.png b/static/media/clinical/observation/check-vital-signs-5.png
new file mode 100644
index 00000000..f8010470
Binary files /dev/null and b/static/media/clinical/observation/check-vital-signs-5.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-1.png b/static/media/clinical/observation/correct-or-remove-a-test-result-1.png
new file mode 100644
index 00000000..7eb08c46
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-1.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-2.png b/static/media/clinical/observation/correct-or-remove-a-test-result-2.png
new file mode 100644
index 00000000..83d5e27f
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-2.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-3.png b/static/media/clinical/observation/correct-or-remove-a-test-result-3.png
new file mode 100644
index 00000000..4a2d32ee
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-3.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-4.png b/static/media/clinical/observation/correct-or-remove-a-test-result-4.png
new file mode 100644
index 00000000..21d8ad80
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-4.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-5.png b/static/media/clinical/observation/correct-or-remove-a-test-result-5.png
new file mode 100644
index 00000000..6387b838
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-5.png differ
diff --git a/static/media/clinical/observation/correct-or-remove-a-test-result-6.png b/static/media/clinical/observation/correct-or-remove-a-test-result-6.png
new file mode 100644
index 00000000..09b86725
Binary files /dev/null and b/static/media/clinical/observation/correct-or-remove-a-test-result-6.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-1.png b/static/media/clinical/observation/record-observations-with-a-form-1.png
new file mode 100644
index 00000000..c26bbfd4
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-1.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-2.png b/static/media/clinical/observation/record-observations-with-a-form-2.png
new file mode 100644
index 00000000..d63d6915
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-2.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-3.png b/static/media/clinical/observation/record-observations-with-a-form-3.png
new file mode 100644
index 00000000..2d2cfc01
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-3.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-4.png b/static/media/clinical/observation/record-observations-with-a-form-4.png
new file mode 100644
index 00000000..5a81afdf
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-4.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-5.png b/static/media/clinical/observation/record-observations-with-a-form-5.png
new file mode 100644
index 00000000..12662e1e
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-5.png differ
diff --git a/static/media/clinical/observation/record-observations-with-a-form-6.png b/static/media/clinical/observation/record-observations-with-a-form-6.png
new file mode 100644
index 00000000..3dc0da0f
Binary files /dev/null and b/static/media/clinical/observation/record-observations-with-a-form-6.png differ
diff --git a/static/media/clinical/observation/view-encounter-observations-1.png b/static/media/clinical/observation/view-encounter-observations-1.png
new file mode 100644
index 00000000..68e12612
Binary files /dev/null and b/static/media/clinical/observation/view-encounter-observations-1.png differ
diff --git a/static/media/clinical/observation/view-encounter-observations-2.png b/static/media/clinical/observation/view-encounter-observations-2.png
new file mode 100644
index 00000000..14a4441d
Binary files /dev/null and b/static/media/clinical/observation/view-encounter-observations-2.png differ
diff --git a/static/media/clinical/observation/view-encounter-observations-3.png b/static/media/clinical/observation/view-encounter-observations-3.png
new file mode 100644
index 00000000..94c1d8b2
Binary files /dev/null and b/static/media/clinical/observation/view-encounter-observations-3.png differ
diff --git a/static/media/clinical/observation/view-encounter-observations-4.png b/static/media/clinical/observation/view-encounter-observations-4.png
new file mode 100644
index 00000000..5f92ff28
Binary files /dev/null and b/static/media/clinical/observation/view-encounter-observations-4.png differ
diff --git a/versioned_docs/version-3.1/concepts/clinical/observation.mdx b/versioned_docs/version-3.1/concepts/clinical/observation.mdx
index 82fe9f3d..5bceb17b 100644
--- a/versioned_docs/version-3.1/concepts/clinical/observation.mdx
+++ b/versioned_docs/version-3.1/concepts/clinical/observation.mdx
@@ -4,64 +4,177 @@ sidebar_position: 5
# Observation
-An **observation** is a single recorded fact about a patient — a blood pressure of 120/80, a body temperature, a coded answer to a screening question. It is the smallest unit of clinical data in Care: the structured building block that, gathered over time, becomes a patient's chart.
+## Definition
-## What it represents
+An [observation](https://build.fhir.org/observation.html) in Care is one recorded result about a patient: a value or a coded answer for one code, at one point in time.
-In Care's FHIR-aligned model, an observation maps to the **Observation** resource. Each one captures:
+Each observation belongs to one patient and one encounter. Care records observations from the answers to questionnaires and from the test results of diagnostic reports.
-- **What was observed** — a coded concept, typically a LOINC code, that names the thing, such as "systolic blood pressure" or "body temperature"
-- **The result** — the value itself: a number, a piece of text, a yes/no, or a coded answer, with a unit where one applies
-- **Context** — the patient it belongs to, the encounter it was recorded in, when it was effective, and who recorded it
-- **Clinical qualifiers** — optional detail such as the body site, the collection method, a reference range, and an interpretation of high, low, or normal
+A trend, such as a temperature chart, is many observations of one code read together.
-An observation is a snapshot, not a running tally. It records one fact at one point in time. A trend — a patient's temperature over a week — is many observations read together, never a single record that gets updated in place.
+## Key Attributes
-## How it is captured
+| Components | What it captures |
+| --- | --- |
+| Code | What was observed. Screens show the display name of the code as the name of the observation. |
+| Value | The result: a number, a quantity, text, a date or a time, a yes or no answer, or a choice from a list. |
+| Unit | The unit of the value. For an answer to a questionnaire, it is the unit set on the question. Care keeps that unit even if you pick another one in the questionnaire. For a test result, it is the unit of the observation definition. |
+| Components | The parts of a result that has several parts, each with its own code and value. |
+| Note | A note. Care copies it from the answer to the questionnaire. You cannot enter a note with a test result. |
+| Time | The time Care records for the observation: the moment the questionnaire was submitted, or the moment the results of the report were last saved. |
+| Entered by | The user who submitted the questionnaire. Care does not record this user for a test result. |
+| Status | Final or Entered in Error. |
+| Patient and encounter | The patient and the encounter that the observation belongs to. |
+| Reference range and interpretation | For a test result that is linked to an observation definition, the reference range and an interpretation such as Normal or Abnormal. |
-Observations are rarely entered field by field. Most are produced as a side effect of submitting a [questionnaire](../definitions/questionnaire.mdx): each answer on the form becomes an observation, and that observation keeps a link back to the questionnaire response that produced it. This is also why every observation carries both a *value* and a *value type* — the value type tells any reader how to interpret what the form captured, whether it was a number, a date, a yes/no, or a coded choice.
+### Codes
-Care strongly prefers **structured, coded** observations over free text. Downstream safety logic — allergy checks, medication interactions, alerting — reads coded values, so a temperature stored as a number with a LOINC code is far more useful than the same reading typed into a note.
+Each observation has a code that names what was observed.
-## Status lifecycle
+For a question on a questionnaire, the code comes from the Observation value set, which holds all LOINC codes. A test result takes the code of its observation definition.
-An observation's `status` signals how much to trust the record:
+### Observations from a questionnaire
-```text
-final → amended
-final → entered_in_error
-```
+When you submit a questionnaire on an encounter, each answered question that has an observation code becomes an observation. The code is bound to the question when the questionnaire is designed, with **Search for observation codes**.
-- **final** — recorded, complete, and verified. Observations created from a questionnaire start here.
-- **amended** — was final, then corrected. The earlier value is superseded, but the change stays auditable.
-- **entered_in_error** — recorded by mistake; readers should disregard it. Care keeps the row rather than deleting it, so the audit trail stays intact.
+A question without a code, other than a group, does not become an observation. A questionnaire that is filled in for the patient, outside an encounter, records no observations: Care saves only its questionnaire response.
-## How it connects
+Each observation from a questionnaire starts as Final. Its time is the moment of the submission, and the user who submitted the questionnaire is recorded as the user who entered it.
-An observation rarely stands alone. It links to the primitives around it:
+Care copies the note of the answer into the observation. It does not store a body site, a method or a time taken for the answer.
-- **Patient** — every observation belongs to one [patient](../clinical/patient); this anchor is what makes it part of a chart.
-- **Encounter** — it is normally recorded within an [encounter](../clinical/encounter.mdx), tying the fact to a specific visit or admission.
-- **Observation definition** — an [observation definition](../definitions/observation-definition.mdx) can act as the template, supplying expected codes, units, and reference ranges.
-- **Diagnostic report** — lab and imaging results are observations grouped under a [diagnostic report](../clinical/diagnostic-report.mdx).
-- **Other observations** — observations can nest. A panel such as a blood-pressure reading is a grouping observation whose components each carry their own code and value.
+If an answer holds more than one value, the observation keeps only the last value.
+
+You open a questionnaire from **Forms** on the **Overview** tab of the encounter, or from the **Questionnaire** group of **Encounter Actions**.
+
+### Test results
+
+You enter test results on the page of a service request, in a diagnostic report for that request. Each result is a value for one observation definition, and Care saves it as one observation.
+
+The observation takes its code and its unit from the observation definition. You enter only the value, or one value for each component.
+
+Test results are the only observations that Care links to an observation definition. They are also the only observations that get a reference range and an interpretation.
+
+You can change the test results of a report until you select **Approve Results**, which sets the report to Final. The service request must be **Draft** or **Active**.
+
+Care can also store an observation that is recorded on its own, without a questionnaire or a diagnostic report. No screen in Care records an observation this way.
+
+### Groups and components
+
+For an ordinary group of questions, each answered question in the group that has a code becomes its own observation. Care also records an observation for the group, with no value, and links the observations of the questions to it.
+
+Care keeps the observation for the group only if at least one question in the group became an observation.
+
+For a group that is set up as components, Care records one observation for the group, with no value of its own. The answers with a code are stored as components inside it, not as separate observations. A blood pressure panel is an example.
+
+An observation definition can have components too. A test result for that definition then has one value for each component. Each component whose code matches a component of the definition gets its own reference range and interpretation.
+
+### Reference range and interpretation
+
+Care works out the reference range and the interpretation of a test result from the ranges set on its observation definition. These ranges can depend on the age, gender or tags of the patient, and on the class or tags of the encounter.
+
+The reference range holds all the ranges of the matching rule, each with its own interpretation. The interpretation of the result comes from the range that the value falls in, or from the coded value, for example Normal, Critical or Abnormal.
+
+Observations from a questionnaire never get a reference range or an interpretation. So the **Vitals** panel shows a normal range, and flags such as **Above normal range**, only for vital signs entered as test results.
+
+A diagnostic report shows its results in a table with a **Reference Range** column and, when a result has one, an **Interpretation** column.
+
+### How it connects
+
+- Patient: every observation belongs to one [patient](./patient).
+- Encounter: every observation belongs to one [encounter](./encounter.mdx).
+- Questionnaire response: an observation from a [questionnaire](../definitions/questionnaire.mdx) links to the [questionnaire response](./questionnaire-response.mdx) of that submission. When the response is marked entered in error, its observations are marked too.
+- Diagnostic report: a test result belongs to one [diagnostic report](./diagnostic-report.mdx), and the report answers one [service request](./service-request.mdx).
+- Observation definition: a test result links to its [observation definition](../definitions/observation-definition.mdx), which gives it its code, its unit and the ranges for its reference range.
+
+### Where Care shows observations
+
+Care shows the observations of an encounter in these places:
+
+- The **Vitals** panel on the **Overview** tab shows the standard vital signs recorded at the latest four times, newest first. It appears once the encounter has a vital sign observation.
+- The **Observations** tab lists the observations of the encounter by date, newest first. Each entry shows the value, the note and, except for a test result, the user who filed it.
+- The **Observations** tab leaves out the observations for groups, so a component group and the answers inside it are not listed there. For a choice answer, or a test result made of components, the tab shows no value.
+- The **Plots** tab draws charts, grouped in chart sets. Each chart has the tabs **Graph**, **Recent Data** and **Full History**.
+
+On a default installation, the chart sets are Primary Parameters, ABG Analysis, Respiratory Support, Nutrition and Dialysis. The team that runs your deployment can set its own chart configuration, so your chart sets can be different.
+
+The **Vitals** panel takes the names of its rows from the Primary Parameters chart set. It leaves out a vital sign that this chart set does not chart.
+
+The history panel shows the observations of one code, or of a group of codes, over time, in the tabs **Plots** and **Table**. It opens from the **Observations** tab, the **Plots** tab, the **Vitals** panel and the **Diagnostic Reports** tab.
+
+The history panel can show the current encounter only, or all encounters of the patient. All encounters need "Can view clinical data about patients" through a role on the patient. See [Chart observations over time](../../flows/clinical/observation/chart-observations-over-time.mdx).
+
+### Status
+
+| Status | Description |
+| --- | --- |
+| Final | The observation is recorded. Observations from a questionnaire and test results start as Final, and a corrected test result stays Final. |
+| Entered in Error | The observation is marked as recorded in error. Care keeps the observation and its value. |
+
+The list of statuses in Care also has amended, but nothing in Care sets an observation to amended.
+
+The **Vitals** panel, the **Graph** and **Recent Data** tabs of a chart, and the history panel leave out observations that are entered in error. Diagnostic reports leave them out of their results too. The **Observations** tab and the **Full History** tab of a chart still list them, with no marker.
+
+You cannot change an observation from a questionnaire. You can only mark the whole questionnaire response as entered in error. Care then marks every observation from that response as entered in error.
+
+By default, you can mark a response as entered in error for 120 minutes after its submission. The team that runs your deployment can change this time limit. The encounter must be open. See [Mark a response as entered in error](../../flows/clinical/questionnaire-response/mark-a-response-as-entered-in-error.mdx).
+
+Only test results can be corrected, and only until **Approve Results**. You can change the value of a test result, or remove it. Care marks a removed test result as entered in error, and **View Observation History** on the report lists it. See [Correct or remove a test result](../../flows/clinical/observation/correct-or-remove-a-test-result.mdx).
## Permissions
-Observations are exposed through a read-only API, so the viewset only gates reading. Access is governed by clinical-data permissions: a reader is allowed if they hold the patient-level `can_view_clinical_data` permission, or, when querying a specific encounter, the encounter-level `can_read_encounter_clinical_data` permission. Observations are recorded as a side effect of submitting questionnaires, so creating them is gated by those questionnaire flows rather than by this viewset.
+When you work with observations, Care checks permissions for patients, encounters, questionnaires and diagnostic reports, and for the records that a diagnostic report uses. What you can do also depends on where you hold the role that gives each permission.
+
+A permission that you hold in the encounter is one that you hold in any of these places:
+
+- A department of the encounter, or a parent department of one.
+- The facility's root department "Administration", which Care creates with every facility.
+- A department of the current location of the encounter.
+
+A role on the patient is a role that you hold in any of these places:
+
+- A department of an open encounter of the patient, or of the current location of that encounter.
+- A geographic organization of the patient.
+- A direct link between you and the patient.
+
+An encounter is closed when its status is **Completed**, **Cancelled**, **Discontinued** or **Entered in error**.
| Permission | Description | System Roles |
| --- | --- | --- |
-| `can_view_clinical_data` | View clinical data about a patient, including their observations | Staff, Doctor, Nurse, Admin, Facility Admin |
-| `can_read_encounter_clinical_data` | Read clinical data recorded within a specific encounter; used as the encounter-scoped fallback when reading observations | Admin, Doctor, Nurse, Facility Admin |
+| Can view clinical data about patients | See the observations of the patient: the **Vitals** panel, the **Observations** and **Plots** tabs, and the history panel. Hold it through a role on the patient. With it, the history panel also shows the other encounters of the patient, and an open encounter shows **Forms**. | Staff, Doctor, Nurse, Facility Admin |
+| Can Read encounter related clinical data | See the observations of one encounter in the same places. Hold it in the encounter. This permission does not depend on the status of the encounter. If this is your only view permission, the history panel shows only that encounter. With it, an open encounter also shows **Forms**. | Doctor, Nurse, Facility Admin |
+| Can Read Questionnaires | See a questionnaire in the **Forms** list and open it. Hold it in a department that the questionnaire is shared with, or in a parent department of one. The facility's root department "Administration" also counts, and so does an organization that the questionnaire is shared with. | Doctor, Nurse, Administrator, Staff, Facility Admin, Volunteer, Pharmacist. In an organization that the questionnaire is shared with: the Admin, Manager and Member roles of a role organization. |
+| Can submit questionnaire about patient encounters | Submit a questionnaire on an encounter, which records its observations. Also mark a questionnaire response of the encounter as entered in error, which marks its observations too, within the time limit. Hold it in the encounter. The encounter must be open. To open a response, you also need one of the two view permissions above. | Staff, Doctor, Nurse, Facility Admin |
+| Can Create Diagnostic Report on Facility | Create a diagnostic report, enter, correct and remove its test results, and approve them with **Approve Results**. Hold it in the encounter of the service request, or in a department of one of the locations of the service request. The status of the encounter does not matter. | Facility Admin, Doctor, Nurse |
+| Can Read Service Request | Open the page of the service request where you enter the test results. Hold it in the same places as "Can Create Diagnostic Report on Facility". | Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer, Pharmacist |
+| Can Read Diagnostic Report | Open the diagnostic report with its test results, and use **View Observation History**. Hold it in the same places as "Can Create Diagnostic Report on Facility". | Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer |
+| Can Read Activity Definition | Load the activity definition of the service request, which sets the test results that the report asks for. Hold it in any department of the facility. | Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer |
+| Can Read Observation Definition | Look up the observation definition when you add a new test result, and search for one with **Add observation**. Hold it in any department of the facility. | Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer, Pharmacist |
+
+The System Roles column lists the default roles. Your deployment can change which roles hold each permission.
+
+The permission definitions also name an Admin role. Roles are matched by name, and the only role named Admin in the database is for role organizations, which the facility screens do not offer. The lists above leave it out. The Admin in the "Can Read Questionnaires" row is that role of a role organization.
+
+Staff does not hold "Can Read encounter related clinical data", so a Staff user sees observations only through a role on the patient.
-Roles are granted through a user's organization, facility, or patient memberships, and permissions cascade down the organization tree — so access to a patient's observations follows from access to the patient.
+If that role comes from a department, it ends when every encounter of the patient in that department is closed. Then the Staff user no longer sees the observations. A role from a geographic organization of the patient, or from a direct link, does not depend on encounters.
+
+The page of the service request does not check your permission before it shows **Save Results** and **Approve Results**. Without "Can Create Diagnostic Report on Facility", Care refuses the save with "You do not have permission to write this diagnostic report".
## Related
-- Reference: [Observation (technical)](../../references/clinical/observation.mdx)
-- Concept: [Observation Definition](../definitions/observation-definition.mdx)
-- Concept: [Diagnostic Report](../clinical/diagnostic-report.mdx)
+- Flow: [Record observations with a form](../../flows/clinical/observation/record-observations-with-a-form.mdx)
+- Flow: [Check a patient's vital signs](../../flows/clinical/observation/check-vital-signs.mdx)
+- Flow: [View the observations of an encounter](../../flows/clinical/observation/view-encounter-observations.mdx)
+- Flow: [Chart observations over time](../../flows/clinical/observation/chart-observations-over-time.mdx)
+- Flow: [Correct or remove a test result](../../flows/clinical/observation/correct-or-remove-a-test-result.mdx)
+- Flow: [Mark a response as entered in error](../../flows/clinical/questionnaire-response/mark-a-response-as-entered-in-error.mdx)
+- Flow: [Enter diagnostic report results](../../flows/clinical/diagnostic-report/enter-diagnostic-report-results.mdx)
- Concept: [Questionnaire](../definitions/questionnaire.mdx)
-- Concept: [Encounter](../clinical/encounter.mdx)
-- Concept: [Patient](../clinical/patient)
+- Concept: [Questionnaire Response](./questionnaire-response.mdx)
+- Concept: [Observation Definition](../definitions/observation-definition.mdx)
+- Concept: [Diagnostic Report](./diagnostic-report.mdx)
+- Concept: [Service Request](./service-request.mdx)
+- Concept: [Encounter](./encounter.mdx)
+- Concept: [Patient](./patient)
+- Reference: [Observation (technical)](../../references/clinical/observation.mdx)
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/_category_.json b/versioned_docs/version-3.1/flows/clinical/observation/_category_.json
new file mode 100644
index 00000000..8a0538f6
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/_category_.json
@@ -0,0 +1,5 @@
+{
+ "label": "Observation",
+ "position": 13,
+ "key": "clinical-observation-flows"
+}
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/chart-observations-over-time.mdx b/versioned_docs/version-3.1/flows/clinical/observation/chart-observations-over-time.mdx
new file mode 100644
index 00000000..bed2c197
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/chart-observations-over-time.mdx
@@ -0,0 +1,217 @@
+---
+sidebar_position: 4
+---
+
+# Chart observations over time
+
+## Overview
+
+This flow describes how to follow a patient's [observations](../../../concepts/clinical/observation.mdx) over time in an [encounter](../../../concepts/clinical/encounter.mdx) in Care, on the **Plots** tab and in the history panel. The history panel shows observations as a chart and a table, for this encounter or all encounters of the patient.
+
+
+
+## Pre-requisites
+
+- Observations are recorded in the encounter. The charts plot only values that are numbers.
+- You have the permissions listed below.
+
+## Permissions
+
+| Permission | Access |
+| --- | --- |
+| Can view clinical data about patients | Lets you see the **Plots** tab, its charts and the history panel. In the history panel, it also lets you see the observations of all the patient's encounters. You must hold it through a role on the patient. By default, the Staff, Doctor, Nurse and Facility Admin roles hold it. |
+| Can Read encounter related clinical data | Lets you see the **Plots** tab and the history panel for this encounter only, without a role on the patient. You must hold it in the encounter. By default, the Doctor, Nurse and Facility Admin roles hold it. |
+
+You need one of the two permissions to see the **Plots** tab and the history panel. To see the observations of all encounters, you need "Can view clinical data about patients" through a role on the patient.
+
+You have a role on the patient when you have a role in one of these places:
+
+- A department of an open encounter of the patient, or a department of that encounter's current location.
+- A geographic organization of the patient.
+- The patient itself, when someone gave you a role directly on the patient.
+
+A closed encounter gives no role on the patient. An encounter is closed when its status is **Completed**, **Cancelled**, **Discontinued** or **Entered in error**.
+
+You hold a permission in the encounter when you have a role in a department of the encounter. These are the departments the encounter is assigned to, their parent departments, the facility's root department "Administration", and the departments of the encounter's current location.
+
+What this means for the default roles:
+
+- A Doctor, Nurse or Facility Admin role in a department of the encounter is enough for the charts and the history panel. This is true whatever the status of the encounter.
+- On an open encounter, that role also gives you a role on the patient, so the history panel can show all encounters. If the encounter is closed and that role is your only link to the patient, the history panel shows only this encounter.
+- The Staff role holds only the permission on the patient. On an open encounter, a Staff role in a department of the encounter is enough, and the history panel can show all encounters.
+- On a closed encounter, the Staff role sees the charts only through another role on the patient. Examples are a role in a department of another open encounter of the patient, or a direct role on the patient.
+
+## Steps
+
+### 1. Open the Plots tab
+
+Open the patient's encounter.
+
+Open the **Plots** tab in one of these ways:
+
+- Select the **Plots** tab.
+- Press `g`, then `p`.
+- Select **Encounter Actions**, or press `Shift+E`. Under **Go to**, select **Plots**.
+
+A workspace of your deployment can hide the **Plots** tab.
+
+
+
+### 2. Select a chart set
+
+The **Plots** tab has one sub-tab for each chart set. The first chart set opens by default.
+
+Select the sub-tab of the chart set that you want to see.
+
+On a default installation, the chart sets are Primary Parameters, ABG Analysis, Respiratory Support, Nutrition and Dialysis.
+
+Your deployment can set up other chart sets, so the sub-tabs that you see can be different.
+
+On a default installation, Primary Parameters has these charts:
+
+- Blood Pressure
+- Pulse
+- Temperature
+- GRBS
+- Body height
+- Body weight
+- Respiratory Rate
+- SpO2
+- FiO2
+- Girth
+
+
+
+### 3. Read a chart
+
+Each chart has three tabs. The chart opens on **Graph**.
+
+| Tab | What it shows |
+| --- | --- |
+| **Graph** | One line for each code of the chart, with time along the horizontal axis. Only values that are numbers are plotted. |
+| **Recent Data** | A table of the recent values, with the columns "Time", "Values", "Entered By" and "Notes". |
+| **Full History** | All the values of the chart's codes in this encounter, with the columns **Time**, **Code**, **Value**, **Entered by** and **Notes**. It loads 30 values at a time. |
+
+Select **Recent Data** or **Full History** to see the values as a table.
+
+**Graph** and **Recent Data** show up to 10 observations of each code in this encounter. These are the observations entered or changed most recently. Both tabs leave out observations marked as entered in error.
+
+**Full History** can include observations marked as entered in error, and it shows no marker for them.
+
+A row of **Recent Data** can hold values of several codes, but it shows only one name under "Entered By". To see who entered each value, use **Full History**.
+
+The info icon next to the title of a chart lists the codes that the chart uses.
+
+
+
+
+
+### 4. Open the history panel
+
+Select the title of a chart. Care opens the history panel for the codes of that chart.
+
+You can also open the history panel from these places:
+
+- On the **Observations** tab, select an entry. See [View the observations of an encounter](./view-encounter-observations.mdx).
+- On the **Overview** tab, in the **Vitals** panel, select **All readings** or the name of a vital sign. See [Check a patient's vital signs](./check-vital-signs.mdx).
+- On the **Diagnostic Reports** tab, select the name of a test in the results. See [View a diagnostic report](../diagnostic-report/view-a-diagnostic-report.mdx).
+
+Under its title, the history panel shows **Current Encounter** or **All Encounters**. It also shows the count, for example "12 recordings".
+
+The history panel leaves out observations marked as entered in error.
+
+
+
+### 5. Choose the encounters to show
+
+With "Can view clinical data about patients" through a role on the patient, the panel opens on all encounters. It also shows the **Show current encounter recordings** checkbox.
+
+Select **Show current encounter recordings** to show only the observations of this encounter.
+
+Clear **Show current encounter recordings** to show the observations of all the patient's encounters again.
+
+If you do not hold that permission through a role on the patient, the panel has no checkbox. It shows only the observations of this encounter.
+
+
+
+### 6. Read the Plots tab of the history panel
+
+The history panel opens on its **Plots** tab.
+
+The tab draws one line chart for each code.
+
+If one code was recorded in more than one unit, the tab draws one chart for each unit. The unit is added to the chart heading.
+
+For an observation with components, such as a blood pressure panel, each component is shown under its own code.
+
+The tab plots only values that are numbers. If a code has no such values, its chart shows **No plottable values**.
+
+Point at a value in the chart to see its details. These are the value and unit, the date and time, the user who entered it, and the note.
+
+Scroll the chart to the left to load older values.
+
+Select **Newest** to go back to the newest value.
+
+When all values are loaded, the last value has the label **Latest**.
+
+
+
+### 7. Read the Table tab of the history panel
+
+Select the **Table** tab of the history panel.
+
+The tab has the heading **Observation History** and the count, for example "Showing all 12 recordings".
+
+The table has one row for each code. The first column is **Component**.
+
+Each other column is one time, newest first. The newest column stays in view when you scroll.
+
+A column heading shows **Today** or the day and month, and the time.
+
+Each cell shows the value and its unit. A "-" means that the code has no value at that time.
+
+A choice answer shows the text of the chosen answer.
+
+
+
+## Expected Outcome
+
+- You see the charts of the chosen chart set for this encounter.
+- In the history panel, you see one or more observations over time, as a chart and as a table.
+- With "Can view clinical data about patients" through a role on the patient, the history panel can show all encounters.
+
+If you see one of these situations, use this table.
+
+| If you see | What it means | What to do |
+| --- | --- | --- |
+| **No data available** on every chart of a chart set | The encounter has no values for these codes, or Care could not load the chart set. The charts show the same message in both cases. | Open **Full History**, or select the title of a chart to open the history panel. These load the values separately. |
+| **No data available** in the history panel | The encounters shown have no values for these codes. | If the panel shows the checkbox, clear **Show current encounter recordings** to include all encounters. |
+| "Could not load this clinical information. Try again." in the history panel | Care could not load the values. | Select **Try Again**. |
+| **No plottable values** | The code has values, but none of them is a number. | Select the **Table** tab of the history panel to see the values. |
+| **No plots configured** | Your deployment has no chart sets set up. | Ask the team that runs your deployment. |
+| The **Plots** tab keeps showing the loading indicator | Care shows it while the chart configuration loads. Care also shows it when the configuration could not load. | Ask the team that runs your deployment to check its chart configuration. |
+| The encounter has no **Plots** tab | You hold neither permission listed above in the right place, or your deployment hides the tab. | Ask the person who manages user roles in your facility, or the team that runs your deployment. |
+
+## Related
+
+Concepts:
+
+- [Observation](../../../concepts/clinical/observation.mdx)
+- [Encounter](../../../concepts/clinical/encounter.mdx)
+
+Flows:
+
+- [Check a patient's vital signs](./check-vital-signs.mdx)
+- [View the observations of an encounter](./view-encounter-observations.mdx)
+- [Record observations with a form](./record-observations-with-a-form.mdx)
+- [Correct or remove a test result](./correct-or-remove-a-test-result.mdx)
+- [View a diagnostic report](../diagnostic-report/view-a-diagnostic-report.mdx)
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/check-vital-signs.mdx b/versioned_docs/version-3.1/flows/clinical/observation/check-vital-signs.mdx
new file mode 100644
index 00000000..2ec7492c
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/check-vital-signs.mdx
@@ -0,0 +1,162 @@
+---
+sidebar_position: 2
+---
+
+# Check a patient's vital signs
+
+## Overview
+
+This flow describes how to check a patient's latest vital signs in Care, on the **Vitals** panel of the encounter's **Overview** tab. Each value in the panel is an [observation](../../../concepts/clinical/observation.mdx) recorded in the [encounter](../../../concepts/clinical/encounter.mdx).
+
+
+
+## Pre-requisites
+
+- At least one vital sign is recorded in the encounter. If none is recorded, the **Overview** tab does not show the **Vitals** panel. To record vital signs, see [Record observations with a form](./record-observations-with-a-form.mdx).
+- You have the permissions listed below.
+
+## Permissions
+
+| Permission | Access |
+| --- | --- |
+| Can view clinical data about patients | Lets you see the **Vitals** panel and its values. You must hold it through a role on the patient. By default, the Staff, Doctor, Nurse and Facility Admin roles hold it. |
+| Can Read encounter related clinical data | Lets you see the **Vitals** panel of this encounter without a role on the patient. You must hold it in the encounter. By default, the Doctor, Nurse and Facility Admin roles hold it. |
+
+You need one of the two permissions, not both.
+
+You have a role on the patient when you have a role in one of these places:
+
+- A department of an open encounter of the patient, or a department of that encounter's current location.
+- A geographic organization of the patient.
+- The patient itself, when someone gave you a role directly on the patient.
+
+A closed encounter gives no role on the patient. An encounter is closed when its status is **Completed**, **Cancelled**, **Discontinued** or **Entered in error**.
+
+You hold a permission in the encounter when you have a role in a department of the encounter. These are the departments the encounter is assigned to, their parent departments, the facility's root department "Administration", and the departments of the encounter's current location.
+
+What this means for the default roles:
+
+- A Doctor, Nurse or Facility Admin role in a department of the encounter is enough, whatever the status of the encounter.
+- The Staff role holds only the permission on the patient. On an open encounter, a Staff role in a department of the encounter is enough.
+- On a closed encounter, the Staff role sees the panel only through another role on the patient. Examples are a role in a department of another open encounter of the patient, or a direct role on the patient.
+
+## Steps
+
+### 1. Open the Vitals panel
+
+Open the patient's encounter.
+
+If the encounter shows another tab, select the **Overview** tab.
+
+Find the **Vitals** panel on the **Overview** tab.
+
+A workspace of your deployment can give the panel another title. It can also give the panel its own list of observation codes.
+
+
+
+### 2. Read the latest values
+
+Read the values in the table of the **Vitals** panel.
+
+Each row is a vital sign. Each column is a time when vital signs were recorded, to the minute.
+
+The panel shows the four latest times, newest first. The newest column is marked.
+
+The first column of each day shows **Today**, **Yesterday** or the day and month, followed by the time. The other columns of that day show only the time.
+
+A "-" means that the vital sign has no value at that time.
+
+The line above the table names the user who entered the newest value. It reads, for example, "Latest 4 readings · last entered by" and a name.
+
+By default, the panel has a row for each of these vital signs, in this order. On a default installation, the rows carry the names in quotes.
+
+- Systolic blood pressure ("Systolic")
+- Diastolic blood pressure ("Diastolic")
+- Heart rate ("Pulse")
+- Body temperature ("Temperature")
+- Respiratory rate ("Respiratory Rate")
+- Oxygen saturation ("SpO2")
+
+The row names come from the Primary Parameters chart set of your deployment's chart configuration. If that chart set does not chart a vital sign, the panel leaves out its row.
+
+The panel leaves out observations marked as entered in error.
+
+
+
+### 3. Check the normal range and the flags
+
+Check the range next to the name of each vital sign.
+
+Next to the name of a vital sign, the panel shows the normal range and unit of its newest value.
+
+The panel flags a value when the interpretation of that value is marked to be highlighted. The flag depends on the interpretation code:
+
+| Flag | When the panel shows it |
+| --- | --- |
+| **Above normal range** | The interpretation code starts with H (high). |
+| **Below normal range** | The interpretation code starts with L (low). |
+| **Abnormal** | The interpretation is highlighted and its code starts with another letter or is empty. |
+
+Only a test result entered on a diagnostic report can have a normal range and an interpretation. Care computes them from the test's [observation definition](../../../concepts/definitions/observation-definition.mdx) when the result is saved.
+
+A vital sign recorded with a questionnaire has no normal range and no interpretation. Its row shows no range, and its values are never flagged.
+
+
+
+### 4. Show only the flagged vital signs
+
+If at least one value in the panel is flagged, the panel shows the **Abnormal only** switch.
+
+Turn on **Abnormal only** to show only the rows with a flagged value.
+
+### 5. Open the history of a vital sign
+
+To see the history of all the vital signs in the panel, select **All readings**.
+
+To see the history of one vital sign, select its name.
+
+Care opens the history panel. To read it, see [Chart observations over time](./chart-observations-over-time.mdx).
+
+
+
+
+
+## Expected Outcome
+
+- You see the vital signs of the encounter at up to four times, newest first.
+- Where the newest value of a vital sign has a normal range, the row shows it with the unit.
+- Flagged values show **Above normal range**, **Below normal range** or **Abnormal**.
+- You can open the history panel of one vital sign or of all of them.
+
+If you see one of these situations, use this table.
+
+| If you see | What it means | What to do |
+| --- | --- | --- |
+| The **Overview** tab has no **Vitals** panel | No vital sign is recorded in this encounter yet. | Record the vital signs. See [Record observations with a form](./record-observations-with-a-form.mdx). |
+| "You do not have permission to view clinical data for this encounter" on the **Overview** tab | You hold neither permission listed above in the right place. | Ask the person who manages user roles in your facility for one of the permissions listed above. |
+| "You do not have permission to view this encounter", and Care goes back | You can neither read the clinical data of this encounter nor read the encounter. | Ask the person who manages user roles in your facility for one of the permissions listed above. |
+| A vital sign has no normal range and no flag | The values were recorded with a questionnaire, or the test's definition gave them no range. | Compare the value with the normal range yourself. A missing flag does not mean that the value is normal. |
+
+## Related
+
+Concepts:
+
+- [Observation](../../../concepts/clinical/observation.mdx)
+- [Encounter](../../../concepts/clinical/encounter.mdx)
+- [Observation definition](../../../concepts/definitions/observation-definition.mdx)
+
+Flows:
+
+- [Record observations with a form](./record-observations-with-a-form.mdx)
+- [View the observations of an encounter](./view-encounter-observations.mdx)
+- [Chart observations over time](./chart-observations-over-time.mdx)
+- [Correct or remove a test result](./correct-or-remove-a-test-result.mdx)
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/correct-or-remove-a-test-result.mdx b/versioned_docs/version-3.1/flows/clinical/observation/correct-or-remove-a-test-result.mdx
new file mode 100644
index 00000000..ae626c03
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/correct-or-remove-a-test-result.mdx
@@ -0,0 +1,137 @@
+---
+sidebar_position: 5
+---
+
+# Correct or remove a test result
+
+## Overview
+
+This flow describes how to correct or remove a test result, an [observation](../../../concepts/clinical/observation.mdx) recorded on a [diagnostic report](../../../concepts/clinical/diagnostic-report.mdx). You can do this only until a user selects **Approve Results**; after that, the results cannot be changed on screen.
+
+
+
+## Pre-requisites
+
+- A user entered test results on a diagnostic report of a service request. See [Enter diagnostic report results](../diagnostic-report/enter-diagnostic-report-results.mdx).
+- The results are not approved yet: the report card shows the status **Preliminary**.
+- The status of the service request is **Draft** or **Active**.
+- You have the permissions listed below.
+
+## Permissions
+
+| Permission | Access |
+| --- | --- |
+| Can Create Diagnostic Report on Facility | Lets you save corrections and removals with **Save Results**. You must hold it in a department of the encounter of the service request, or of that encounter's current location. A department of one of the locations of the service request also counts. By default, Facility Admin, Doctor and Nurse hold it. |
+| Can Read Service Request | Lets you open the service request page. You must hold it in the same departments as "Can Create Diagnostic Report on Facility". By default, Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer and Pharmacist hold it. |
+| Can Read Activity Definition | Lets the service request page load the activity definition of the service request. You can hold it in any department of the facility. By default, Facility Admin, Administrator, Staff, Doctor, Nurse and Volunteer hold it. |
+| Can Read Diagnostic Report | Lets you open the report card with its results, and the results marked as entered in error in **View Observation History**. You must hold it in the same departments as "Can Read Service Request". By default, Facility Admin, Administrator, Staff, Doctor, Nurse and Volunteer hold it. |
+
+While the report is **Preliminary**, Care shows **Save Results** to every user who can open the report card. If you do not hold "Can Create Diagnostic Report on Facility" in one of those departments, Care refuses the save. Care then shows the message "You do not have permission to write this diagnostic report".
+
+By default, this happens to Staff, Administrator and Volunteer: they can open the report but cannot save changes.
+
+## Steps
+
+### 1. Open the report card
+
+Open the service request page. See [View service requests](../service-request/view-service-requests.mdx).
+
+Under **Test Result Entries**, find the card of the report.
+
+If the card is collapsed, select its title to expand it.
+
+The card lists the tests that the service request asks for and the tests that have saved results.
+
+
+
+### 2. Correct a value
+
+In the box of the result, change the value.
+
+If the test has components, change the value in the box of that component.
+
+Note: If you clear the value of a saved result, Care does not send it, and the saved value stays. To take a result off the report, do step 3.
+
+
+
+### 3. Remove a result
+
+Beside the result, select the button with three vertical dots ("Result actions").
+
+Select **Remove observation**.
+
+- If the result is not saved yet, Care deletes the row.
+- If the result is saved, Care greys out the row and shows **Marked for deletion. Click save results to delete.**
+
+**Remove observation** is not available for the first unsaved row of a test that the service request asks for. It is also not available for a result that is already marked for deletion.
+
+Note: The **Conclusion** box keeps the saved conclusion of the report. If the service request asks for tests, you cannot remove every result while the report has a conclusion. Care then shows **Cannot add conclusion without results** and does not save.
+
+
+
+
+
+### 4. Save the changes
+
+Select **Save Results**.
+
+Care saves the corrections and the removals of the report in one save.
+
+Care shows **Test results saved successfully** and collapses the report card.
+
+
+
+### 5. Review the results marked as entered in error
+
+On the report card, select the button with three vertical dots in the header.
+
+Select **View Observation History**.
+
+Care lists the results of the report that are marked as entered in error. Each one has the badge **Entered in Error**.
+
+Each result in the list shows the information in the table below.
+
+| Component | What it shows |
+| --- | --- |
+| **Value** | The value of the result. |
+| **Modified Date** | The time when the removal was saved. |
+| **Interpretation** | The interpretation of the result. |
+| **Recorded by** | The user who last updated the result. |
+| **Components** | The values of the components, if the test has components. |
+| **Notes** | The note on the result. |
+
+If no result of the report is marked as entered in error, Care shows **No Deleted Observation**.
+
+
+
+## Expected Outcome
+
+- A corrected result shows the new value and keeps the status Final. Care replaces the saved value with the new value.
+- Each time a user selects **Save Results**, Care sets the time of every saved result that has a value to the moment of the save. This includes results that nobody changed.
+- A removed result has the status entered in error. Care leaves it out of the result editor, the review card and the report views.
+- The **Observations** tab of the encounter can still list a removed result. See [View the observations of an encounter](./view-encounter-observations.mdx).
+- **View Observation History** lists only the results marked as entered in error. A corrected result does not appear there.
+- After a user selects **Approve Results**, the report is Final, and its results cannot be changed on screen.
+
+## Related
+
+Concepts:
+
+- [Observation](../../../concepts/clinical/observation.mdx)
+- [Diagnostic Report](../../../concepts/clinical/diagnostic-report.mdx)
+
+Flows:
+
+- [Enter diagnostic report results](../diagnostic-report/enter-diagnostic-report-results.mdx)
+- [View a diagnostic report](../diagnostic-report/view-a-diagnostic-report.mdx)
+- [View service requests](../service-request/view-service-requests.mdx)
+- [View the observations of an encounter](./view-encounter-observations.mdx)
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/record-observations-with-a-form.mdx b/versioned_docs/version-3.1/flows/clinical/observation/record-observations-with-a-form.mdx
new file mode 100644
index 00000000..9624c02d
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/record-observations-with-a-form.mdx
@@ -0,0 +1,152 @@
+---
+sidebar_position: 1
+---
+
+# Record observations with a form
+
+## Overview
+
+This flow describes how to record [observations](../../../concepts/clinical/observation.mdx) for an encounter by filling a [questionnaire](../../../concepts/definitions/questionnaire.mdx). When you save, Care records observations of the encounter from your answers to coded questions.
+
+
+
+## Pre-requisites
+
+- The patient has an open [encounter](../../../concepts/clinical/encounter.mdx) in your facility. An encounter is closed when its status is **Completed**, **Cancelled**, **Discontinued** or **Entered in error**.
+- You open the encounter from your facility.
+- You work on the current encounter, not on a past encounter that you selected from the encounter history.
+- An active questionnaire for encounters is available at your facility. It is shared with your department or with a department below it, as described under Permissions.
+- Each question that must record an observation has an observation code. The code is added in the questionnaire builder with **Search for observation codes**. The builder is described in [Add and edit questions](../../definitions/questionnaire/add-and-edit-questions.mdx).
+- You have the permissions listed below.
+
+## Permissions
+
+| Permission | Access |
+| --- | --- |
+| Can submit questionnaire about patient encounters | Lets you save the answers, which records the observations. You need it in a department of the encounter. By default, Staff, Doctor, Nurse and Facility Admin hold it. |
+| Can Read Questionnaires | Lets you find and open the questionnaire. For your facility's questionnaires, you need it in a department that the questionnaire is shared with. A department above that one also counts, and so does the facility's root department "Administration". By default, Doctor, Nurse, Administrator, Staff, Facility Admin, Volunteer and Pharmacist hold it. |
+| Can view clinical data about patients | Lets you open the encounter, and shows **Forms**. You hold it through a role on the patient. A role in a department of the patient's open encounter counts. By default, Staff, Doctor, Nurse and Facility Admin hold it. |
+| Can Read encounter related clinical data | Gives the same access as "Can view clinical data about patients" when you hold it in a department of the encounter. By default, Doctor, Nurse and Facility Admin hold it. |
+
+Note: A department of the encounter is a department that the encounter belongs to, or a department above it. The facility's root department "Administration" and the departments of the encounter's current location also count.
+
+Note: These role lists are the defaults. Your deployment can change them.
+
+## Steps
+
+### 1. Open the encounter
+
+Open the patient's encounter from your facility.
+
+Go to the **Overview** tab.
+
+
+
+### 2. Open Forms
+
+In the quick actions on the **Overview** tab, select **Forms**. You can also press `f`.
+
+Care opens a list of questionnaires with the search box **Search Forms**.
+
+You can also start from **Encounter Actions**. Select **Encounter Actions**, or press `Shift+E`. In the **Questionnaire** group, select a questionnaire of your facility. Care opens the questionnaire, as in step 3. Then continue with step 4.
+
+
+
+### 3. Choose the questionnaire
+
+Find the questionnaire in the list. To search, type part of its title in **Search Forms**.
+
+Select the questionnaire. Care opens it.
+
+
+
+### 4. Answer the questions
+
+Answer the questions. A question with * after its text is required.
+
+If a question has a unit, the unit shows in brackets after the question.
+
+| Components | What it captures |
+| --- | --- |
+| Number box | A number. If the question takes whole numbers, Care removes the decimal part. |
+| Number box with **Unit** | A quantity: a number and a unit. The question's own unit is selected first. |
+| Unit buttons under the number box | The unit of a quantity, when the question offers only a few units. |
+
+Note: Care shows a quantity with the unit that is set on the question, even if you select another unit. If the question shows a unit in brackets, enter the number in that unit.
+
+
+
+### 5. Save the answers
+
+Select **Save Changes**.
+
+
+
+
+
+## Expected Outcome
+
+- Care shows "Questionnaire submitted successfully".
+- Care returns you to the **Overview** tab, or to the encounter tab where you started.
+- For each coded question that you answered, Care records one observation.
+- For a group of questions set up as components, Care records one observation for the whole group. The answers are stored inside it as components, not as observations of their own.
+- Each observation belongs to the encounter and links to the questionnaire response.
+- Each observation has the time when you saved, not a time that you enter. Care names you as the person who entered it.
+
+The observations then appear in these places:
+
+- The **Observations** tab lists the encounter's observations by date, with **filed by** and your name. A group set up as components, and the answers inside it, are not listed there. See [View the observations of an encounter](./view-encounter-observations.mdx).
+- For an answer chosen from a list, the **Observations** tab shows no value. Select the entry. Then select the **Table** tab of the history panel to see the answer. See [Chart observations over time](./chart-observations-over-time.mdx).
+- If the question's code is a vital sign of the **Vitals** panel on the **Overview** tab, the observation appears there. Observations from a questionnaire show no normal range and no flag there. See [Check a patient's vital signs](./check-vital-signs.mdx).
+- If a chart set of the **Plots** tab charts the question's code, the observation appears in that chart. The chart plots only numbers. See [Chart observations over time](./chart-observations-over-time.mdx).
+
+These answers do not become observations:
+
+- An answer to a question without an observation code.
+- Answers to a questionnaire about the patient rather than an encounter. Care saves the questionnaire response, but records no observations.
+
+To correct a mistake, use the questionnaire response. Care has no control to change or remove one observation that a questionnaire recorded.
+
+- Mark the whole questionnaire response as entered in error. See [Mark a response as entered in error](../questionnaire-response/mark-a-response-as-entered-in-error.mdx).
+- Do this within 120 minutes after you save the questionnaire. This is the default limit, and your deployment can set another.
+- You need "Can submit questionnaire about patient encounters", and the encounter must be open.
+- Care then marks every observation of that response as entered in error.
+
+After this, the **Vitals** panel, the history panel, and the **Graph** and **Recent Data** tabs of the charts leave out these observations. The **Observations** tab and the **Full History** tab of a chart still list them, with no marker.
+
+If you see one of these situations, use this table.
+
+| If you see | What it means | What to do |
+| --- | --- | --- |
+| **Forms** is not in the quick actions. | The encounter is closed, or you did not open the current encounter from your facility. Or you lack a permission listed above. | Open the current encounter from your facility. If **Forms** is still missing, ask the person who manages user roles in your facility for the permissions listed above. |
+| "You do not have permission to view this encounter" | You have no permission that opens this encounter. | Ask the person who manages user roles in your facility for "Can view clinical data about patients" or "Can Read encounter related clinical data". |
+| The questionnaire is not in the list. | The list shows at most 15 active questionnaires that are shared with you. | Type part of its title in **Search Forms**. If it is still missing, ask the person who manages questionnaires in your facility to share it with your department. |
+| "This field is required" | A required question has no answer. | Answer each question marked with *. Then select **Save Changes** again. |
+| "Nothing to submit yet — answer at least one question" | You did not answer any question. | Answer at least one question. Then select **Save Changes** again. |
+| "Failed to submit questionnaire" | The submission failed. Care marks the questions that it rejected. | Correct the marked answers. Check that the encounter is still open. Check that you have the permissions listed above. Then select **Save Changes** again. |
+
+## Related
+
+Concepts:
+
+- [Observation](../../../concepts/clinical/observation.mdx)
+- [Questionnaire](../../../concepts/definitions/questionnaire.mdx)
+- [Encounter](../../../concepts/clinical/encounter.mdx)
+
+Flows:
+
+- [Check a patient's vital signs](./check-vital-signs.mdx)
+- [View the observations of an encounter](./view-encounter-observations.mdx)
+- [Chart observations over time](./chart-observations-over-time.mdx)
+- [Correct or remove a test result](./correct-or-remove-a-test-result.mdx)
+- [Mark a response as entered in error](../questionnaire-response/mark-a-response-as-entered-in-error.mdx)
+- [Add and edit questions](../../definitions/questionnaire/add-and-edit-questions.mdx)
diff --git a/versioned_docs/version-3.1/flows/clinical/observation/view-encounter-observations.mdx b/versioned_docs/version-3.1/flows/clinical/observation/view-encounter-observations.mdx
new file mode 100644
index 00000000..e03b487a
--- /dev/null
+++ b/versioned_docs/version-3.1/flows/clinical/observation/view-encounter-observations.mdx
@@ -0,0 +1,142 @@
+---
+sidebar_position: 3
+---
+
+# View the observations of an encounter
+
+## Overview
+
+This flow describes how to see the [observations](../../../concepts/clinical/observation.mdx) recorded in an [encounter](../../../concepts/clinical/encounter.mdx) in Care, on the encounter's **Observations** tab. From an entry, you can open the history panel of that observation.
+
+
+
+## Pre-requisites
+
+- Observations are recorded in the encounter, with a questionnaire or as test results on a diagnostic report.
+- You have the permissions listed below.
+
+## Permissions
+
+| Permission | Access |
+| --- | --- |
+| Can view clinical data about patients | Lets you see the **Observations** tab and the observations of the encounter. You must hold it through a role on the patient. By default, the Staff, Doctor, Nurse and Facility Admin roles hold it. |
+| Can Read encounter related clinical data | Lets you see the **Observations** tab of this encounter without a role on the patient. You must hold it in the encounter. By default, the Doctor, Nurse and Facility Admin roles hold it. |
+
+You need one of the two permissions, not both.
+
+You have a role on the patient when you have a role in one of these places:
+
+- A department of an open encounter of the patient, or a department of that encounter's current location.
+- A geographic organization of the patient.
+- The patient itself, when someone gave you a role directly on the patient.
+
+A closed encounter gives no role on the patient. An encounter is closed when its status is **Completed**, **Cancelled**, **Discontinued** or **Entered in error**.
+
+You hold a permission in the encounter when you have a role in a department of the encounter. These are the departments the encounter is assigned to, their parent departments, the facility's root department "Administration", and the departments of the encounter's current location.
+
+What this means for the default roles:
+
+- A Doctor, Nurse or Facility Admin role in a department of the encounter is enough, whatever the status of the encounter.
+- The Staff role holds only the permission on the patient. On an open encounter, a Staff role in a department of the encounter is enough.
+- On a closed encounter, the Staff role sees the tab only through another role on the patient. Examples are a role in a department of another open encounter of the patient, or a direct role on the patient.
+
+## Steps
+
+### 1. Open the Observations tab
+
+Open the patient's encounter.
+
+Open the **Observations** tab in one of these ways:
+
+- Select the **Observations** tab.
+- Press `g`, then `o`.
+- Select **Encounter Actions**, or press `Shift+E`. Under **Go to**, select **Observations**.
+
+A workspace of your deployment can hide the **Observations** tab.
+
+
+
+### 2. Read the list
+
+The tab groups the observations by date, newest date first.
+
+A date heading shows the date. For today and yesterday, it shows "Today" or "Yesterday" followed by the date in brackets.
+
+Under each date, the newest observation comes first.
+
+Each entry shows these parts:
+
+| Part | What it shows |
+| --- | --- |
+| Time | The time of the observation. |
+| Value | The value of the observation. A choice answer, or a test result whose values are in components, shows no value in this list. |
+| Note | The note recorded with the observation, if there is one. |
+| Name | The name of the observation. If it has no name, the entry shows its code, or **Unknown**. |
+| **filed by** | The user who entered the observation. Test results entered on a diagnostic report show no **filed by** line. |
+
+The list leaves out group observations. For an ordinary group of questions, each answer inside the group is listed on its own.
+
+A group of questions set up as components is saved as one group observation, with its answers inside it. The list shows neither that group nor its answers.
+
+Note: The list can include observations marked as entered in error, and it shows no marker for them. The history panel, and the **Graph** and **Recent Data** tabs of the charts on the **Plots** tab, leave them out.
+
+
+
+### 3. Load more observations
+
+The tab loads 20 observations at a time.
+
+Scroll to the end of the list to load the next observations. While more observations exist, the end of the list shows **Load More**.
+
+
+
+### 4. Open the history of an observation
+
+Select an entry to open its history panel.
+
+If an observation has no code, its entry does not open.
+
+The history panel shows the observation over time, as a chart and as a table. To read it, see [Chart observations over time](./chart-observations-over-time.mdx).
+
+The tab has no other action on an observation. You cannot change or remove an observation from this tab.
+
+
+
+## Expected Outcome
+
+- You see the observations of the encounter, grouped by date, newest first.
+- You can open the history panel of each observation that has a code.
+
+If you see one of these situations, use this table.
+
+| If you see | What it means | What to do |
+| --- | --- | --- |
+| **No Observations** | The encounter has no observations to list. | To record observations, see [Record observations with a form](./record-observations-with-a-form.mdx). |
+| An entry shows no value | The observation is a choice answer, or a test result whose values are in components. | Select the entry. If it opens, select the **Table** tab of the history panel. The table shows the chosen answer, or each component under its own code. |
+| A test result is wrong | You cannot change it on this tab. | If the diagnostic report is not approved yet, see [Correct or remove a test result](./correct-or-remove-a-test-result.mdx). |
+| A questionnaire answer is wrong | You cannot change it on this tab. | Mark the whole questionnaire response as entered in error. Care then marks its observations too. By default, you can do this only within 120 minutes after the response was submitted. The encounter must also be open. See [Mark a response as entered in error](../questionnaire-response/mark-a-response-as-entered-in-error.mdx). |
+| The encounter has no **Observations** tab | You hold neither permission listed above in the right place, or your deployment hides the tab. | Ask the person who manages user roles in your facility, or the team that runs your deployment. |
+
+## Related
+
+Concepts:
+
+- [Observation](../../../concepts/clinical/observation.mdx)
+- [Encounter](../../../concepts/clinical/encounter.mdx)
+
+Flows:
+
+- [Record observations with a form](./record-observations-with-a-form.mdx)
+- [Check a patient's vital signs](./check-vital-signs.mdx)
+- [Chart observations over time](./chart-observations-over-time.mdx)
+- [Correct or remove a test result](./correct-or-remove-a-test-result.mdx)
+- [Mark a response as entered in error](../questionnaire-response/mark-a-response-as-entered-in-error.mdx)
diff --git a/versioned_docs/version-3.1/references/clinical/observation.mdx b/versioned_docs/version-3.1/references/clinical/observation.mdx
index 426917d6..5684093c 100644
--- a/versioned_docs/version-3.1/references/clinical/observation.mdx
+++ b/versioned_docs/version-3.1/references/clinical/observation.mdx
@@ -4,266 +4,534 @@ sidebar_position: 5
# Observation
-An `Observation` is one named, coded data point about a subject — almost always a patient: a blood pressure reading, a temperature, a coded answer captured through a questionnaire. `main_code` records *what* was observed (usually bound to LOINC) and `value` holds the result. You rarely create one by hand; most observations are materialized when a questionnaire is submitted.
+Technical reference for the `Observation` module in Care EMR. For the plain-language view, see the [Observation concept](../../concepts/clinical/observation.mdx).
**Source:**
+
- Model: [`care/emr/models/observation.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/models/observation.py)
-- Resource spec: [`care/emr/resources/observation/spec.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/spec.py)
-- Value sets: [`care/emr/resources/observation/valueset.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/valueset.py)
+- Specs: [`care/emr/resources/observation/spec.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/spec.py) · [`valueset.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/valueset.py)
+- Viewset: [`care/emr/api/viewsets/observation.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/api/viewsets/observation.py) · read and write checks in [`encounter_authz_base.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/api/viewsets/encounter_authz_base.py)
+- Other write paths: [`care/emr/resources/questionnaire/utils.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/questionnaire/utils.py) (questionnaire submission) · [`care/emr/api/viewsets/diagnostic_report.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/api/viewsets/diagnostic_report.py) (test results) · [`compute_observation_interpretation.py`](https://github.com/ohcnetwork/care/blob/develop/care/emr/utils/compute_observation_interpretation.py)
+
+An observation is one recorded result about a patient in an encounter: a value or a coded answer for one code at one effective time.
+
+The Django model is the storage layer. It keeps the codes, the value, the reference ranges, the interpretation and the components as JSON fields.
+
+The Pydantic resource specs give those fields their shape. They also define the enums, the bound value sets, and the separate read and write schemas.
-The model is just storage; several fields are opaque `JSONField`s. Their real structure lives in the Pydantic resource specs under `care/emr/resources/observation/`, which own the enums, nested JSON shapes, validation, and the read/write schema split. Each field row below gives the storage column first, then the shape the spec enforces on top of it.
+Three paths write observations: questionnaire submission, test results on a diagnostic report (`upsert_observations`), and direct create on the observation API. Each path sets different fields. See "Methods & save behaviour".
+
+The observation API has no update. A `DELETE` does not remove the record: it marks the observation entered in error.
## Models
| Model | Purpose |
| --- | --- |
-| `Observation` | A single coded measurement or finding about a patient, captured within an encounter |
+| `Observation` | One recorded result about a patient, linked to one encounter: a value or coded answer for one code at one effective time |
+
+`Observation` extends [`EMRBaseModel`](../foundation/base-model.mdx). Through it, each observation also has `history` and `meta` JSON fields and `created_by` / `updated_by` user links.
-`Observation` extends [`EMRBaseModel`](../foundation/base-model.mdx), the shared Care EMR base that supplies `external_id`, `created_date`/`modified_date`, soft-delete via `deleted`, `created_by`/`updated_by`, and `history`/`meta` JSON.
+The API identifies an observation by its `external_id`, which read responses return as `id`.
## `Observation` fields
-### Classification & coding
+### Status and grouping
+
+| Field | Storage | API and write paths |
+| --- | --- | --- |
+| `status` | `CharField(255)` | `ObservationStatus`. Required in the shared spec. Direct create accepts only `final`, which is also its default. Values and the paths that set them are listed under "Enum values" |
+| `is_group` | `BooleanField`, default `False` | No code sets it. A group observation is marked by `value_type` `group` instead |
+
+### Codes
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `status` | `CharField(255)` | Enum `ObservationStatus` — `final`, `amended`, `entered_in_error`. Required in specs. Questionnaire-sourced observations land as `final` |
-| `is_group` | `BooleanField` | Default `False`. `True` marks a grouping/panel observation that holds `component`/child observations instead of a single value. Not exposed in the resource specs |
-| `category` | `JSONField` (default `{}`) | Spec: optional `Coding { system?, version?, code, display? }`. FHIR observation category, derived from the questionnaire |
-| `main_code` | `JSONField` (default `{}`) | Spec: optional `Coding`. What is being observed, typically LOINC (`CARE_OBSERVATION_VALUSET`, system `http://loinc.org`) |
-| `alternate_coding` | `JSONField` (default `[]`) | Spec: optional `CodeableConcept { id?, coding?: Coding[], text }`. Same concept expressed in other code systems |
+| `main_code` | `JSONField`, default `{}` | `Coding`. Required on direct create, and not checked against a value set there. Questionnaire: the question's code, which must be in the "Observation" value set. Test results: the observation definition's code |
+| `category` | `JSONField`, default `{}` | `Coding`, optional on direct create. Questionnaires never set it, because a stored question has no category. Test results: the observation definition's category |
+| `alternate_coding` | `JSONField`, default `[]` | `CodeableConcept`, optional on direct create. The storage default is a list, while the spec type is one object |
-### Subject & context
+### Subject and context
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `subject_type` | `CharField(255)` | Enum `SubjectType` — `patient`, `encounter`. Spec defaults to `encounter` |
-| `subject_id` | `UUIDField` | The subject entity's id. Set server-side; not in the spec body |
-| `patient` | `FK → Patient` | `CASCADE`. Set server-side, not in the spec body |
-| `encounter` | `FK → Encounter` | `CASCADE`. Spec field is `UUID4 \| None`. Where the observation was recorded |
-| `effective_datetime` | `DateTimeField` | When the observation was effective. Nullable in storage, but the spec requires a tz-aware `datetime` on create; optional on update |
+| `subject_type` | `CharField(255)` | `SubjectType`, default `encounter` in the shared spec. Direct create and test results set `encounter`. Questionnaires set the questionnaire's subject type, and only submissions with an encounter store observations |
+| `subject_id` | `UUIDField` | Not in the create spec. Direct create: the encounter's ID. Questionnaire: the submission's resource ID, which the Care frontend sets to the encounter's ID |
+| `patient` | `FK → emr.Patient`, `CASCADE` | Set by Care: from the encounter (direct create), from the report (test results), or from the questionnaire submission |
+| `encounter` | `FK → emr.Encounter`, `CASCADE`, required | `UUID4`, required on direct create. The encounter must belong to the patient in the URL. Read responses return `null` |
+| `effective_datetime` | `DateTimeField`, nullable | Timezone-aware datetime, required on direct create. Optional in `ObservationUpdateSpec`. Questionnaire: the moment of submission. Test results from the Care frontend: the moment of saving |
-### Author & performer
+### Author and performer
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `data_entered_by` | `FK → users.User` | `CASCADE`, nullable. `related_name="observations_entered"`. Write specs accept `data_entered_by_id: int`; read specs serialize a nested `UserSpec` |
-| `performer` | `JSONField` (default `{}`) | Spec: optional `Performer { type: PerformerType (related_person\|user), id: str }`. Use it when the performer differs from the data-entry user |
+| `data_entered_by` | `FK → users.User`, `CASCADE`, nullable | Direct create rejects `data_entered_by_id` and records the signed-in user. Questionnaire: the submitting user. Test results: not set. Read responses include it as a user object when it is set |
+| `performer` | `JSONField`, default `{}` | `Performer`, optional on direct create |
### Value
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `value_type` | `CharField(255)` | Enum `QuestionType` (from the questionnaire module). Tells the client how to read `value` — see the table below. Required in specs |
-| `value` | `JSONField` | Spec: `QuestionnaireSubmitResultValue { value?: str, unit?: Coding, coding?: Coding }`. Required on create, optional on update. `value` holds the raw/string result, `unit` the quantity unit, `coding` the coded answer |
-| `note` | `TextField` | Spec: `str \| None`. Free-text note |
+| `value_type` | `CharField(255)` | `QuestionType`, required on direct create. Questionnaire: the question's type. Test results from the Care frontend: the definition's data type, or `decimal` when it has none |
+| `value` | `JSONField`, no default, not nullable | `QuestionnaireSubmitResultValue`, required on direct create. Optional in `ObservationUpdateSpec`. Shape and the way each path fills it are under "Nested JSON shapes" |
+| `note` | `TextField` | Optional on direct create. Questionnaires copy the note of the answer |
-### Clinical qualifiers
+### Qualifiers
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `body_site` | `JSONField` (default `{}`) | Spec: optional `Coding` bound to `CARE_BODY_SITE_VALUESET` (slug `system-body-site-observation`, SNOMED CT). FHIR `Observation.bodySite` |
-| `method` | `JSONField` (default `{}`) | Spec: optional `Coding` bound to `CARE_OBSERVATION_COLLECTION_METHOD` (slug `system-collection-method`, SNOMED CT). FHIR `Observation.method` |
-| `reference_range` | `JSONField` (default `[]`) | Spec: `ReferenceRange[]` (shape below), default `[]`. Reference ranges for the value, usually carried over from the observation definition |
-| `interpretation` | `JSONField` (default `{}`) | Spec: free `dict`, default `{}`. Coded interpretation against the reference range (high/low/normal). Normal/abnormal/critical value sets exist (below) but are not enforced on this dict |
-| `interpretation_old` | `CharField(255)` | Nullable. Legacy free-text interpretation, kept for backward compatibility. Not in the specs |
+| `body_site` | `JSONField`, default `{}` | `Coding` bound to the "Body Site" value set (`system-body-site-observation`), optional. Questionnaires never store it |
+| `method` | `JSONField`, default `{}` | `Coding` bound to the "Observation Method" value set (`system-collection-method`), optional. Questionnaires never store it |
-### Structure & relationships
+### Interpretation and ranges
-| Field | Storage type | Spec shape / notes |
+| Field | Storage | API and write paths |
| --- | --- | --- |
-| `parent` | `UUIDField` | Nullable. Spec: `UUID4 \| None` — the `external_id` of a parent observation, for nesting related observations |
-| `component` | `JSONField` (default `[]`) | Spec: `Component[]` (shape below), default `[]`. Sub-observations sharing this context but carrying their own codes and values (FHIR `Observation.component`) |
-| `questionnaire_response` | `FK → QuestionnaireResponse` | `CASCADE`, nullable. Spec field is `UUID4 \| None`. The submission that produced this observation |
-| `diagnostic_report` | `FK → DiagnosticReport` | `CASCADE`, nullable. The report this observation belongs to, if any. Not in the write specs |
-| `observation_definition` | `FK → ObservationDefinition` | `CASCADE`, nullable. The definition this observation templates from. Serialized as `BaseObservationDefinitionSpec` only in `ObservationRetrieveSpec` |
+| `reference_range` | `JSONField`, default `[]` | List of `ReferenceRange`. Not accepted on direct create. Test results linked to a definition: computed by Care. Questionnaire: never set |
+| `interpretation` | `JSONField`, default `{}` | A free object (`dict`, default `{}`) in the shared spec. Not accepted on direct create. Test results linked to a definition: computed by Care. Questionnaire: never set |
+| `interpretation_old` | `CharField(255)`, nullable | Legacy text column |
-## Enum & value-set reference
+### Structure and links
+
+| Field | Storage | API and write paths |
+| --- | --- | --- |
+| `parent` | `UUIDField`, nullable, not a foreign key | Optional `UUID4` in the shared spec. Rejected on direct create. Questionnaire: each child of an ordinary group points to the group observation |
+| `component` | `JSONField`, default `[]` | List of `Component`, default `[]`. Allowed on direct create. Questionnaire: filled from a component group. Test results: each matching component gets its own interpretation |
+| `questionnaire_response` | `FK → emr.QuestionnaireResponse`, `CASCADE`, nullable | Optional `UUID4` in the shared spec. Rejected on direct create. Set by questionnaire submission. Read responses return `null` |
+| `diagnostic_report` | `FK → emr.DiagnosticReport`, `CASCADE`, nullable | Rejected on direct create. Set by `upsert_observations` |
+| `observation_definition` | `FK → emr.ObservationDefinition`, `CASCADE`, nullable | Not accepted on direct create. Set by `upsert_observations` when the item names a definition. Retrieve returns it |
+
+## Enum values
### `ObservationStatus` values
-| Value | Meaning |
-| --- | --- |
-| `final` | Recorded, complete and verified. The default for questionnaire-sourced observations |
-| `amended` | Was `final`, then corrected |
-| `entered_in_error` | Recorded in error; disregard it |
+| Value | Label in the locale file | Set by |
+| --- | --- | --- |
+| `final` | **Final** | Direct create (the only value it accepts), questionnaire submission, and new test results created from a definition |
+| `amended` | None: the locale file has no key for it | No backend code sets it, and the Care frontend never sends it. An API client can store it by sending it to `upsert_observations` for an existing test result |
+| `entered_in_error` | **Entered in Error** | `DELETE` on a random observation, marking the questionnaire response entered in error, or `upsert_observations` |
-### `PerformerType` values (`performer.type`)
+### `QuestionType` values (`value_type`)
-| Value |
-| --- |
-| `related_person` |
-| `user` |
+`value_type` uses the question types of the questionnaire module.
+
+| Value | Label in the locale file |
+| --- | --- |
+| `group` | **Group** |
+| `boolean` | **Boolean** |
+| `decimal` | **Decimal** |
+| `integer` | **Integer** |
+| `string` | **String** |
+| `text` | **Text** |
+| `display` | **Display** |
+| `date` | **Date** |
+| `dateTime` | **Date Time** |
+| `time` | **Time** |
+| `choice` | **Choice** |
+| `url` | **URL** |
+| `quantity` | **Quantity** |
+| `structured` | **Structured** |
+
+- `ignore_group=true` on the list leaves out observations with `value_type` `group`.
+- For test results, the Care frontend sends the observation definition's data type as `value_type`, and `decimal` when the definition has none.
### `SubjectType` values (`subject_type`)
| Value |
| --- |
| `patient` |
-| `encounter` (spec default) |
-
-### `QuestionType` values (`value_type`)
+| `encounter`: the shared spec default, and the value that direct create and test results set |
+| `referral` |
+| `location` |
+| `device` |
+| `facility` |
-From the questionnaire module. The value tells the client which key of `value` to read.
+### `PerformerType` values (`performer.type`)
-| Value | Value sourced from `QuestionnaireSubmitResultValue` |
-| --- | --- |
-| `group` | grouping node (no direct value) |
-| `boolean` | `value` (`"true"`/`"false"`) |
-| `decimal` | `value` |
-| `integer` | `value` |
-| `string` | `value` |
-| `text` | `value` |
-| `display` | display-only |
-| `date` | `value` |
-| `dateTime` | `value` |
-| `time` | `value` |
-| `choice` | `coding` |
-| `url` | `value` |
-| `quantity` | `value` + `unit` |
-| `structured` | structured payload |
-
-### Bound value sets
-
-Coded fields validate against registered Care value sets. A `body_site` or `method` coding outside its value set is rejected during deserialization.
-
-| Field | Value set | Slug | System(s) |
-| --- | --- | --- | --- |
-| `main_code` | `CARE_OBSERVATION_VALUSET` | `system-observation` | `http://loinc.org` |
-| `body_site` | `CARE_BODY_SITE_VALUESET` | `system-body-site-observation` | `http://snomed.info/sct` (curated concept list + descendants of `442083009`) |
-| `method` | `CARE_OBSERVATION_COLLECTION_METHOD` | `system-collection-method` | `http://snomed.info/sct` (descendants of `272394005`, `129264002`, `386053000`) |
+| Value |
+| --- |
+| `related_person` |
+| `user` |
-These interpretation value sets are registered for the frontend and observation definitions, but are not enforced on the `interpretation` dict:
+### Value sets
-| Value set | Slug | Concepts (system `http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation`) |
-| --- | --- | --- |
-| Normal | `system-normal-coded-valueset` | `N` Normal, `ND` Not detected, `NEG` Negative |
-| Abnormal | `system-abnormal-coded-valueset` | `A` Abnormal, `AA` Critically abnormal, `H` High, `HH` Critically high, `L` Low, `LL` Critically low, `POS` Positive, `DET` Detected |
-| Critical | `system-critical-coded-valueset` | `C` Critical, `CC` Critical high, `CL` Critical low, `CV` Critical value |
-| UCUM units | `system-ucum-units` | `http://unitsofmeasure.org` (all UCUM units) |
+| Name | Slug | Content | Used by |
+| --- | --- | --- | --- |
+| Observation | `system-observation` | All LOINC codes (`http://loinc.org`) | The code of a questionnaire question, and so the `main_code` of questionnaire observations |
+| Body Site | `system-body-site-observation` | SNOMED CT concepts that are a `442083009` | `body_site` |
+| Observation Method | `system-collection-method` | SNOMED CT descendants of `272394005`, `129264002` and `386053000` | `method` |
+| UCUM Units | `system-ucum-units` | All UCUM units (`http://unitsofmeasure.org`) | The unit of a questionnaire question |
+| Normal Coded Value Set | `system-normal-coded-valueset` | HL7 interpretation codes `N` Normal, `ND` Not detected, `NEG` Negative | Defined in the observation module |
+| Critical Coded Value Set | `system-critical-coded-valueset` | `C` Critical, `CC` Critical high, `CL` Critical low, `CV` Critical value | Defined in the observation module |
+| Abnormal Coded Value Set | `system-abnormal-coded-valueset` | `A`, `AA`, `H`, `HH`, `L`, `LL`, `POS`, `DET` | Defined in the observation module |
-## Nested JSON shapes (from the spec)
+- A `body_site` or `method` code outside its value set is rejected with "Code does not exist in the valueset".
+- On direct create, `main_code` is a plain `Coding`. Care does not check it against a value set.
-The structures behind the model's `JSONField`s.
+## Nested JSON shapes
### `Coding`
+`main_code`, `category`, `body_site`, `method`, `value.unit`, `value.coding` and `component[].code` are codings. Care rejects any key that is not listed.
+
```text
Coding {
- system: str | null # e.g. http://loinc.org
+ system: str | null
version: str | null
- code: str # required
+ code: str required
display: str | null
-} # extra keys forbidden
+}
```
-### `CodeableConcept` (`alternate_coding`)
+`code` has no minimum length, so an empty code (`""`) is accepted.
+
+### `alternate_coding`: `CodeableConcept`
+
+The `text` key must be present, but it may be `null`. Care rejects any key that is not listed.
```text
CodeableConcept {
id: str | null
coding: Coding[] | null
- text: str | null # field present, required key
-} # extra keys forbidden
+ text: str | null key required
+}
```
-### `QuestionnaireSubmitResultValue` (`value`)
+### `value`: `QuestionnaireSubmitResultValue`
+
+All three parts are optional. `value` is text, `unit` is the coding of a quantity's unit, and `coding` is the coding of a coded answer.
```text
QuestionnaireSubmitResultValue {
- value: str | null # raw/string value
- unit: Coding | null # for quantity values
- coding: Coding | null # for coded values
+ value: str | null
+ unit: Coding | null
+ coding: Coding | null
}
```
-### `Performer` (`performer`)
+How each write path fills `value`:
+
+- Questionnaire, choice answer with a coding: `coding` holds the answer's coding.
+- Questionnaire, quantity answer with a coding: `unit` is the question's unit, `value` the entered number, and `coding` the answer's coding.
+- The Care frontend sends the unit picked in the questionnaire as the answer's coding. So the picked unit is kept only in `value.coding`, and `value.unit` is always the question's unit.
+- Questionnaire, any other answer: `value` holds the entered value, plus the question's `unit` when the question has one.
+- Questionnaire, group: an empty object.
+- Questionnaire, answer with several values: one observation, with the last value only.
+- Test results from the Care frontend: the unit is the observation definition's unit.
+
+### `performer`: `Performer`
```text
Performer {
- type: PerformerType # related_person | user
+ type: PerformerType related_person | user
id: str
}
```
-### `ReferenceRange` (`reference_range[]`)
+A performer has a `type` and an `id`.
+
+### `reference_range[]`: `ReferenceRange`
+
+The spec types a reference range as follows.
```text
ReferenceRange {
min: float | null
max: float | null
unit: str | null
- interpretation: str # required
+ interpretation: str required
value: str | null
}
```
-### `Component` (`component[]`)
+The reference ranges that Care computes for test results are the numeric ranges of the matching qualified range. Each stored entry therefore carries an interpretation object, not text.
+
+### `interpretation`: computed interpretation object
+
+The shared spec types `interpretation` as a free object. The interpretation that Care computes from an observation definition has this shape.
+
+```text
+Interpretation {
+ display: str required
+ icon: optional
+ color: optional
+ highlight: bool | null default false
+ code: optional
+}
+```
+
+The built-in coded interpretations are `{"display": "Normal"}`, `{"display": "Critical"}` and `{"display": "Abnormal"}`.
+
+### `component[]`: `Component`
```text
Component {
- value: QuestionnaireSubmitResultValue # required
- interpretation: str | dict = {}
- reference_range: ReferenceRange[] = []
- code: Coding | null = null
- note: str = ""
+ value: QuestionnaireSubmitResultValue required
+ interpretation: str | dict default {}
+ reference_range: ReferenceRange[] default []
+ code: Coding | null default null
+ note: str default ""
}
```
+The spec defines a component as above. A questionnaire component holds the sub-question's code, value and note.
+
+## Related models
+
+`Observation` links to other models as follows. `parent` points to another observation and is not a foreign key. Deleting the patient row deletes its observations (`CASCADE`).
+
+```text
+Observation
+ patient → FK emr.Patient (CASCADE)
+ encounter → FK emr.Encounter (CASCADE, required)
+ data_entered_by → FK users.User (CASCADE, nullable)
+ questionnaire_response → FK emr.QuestionnaireResponse (CASCADE, nullable)
+ diagnostic_report → FK emr.DiagnosticReport (CASCADE, nullable)
+ observation_definition → FK emr.ObservationDefinition (CASCADE, nullable)
+ parent → UUIDField: id of another Observation (not a foreign key)
+```
+
+Observations about locations, devices and facilities are a separate model, `FacilityResourceObservation`, tied to a facility. This page does not cover it.
+
## Resource specs (API schema)
-The Pydantic specs build on [`EMRResource`](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/base.py), which provides `serialize` / `de_serialize` and the `perform_extra_serialization` / `perform_extra_deserialization` hooks. Every concrete spec inherits from `BaseObservationSpec`.
+`ObservationCreateSpec` extends `EMRResource` directly. `ObservationUpdateSpec`, `ObservationSpec` and `ObservationReadSpec` extend the shared `BaseObservationSpec`, and `ObservationRetrieveSpec` extends `ObservationReadSpec`.
| Spec | Role | Notes |
| --- | --- | --- |
-| `BaseObservationSpec` | shared base | Defines the common fields: `id`, `status`, `category`, `main_code`, `alternate_coding`, `subject_type`, `encounter`, `effective_datetime`, `performer`, `value_type`, `value`, `note`, `body_site` (bound), `method` (bound), `reference_range`, `interpretation`, `parent`, `questionnaire_response`, `component` |
-| `ObservationSpec` | write · create | Adds `data_entered_by_id`, `created_by_id`, `updated_by_id` (all `int`). Used internally when materializing observations from a questionnaire submission |
-| `ObservationUpdateSpec` | write · update | The base, but `effective_datetime` and `value` relax to optional (`None`) for partial updates |
-| `ObservationReadSpec` | read · list | Swaps the user IDs for nested `created_by` / `updated_by` / `data_entered_by` `UserSpec` objects |
-| `ObservationRetrieveSpec` | read · detail | Extends `ObservationReadSpec` and additionally serializes `observation_definition` via `BaseObservationDefinitionSpec` when it is set |
+| `BaseObservationSpec` | shared base | `status` required. `subject_type` default `encounter`. `body_site` and `method` bound to value sets. `interpretation` a free object, default `{}`. `parent` and `questionnaire_response` optional UUIDs. `component` default `[]` |
+| `ObservationCreateSpec` | write · create (`POST`) | "An observation entered independently of a questionnaire or diagnostic report". Rejects any field it does not list |
+| `ObservationUpdateSpec` | write · `upsert_observations` | The shared spec with `effective_datetime` and `value` optional. `status` stays required |
+| `ObservationSpec` | internal · questionnaire submission | Adds `data_entered_by_id`, `created_by_id` and `updated_by_id`, and keeps the observation ID generated during submission |
+| `ObservationReadSpec` | read · list | Adds `is_random`, `created_by`, `updated_by` and `data_entered_by` |
+| `ObservationRetrieveSpec` | read · detail | Extends the read spec with `observation_definition`, when one is linked |
-### Server-side behaviour
+### Create: `ObservationCreateSpec`
-- `ObservationSpec.perform_extra_deserialization` (create/update): sets `obj.external_id = self.id`, copies `data_entered_by_id`, `created_by_id`, `updated_by_id` onto the model, drops `data_entered_by_id` from `meta`, and on **create** (`is_update` is false) clears `obj.id` so a new row is inserted.
-- `ObservationReadSpec.perform_extra_serialization`: maps `id` from `external_id`; deliberately blanks `encounter`, `patient`, and `questionnaire_response` to `None` in the output to avoid extra DB queries; resolves the audit users (`created_by`, `updated_by`) and `data_entered_by` from cache (`model_from_cache`).
-- `ObservationRetrieveSpec.perform_extra_serialization`: calls the parent, then inlines the full `observation_definition` when the FK is set.
-- `body_site` / `method` are `ValueSetBoundCoding[...]`: the supplied `Coding` is validated against its bound value set during deserialization and rejected if the code is not a member.
-- `de_serialize` only writes fields present in the model's column mapping. Non-default values are persisted (`model_dump(exclude_defaults=True)`), and unknown spec-only fields would land in `meta` when `__store_metadata__` is set — which, by default, it is not for observations.
+The body of `POST /api/v1/patient/{patient_id}/observation/`.
-## Related models
+```text
+{
+ "encounter": UUID, required
+ "status": "final", optional; default "final"; no other value
+ "main_code": Coding, required; not bound to a value set
+ "effective_datetime": datetime with timezone, required
+ "value_type": QuestionType, required
+ "value": QuestionnaireSubmitResultValue, required
+ "category": Coding | null, optional
+ "alternate_coding": CodeableConcept, optional
+ "performer": Performer, optional
+ "note": str, optional
+ "body_site": Coding in system-body-site-observation, optional
+ "method": Coding in system-collection-method, optional
+ "component": Component[], optional; default []
+}
+```
+
+- Any other field is rejected with HTTP 400. This includes `id`, `questionnaire_response`, `diagnostic_report`, `parent`, `created_by_id`, `data_entered_by_id`, `is_random` and `meta`.
+- The create spec has no `reference_range`, `interpretation` or `observation_definition`.
+- Care takes the patient from the encounter, sets `subject_type` to `encounter`, and sets `subject_id` to the encounter's ID.
+- Care sets `data_entered_by`, `created_by` and `updated_by` to the signed-in user.
+- The response is the full saved observation.
+
+### Read: `ObservationReadSpec` and `ObservationRetrieveSpec`
+
+- `id` is the observation's `external_id`.
+- `is_random` tells whether the observation was entered on its own, not through a questionnaire or a diagnostic report.
+- `created_by` and `updated_by` are user objects. `data_entered_by` is a user object when it is set.
+- `encounter` and `questionnaire_response` are always `null` in read responses, to avoid extra queries.
+- Retrieve also returns the linked observation definition as `observation_definition`.
+
+### Deserialization
+
+Generic deserialization never writes a foreign key, `id` or `external_id` from a request body. Care sets those fields itself on each path.
+
+## Methods & save behaviour
+
+### `is_random`
+
+`is_random` is a model property. It is true when the observation has neither a questionnaire response nor a diagnostic report. Only random observations can be marked entered in error with `DELETE`.
+
+### Write path 1: questionnaire submission
+
+Questionnaire answers are submitted with `POST /api/v1/questionnaire/{questionnaire_id}/submit/`. Care builds the observations with the internal `ObservationSpec`.
+
+- Observations are stored only when the submission has an encounter. A patient questionnaire saves the questionnaire response and no observations.
+- A question that is not a group produces an observation only if the question has a code.
+- Each observation has status `final` and takes `value_type` from the question type.
+- `main_code` is the question's code. A stored question has no `category` key, so questionnaire observations have no category.
+- `effective_datetime` is the moment of submission. A time taken on the answer is not stored.
+- The note of the answer is copied. Body site and method are not stored.
+- `subject_type` is the questionnaire's subject type. The submitting user is recorded as `data_entered_by`, `created_by` and `updated_by`.
+- Each observation is linked to the questionnaire response, the patient and the encounter. `subject_id` is the submission's resource ID.
+- No observation definition, reference range or interpretation is set.
+- A group question gives a group observation: `value_type` `group`, an empty `value`, and the submission time.
+- In an ordinary group, each answer inside gives a separate observation whose `parent` is the group observation's ID. Care keeps the group observation only if it has at least one child.
+- A group marked as component gives one observation, with the answers as its components. A repeating group gives one such observation per repetition.
+- Marking the questionnaire response entered in error marks every observation created from it entered in error.
+
+### Write path 2: test results on a diagnostic report (`upsert_observations`)
+
+Results are written with `POST /api/v1/patient/{patient_id}/diagnostic_report/{id}/upsert_observations/`. It creates observations from an observation definition or from scratch, or updates existing ones.
+
+Each item has an `observation` body (`ObservationUpdateSpec`, `status` required). It also names an observation definition by slug (`observation_definition`), an existing observation (`observation_id`), or neither for a new observation.
+
+- The call is refused on a final report: "Cannot update observations for a final diagnostic report".
+- After that check, Care runs the diagnostic-report write check. It does not check the encounter's status or the service request's status.
+- With a definition slug, Care looks up the definition in the report's facility and links it to the new observation. The new observation starts as `final`, with the definition's category and code.
+- With `observation_id`, the observation must belong to that report. The fields sent, `status` included, overwrite the stored ones.
+- So this path can set an existing observation to `amended` or `entered_in_error`.
+- Every observation saved here gets the report's encounter and patient, the report link, and `subject_type` `encounter`. Care sets `updated_by`; it does not set `data_entered_by`.
+- When the observation is linked to a definition, Care computes its interpretation and reference ranges before saving. See "Interpretation and reference ranges" below.
+- `ObservationUpdateSpec` makes `value` optional, but the `value` column has no default and is not nullable.
+- Opening the report returns all its observations in any status, `entered_in_error` included, each with its definition.
+
+The Care frontend sends each result with status `final`, or `entered_in_error` when the user removes it. It never sends `amended`. It sends the moment of saving as `effective_datetime`.
+
+Each **Save Results** sends every saved result of the report again, changed or not. So each one gets the new save time as its effective time.
+
+### Write path 3: direct create
+
+`POST /api/v1/patient/{patient_id}/observation/` creates an observation from `ObservationCreateSpec`. See "Create: `ObservationCreateSpec`" above for the body and the fields that Care sets.
+
+No screen of the Care frontend creates an observation directly or sends `DELETE`. Its observation API has only list, analyse and `upsert_observations`.
+
+### Interpretation and reference ranges
-`Observation` is self-contained; it expresses relationships through foreign keys rather than secondary tables.
+Care computes these only for test results linked to an observation definition. Questionnaire observations and direct creates get none.
+
+- Care evaluates the definition's qualified ranges in the context of the observation's patient and encounter.
+- The result sets `interpretation` and `reference_range`. When nothing matches, Care clears both.
+- Care uses the first qualified range whose conditions all hold. Conditions can test Patient Age, Patient Gender, Patient Tag, Encounter Class and Encounter Tag.
+- Numeric value: it must be between `min` and `max`, both included; a missing bound is open. Care uses the matching range's interpretation and stores all the rule's ranges as the reference range.
+- A coded value against numeric ranges raises "Coding not supported".
+- Coded value: Care checks the coding against the rule's normal, then critical, then abnormal value set, which give "Normal", "Critical" or "Abnormal". Then it checks each custom value set interpretation.
+- If no range or value set matches, Care uses the rule's default interpretation when it has one.
+- Each component whose code matches a component of the definition gets its own interpretation and reference ranges.
+
+### Marking entered in error
+
+- `DELETE` sets `status` to `entered_in_error` and records the user as `updated_by`. It does not remove or soft-delete the observation.
+- The value, the author and the data-entry user stay. Repeating the request still returns HTTP 204.
+- Only random observations can be marked this way. Others fail with "Only random observations can be marked as entered in error".
+- Questionnaire observations: mark the questionnaire response entered in error, which marks all its observations. By default this is possible for 120 minutes after the response is created.
+- Test results: send the observation with status `entered_in_error` to `upsert_observations`.
+- The observation API has no hard delete and no update.
+
+## API integration notes
+
+### Routes
+
+All routes are under `/api/v1/`. Observation routes are nested under the patient. Every request needs a signed-in user.
+
+| Action | Method and path | Body | Response |
+| --- | --- | --- | --- |
+| List | `GET /api/v1/patient/{patient_id}/observation/` | None | `count` and `results` |
+| Retrieve | `GET /api/v1/patient/{patient_id}/observation/{id}/` | None | The observation, with its observation definition when one is linked |
+| Create | `POST /api/v1/patient/{patient_id}/observation/` | `ObservationCreateSpec` | The saved observation |
+| Update | `PUT` or `PATCH /api/v1/patient/{patient_id}/observation/{id}/` | None | HTTP 405 |
+| Mark entered in error | `DELETE /api/v1/patient/{patient_id}/observation/{id}/` | None | HTTP 204, no body |
+| Analyse | `POST /api/v1/patient/{patient_id}/observation/analyse/` | `codes`, `page_size` | `results`: one entry per code |
+| Test results | `POST /api/v1/patient/{patient_id}/diagnostic_report/{id}/upsert_observations/` | Items as described above | See "Write path 2" |
+| Questionnaire submission | `POST /api/v1/questionnaire/{questionnaire_id}/submit/` | The questionnaire answers | See "Write path 1" |
+
+`{id}` is the observation's `id` as read responses return it.
+
+### List filters, ordering and pages
+
+| Query parameter | Effect |
+| --- | --- |
+| `encounter` | Encounter external ID. Returns only that encounter's observations. Without patient-level access, the list needs it (see "Authorization") |
+| `codes` | Comma-separated codes. Matches the code of `main_code`, not its system. An empty value applies no filter |
+| `ignore_group` | `true` leaves out observations whose `value_type` is `group` |
+| `status` | Comma-separated statuses. Without it, the list returns every status, `entered_in_error` included |
+| `limit` | Records per page: 14 by default, at most 200 |
+| `offset` | Records to skip |
+
+- The list has no ordering parameter and no date-range filter.
+- Results are always the most recently modified first, and only for the patient in the URL.
+
+### `analyse`
+
+`analyse` returns the most recently modified observations of several codes in one call.
```text
-patient → FK Patient (CASCADE)
-encounter → FK Encounter (CASCADE)
-data_entered_by → FK users.User (CASCADE, nullable)
-questionnaire_response → FK QuestionnaireResponse (CASCADE, nullable)
-diagnostic_report → FK DiagnosticReport (CASCADE, nullable)
-observation_definition → FK ObservationDefinition (CASCADE, nullable)
+POST /api/v1/patient/{patient_id}/observation/analyse/
+{
+ "codes": Coding[], 1 to 20 codings
+ "page_size": int default 10, at most 30
+}
```
-`parent` is the exception: a soft, UUID-based self-reference to another observation's `external_id`, not a Django FK. It lets observations nest without a database constraint.
+- For each coding, Care returns up to `page_size` of the patient's most recently modified observations with that code and system.
+- The list's query filters apply first: `encounter`, `status`, `codes` and `ignore_group`.
+- The response has `results`, a list with one entry for each requested code. Each entry has the `code` and its `results`.
-## API integration notes
+### Authorization
+
+The table uses these terms.
+
+- "Closed encounter": the encounter's status is `completed`, `cancelled`, `entered_in_error` or `discontinued`.
+- "A role on the patient": a role in a facility organization of an open encounter of the patient, or of its current location. It can also come from the patient's geographic organizations, or a direct patient–user association.
+- "An organization of the encounter": one of the encounter's facility organizations (its departments), or an organization of its current location.
+- The encounter's facility organizations include the organizations it is assigned to, their parents, and the facility's root organization "Administration".
+- Where the "Held where" column names organizations, the user must hold a role that carries the permission in one of them.
+
+| Action | Permission (display name, slug) | Held where | Conditions and refusal |
+| --- | --- | --- | --- |
+| Retrieve | "Can view clinical data about patients" (`can_view_clinical_data`) | A role on the patient | Refusal: "Permission denied to user" |
+| List, analyse | "Can view clinical data about patients" (`can_view_clinical_data`) | A role on the patient | If this check fails, Care tries the next row |
+| List, analyse, with `?encounter=` | "Can Read encounter related clinical data" (`can_read_encounter_clinical_data`) | An organization of the encounter named in `encounter` | Open and closed encounters alike. Without `encounter`, a user with only this permission gets HTTP 403. Refusal: "Permission denied to user" |
+| Create | "Update Encounter related clinical data" (`can_write_encounter_clinical_data`) | An organization of the encounter in the body | Refused for a closed encounter (HTTP 403). Refusal: "You do not have permission to update encounter" |
+| Mark entered in error (`DELETE`) | "Update Encounter related clinical data" (`can_write_encounter_clinical_data`) | An organization of the observation's encounter | Refused for a closed encounter. The observation must be random and belong to the patient in the URL. No read check runs |
+| Questionnaire submission (encounter questionnaire) | "Can submit questionnaire about patient encounters" (`can_submit_encounter_questionnaire`) | An organization of the encounter | Refused for a closed encounter: "Permission Denied to submit encounter questionnaire". The encounter must belong to the patient ("Encounter is required for this questionnaire"), and to the questionnaire's facility for a facility questionnaire ("Encounter facility does not match questionnaire facility"). The questionnaire must be active ("Questionnaire is inactive") and the latest revision; an empty submission fails ("Empty Questionnaire cannot be submitted") |
+| Mark a questionnaire response entered in error | "Can submit questionnaire about patient encounters" (`can_submit_encounter_questionnaire`) | An organization of the encounter | First, the response must be readable: "Can view clinical data about patients" through a role on the patient, or "Can Read encounter related clinical data" in an organization of the encounter; else "You do not have permission to view questionnaire responses". Refused for a closed encounter: "Permission Denied to update encounter questionnaire". Refused when the response is already entered in error, or after the edit window (120 minutes by default): "Questionnaire Response cannot be edited" |
+| `upsert_observations` | "Can Create Diagnostic Report on Facility" (`can_write_diagnostic_report`) | An organization of the service request's encounter, or of one of the service request's locations | The report is not final. The encounter's status is not checked. Refusal: HTTP 403, "You do not have permission to write this diagnostic report" |
+| Read test results (open the diagnostic report) | "Can Read Diagnostic Report" (`can_read_diagnostic_report`) | The same places as the write check | Refusal: "You do not have permission to read this diagnostic report" |
+
+Default roles per permission:
+
+| Permission (display name) | Slug | Default roles |
+| --- | --- | --- |
+| Can view clinical data about patients | `can_view_clinical_data` | Staff, Doctor, Nurse, Facility Admin |
+| Can Read encounter related clinical data | `can_read_encounter_clinical_data` | Doctor, Nurse, Facility Admin |
+| Update Encounter related clinical data | `can_write_encounter_clinical_data` | Doctor, Nurse, Facility Admin |
+| Can submit questionnaire about patient encounters | `can_submit_encounter_questionnaire` | Staff, Doctor, Nurse, Facility Admin |
+| Can Create Diagnostic Report on Facility | `can_write_diagnostic_report` | Facility Admin, Doctor, Nurse |
+| Can Read Diagnostic Report | `can_read_diagnostic_report` | Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer |
+
+- The permission definitions also name an Admin role. Roles are matched by name, and the only role named Admin in the database is for role organizations, which the facility screens do not offer. The lists above leave it out.
+- Staff does not hold "Can Read encounter related clinical data" or "Update Encounter related clinical data". Staff reads observations only through a role on the patient.
+- These role lists are the defaults in code. The roles of an installation can be changed.
+
+### Errors
+
+- A create body with a field that the create spec does not list: HTTP 400.
+- An encounter of another patient: "Patient external ID mismatch with encounter's patient". An unknown encounter: not found.
+- A `body_site` or `method` code outside its value set: "Code does not exist in the valueset".
+- A create in a closed encounter: HTTP 403.
+- `PUT` or `PATCH` on an observation: HTTP 405.
+- A request without a signed-in user: HTTP 403.
+
+### Other places observations appear
-- Observations are exposed through Care's REST API and align with the FHIR `Observation` resource. FHIR field names (`effectiveDateTime`, `bodySite`, and so on) differ from the Django model names; the resource specs above are the authoritative request/response schemas.
-- Most observations are created as a side effect of submitting a questionnaire. `value` and `value_type` mirror the submission types (`QuestionnaireSubmitResultValue` / `QuestionType`), and `questionnaire_response` records provenance.
-- `effective_datetime` must be timezone-aware. Required on create, optional on update.
-- `status` is one of `final` / `amended` / `entered_in_error`; questionnaire-sourced observations are `final`.
-- `body_site` and `method` are validated against their bound value sets, and `main_code` is expected to bind to LOINC via `CARE_OBSERVATION_VALUSET`.
-- On read, the list and detail specs blank out `encounter`, `patient`, and `questionnaire_response`, so don't rely on those being populated in observation payloads.
-- Prefer structured observations. Allergy and medication checks read coded values, not free text, so unstructured data leaves them blind.
+- Referrals: an observation can be attached to a referral as a resource of type `observation`.
+- Reading it there needs the patient-level read check ("Can view clinical data about patients"), or the encounter-level read check on the observation's encounter. Otherwise: "Permission denied to read this resource".
+- Report templates: a diagnostic report's template can include its observations, with title, value, components, status, effective date and time, interpretation and reference ranges.
+- Resource observations (`/api/v1/resource_observation/`) come from location, device and facility questionnaires and need "Can View Resource Responses"; no staff screen reads them.
## Related
+- Concept: [Observation](../../concepts/clinical/observation.mdx)
- Reference: [Observation Definition](../definitions/observation-definition.mdx)
-- Reference: [Diagnostic Report](../clinical/diagnostic-report.mdx)
+- Reference: [Diagnostic Report](./diagnostic-report.mdx)
+- Reference: [Questionnaire Response](./questionnaire-response.mdx)
- Reference: [Questionnaire](../definitions/questionnaire.mdx)
-- Reference: [Encounter](../clinical/encounter.mdx)
+- Reference: [Encounter](./encounter.mdx)
- Reference: [Patient](../clinical/patient)
-- Reference: [Base Model](../foundation/base-model.mdx)
-- Source: [observation.py on GitHub](https://github.com/ohcnetwork/care/blob/develop/care/emr/models/observation.py)
-- Source: [observation/spec.py on GitHub](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/spec.py)
-- Source: [observation/valueset.py on GitHub](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/valueset.py)
-- Source: [resources/base.py on GitHub](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/base.py)
+- Reference: [Value Set](../definitions/valueset.mdx)
+- Reference: [Permission](../access-governance/permission.mdx)
+- Reference: [Role](../access-governance/role.mdx)
+- Flow: [Mark a response as entered in error](../../flows/clinical/questionnaire-response/mark-a-response-as-entered-in-error.mdx)
+- Flow: [Enter diagnostic report results](../../flows/clinical/diagnostic-report/enter-diagnostic-report-results.mdx)
+- Base: [Base model](../foundation/base-model.mdx)
+- Source: [observation.py (model)](https://github.com/ohcnetwork/care/blob/develop/care/emr/models/observation.py) · [observation/spec.py](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/spec.py) · [observation/valueset.py](https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/observation/valueset.py) · [viewsets/observation.py](https://github.com/ohcnetwork/care/blob/develop/care/emr/api/viewsets/observation.py)
diff --git a/versioned_sidebars/version-3.1-sidebars.json b/versioned_sidebars/version-3.1-sidebars.json
index 3b2a2c43..ae7b3498 100644
--- a/versioned_sidebars/version-3.1-sidebars.json
+++ b/versioned_sidebars/version-3.1-sidebars.json
@@ -111,6 +111,18 @@
"flows/clinical/diagnostic-report/print-a-diagnostic-report"
]
},
+ {
+ "type": "category",
+ "label": "Observation",
+ "key": "clinical-observation-flows",
+ "items": [
+ "flows/clinical/observation/record-observations-with-a-form",
+ "flows/clinical/observation/check-vital-signs",
+ "flows/clinical/observation/view-encounter-observations",
+ "flows/clinical/observation/chart-observations-over-time",
+ "flows/clinical/observation/correct-or-remove-a-test-result"
+ ]
+ },
{
"type": "category",
"label": "Consent",