57 lines
2.2 KiB
Markdown
57 lines
2.2 KiB
Markdown
# US-09 — Delete a blood-pressure observation
|
|
|
|
The [common requirements](00-common-requirements.md) apply to this story.
|
|
|
|
**User story**
|
|
|
|
> As a patient, I want to delete an incorrectly recorded observation so that it is no longer part of my measurement history.
|
|
|
|
## Functional requirements
|
|
|
|
Deleting an observation shall also remove its context from ordinary observation retrieval, history, numerical summaries, and assessments. Context belonging to other observations shall remain unaffected. Context has no separate user-visible lifecycle after its observation is deleted.
|
|
|
|
## Acceptance criteria
|
|
|
|
```gherkin
|
|
Feature: Delete blood-pressure observation
|
|
|
|
Scenario: Delete an existing observation
|
|
Given a patient has a recorded observation
|
|
When that observation is deleted
|
|
Then the deletion succeeds
|
|
And the observation can no longer be retrieved
|
|
And the observation no longer appears in the patient's observation history
|
|
|
|
Scenario: Delete an observation that does not exist
|
|
Given no observation exists with the requested observation identifier
|
|
When deletion is requested
|
|
Then the request reports that the observation does not exist
|
|
```
|
|
|
|
```gherkin
|
|
Feature: US-09 — Remove context with a deleted observation
|
|
|
|
Scenario: Delete contextualised observation
|
|
Given an authorised patient has an observation with setting and conditions
|
|
When that observation is deleted
|
|
Then deletion succeeds
|
|
|
|
Scenario: History excludes previously deleted observation
|
|
Given an observation with Home and At rest was deleted
|
|
And other home-resting observations remain in the selected period
|
|
When history is requested for Home and At rest
|
|
Then the deleted observation and its context are absent
|
|
And the remaining matching observations are returned
|
|
|
|
Scenario: Assessment excludes deleted data
|
|
Given a contextualised observation was deleted
|
|
And sufficient remaining observations exist for an assessment
|
|
When the assessment is requested
|
|
Then the deleted values and context do not contribute to the result
|
|
|
|
Scenario: Reject unauthorised deletion
|
|
Given a user is not authorised to delete an observation
|
|
When the user requests its deletion
|
|
Then the operation is rejected
|
|
```
|