네트워크/HL7 FHIR

[HL7 FHIR] FHIR 서버 설치

IT 기술자 2024. 11. 1. 11:00

hapi-fhir-jpaserver-starter

java spring maven 프로젝트로 docker를 제공하여, docker 또는 spring 구동으로 서버를 실행할 수 있다.

fhir의 모든 api를 full로 지원한다.
프로젝트 소스 : https://github.com/hapifhir/hapi-fhir-jpaserver-starter

 

GitHub - hapifhir/hapi-fhir-jpaserver-starter

Contribute to hapifhir/hapi-fhir-jpaserver-starter development by creating an account on GitHub.

github.com

 

docker로 실행

1. 세팅

MySql docker configuration 내용 추가
src/main/resources/application.yaml

spring:
  datasource:
    url: 'jdbc:mysql://hapi-fhir-mysql:3306/hapi'
    username: admin
    password: admin
    driverClassName: com.mysql.jdbc.Driver
    
# hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirH2Dialect

 

2. 실행

docker-compose up -d --build

 

spring 구동으로 실행

db 세팅

1. mysql 설치

sudo apt-get update
sudo apt-get install mysql-server
sudo systemctl start mysql
sudo systemctl enable mysql
sudo /usr/bin/mysql -u root -p

 

2. 외부 IP 접속 허용

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0

 

3. mysql 서비스 재시작

sudo systemctl restart mysql

 

4. lower_case_table_names=1 설정

참고 : https://stackoverflow.com/questions/51803216/lower-case-table-names-settings-in-mysql-8-0-12

 

lower_case_table_names Settings in MySQL 8.0.12

I've just compiled the version MySQL 8.0.12 in a Ubuntu 16.0.4. After following the instructions in the website and making the following my.cnf file: [mysqld] datadir=/usr/local/mysql/data socket...

stackoverflow.com

5. db 생성

create database hapi;

 

자바 세팅

1. java, maven 설치

apt-cache search openjdk
sudo apt install openjdk-17-jre openjdk-17-jdk
sudo apt install maven

 

2. 환경에 JAVA_HOME, PATH 추가

vi ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH="$PATH:$JAVA_HOME/bin"

 

3. MySql docker configuration 내용 추가

src/main/resources/application.yaml

spring:
  datasource:
    url: 'jdbc:mysql://localhost:3306/hapi'
    username: root
    password: root
    driverClassName: com.mysql.jdbc.Driver

# hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirH2Dialect

 

4. 실행

mvn jetty:run

 

hapi-fhir 프로젝트

hapi-fhir-jpaserver-starter가 사용하는 모듈들을 모두 포함한다.
fhir의 기본 기능들을 모두 제공한다.

프로젝트 메일 페이지 : https://hapifhir.io/hapi-fhir/docs/

 

Table of Contents

HAPI FHIR is an Open Source FHIR-based Clinical Data Repository. Powering the next generation of connected health systems.

hapifhir.io

 

프로젝트 소스 : https://github.com/hapifhir/hapi-fhir

 

GitHub - hapifhir/hapi-fhir: 🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers - hapifhir/hapi-fhir

github.com