Light-Messenger helps MTRAs communicate with radiologists without calling them on the phone. Normally, urgent cases require that the MTRA calls up the Radiologist on the phone. While this communication is well established, it has the downside of interrupting the radiologist on duty along with disturbing the other people reading images in the same room. Instead of calling the radiologist the MTRAs can send a ambient light signal to the radiology the department has a lower interruption cost.
Light-Messenger is a web application that provides the solution described above. The MTRAs use a ui which allows them to create notifications with three different priorities. On the Radiology side, the doctors are presented with a list of open notifications regarding urgent cases that need to be acknowledged.
This application also supports an arduino that can hook into the application via a REST API and flash an LED in case there is a notification open so that the Radiologist can acknowledge the notification.
This is a screenshot of how it looks on the MTRAs side
This is a screenshot of how it looks for the radiologist department
TODO: image of the LED flashing in the Befund room :)
The development environment uses docker to spin up a local mysql instance. This can be replaced by a local mysql instance if required.
Requirements:
Go >= 1.12.1
mysql = 5.7.x
Docker >= 19.03.2
docker-compose >= 1.21.0
Git repository structure:
res
: resources including sql scripts to create tables and setup integration testssrc
: go source codestatic
: static web assets including the golang html templatesconfig-sample.json
: sample configuration in json format, note that the application binary requires aconfig.json
located in the same folder to rundocker-compose.yml
: docker configuration to spin up a mysql databasego.mod
: go modules filego.sum
: go modules checksum fileJenkinsfile
: ci configurationLICENSE
: licenselight-messenger.go
: main application entry pointMakefile
: build toolREADME.md
: this documentrun-dev.sh
: development script to rebuild application on code change
Steps:
- Copy the provided
config-sample.json
toconfig.json
and fill in with values as desired. Note that the integration tests currently use values provided inconfig-sample.json
. - Spin up the database in a separate shell:
docker-compose up
- Get the rice binary via
go get github.com/GeertJohan/go.rice/rice
- Build the application:
make build
- Create the default tables:
./light-messenger.exec db-exec --script-path ./res/create_tables.sql
- Run the application:
make run
All commands:
make deps
: get all dependencies, uses go modules to get exact dependencies.make run
: compile and executemake test
: run all testsmake test-unit
: run unit testsmake test-integration
: run integration tests
To setup a local mysql instance, create a database and user: light_messenger
and change the values in config.json
accordingly.
To setup auto recompile on code change, use the provided run-dev.sh
script. Note that this requires entr
TODO and ag
TODO.
To create a production release which is a self contained binary, run the following:
./release.sh
- Note that error stacktraces need to be enabled at the point of library interaction in the code. As an example, an error that occurs while communicating with the db needs to be wrapped with
errors.WithStack()
but this error can simply be passed along when used in the handler. The idea is to enable clean stacktraces and avoid Java-esque stacktrace recursion.
Systemd setup:
[Unit]
Description=Light Messenger
After=syslog.target
After=network.target
After=mysql.service
[Service]
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=nofasy
Group=nofasy
WorkingDirectory=/home/nofasy/light-messenger-dist
ExecStart=/home/nofasy/light-messenger/light-messenger.exec
Restart=always
RestartSec=10
#StandardOutput=file:/var/log/radiology-monitor.out
#StandardError=file:/var/log/radiology-montitor.err
Environment="USER=nofasy" "HOME=/home/nofasy"
Environment="GOPATH=/home/nofasy/.gvm/pkgsets/go1.12.1/global" "GOROOT=/home/nofasy/.gvm/gos/go1.12.1" "GVM_ROOT=/home/nofasy/.gvm"
Environment="PATH=/home/nofasy/.nvm/versions/node/v10.15.3/bin:/home/nofasy/.gvm/pkgsets/go1.12.1/global/bin:/home/nofasy/.gvm/gos/go1.12.1/bin:/home/nofasy/.gvm/pkgsets/go1.12.1/global/overlay/bin:/home/nofasy/.gvm/bin:/home/nofasy/.gvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
[Install]
WantedBy=multi-user.target
sudo systemctl enable light-messenger
sudo service light-messenger start
Logging:
TODO: