You are on page 1of 3

Specification Case Study: Patient Record System

A first step towards developing a generalized (and persistent) “Patient Record Sys-
tem” is to model the known “Patient Population”, specified as class PP [ P, I ]:
PP
A Patient Population includes an
initially-empty set of patients (as Patient : ℘ P
uniquely identified by elements of Info : Patient → I
a given type P). Each patient has {Alive, Dead } : part Patient
some associated information (of
type I), and is either alive or dead . Patient ′ = ∅

1. Two queries, leaving its state unchanged, are to be provided for the class PP :

PP ?info(p → i)
Current information i for patient p
can be shown at any time. ...

PP ?isAlive(p → t)
Whether patient p is or is not alive
can be shown as a boolean test t. ...

Give a simple formal specification for each query, guided by its documentation. (5)

2. All possible changes-of-state at this level are specified by the following events:

PP !NewPatient(i → p)
...
i : I ; p : P \Patient

Info ′ p = i ; p ∈ Alive ′

PP !UpdateInfo(p, i)
...
p : Patient ; i : I
i ̸= Info p

Info ′ p = i

PP !Death(p)
...
p : Alive

p ∈ Dead ′

Document each event informally, using simple but precise natural language. (9)

1
3. At a later development stage, the overall “Health-Care System” might then be
introduced by extending PP . This is specified as class HCS [ P, I, S, H ]:

HCS
The Health-Care System supports its
Patient Population by means of some PP [ P, I ]
hierachical set of services and nested Service : ℘ S
sub-services (with unique identifiers SubService := dom NestIn
from type S). It also maintains a cen- NestIn : Service 9 Service
tral register of health-professionals NestIn + ∩ id Service = ∅
(with unique identifiers from type H),
and their current associations with HProf : ℘ H
any service or sub-service; those who Assoc : HProf = Service
have at least one such association are Active := dom Assoc
said to be active. All of the services Roll : Patient = Service
for which each patient is enrolled are
maintained at this level as well. Service ′ = ∅ ; HProf ′ = ∅

Several new queries will now be required for this class, e.g. the following:

HCS ?subServices(s → S)
...
s : Service
S = {x : S • NestIn x = s}

HCS ?associations(h → S)
...
h : HProf
S = {x : S • h 7→ x ∈ Assoc}

Informally document each of these queries, once again using natural language. (6)

4. A number of events will obviously be required for HCS , e.g. the following:

HCS !NewSubService(s, n)
A new sub-service s nested in n can be
defined, provided its name is unique. ...

HCS !RegisterHProf (→ h)
A new health professional can be reg-
istered, and given unique identifier h. ...

HCS !EnrolPatient(p, s)
Some patient p can be newly enrolled
for (sub-)service s, provided they are ...
not already enrolled there.

Formally specify each event, guided by its documentation. (10)

2
5. An initial model for the required “Patient Record System” may be introduced by
further refining class HCS . This is specified as class PRS [ P, I, S, H, R, F ]:
PRS
A Patient Record System extends the
Health-Care System, so as to provide HCS [ P, I, S, H ]
a shared database of patient records PRec : ℘ R
(uniquely identified by elements from Ref : PRec → Patient
type R). Each such record refers to Orig : PRec → HProf×Service
one particular patient, and identifies
Dest : PRec → HProf×Service
both the originator and destination
DaT : PRec → DATE×TIME
(as professional-service pairs). Auto-
matically imposed are its DATE and Msg : PRec → TEXT
TIME of entry. All of them include a Att : PRec = F
message (of type TEXT), while some {Note, Comm}: part PRec
may also have one or more attached Note =
files (of type F). Every record having {r : PRec • Orig r = Dest r}
the same originator and destination is
said to be a note; otherwise, it corre- PRec ′ = ∅
sponds to a medical communication.
Assume TEXT, DATE and TIME are pre-defined types, and that the usual order-
relations (<, ≤, ≥, >) apply to DATE or TIME values. Assume also that a function
sorted by is provided, where R sorted by DaT constructs the sequence of record-
identifiers from selected set R which is ordered (using ≤) by their DaT values.
The capabilities at this level are very general ; the challenge is to exploit them in
a way that supports clinical practice – by providing appropriate operations.
Consider for example a simple query, informally documented as follows:
PRS ?showFrom(p, d, h, s → S)
The sequence S of record-identifiers
(sorted by their entry date and time) ...
can be shown, provided they refer to
patient p, were entered on dates ≥ d
and have a professional h of service s
as the originator and/or destination.
Formally specify this query. (10)
6. Consider also a simple event, with the following informal documentation:
PRS !EnterNote(p, m, h, s → r)
A new note which refers to patient p
can be entered with message m (but ...
no attachments) by professional h of
service s, provided p is enrolled for s
and h is associated with s; doing so
returns its unique record-identifier r.
Formally specify this event. (10)

You might also like