...
@rule_1
@read @episode @encounter @observation @condition @service_request @diagnostic_report
...
Scenario: Doctor with active declaration can read all patient data
...
Given Active declaration with patient
...
And declaration from the same MSP
...
When I require read access
...
Then I can read
...
@rule_2
@read @episode @service_request @diagnostic_report
...
...
Rule type | Description |
---|
Based on declaration | Doctor with an active declaration can access all the patient's medical data. |
Based on context episode | User can read medical data, that was collected during an episode of care, that user has access to. |
Based on diagnostic report | User can read medical data, that was collected as a part of a diagnostic report, managed by the user's legal entity. |
Based on origin episode | Doctor can read medical data, that was collected as a part of a diagnostic report or episode of care, that user has access to. Episode of care, that contains this service request, is considered as an origin episode in that case. |
Rule | Base | Resource | Routes | Context | Implementation | Source of context |
---|
@rule_1 @read @episode @encounter @observation @condition @service_request @diagnostic_report
|
| Scenario: Doctor with active declaration can read all patient data |
| Given Active declaration with patient |
| And declaration from the same MSP |
| When I require read access |
| Then I can read |
| Based | on context episodeon declaration
| episode | by id | patient_id
| There is an active declaration between the patient and the doctor in OPS
| patient_id from URL
|
by search params |
encounter
| by id |
by search params |
by id in episode context |
by search params in episode context |
observation
| by id |
by search params |
by id in episode context |
by search params in episode context |
condition | by id |
by search params |
by is id in episode context |
by search params in episode context |
service | _requestby id | by search params | by id in episode context | diagnostic_report | by id | by search params |
@rule_4 @read @episode @encounter @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report |
Scenario: Doctor with active approval can read all the data of specified in approval patient | Given Active approval on patient | When I require read access | Then I can read | not implemented yet | @rule_5 @read @episode @encounter @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement _request | by id | by search params |
diagnostic_report | by id |
by search params |
|
|
|
|
|
|
|
@rule_2 @read @episode @service_request @diagnostic_report
|
| Scenario: Doctor |
| with active approval | all the data of specified in approval episodesGiven Active approval on episodeentity created in the doctors MSP |
| Given Entity has been created on my MSP |
| When I require read access |
| Then I |
| can readBased on context episode
episode | encounter
observation
condition
service request
diagnostic report | @rule_6 @read @diagnostic_report @encounter
|
| episode | by id | episode | episode.managing_organization==token.client_id | DB.episode |
by search params | search param {managing_organization} from URL |
service_request
| by id | service request | service_request.managing_organization==token.client_id
| DB.service_request |
by search params | search param {managing_organization} from URL |
diagnostic_report | by id | diagnostic_report | diagnostic_report.managing_organization==token.client_id | DB.diagnostic_report |
by search params | search param {managing_organization} from URL |
|
|
|
|
|
|
|
@rule_3 @read @encounter @observation @condition @service_request @diagnostic_report |
| Scenario: Doctor can read |
| diagnostic report originated by episode all the data of episodes created in the doctors MSP |
| Given |
| Entity | originated by mine MSP episodecreated on my MSP |
| When I require read access |
| Then I can read |
| Based | on origin episode
encounter | by idon context episode | encounter | by id | episode
| episode.managing_organization==token.client_id
| DB.encounter.episode |
by search params | search param {episode_id} from URL |
by id in episode context | episode_id from URL (path) |
by search params in episode context | diagnostic repost
observation | by id | DB.observation.episode |
by search params |
@rule_7 @read @observation |
Scenario: Doctor can read all the data of diagnostic report originated by episode created in the doctors MSP | Given Diagnostic report context has been originated by mine MSP episode | When I require read access | Then I can read | Based on origin episode | observation | by idsearch param {episode_id} from URL | by id in episode context | episode_id from URL (path) |
by search params in episode context |
condition | by id | DB.condition.episode |
by search params |
@rule_8 @read @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report |
Scenario: Doctor can read all the data of encounter originated by episode created in the doctors MSP | Given Encounter context has been originated by mine MSP episode | When I require read access | Then I can read | Based on origin episode | observation | by id | by search params | condition | by id | by search params | service request | by id | by search params | diagnostic_report | by id | by search params |
Rule | Rule type | Resource | Route | Сontext | Logic | Context source |
---|
@rule_1
search param {episode_id} from URL |
by is in episode context | episode_id from URL (path) |
by search params in episode context |
service_request | by id | DB.service_request.encounter.episode.managing_organization |
by search params | search param {episode_id} from URL |
by id in episode context | episode_id from URL (path) |
diagnostic_report | by id | DB.diagnostic_report.encounter.episode.managing_organization |
by search params | context_episode_id from URL (path) |
|
|
|
|
|
|
|
@rule_4 @read @episode @encounter @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report |
| Scenario: Doctor with active approval can read all the data of specified in approval patient |
| Given Active approval on patient |
| When I require read access |
| Then I can read |
| not implemented yet |
|
|
|
|
|
|
|
|
|
|
|
|
@rule_5 @read @episode @encounter @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report |
| Scenario: Doctor with active |
|
declaration patient the data of specified in approval episodes |
| Given Active |
|
declaration with patientAnd declaration from the same MSPapproval on episode |
| When I require read access |
| Then I can read |
| Based on |
declaration idpatientfor all:{patient_} form URL |
|
|
|
by search params |
|
|
|
encounter
| by id |
|
|
|
by search params |
in episode context in episode context |
|
|
|
by search params in episode context |
|
|
|
observation
| by id |
|
|
|
by search params |
in episode context in episode context |
|
|
|
by search params in episode context |
|
|
|
condition
| by id |
|
|
|
by search params |
in episode context by search params |
|
|
|
by search params in episode context |
|
|
|
service |
_ request
| by id |
|
|
|
by search params |
|
|
|
by id in episode context |
|
|
|
diagnostic |
_ report | by id |
|
|
|
by search params |
|
|
|
|
|
|
|
|
|
|
|
2 @episode @service_request @diagnostic_report @encounter |
| Scenario: Doctor can read |
|
entity diagnostic report originated by episode created in the doctors MSP |
| Given Entity has been |
|
created on my MSPoriginated by mine MSP episode |
| When I require read access |
| Then I can read |
| Based on origin episode
| encounter | by id |
|
|
|
by search params |
|
|
|
diagnostic repost | by id |
|
|
|
by search params |
|
|
|
|
|
|
|
|
|
|
|
5 @episode @encounter @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report with active approval specified in approval episodesGiven Active approval on diagnostic report originated by episode created in the doctors MSP |
| Given Diagnostic report context has been originated by mine MSP episode |
| When I require read access |
| Then I can read |
| Based on |
approvalepisode | by id | none | episode.id in approvals.permitted_resources by id: selected from DB
by search param: {episode_id}
or {context_episode_id} from URL
encounter | by id | episode |
by search param |
observation | by id |
by search param |
conditionorigin episode | observation | by id |
|
|
|
by search |
paramparams |
|
|
|
|
|
|
|
|
|
|
@rule_8 @read @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @service_request @diagnostic_report |
| Scenario: Doctor can read all the data of encounter originated by episode |
|
, created in the doctors MSP |
| Given Encounter context has been originated by mine MSP episode |
| When I require read access |
| Then I can read |
| Based on origin episode | observation | by id |
encounter | context.origin_episode.managing_organization==token.client_id
|
|
|
| by search params |
|
|
|
condition | by id |
: selected from DB param: {encounter_id}
from URLby search param |
condition | params |
|
|
|
service request | by id |
|
|
|
| by search |
paramparams |
|
|
|
diagnostic_report | by |
idencounter.origin_episode.managing_organization==token.client_ search param