Title: PatientsAppointmentsBloodtest
Version: 0.1
Type: Sketch
Overview
A health informatics scenario: three independent systems relating to hospital patients (bed allocation, doctor's appointments, and blood tests) plus an inter-model integrity constraint.
Models
Model $M_1$ is an optional-to-optional association between patients and beds. Model $M_2$ is a many-to-many association recording appointments between patients and doctors. Model $M_3$ is a one-to-many association between patients and blood test results, the latter having a boolean attribute recording severity.
Consistency
All three models are synchronised on the set of patients. An additional inter-model integrity constraint $I$ requires that any patient allocated a bed and in receipt of a severe test result must also have a doctor's appointment.
Consistency Restoration
Consistency restoration is straightforward when adding or removing a patient, and trivial when de-allocating a bed, removing a test result, adding a non-severe test result, or adding an appointment. When allocating a patient to a bed, if that patient already has a severe test result and no doctor's appointment then an appointment should be made (rather than deleting the test result). Similarly, when adding a new severe test result for a patient, if that patient is currently allocated a bed and has no doctor's appointment, then an appointment should be made (rather than eviction from the bed). When cancelling a patient's only doctor's appointment, if they have a severe test result then a new appointment must be made.
Properties
Should be at least correct and hippocratic.
Variants
Given a simple federation of the three models $M_1, M_2, M_3$, there are numerous ways of implementing the additional integrity constraint $I$; these were the focus of a working group at Dagstuhl Meeting 18491 on Multidirectional Transformations and Synchronisations. Possibilities include invasively modifying the appointment system $M_2$; non-invasively imposing a wrapper around $M_2$; incorporating a fourth component responsible for monitoring conformance to the integrity constraint and fixing violations; maintaining a fourth model $M_4$ recording the patients of special interest (namely those allocated a bed and having a severe test result).
Discussion
This scenario was intended to provide an example of a multidirectional transformation that is not easily expressed using bidirectional transformations. It is not clear whether it serves that purpose, depending on what one allows as a "using bidirectional transformations". The scenario is harder to model using bidirectional transformations just between the original components $M_1, M_2, M_3$, but easier if one is allowed to incorporate an additional $M_4$. It's also harder if one expects synchronisation between (say) $M_1$ and $M_2$ to be expressible in terms of pure functions between just these sets, but easier if these operations may incorporate computational effects, for example to consult $M_3$.
References
Harald König. Commonality Specifications, Merged Models, and Partial Morphisms (slides), 2018.
Author(s)
Jeremy Gibbons.
Reviewer(s)
Not yet reviewed.
Comments
None so far.
Artefacts
