Simplify SM openEHR platform, I_EHR_SERVICE create EHR operations
Description
Activity
Thomas Beale February 13, 2019 at 7:34 PM
I have always preferred the opposite approach, because it reduces a) the complexity of the specification, and b) it often reduces the errors in parameter processing. However, both styles are widely used, and there are arguments for both.
Note that these alternative operations have equivalents in the REST API.
From my point of view, having more routines in an interface is no problem; the goal is to make it as simple as possible for the developer to choose which one matches a particular need, and then to easily understand how to use it.
I think we should discuss this style issue more widely however; there will certainly be differing views.

Pablo Pazos February 3, 2019 at 8:45 PM
Similar suggestion could be done for has_ehr and has_ehr_for_subject https://specifications.openehr.org/releases/SM/latest/openehr_platform.html#_i_ehr_service_interface
Currently there are four operations to create an EHR, the difference between them are the parameters passed.
I would suggest to merge the four operations into one that can receive all the parameters and also does the correspondent validation and error reporting currently explained on each operation.
As a general design approach, I would prefer to have one operation per business goal (e.g. 'create EHR'), and handle all the parameters and internal rules there.
REF: https://specifications.openehr.org/releases/SM/latest/openehr_platform.html#_i_ehr_service_interface