3.5 KiB
US-08 — Update a blood-pressure observation
The common requirements apply to this story.
User story
As a patient, I want to correct a previously recorded observation so that accidental entry errors can be fixed.
Functional requirements
The patient shall be able to add, correct, or clear individual setting, activity-condition, and optional preparation/circumstance details defined in US-04, including on historical observations. Clearing a value makes it unknown; it does not assign a default.
An update to context alone shall preserve numerical measurements, measurement timestamp, patient association, and all context or note values not explicitly changed. Partial updates shall not erase unrelated information. Unsupported categories shall be rejected without partially applying the requested update.
Subsequent reads, context selections, and assessments shall use the current recorded context. They shall not retain classifications derived from context that was corrected or cleared.
Acceptance criteria
Feature: Update blood-pressure observation
Scenario: Correct an existing observation
Given a patient has an observation with
| systolic | 182 |
| diastolic | 82 |
| pulse | 68 |
When the systolic value is corrected to 128
Then the update succeeds
And the observation identifier is unchanged
And the observation contains systolic value 128
Scenario Outline: Reject an update containing a non-positive measured value
Given a patient has an existing observation
When the observation is updated with
| systolic | <systolic> |
| diastolic | <diastolic> |
| pulse | <pulse> |
Then the update is rejected
Examples:
| systolic | diastolic | pulse |
| 0 | 82 | 68 |
| 128 | 0 | 68 |
| 128 | 82 | 0 |
Scenario: Update an observation that does not exist
Given no observation exists with the requested observation identifier
When an update is requested
Then the update is rejected
Feature: US-08 — Correct or remove recorded measurement context
Scenario: Add context to historical observation
Given an authorised patient has an observation without context
When Home and At rest are added
Then the update succeeds
Scenario: Correct one context value
Given an authorised patient has an observation recorded as Home and At rest
When the setting alone is corrected to Clinic
Then the update succeeds
Scenario: Clear optional context
Given an authorised patient has an observation with a known activity condition
When that activity condition is cleared
Then the update succeeds
Scenario: Retrieve partially corrected observation
Given an observation’s setting was corrected to Clinic without changing its other values
When an authorised user requests that observation
Then Clinic is returned
And the original numerical values, timestamp, activity condition, and note are returned unchanged
Scenario: Reject invalid context correction
Given an observation exists
When an update contains an unsupported setting category
Then the update is rejected
Scenario: Nonexistent observation
Given the observation does not exist
When a context correction is submitted
Then the update is rejected
Scenario: Unauthorised correction
Given a user is not authorised to modify an observation
When the user submits a context correction
Then the operation is rejected