How to solve

We have a question with regard to the standard care program. We want to add the activities automaticaly to the treatment when a standard care program is selected. This is not possible for us.  We already created standard care programs and assigned activities to this programs. When we create a new treatment, we can also choose a standard care program to add and see which activities need to be executed. We can also add additional/individual activities. We want to make a general list, which includes the activities from a standard care program and the additional activities (a general activity list). We tried in many ways but haven't found a solution yet. Kind regards,
1 answers

This looks like a datamodeling problem: you use Activity for two entirely different purposes and to solve this, you should split this into two entities. The first entity you could call TemplateActivity, and they are connected to StandardCarePrograms. These TemplateActivities contain generic information about an activity, such as its name and the standard price. The second entity is Activity, which represent activities that actually took place, and they are connected to a patient (and possibly a doctor) and a TemplateActivity. They contain the session length, end date and outcome (assuming these attributes can differ per patient), and derive their name from the TemplateActivity.


With this setup, when you select a StandardCareProgram, you create an Activity object for each TemplateActivity object associated with the StandardCareProgram. Each Activity object you create must be associated with a patient (possibly through a treatment) and to the TemplateActivity.

Furthermore, a doctor can now select a TemplateActivity from a list and create an Activity, indicating that he has performed the activity for a certain patient.