This is a fork of Google's Simulated Hospital.
Simulated Clinic is a tool that generates realistic and configurable hospital patient data in HL7v2 format.
A hospital's Electronic Health Record (EHR) system contains patients' health information. EHRs use messages to communicate clinical actions like the admission of a patient, ordering a blood test, or getting test results. This flow of messages describes the lifetime of a patient's stay in a hospital.
Most EHRs use a message format called HL7v2, which is ugly and tedious to type. Simulated Clinic generates messages in HL7v2 format from sequences of clinical actions. The generated HL7v2 messages can be sent to an MLLP host, saved to a txt file, or printed to the console.
Simulated Clinic helps developers build and test clinical apps without access to real data. It makes it easy to generate HL7v2 messages that reproduce realistic situations in clinical settings.
The basic behavior of Simulated Clinic can be summarized as follows:
- Simulated Clinic creates patients at a configurable rate.
- When Simulated Clinic creates a patient, it associates the patient with a pathway.
- A pathway models the events that will occur to the patient.
- Simulated Clinic runs events when they are due, in real time.
- When events run, they generate HL7v2 messages.
A pathway is a sequence of clinical actions or events that describe the lifetime of a patient's stay in a hospital. An example of a simple pathway could be: the patient is admitted, a doctor orders an X-ray, the X-ray is taken, and the patient is discharged. Each action typically generates one or more HL7v2 messages.
Simulated Clinic runs pathways. You can configure Simulated Clinic to run the pathways that you want, including how frequently to run each one. The application includes a few built-in pathways (see the folder "config/pathways") but most people will want to write their own.
Pathways are written using YAML or JSON and are human readable. The events are defined with words that are common in clinical settings such as "admission", "discharge", etc., and utility actions such as time delays.
-
Get started by downloading & running Simulated Clinic.
-
See an example of the messages that Simulated Clinic generates.
-
Write pathways to create patients with specific conditions, for instance, a patient with appendicitis that has sets of Vital Signs taken periodically.
-
Change the default behavior of Simulated Clinic using command-line arguments, including:
- What pathways Simulated Clinic runs and their distribution, i.e., what pathways should run more frequently than others.
- What specific values to set for some fields in the HL7v2 messages in order to comply, or not, with the values in the HL7v2 standard. For instance, you can configure what should be set as the Sending Facility in the generated messages, or what keyword to use to represent that a set of laboratory results is amended.
- The demographics of the patients that are generated: names, surnames, ethnicity, etc. For instance, you can configure how many patients will have middle names, or what is the probability that a patient will have pre-existing allergies.
-
Control a running instance Simulated Clinic using its Dashboard (screenshot). Using the dashboard, you can do the following:
- Change the message-sending rate of a self-running simulation.
- Start an ad-hoc pathway or send an HL7v2 message.
-
Extend Simulated Clinic with advanced functionality using source code. For instance, you can change the format of the identifiers that Simulated Clinic generates, or create your own behavior for some events.
Prerequisites: install docker.
Run the latest version of Simulated Clinic:
docker build -t simclinic .
docker run --rm -it -p 8000:8000 simclinic \
-output mllp \
-mllp_destination host.docker.internal:6000 \
-dashboard_address :8000Stop the simulator with Ctrl-C.
See more instructions on how to download & run Simulated Clinic.