Display patients with the same caregroup as a coordinator (current user)

0
Hello, I have a question relating a problem about our mendix module. We have 3 roles, a doctor, a administrator (which is not the overall admin) and a coordinator. We managed to use some microflows in order to create a login account, when we are adding an employee (all our roles inherit employee, which inherits system.user). We also have patients, which can be located to a caregroup. Coordinators can be located to a caregroup too. Is it possible to show a data grid of all the patients with the same caregroup as the logged in coordinator? You would save my day! Kind regards
asked
3 answers
0

Create a page with a data grid with accounts and the datasource xpath.

Set the xpath to

[Account/Account_Caregroup/Module.Caregroup/Account_Caregroup = $currentuser]

(change to your correct entitynames)

This means that the account must belong to the caregroup where the current user belongs to.

Set the forms 'visible for' to 'Coordinator'

Edit 1: I Assume that both coordinators and patients are accounts

answered
0

Thanks for your fast reply, The only thing that does not match is that we just have a entity care group with attribute 'name' string (which is associated to patient and coordinator, Patient and Coordinator are also connected).

And with accouns do you mean the the administrator.account entity? or our coordinator entity?

Thanks

answered
0

Hello Mairen,

Try never to answer your own question but edit your original question. And he means the administrator.account entity. But from your text it seems you do not use that (unless you made the mistake to directly inherit from user instead of account). In my opionion you should have let the employee inherit from account which inherit from system.user.

Since patients are no users I think it might be simpeler to create a datagrid with a datasource microflow where you pass the current user. In this datasource retrieve the Caregroup of the current user. Then you could retrieve all the patients belonging to that Caregroup and return the list of patients in that microflow.

Regards,

Ronald

answered