# HAPI FHIR Server on Windows (PostgreSQL & Apache Tomcat) 以下針對在Windows環境下使用Tomcat架設HAPI FHIR Server的操作步驟做說明: ## 環境與系統說明 以下是介紹時使用之軟體與版本: - Database: Postgresql 12.10 - Java Development Kit (JDK): 17.0.4.1 - Apache Tomcat: 9.0 - Docker: 24.0.6 (Maven install test時需要) - IDE: Eclipse ## Getting Started ### Step1: Installation - Postgresql: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads - hapi-fhir-jpaserver-starter: https://github.com/hapifhir/hapi-fhir-jpaserver-starter - JDK: https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html - Tomcat: https://tomcat.apache.org/download-90.cgi - Docker: https://docs.docker.com/desktop/install/windows-install/ ### Step2: 設定Postgresql 開啟PgAdmin 4,設定User: [Login/Group Roles] > [Create] > [Login/Group Role]  設定User name和password - user name: 位於General頁籤 - password: 位於Definition頁籤 於Privileges頁籤設定開啟 [Can Login?] 再來建立Database: [Databases] > [Create] > [Database]  設定Database Name,並選擇Owner為剛剛建立的User ### Step3: 建置 開啟Eclipse,建新專案 #### (1) 設定JDK Window>Preference>Java>Install JREs 添入上面下載的JDK版本  #### (2)Import HAPI FHIR starter 將hapi-fhir-jpaserver-starter引入(Import時選擇Existing Maven Projects)  需要先執行Maven install: 右鍵>Run As>8.Maven Install (會花一段時間),跑完如果是成功的會顯示BUILD SUCCESS  #### (3)設定application.yaml 設定檔: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml 設定使用Postgresql: ``` datasource: url: 'jdbc:postgresql://[localhost]:[port]/[table name]' username: [username] password: [password] driverClassName: org.postgresql.Driver jpa: properties: hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect hibernate.search.enabled: false ``` #### (5) 新增Server-Tomcat 新增Server>選擇Tomcat 9.0>Add the project    #### (6) Run the Server 把Server run起來:  成功🎺🎺:  /metadata:  ## 參考資料 1. [Build HAPI FHIR Server Tutorial from SCRATCH on Windows using PostgreSQL & Apache Tomcat Web Server](https://www.youtube.com/watch?v=5ypS1XJm4YE) -->同一作者有將資料整理成文件[Tutorial Build FHIR Server On Windows](https://hackmd.io/@victoriatjia/FHIR/https%3A%2F%2Fhackmd.io%2F%40victoriatjia%2Fbuild-fhir-server#Tutorial-Build-FHIR-Server-On-Windows)
×
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