health
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health] Restricting doctors access to patient history


From: Humberto Freitas
Subject: Re: [Health] Restricting doctors access to patient history
Date: Tue, 1 Sep 2020 18:36:27 +0100

Hey Edgar,

I found the solution.

Yeah, that’s the rules Im trying to set, for example for appointments, and it does not work. The way Im think is as following:
[['healthprof', '=', Get(Eval('user', {}), 'healthprof', None)]]
In here, I think I’m trying to filter all the appointments where the User is equal to the health professional of the appointment. However, it looks like I’m missing something in this PYSON domain.

I’ll be experimenting with this and I will, for sure, let you know when I find something that works.
As I said in the last email, I was trying to solve the problem setting the group rule as [['healthprof', '=', Get(Eval('user', {}), 'healthprof', None)]], and it was not working because, as it’s explained on [1], there is no field called healthprof on the user module.

According to [1],
Given the PYSON statement:
Get(Eval('context', {}), 'company', 0))

Eval() checks the evaluation context for a variable context if defined, return the variable context, otherwise return an empty dictionary {}. Get() checks the former resulting dictionary and returns the value of the key 'company', otherwise it returns the number 0

So, in my case, if a doctor wants to only fetch his/her appointments, the PYSON statement would be: [['healthprof', '=', Get(Eval('user', {}), ‘employee', None)]]. Thus, only the appointments in which are created by the doctor will be fetched.


Let me know in you you have any questions.

In case, someone has a better solution, please let me know your thoughts.

As always thank you so much for all your wonderful work.

Happy hacking.

Sincerely, 

Humberto Freitas

Cell phone: +244 944 775 334
email: humberto.freitas310@gmail.com
Angola

On Sep 1, 2020, at 11:31, Humberto Freitas <humberto.freitas310@gmail.com> wrote:

Hello Edgar, thank you so much for your fast and kind responses

At Administration/Models/Record Rules/Calendar (the second one in the federation demo-database with only read privileges)

there is a rule

"[[""owner"", ""="", {""__class__"": ""Get"", ""v"": {""__class__"": ""Eval"", ""v"": ""user"", ""d"": {}}, ""k"": ""id"", ""d"": -1}]]"
"[[""read_users"", ""="", {""__class__"": ""Get"", ""v"": {""__class__"": ""Eval"", ""v"": ""user"", ""d"": {}}, ""k"": ""id"", ""d"": -1}]]”

Yeah, that’s the rules Im trying to set, for example for appointments, and it does not work. The way Im think is as following:
[['healthprof', '=', Get(Eval('user', {}), 'healthprof', None)]]
In here, I think I’m trying to filter all the appointments where the User is equal to the health professional of the appointment. However, it looks like I’m missing something in this PYSON domain.

I’ll be experimenting with this and I will, for sure, let you know when I find something that works.

Thanks again.

Sincerely, 

Humberto Freitas

Cell phone: +244 944 775 334
email: humberto.freitas310@gmail.com
Angola

On Sep 1, 2020, at 10:29, Edgar Hagenbichler <edgar.hagenbichler@hagenbichler.at> wrote:

Hello Humberto,

Am 01.09.2020 um 11:16 schrieb Humberto Freitas:
There could be different levels of doctors, e.g. intern, senior physician, medical head of department, medical head of hospital and so on who could have different access privileges to patient evaluations then. One has to create at Administration/User a new Group, I guess. And then probably you have to finetune at Administration/Models/Fields and /Record Rules (maybe similar to Calendar(?)).
Yeah, that was my first thought, and no matter how I tweak the Administration/Models/Fields and /Record Rules, I cannot set the restriction I am looking for :S
What do you mean when you say: (maybe similar to Calendar(?))

At Administration/Models/Record Rules/Calendar (the second one in the federation demo-database with only read privileges)

there is a rule

"[[""owner"", ""="", {""__class__"": ""Get"", ""v"": {""__class__"": ""Eval"", ""v"": ""user"", ""d"": {}}, ""k"": ""id"", ""d"": -1}]]"
"[[""read_users"", ""="", {""__class__"": ""Get"", ""v"": {""__class__"": ""Eval"", ""v"": ""user"", ""d"": {}}, ""k"": ""id"", ""d"": -1}]]"

Since I am no programmer I do not know what this means, but as I guess the calendar should be for each doctor with "his own" patients.

Unfortunately I do not know either, I would be interested in the solution too. Could you please share it if you find a way?

Yes indeed. It’s the least I can do ;)

Right now, I experimenting with group configuration, setting rules on the patient evaluation records with the following domain: 
[['healthprof', '=', Get(Eval('user', {}), 'healthprof', None)]]

Any thoughts?

see above, it looks somehow similar for me

All the best

Edgar






reply via email to

[Prev in Thread] Current Thread [Next in Thread]