How to Implement HAPI - FHIR?

1,058 views
Skip to first unread message

Avu

unread,
Mar 1, 2017, 5:22:49 AM3/1/17
to HAPI FHIR
Hello all,

I am newbie to work with FHIR. I have to set up the HAPI-FHIR in my local machine?

List me the steps required to set up my successful FHIR implementation. Thanks in advance.

qazy...@gmail.com

unread,
Mar 1, 2017, 2:18:44 PM3/1/17
to HAPI FHIR

linux command to start server:    ./hapi-fhir-cli run-server -f dstu3

linux way:

1- Make sure you have Java 8 : java -version
3- unzip the files to a directory with bzip2:  bzip2 -d hapi-fhir-2.2-cli.tar.bz2
4- with terminal, cd to directory above e.g. [user@localhost vshare]$ cd linux_hapi-fhir-2.2-cli/
5- to start the stu3 server instance run this command: ./hapi-fhir-cli run-server --fhirversion dstu3  or ./hapi-fhir-cli run-server -f dstu3
6- wait a moment to load then from a browser point to http://localhost:8080/ : this is the HAPI server stu3 instance without any populated resources
7- To populate the server with resources, open another instance of a terminal
8- ./hapi-fhir-cli upload-examples --fhirversion dstu3 -t http://localhost:8080/baseDstu3 :  if this gives you a 404 you have to manually upload the examples
9- wget  http://build.fhir.org/examples-json.zip to download the resource examples
10- ./hapi-fhir-cli upload-examples --data examples-json.zip -t http://localhost:8080/baseDstu3
11- refresh http://localhost:8080 : you will see FHIR resources loaded.
12- For others to see your HAPI FHIR server open port 8080: firewall-cmd --zone=public --add-port=8080/tcp --permanent
13-  sudo firewall-cmd --reload

Windows: hapi-fhir-cli run-server -f dstu3

Windows way:

1- Make sure you have Java 8 : java -version
3- unzip the files to a directory
4- click the Start button > search > cmd  : to open a dos session
5- cd to the directory you downloaded the zipped files above : e.g C:\Users\user>cd c:\vshare\hapi-fhir-2.2-cli
6- if you follow the instructions from url above, you will run the default dstu2 instance: hapi-fhir-cli run-server
7- to start the stu3 server instance : hapi-fhir-cli run-server --fhirversion dstu3  or hapi-fhir-cli run-server -f dstu3
8- wait a few moments to load then point your browser to: http://localhost:8080 : you will have a running local instance of stu3 server without any resources.
9- To populate the server with resources, open another instance of a terminal window ( step 4 above )
10- hapi-fhir-cli upload-examples --fhirversion dstu3 -t http://localhost:8080/baseDstu3 : if this gives you a 404 you have to manually upload the examples
11- manually download : http://build.fhir.org/examples-json.zip > copy the zip file to the directory above in step 5.
12- hapi-fhir-cli upload-examples --data examples-json.zip -t http://localhost:8080/baseDstu3
13- refresh  http://localhost:8080 and you will see populated resources.

Avu

unread,
Mar 1, 2017, 10:46:59 PM3/1/17
to HAPI FHIR
Thank you dude..Thank you very much.. @effi
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages