Git Product home page Git Product logo

simhospital's Introduction

Simulated Hospital

Simulated Hospital is a tool that generates realistic and configurable hospital patient data in HL7v2 format.

Simulated Hospital Logo

Disclaimer: This is not an officially supported Google product.

Overview

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 Hospital 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 Hospital 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.

Basic Concepts

The basic behavior of Simulated Hospital can be summarized as follows:

  • Simulated Hospital creates patients at a configurable rate.
  • When Simulated Hospital creates a patient, it associates the patient with a pathway.
  • A pathway models the events that will occur to the patient.
  • Simulated Hospital runs events when they are due, in real time.
  • When events run, they generate HL7v2 messages.

Pathways

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 Hospital runs pathways. You can configure Simulated Hospital 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.

Next steps

  • Get started by downloading & running Simulated Hospital.

  • See an example of the messages that Simulated Hospital 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 Hospital using command-line arguments, including:

    • What pathways Simulated Hospital 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 Hospital 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 Hospital with advanced functionality using source code. For instance, you can change the format of the identifiers that Simulated Hospital generates, or create your own behavior for some events.

Quickstart

Prerequisites: install docker.

Run the latest version of Simulated Hospital:

docker run --rm -it -p 8000:8000 eu.gcr.io/simhospital-images/simhospital:latest health/simulator

Stop the simulator with Ctrl-C.

See more instructions on how to download & run Simulated Hospital.

simhospital's People

Contributors

carmrui avatar cmiles74 avatar jordan83 avatar sonjoonho avatar taraojo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simhospital's Issues

Unable to build on Mac

Hi tried to build this on Mac. I am getting following error

/Users/shumonalam/Documents/simhospital/WORKSPACE:58:15: in
/private/var/tmp/_bazel_shumonalam/335dd65aaaca9d8a54966ea18af5f74a/external/io_bazel_rules_docker/repositories/deps.bzl:35:12: in deps
/private/var/tmp/_bazel_shumonalam/335dd65aaaca9d8a54966ea18af5f74a/external/io_bazel_rules_docker/repositories/py_repositories.bzl:36:19: in py_deps
Repository rule pip_import defined at:
/private/var/tmp/_bazel_shumonalam/335dd65aaaca9d8a54966ea18af5f74a/external/rules_python/python/pip.bzl:42:29: in
ERROR: An error occurred during the fetch of repository 'pip_deps':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_shumonalam/335dd65aaaca9d8a54966ea18af5f74a/external/rules_python/python/pip.bzl", line 40, column 13, in _pip_import_impl
fail("pip_import failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: pip_import failed: (src/main/tools/process-wrapper-legacy.cc:80: "execvp(python, ...)": No such file or directory
)
ERROR: /Users/shumonalam/Documents/simhospital/WORKSPACE:58:15: fetching pip_import rule //external:pip_deps: Traceback (most recent call last):
File "/private/var/tmp/_bazel_shumonalam/335dd65aaaca9d8a54966ea18af5f74a/external/rules_python/python/pip.bzl", line 40, column 13, in _pip_import_impl
fail("pip_import failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: pip_import failed: (src/main/tools/process-wrapper-legacy.cc:80: "execvp(python, ...)": No such file or directory
)
ERROR: no such package '@pip_deps//': pip_import failed: (src/main/tools/process-wrapper-legacy.cc:80: "execvp(python, ...)": No such file or directory
)

cannot establish mllp connection

When I tried to establish a connection to the MLLP adapter (https://github.com/GoogleCloudPlatform/mllp) by specifying mllp_destination option for SimHospital, an error occurred.
Error message:
FATA [2021-05-26T02: 16: 16Z] Cannot create Hospital Runner error = "cannot create default hospital config: cannot create the sender: cannot establish mllp connection on sender & {client: conn: address: 127.0.0.1: 2575 mllpKeepAlive: false mllpKeepAlivePeriod: 60000000000 count: 0}: cannot connect to tcp address 127.0.0.1: 2575: dial tcp 127.0.0.1: 2575: connect: connection refused "prefix = cmd / simulator source =" main. main (cmd / simulator / simulator.go: 134) ""

Both SimHospital and MLLP Adapter are running on the same server, and their commands are as follows:

[MLLP Adapter]
docker run --network = host
gcr.io/cloud-healthcare-containers/mllp-adapter \ / usr / mllp_adapter / mllp_adapter
--hl7_v2_project_id = $ PROJECT_ID
--hl7_v2_location_id = $ REGION
--hl7_v2_dataset_id = $ DATASET_ID
--hl7_v2_store_id = $ HL7_STORE_ID
--export_stats = false --receiver_ip = 127.0.0.1
--mllp_addr = https: //healthcare.googleapis.com: 443 / v1beta1
--logtostderr

[Sim Hospital]
docker run --rm -it -p 8000: 8000
eu.gcr.io/simhospital-images/simhospital:latest
health / simulator
-output mllp
-mllp_destination 127.0.0.1:2575

I confirmed that MLLP Adapter is listening on TCP 2575 and I could send a HL7 message to 127.0.0.1:2575.

Add Support for all HL7 V2 versions

Documentation states that it can generate HL7 v2 version messages.

simhospital is only generating messages for HL7 v2.3. can you please extend functionality to include HL7 v2.1-2.8 versions.

Docker unformatted information

Hi,
I was trying it out through docker run --rm -it -p 8000:8000 eu.gcr.io/simhospital-images/simhospital:latest health/simulator, and the installation part worked. After which INFO written with 30-40 lines of information. Most of the information looks like this.

Screenshot_20230327_132426

Getting Connection Refused to local MLLP Server

I am running the docker image it starts with the default command line in getting started, but when I add arguments to connect to a MLLP server (localhost) it fails with a connection refused errro.

I have tried sending messages to a 7edit Receive anda mirth connect listener channel.

It gets the same from both. I can send and receive between Mirth and 7edit no problems, so im sure its not a connection issue.

This is the command line: docker run --rm -it -p 8000:8000 eu.gcr.io/simhospital-images/simhospital:latest health/simulator -output mllp -mllp_destination localhost:6661 -mllp_keep_alive true

and this is the error:

FATA[2023-05-18T11:08:15Z] Cannot create Hospital Runner error="cannot create default hospital config: cannot create the sender: cannot establish mllp connection on sender &{client: conn: address:localhost:6661 mllpKeepAlive:true mllpKeepAlivePeriod:60000000000 count:0}: cannot connect to tcp address localhost:6661: dial tcp 127.0.0.1:6661: connect: connection refused" prefix=cmd/simulator source="main.main(cmd/simulator/simulator.go:134)"

Thx

Not able to run on Windows & linux. Need help

I cloned the project and when i did run the bazel build , it is throwing error like this both in Windows & linux

C:\trial\simhospital>bazel run /cmd/simulator:simulator
WARNING: Output user root "C:/Users/Manas Chandan/_bazel_Manas Chandan" contains a space. This will probably break the build. You should set a different --output_user_root.
INFO: Repository pip_deps instantiated at:
C:/trial/simhospital/WORKSPACE:58:15: in
C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/io_bazel_rules_docker/repositories/deps.bzl:35:12: in deps
C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/io_bazel_rules_docker/repositories/py_repositories.bzl:36:19: in py_deps
Repository rule pip_import defined at:
C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/python/pip.bzl:42:29: in
ERROR: An error occurred during the fetch of repository 'pip_deps':
Traceback (most recent call last):
File "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/python/pip.bzl", line 40, column 13, in _pip_import_impl
fail("pip_import failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: pip_import failed: (java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("python" "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/tools/piptool.par" --name pip_deps --input "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/io_bazel_rules_docker/repositories/requirements-pip.txt" --output "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps/requirements.bzl" --directory "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps"): The system cannot find the file specified.
(error: 2))
ERROR: Error fetching repository: Traceback (most recent call last):
File "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/python/pip.bzl", line 40, column 13, in _pip_import_impl
fail("pip_import failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: pip_import failed: (java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("python" "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/tools/piptool.par" --name pip_deps --input "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/io_bazel_rules_docker/repositories/requirements-pip.txt" --output "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps/requirements.bzl" --directory "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps"): The system cannot find the file specified.
(error: 2))
ERROR: no such package '@pip_deps//': pip_import failed: (java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("python" "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/rules_python/tools/piptool.par" --name pip_deps --input "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/io_bazel_rules_docker/repositories/requirements-pip.txt" --output "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps/requirements.bzl" --directory "C:/users/manas chandan/_bazel_manas chandan/k3fgmb6n/external/pip_deps"): The system cannot find the file specified.
(error: 2))
INFO: Elapsed time: 0.708s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

panic: unknown time zone Europe/London

running this command on macOs Big Sure version 11.4:

docker run --rm -it -p 8000:8000 eu.gcr.io/simhospital-images/simhospital:latest health/simulator

got this error:

panic: unknown time zone Europe/London
goroutine 1 [running]:
github.com/google/simhospital/pkg/hl7.timezoneLocation(0x1ba5df5, 0xd, 0xc0002d3220)
pkg/hl7/parser.go:121 +0x6c
github.com/google/simhospital/pkg/hl7.init()
pkg/hl7/parser.go:113 +0x5c9

Insurance

I dont see a way to add insurance. can you share a way to include IN1 segment
thank you,

Running on Windows

Has anyone had any luck running the bazel build on Windows? I either get the message that there are no targets and no modules are loaded

$ bazel build
WARNING: Usage: bazel build <options> <targets>.
Invoke `bazel help build` for full description of usage and options.
Your request is correct, but requested an empty set of targets. Nothing will be built.
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: 0 targets (0 packages loaded, 0 targets configured)
INFO: Analyzed 0 targets (0 packages loaded, 0 targets configured).
INFO: Found 0 targets...
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Elapsed time: 5.928s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action

Or that the bazel_gazelle_go_repository_tools repository cannot be found, with the error:

INFO: Repository bazel_gazelle_go_repository_tools instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule go_repository_tools defined at:
  C:/users/z00405bj.ad005/_bazel_z00405bj/xnsmx27y/external/bazel_gazelle/internal/go_repository_tools.bzl:116:38: in <toplevel>
ERROR: An error occurred during the fetch of repository 'bazel_gazelle_go_repository_tools':
   Traceback (most recent call last):
        File "C:/users/z00405bj.ad005/_bazel_z00405bj/xnsmx27y/external/bazel_gazelle/internal/go_repository_tools.bzl", line 42, column 25, in _go_repository_tools_impl
                env = read_cache_env(ctx, str(ctx.path(ctx.attr.go_cache)))
        File "C:/users/z00405bj.ad005/_bazel_z00405bj/xnsmx27y/external/bazel_gazelle/internal/go_repository_cache.bzl", line 81, column 13, in read_cache_env
                fail("failed to read cache environment: " + result.stderr)
Error in fail: failed to read cache environment: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("cat" C:/users/z00405bj.ad005/_bazel_z00405bj/xnsmx
27y/external/bazel_gazelle_go_repository_cache/go.env): The system cannot find the file specified.
 (error: 2)
ERROR: error loading package '': Encountered error while reading extension file 'bazel/go_dependencies.bzl': no such package '@com_google_fhir//bazel': no such package '@bazel_gazelle_
go_repository_config//': no such package '@bazel_gazelle_go_repository_tools//': failed to read cache environment: java.io.IOException: ERROR: src/main/native/windows/process.cc(202):
CreateProcessW("cat" C:/users/z00405bj.ad005/_bazel_z00405bj/xnsmx27y/external/bazel_gazelle_go_repository_cache/go.env): The system cannot find the file specified.
 (error: 2)
INFO: Elapsed time: 0.465s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

On my linux box this works just fine. Has anybody encountered this?

How is HL7 schema generated?

I'm looking for a hl7 parser for a project and this implementation looks promising. Can you share any details on how the schema files are generated? Would you be interested in splitting this package into its own repo?

@carmrui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.