Transform RecordMap to FHIR
This is my first FHIR app
It contains a FHIR SERVER, imports test data, and demoes REST API usage with a simple web page.
I added an Interoperability Production which can transform a RecordMap to FHIR. It sends new patients to the FHIR SERVER.
Make sure you have git and Docker desktop installed.
Clone/git pull the repo into any local directory
$ git clone https://github.com/oliverwilms/iris-fhirserver.git
Open the terminal in this directory and run:
$ docker-compose up -d
The template provides several patients in /data/fhir folder which are automatically loaded. You can generate more patients doing the following. Open terminal shell in repository folder and call:
#./synthea-loader.sh 10
this will create 10 more patients in data/fhir folder. Then open IRIS terminal in FHIRSERVER namespace with the following command:
docker-compose exec iris iris session iris -U FHIRServer
and call the loader method:
FHIRSERVER>d ##class(fhirtemplate.Setup).LoadPatientData("/irisdev/app/output/fhir","FHIRSERVER","/fhir/r4")
with using the following project
Copy recordmap sample file to fhir-input directory inside the container
cp /opt/irisapp/delimited/RecordMap_Delimited_TX.txt /opt/irisapp/fhir-input/TX.txt
The EnsLib.RecordMap.Service.FileService sends the file to interop.bp.Transformer where the RecordMap record is transformed to FHIR. You should be able to find the patient in FHIRSERVER.
Open URL http://localhost:32783/fhir/r4/metadata you should see the output of fhir resources on this server
Get fhir resources metadata
GET call for http://localhost:32783/fhir/r4/metadata
Open Postman and make a GET call for the preloaded Patient:
http://localhost:32783/fhir/r4/Patient/1
the very basic frontend app with search and get calls to Patient and Observation FHIR resources could be found here:
http://localhost:32783/csp/user/fhirUI/FHIRAppDemo.html
or from VSCode ObjectScript menu:
While open the page you will see search result for female anemic patients and graphs a selected patient's hemoglobin values:
InterSystems IRIS FHIR Documentation FHIR API Developer Community FHIR section
This repository is ready to code in VSCode with ObjectScript plugin.
Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
Feel free to delete PackageSample folder and place your ObjectScript classes in a form /src/Package/Classname.cls Read more about folder setup for InterSystems ObjectScript
The script in Installer.cls will import everything you place under /src into IRIS.
The simplest dockerfile which starts IRIS and imports Installer.cls and then runs the Installer.setup method, which creates IRISAPP Namespace and imports ObjectScript code from /src folder into it. Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders. Use .env/ file to adjust the dockerfile being used in docker-compose.
Settings file to let you immedietly code in VSCode with VSCode ObjectScript plugin)
Config file if you want to debug with VSCode ObjectScript
ERROR #5001: Error -28 Creating Directory /usr/irissys/mgr/FHIRSERVER/ If you see this error it probably means that you ran out of space in docker. you can clean up it with the following command:
docker system prune -f
And then start rebuilding image without using cache:
docker-compose build --no-cache
and start the container with:
docker-compose up -d
This and other helpful commands you can find in dev.md
Transform RecordMap to FHIR
Added missing classes
Fix link in Read Me
Initial Release