FUME - FHIR資料轉換的開源軟體介紹 === 主要參考資料 --- * [FHIR Conversion Made Easy](https://www.devdays.com/wp-content/uploads/2024/07/6.12.24-Daniel-Mechanik-FHIR-Conversion-Made-Easy.pdf):2024 DevDays由Daniel Mechanikz發表。 * [fume-community](https://github.com/Outburn-IL/fume-community):原始碼github位址 * [FUME官方網站](https://www.fume.health/) * [FUME Designer | Online FHIR Converter](https://try.fume.health/) 實作步驟 --- 1. [Getting Start](https://github.com/Outburn-IL/fume-community/blob/main/docs/getting-started.md) 2. docker版本:修改原始碼`docker-compose.yml`添加FHIR Server與相關連結設定。 ``` services: server: container_name: fume-fhir-converter build: context: . dockerfile: Dockerfile ports: - "42420:42420" volumes: - "./snapshots:/usr/src/app/snapshots" logging: driver: "json-file" options: max-size: "10m" max-file: "10" compress: "true" env_file: - ./.env depends_on: - fhir db: container_name: fhirdb image: postgres restart: always environment: POSTGRES_PASSWORD: hapipoc POSTGRES_USER: hapipoc POSTGRES_DB: hapi # not needed for networking between containers but here for troubleshooting ports: - "5432:5432" fhir: container_name: fhir-fume image: hapiproject/hapi:latest ports: - "8080:8080" environment: HAPI_FHIR_USERNAME : admin HAPI_FHIR_PASSWORD : admin profiles.active: r4 spring.datasource.url: 'jdbc:postgresql://fhirdb:5432/hapi' spring.datasource.username: hapipoc spring.datasource.password: hapipoc spring.datasource.driverClassName: org.postgresql.Driver spring.jpa.properties.hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect spring.jpa.properties.hibernate.search.enabled: false depends_on: - db ``` 3. 使用FUME Designer ![fume101-1](https://hackmd.io/_uploads/HkI7wPtAJe.png) 4. 匯出StructureMap:`$resolve("StructureMap/<Map ID>") 5. 上傳StructureMap至FHIR Server ``` PUT <FHIR Server URL>/StructureMap/<Map ID> Content-Type: application/fhir+json Body: {StructureMap} ``` 實際Postman操作畫面如下: ![fume101-2](https://hackmd.io/_uploads/BkBVuDFCye.png) 6. 使用FUME engine API執行資料轉換 ``` POST <FUME engine base>/Mapping/<Map ID> Content-Type: {according to body content type} Body: Mapping input – Source message to convert by previously stored map ``` 實際操作畫面如下: ![fume101-3](https://hackmd.io/_uploads/rJ7huvK0yl.png) FUME應用 ![fume101-4](https://hackmd.io/_uploads/ryLBtAgkeg.png) 1. IG Analyzer匯入IG Package,產生IG ApplyModel Template 2. 使用FUME Designer產生IG之StructureMap Resource檔案 3. IG Analyzer驗證資料正確後,將相關StructureMap匯入FHIR Server 4. HIS根據IG ApplyModel Template產生ApplyModel資料檔 5. IG Agent呼叫FUME Engine,將ApplyModel資料檔轉換成IG Resource檔 6. IG Agent驗證IG Resource檔後,呼叫FHIR API將resource存入FHIR Server 7. IG Exporter產生IG Bundle檔 另一種架構則是直接將HIS資料轉換為FHIR JSON格式,也就是HIS提供ApplyModel資料 API,呼叫FUME Engine將ApplyModel資料即時轉換為FHIR API。技術上,設計相關流程必須考慮Resource Reference的相依性,同時回傳FHIR API僅提供單一Recource,必須能確認回傳值為單筆,實務上需要更多考量。然而,這樣做的優點是API即時回傳,並不需要資料暫存。 結論與未來發展 --- FUME提供了一個簡便的資料轉換引擎,可以將簡單的JSON或CSV格式資料,透過設定檔,快速轉會為FHIR格式資料。 透過適當的客製與整合,可將FUME發展成為一HIS與FHIR間之中介軟體,使用者只要持續發展StructureMap就可以快速發展FHIR資料轉換工具。