This article is the content of the lecture introduced at the 2nd openEHR study group in 2020. EHRbase is one of the open source software implementations of the openEHR specification. This time, I will introduce the architecture of EHRbase and how to build a development environment.
The following contents are constructed with reference to the following materials and the memo of Professor Ehime Kimura of Ehime University.
Lists the main software components used by EHRbase as a development environment. The environment is built with docker, but please install it if necessary.
Christian Chevaley, EHRbase, the 3rd openEHR Asia summit, online, July 24, 2020.
Christian Chevaley, EHRbase, the 3rd openEHR Asia summit, online, July 24, 2020.
EHRbase server
EHRbase SDK
This time we will build the environment with Docker, so we will prepare the environment so that docker can operate. docker-engine and docker-compose will work with relatively new versions, but not with older versions around ver 1.7.
** Important **: Please note that the official procedure may cause it to stop working.
Create a docker network for EHRbase with the following command
$ docker network create ehrbase-net
Check with docker network ls and it is OK if the following is displayed.
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
2c6a5b55365a bridge bridge local
4b82d2167e35 ehrbase-net bridge local
5ee3d71c037f host host local
31ab9819a783 none null local
If you are already using PostgreSQL, you can use it as it is, but you need to install the plug-in.
$ docker run --name ehrdb --network ehrbase-net -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 ehrbaseorg/ehrbase-postgres:latest
$ sudo apt install gcc bison flex postgresql libpq-dev postgresql-server-dev-all openjdk-11-jdk maven
temporal_tables
$ git clone https://github.com/arkhipov/temporal_tables.git
$ cd temporal_tables
$ make
$ sudo make install
$ make installcheck
If you get an error with make install check, create a ROLE with the same name as your Linux user name in PostgreSQL and give it database creation privileges.
Install jsquery
jsquery
$ git clone https://github.com/postgrespro/jsquery.git
$ cd jsquery
$ make USE_PGXS=1
$ sudo make USE_PGXS=1 install
$ make USE_PGXS=1 installcheck
$ docker run --name ehrbase --network ehrbase-net -d -p 8080:8080 -e DB_URL=jdbc:postgresql://ehrdb:5432/ehrbase -e DB_USER=ehrbase -e DB_PASS=ehrbase -e SYSTEM_NAME=local.ehrbase.org ehrbaseorg/ehrbase:latest
$ docker exec -i -t ehrbase /bin/bash
$ git clone https://github.com/ehrbase/ehrbase.git
$ cd ehrbase
$ sudo -u postgres psql -e < ./base/db-setup/createdb.sql
Maven environment settings
Edit pom.xml if necessary.
Package build
$ mvn package
$ java -jar application/target/application-0.13.0.jar
If it works, you will see a list of APIs built with Swagger-ui. The basic authentication user is ehrbase-user and the password is SuperSecretPassword.
http://localhost:8080/ehrbase/swagger-ui.html
Let's register EHR using Postman. Use the following JSON sample in the official tutorial.
{
"_type": "EHR_STATUS",
"subject": {
"external_ref": {
"id": {
"_type": "GENERIC_ID",
"value": "ins01",
"scheme": "id_scheme"
},
"namespace": "ehr_craft",
"type": "PERSON"
}
},
"other_details": {
"_type": "ITEM_TREE",
"items": []
},
"is_modifiable": "true",
"is_queryable": "true"
}
Create a Template using Template editing software such as Ocean Template Designer. Once created, output in operational template format.
After checking the contents of the XML file, register it with Postman according to the API.
The registered file can also be viewed using Postman.
Next time, we will register, read, update, and delete (CRUD) data based on this template.
Recommended Posts