Skip to content

fhir-smart should allow read access to Patient resources in compartment of the patient context #3592

@lmsurpre

Description

@lmsurpre

Is your feature request related to a problem? Please describe.
Currently, fhir-smart controls "direct" (read, vread, delete, and history-instance) access to the Patient resource based on the resource id.
For almost every other resource type, its based on compartment membership instead.

Describe the solution you'd like
With a patient/Patient.read scope, a user should be able to access the Patient resources that are linked to the in-context patient.

Describe alternatives you've considered

Acceptance Criteria

  1. GIVEN a Patient resource on the server with a link to a specific patient (e.g. Patient/123)
    AND a valid access token with a patient_id that includes that patient id (e.g. 123)
    WHEN the user performs a direct interaction (read, vread, delete, and history-instance) with that resource
    THEN the interaction is permitted

  2. GIVEN a valid access token with a patient_id
    WHEN the user attempts to performs a direct interaction (read, vread, delete, and history-instance) with any Patient resource (existent or not)
    THEN the interaction is rejected with an HTTP 403 (Forbidden)

Additional context
I think the reason we originally prohibited any interaction with any Patient resource with any other id was because we didn’t want to leak whether or not that other patient id was a valid id. If the patient doesn't exist it still needs to be a 403 (not a 404).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions