Prevent VERSION<EHR_STATUS>.lifecycle_state = incomplete
Description
Activity

Pablo Pazos May 31, 2022 at 7:34 PM
Hi @Thomas Beale I think what I tried to say was the EHR_STATUS is created by default, but I couldn’t find something in the specs that says “when the EHR_STATUS is created when the EHR is created, all the internal VERSION, AUDIT_DETAILS, and even a COTRIBUTION should be also created” so the EHR_STATUS has the change_type ‘create’ associated when it is created by default with the EHR.
Though maybe there is something in the specs and I just didn’t see it.
Thomas Beale May 31, 2022 at 5:57 PM
@Pablo Pazos not sure I understand the following:
An edge case is when VERSION<EHR_STATUS>.commit_audit.change_type = creation, because when an EHR is created an EHR_STATUS is created by default , so the “creation” change type won’t be valid for committing EHR_STATUS.
I would expect it to be set to ‘creation’ when it is created. The ‘creation’ change type won’t be valid for updating anything that is already created.
Since commits of CONTRIBUTION or VERSION<EHR_STATUS> are allowed and VERSION.lifecycle_state could be "incomplete", but that state doesn't make much sense for EHR_STATUS, add a constraint to prevent it.
Similarly, I think the EHR_STATUS can’t be deleted, so the same might happen when VERSION<EHR_STATUS>.lifecycle_state = deleted
An edge case is when VERSION<EHR_STATUS>.commit_audit.change_type = creation, because when an EHR is created an EHR_STATUS is created by default , so the “creation” change type won’t be valid for committing EHR_STATUS.
REF: check the discussion on discourse https://discourse.openehr.org/t/issues-questions-with-contribution-of-ehr-status/1116