As said earlier it is not undoable but quite hard for a person starting in Mendix. The standard fields are no problem. They all have a picture, name and a begin and end datetime fields. The hard part is the dynamic part. Create an entity for this and attach it to the first entity (one to many). Now for each attribute you need to store the name of the attribute, the type of field it is (create an enum with string, decimal, integer etc) and offcourse all the attributes for each enum. So that second entity contains name attribute, type attribute (the enum), decimal attribute, boolean attribute, string attribute, integer attribute etc.). Then create the form where the admin can add this entity to the main entity and define the fields to show. After selecting the Type show with conditional visibilty to correct field to show where the end user can enter the value.
Regards,
Ronald
However, there is still something I don’t really understand and it has to do with this part of your comment: “Then create the form where the admin can add this entity to the main entity and define the fields to show. After selecting the Type show with conditional visibilty to correct field to show where the end user can enter the value.”
I’ve taken the following steps
I have coordinator page in which new activity types can be made. Each activity type has the following attributes:
- Name (String)
- Readable by patient (Boolean)
- Editable by patient (Boolean)
- Readable by doctor (Boolean)
- Editable by doctor (Boolean).
Furthermore, I have implemented a reference set selector within the Activity_type_NewEdit page, in which the attributes related to that activity type can be assigned.
This also means I made a tab in which new attribute_types can be created. Each attribute type has the following attributes:
- Name (String)
- Attribute type (Enumeration with as enumeration values: String, Decimal, Long, Date and time, etc.)
This is how it looks like
On the patient page, I have created a data grid in which all activities (NOT activity types) are listed. A patient can also create new activities. When the 'New' button is clicked, the page activity_NewEdit is shown, in which a reference selector asks for the associated activity type. This is also the point where I get stuck. How can I make the system show all associated attributes to a specific activity type, once I have selected that specific activity type in the reference selector? And how do I then give input to these attributes (so for recording date, how do I connect a date to that?
https://1bk00.samengezond.app/. this is the mock-up and as you can see a patient can select an activity and then the attribute fields show up. These fields can then be filled in. So my question is how can I also implement this?
I have managed to create an admin page in which he/she can create attributes and activities (see pictures below)
this is where the attributes are created
this is where a new activity is created and the attributes are added
Right now I’m able to create attributes and activities
you can type the name of the activity you want to create, and then with the add button one can add the needed attributes
I have also created a patients page in which a patient can select an activity and fill in the needed values
When a patient clicks on new, he/she can add a activity
This is how it looks like
But the problem I have here is that when a patient selects an activity she sees the following and is not able to fill in a form
So my question is when a patient selects an activity in the drop down how can I make it show a form that he/she can fill in?
Thanks in advance! I really appreciate it, your comments have helped me a lot!