###### tags: `FHIR` # HAPI-FHIR Database 轉置資料 (一) - Database結構 :::danger 注意此篇只研究**Postgres**,且只跟轉資料有關 ::: 由於出現了必須從HAPI-FHIR轉到另一個FHIR Server,且是完全不相同的結構。 小弟認為直接讀取HAPI-FHIR的Database應該會比FHIR WEB API還來得快,所以研究了一下HAPI-FHIR轉置資料所需要使用到的Data Tables。 # 環境配置 - [docker hapi-fhir-jpaserver-starter ](https://github.com/hapifhir/hapi-fhir-jpaserver-starter) - **Postgres** # HFJ_RESOURCE: Resource Master Table 記錄**create**、**update**所有Resource相關資料,ID、version、resourceType等。 | Name | Datatype | Description | | ------- | -------- | ----------------------------------------- | | res_ver | Long | 資料當前版本號,**每次PUT時,此筆資料同步更新版本號** | | res_id | bigint | 此資料在資料庫的唯一id | | res_type | String | resource type.(e.g. `Patient`) | 此資料表用來做以下事情: - 取得在FHIR Server所有的資料數量 - 確認每筆資料的version # HFJ_RES_VER: Resource Versions and Contents 記錄每一個version的資料,包含FHIR Resource JSON,**此資料表為轉置資料最主要的資料表**。 | Name | Datatype | Description | | ------- | -------- | ----------------------------------------- | | res_ver | Long | 資料當前版本號,**每次PUT時,都會新增一筆資料到此資料表**| | res_id | bigint | 此資料在資料庫的唯一id | | res_type | String | resource type.(e.g. `Patient`) | | res_text | byte[] (SQL LOB) | FHIR Resource資料,使用byte儲存 | 此資料表用來做以下事情: - 取得Resource的JSON資料 下一篇將實作轉置資料的方法。 # 參考資料 - [HAPI FHIR JPA Schema](https://hapifhir.io/hapi-fhir/docs/server_jpa/schema.html)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up