Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Rule typeDescription
Based on declarationDoctor with an active declaration can access all the patient's medical data.
Based on context episodeUser can read medical data, that was collected during an episode of care, that user has access to.
Based on diagnostic reportUser can read medical data, that was collected as a part of a diagnostic report, managed by the user's legal entity.
Based on origin episodeDoctor 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. 


RuleBaseResourceRoutesContextImplementationSource 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  declaration









episodeby idpatient_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
conditionby id
by search params
by id in episode context
by search params in episode context
service_requestby id
by search params
diagnostic_reportby id
by search params








@rule_2

@read @episode @service_request @diagnostic_report




Scenario: Doctor can read entity created in the doctors MSP

Given Entity has been created on my MSP

When I require read access

Then I can read








Based on context episode 





episode







service_request

by id


by search params


by search paras episode context


diagnostic_reportby id


by search params










@rule_3 @read @encounter @observation @condition @service_request @diagnostic_report

Scenario: Doctor can read all the data of episodes created in the doctors MSP

Given Episode context has been created on my MSP

When I require read access

Then I can read


Based on context episodeencounterby id


by search params


by id in episode context


by search params in episode context


observationby id


by search params


by id in episode context


by search params in episode context


conditionby id


by search params


by is in episode context


by search params in episode context


service_requestby id


by search params


by id in episode context


diagnostic_reportby 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 @service_request @diagnostic_report

Scenario: Doctor with active approval can read all the data of specified in approval episodes

Given Active approval on episode

When I require read access

Then I can read




















Based on context episode

















episode







encounter


















observation


















condition


















service request













diagnostic report















@rule_6 @read @diagnostic_report @encounter

Scenario: Doctor can read diagnostic report originated by episode created in the doctors MSP

Given Entity has been originated by mine MSP episode

When I require read access

Then I can read





Based on origin episode


encounterby id


by search params


diagnostic repostby id


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 episodeobservationby id


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 episodeobservationby id



by search params


conditionby id



by search params


service requestby id



by search params


diagnostic_reportby id



by search params









...

RuleRule typeResourceRouteСontextLogicContext source

@rule_1

@read @episode @encounter @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @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 declaration


episodeby idpatient






















for all:{patient_id} form URL







by search params


encounterby id
by search params
in episode context by id
in episode context by search params
observationby id
by search params
in episode context by id
in episode context by search params
conditionby id
by search params
in episode context by id
in episode context by search params


by search params













service_requestby id
by search params
diagnostic_reportby id
by search params


@rule_2 @read @episode @service_request @diagnostic_report

Scenario: Doctor can read entity created in the doctors MSP

Given Entity has been created on my MSP

When I require read access

Then I can read











































@rule_5

@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 episodes

Given Active approval on episode

When I require read access

Then I can read








Based on approval





episodeby idnoneepisode.id in approvals.permitted_resources 

by id: selected from DB

by search param: {episode_id} or {context_episode_id} from URL








encounterby idepisode
by search param
observationby id
by search param
conditionby id
by search param














@rule_8 @read @observation @condition @allergy_intolerance @immunization @risk_assessment @device @medication_statement @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 episode
When I require read access
Then I can read














Based on origin episode














observation by idencountercontext.origin_episode.managing_organization==token.client_id















by id: selected from DB

by search param: {encounter_id} from URL

by search param
condition by id
by search param
diagnostic_reportby idencounter.origin_episode.managing_organization==token.client_id
by search param














...