Hi Thaibinh, pages are object orientated which means you only can constrain a datagrid, listview and template grid based on objects (CurrentObject, CurrentUser, etc.) and associations. You want a compare based on attributes which isn't possible in Mendix. So another solution is needed.
- Microflow datasource. Instead of letting the datagrid retrieving the data by database, it uses a microflow. A microflow retrieve activity is able to compare on attribute level. The list of the retrieve is the output of the microflow. This has disadvantages because the datagrid, listview and template grid isn't able anymore to filter data with searchfields and change the sorting per column.
- The best solution is to make you're CareGroup attribute an separate entity containing the enumeration as attribute. The coordinator has an assocation which CareGroup he uses and the patient has an association to the CareGroup. Then you can constrain in the datagrid, listview and template grid based on association: show the patients which has the CareGroup which has been assigned to the currentuser.
I hope this helps, good luck.
You can compare the enumeration values. My advice would be to look into a datasource microflow to retrieve the data.
In the sample "replace" ordertype by your enumeration.