System Design Atlas

Telemedicine appointments and care records

04 / 10Worked example

Change commands and retries

Which check protects consultation access when someone knows the room ID?

Scale alone does not ensure consistent retry behaviour. This proposed API binds the role, business object, change payload and expected state to each new intent. An idempotency key identifies the same intent after a response is lost.

Starting point Calculate appointment rates and consultation minutes separately.

Assumptions for the example case

Fictitious example design: an outpatient video consultation with one clinician; appointment intervals in UTC; documented consent; manually confirmed consultation end and a versioned clinical note. Figures and quality targets are illustrative test assumptions. Emergency care, automatic diagnosis, prescribing and billing are outside the scope.

Retries and new intent

Booking and note contracts · key plus version

CommandKey · Identity · Interval/Version
Command → ErgebnisspeicherCheck fingerprint
Result storeT-71 / N-1
identical → historical resultChanged → conflictNew → check current state

Identical replay reads T-71 or N-1; a different patient or text requires a new intent.

A forwarded link could expose access to an unauthorised person. Verify the appointment and authorised participants when issuing access. A room ID alone grants no access.

Proposed domain API contracts

  1. POST/appointments

    Reserve the clinician's time.

    Input
    Patient identity, B-71, start 12:00 UTC, end 12:20 UTC, date and booking key.
    Result
    T-71 for a conflict-free half-open interval; an overlap rejects the entire booking.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  2. POST/appointments/{id}/consents

    Document consent.

    Input
    Patient identity, T-71, purpose, consent text version, time of consent and key; revocation is a separate operation.
    Result
    E-71 with current validity and traceable history; revocation blocks issuance of new access.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  3. POST/appointments/{id}/access

    Issue access to the specific consultation.

    Input
    Authorised patient or clinician, T-71, proof of identity and current consent status.
    Result
    Time-limited, person-bound access associated with the existing room request; reject unauthorised identity or revoked consent.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  4. POST/encounters/{id}/notes/release

    Close the encounter with a record of the actual consultation.

    Input
    Clinician, F-71, expected version, note text, consultation history, next step and key.
    Result
    Approved N-1 and state abgeschlossen; later corrections require a new addendum version.
    Retry behaviour
    An identical operation by the same authorised role on the same object, using the same key and canonical payload, returns the stored original result. A changed payload under that key is rejected. External result identifiers are durably deduplicated after authentication; new intents check the current version again.
  5. GET/appointments/{id}

    Read appointment state and room reconciliation status.

    Input
    Practice staff or patient with authorisation for the object.
    Result
    Appointment status, room request status and unresolved contact needs; the clinical note requires separate clinical authorisation.
    Retry behaviour
    Repeating a read creates no business effect; the returned current state may change between requests.

Bind access to its specific context

Bind access to its specific context

Check the appointment and authorised participants when issuing access.

A forwarded link could give strangers access.

A room ID alone grants no access.

Alternative considered
Unbound links make unauthorised joining easier.
Trade-off
Identity verification requires a visible step.
Reassess
Guest participation requires a separate authorisation contract.

Terms in this step

Bind access to its specific context
A room ID alone grants no access.

Try it yourself

An unrelated user knows the room ID for T-71. Specify the access checks and their outcome.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
The API checks authorised identity, the specific appointment and valid consent.
Second part of the solution
The room ID alone is insufficient; the unrelated user receives no consultation access.

Apply to your project

Which corresponding assumption would you check first in your project when guest participation requires a separate authorisation contract?

Step 5 examines: Version clinical notes.