Introduction to EHRbase 1-Overview and Environmental Improvement

Introduction

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.


EHRbase development environment

Lists the main software components used by EHRbase as a development environment. The environment is built with docker, but please install it if necessary.


EHRbase overview


What EHRbase is aiming for


EHRbase Organizational Governance


EHRbase architecture

ehrbase_platform.png

Christian Chevaley, EHRbase, the 3rd openEHR Asia summit, online, July 24, 2020.


EHRbase and its surroundings

ehrbase_context.png

Christian Chevaley, EHRbase, the 3rd openEHR Asia summit, online, July 24, 2020.


EHRbase server


EHRbase SDK


Development environment construction


Before installing EHRbase

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.


EHRbase installation

** Important **: Please note that the official procedure may cause it to stop working.

  1. Create docker-network
  2. Setting up a container with PostgreSQL and related plugins
  3. Create an EHRbase application container

Creating docker-network

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

Setting up a container with PostgreSQL and related plugins

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

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

Build an EHRbase server

$ 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
$ mvn package
$ java -jar application/target/application-0.13.0.jar

API confirmation

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

EHR registration

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"
}

Template registration

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

Introduction to EHRbase 1-Overview and Environmental Improvement
Introduction to PlayFramework 2.7 ① Overview
Introduction to EHRbase 2-REST API
[Introduction to Java] Variable declarations and types
Introduction to Ruby 2
Introduction to SWING
Introduction to web3j
Introduction to Micronaut 1 ~ Introduction ~
[Java] Introduction to Java
Introduction to migration
Introduction to Apache Beam (1) ~ Reading and writing text ~
Introduction to java
Introduction to Doma
Introduction to JAR files
Introduction to Ratpack (8)-Session
Introduction to RSpec 1. Test, RSpec
Introduction to bit operation
Introduction to Ratpack (6) --Promise
Introduction to Ratpack (9) --Thymeleaf
Introduction to Android Layout
Introduction to design patterns (introduction)
Introduction to Practical Programming
Introduction to jar command
Introduction to Ratpack (2)-Architecture
SystemSpec introduction and writing
Introduction to lambda expression
Introduction to java command
Introduction to RSpec 2. RSpec setup
Introduction to Keycloak development
Introduction to javac command
Introduction to Effective java by practicing and learning (Builder pattern)
Introduction purpose of ActiveHash and simple flow to application implementation