Files

5.8 KiB
Raw Permalink Blame History

US-04 — Record a blood-pressure observation

The common requirements apply to this story.

User story

As a patient, I want to record a blood-pressure observation so that I can maintain a history of my measurements.

Functional requirements

The patient shall be able to record and save the following information with an observation:

Information Required supported distinctions
Setting Home, clinic, other, unknown/not recorded
Activity condition At rest, during activity, after activity, unknown/not recorded
Preparation and technique Optional details about rest duration, body position, measured arm, and device/cuff used
Additional circumstances Optional descriptions such as recent activity, stress, pain, or a departure from the usual measurement routine

Setting and activity condition shall be independently recordable and usable for subsequent selection and comparison; users shall not have to encode both solely in an undifferentiated note. The representation and storage design are implementation choices.

Partial context shall be accepted. Missing information shall remain unknown, without defaulting to home, resting, or correct technique. Existing observations and valid submissions without context shall remain supported.

The existing optional context text and note shall be preserved. Ambiguous historical text shall not be converted into definite categories. Where recorded categories and narrative descriptions conflict, the system shall retain the supplied information and make the conflict apparent when relevant to interpretation.

Users shall record the actual circumstances, including departures from guidance. A measurement taken after activity is valid to record; it is not a validation error merely because it is unsuitable for a resting comparison.

Context shall remain associated with its observation and be available on subsequent authorised reads. No separate patient-level context record or manually entered consistency score is required. Comparability is assessed across observations under US-11.

Acceptance criteria

Feature: Record blood-pressure observation

  Scenario: Record a valid observation
    Given a patient exists
    When the patient records a blood-pressure observation with
      | measuredAt | 2026-09-12T08:00:00 |
      | systolic   | 128                 |
      | diastolic  | 82                  |
      | pulse      | 68                  |
      | context    | Resting             |
      | note       | Before breakfast    |
    Then the observation is accepted
    And an observation identifier is assigned
    And the observation is associated with the patient
    And the observation can be retrieved later

  Scenario: Record an observation without optional fields
    Given a patient exists
    When the patient records a blood-pressure observation with
      | measuredAt | 2026-09-12T08:00:00 |
      | systolic   | 128                 |
      | diastolic  | 82                  |
      | pulse      | 68                  |
    Then the observation is accepted

  Scenario Outline: Reject an observation containing a non-positive measured value
    Given a patient exists
    When the patient records a blood-pressure observation with
      | measuredAt | 2026-09-12T08:00:00 |
      | systolic   | <systolic>          |
      | diastolic  | <diastolic>         |
      | pulse      | <pulse>             |
    Then the observation is rejected

    Examples:
      | systolic | diastolic | pulse |
      | 0        | 82        | 68    |
      | -1       | 82        | 68    |
      | 128      | 0         | 68    |
      | 128      | -1        | 68    |
      | 128      | 82        | 0     |
      | 128      | 82        | -1    |

  Scenario: Reject an observation without a measurement timestamp
    Given a patient exists
    When the patient records a blood-pressure observation without a measurement timestamp
    Then the observation is rejected

  Scenario: Record an observation for a patient that does not exist
    Given no patient exists with the requested patient identifier
    When a blood-pressure observation is recorded for that patient
    Then the observation is rejected
Feature: US-04 — Record measurement setting and conditions

  Scenario: Record setting and condition independently
    Given a patient exists and the submitting patient is authorised
    When a valid observation is submitted with setting Home and activity condition At rest
    Then observation creation succeeds

  Scenario: Record partial context
    Given a patient exists
    When a valid observation is submitted with setting Clinic and no activity condition
    Then observation creation succeeds

  Scenario: Retain support for absent context
    Given a patient exists
    When an otherwise valid observation is submitted without context
    Then observation creation succeeds

  Scenario: Record departure from routine
    Given a patient exists
    When a valid observation is submitted as After activity with a description of the activity
    Then observation creation succeeds

  Scenario: Reject unsupported category
    Given a patient exists
    When an observation is submitted with a setting category outside the supported distinctions
    Then the operation is rejected with an explanation of the invalid category

  Scenario: Retrieve previously saved context
    Given an observation exists with saved setting, activity condition, preparation details, and a note
    When an authorised user requests that observation
    Then the returned observation contains those saved details associated with that observation

  Scenario: Reject another patient’s context submission
    Given the submitting patient is not authorised to record observations for another patient
    When an observation with measurement context is submitted for that other patient
    Then the operation is rejected