InterSystems FHIR Client to connect any open FHIR Server and get resources information either by terminal or by using CSP Web application. Application is using functionality of embedded python by using fhirpy (FHIR client for python Library)
https://irisfhirclient.demo.community.intersystems.com/csp/fhirclient/index.csp by using SuperUser | SYS
- Registered any Open FHIR Servers
- List Down Server Details and Connect to any FHIR Server
- InterSystem FHIR Accelerator Service and SmartHealthIT Open FHIR Server are registered by default and ready to use
- Get Resources information by providing resource from active server
- Get Resources for particular patient from the FHIR Servers
- Search in Patient Resource
- Create Patient Resource
- Create Patient Observation Resource
- View FHIR Server information from CSP Web application
To start coding with this repo, you do the following:
- Clone/git pull the repo into any local directory
git clone https://github.com/mwaseem75/iris-fhir-client.git
- Open the terminal in this directory and run:
docker-compose build
- Run the IRIS container with your project:
docker-compose up -d
zpm "install iris-fhir-client"
- Dockerfile, docker-compose.yml, and module.xml files
- iris.script, contains script to execute during container initialization
- /src with source files of classes and CSP application
- /python with python source files
- /.vscode/settings.json for automatic server connections when opened in VS Code.
- Docker desktop
- Get the latest InterSystems IRIS for Health image for use in the Dockerfile: https://hub.docker.com/_/intersystems-iris-for-health
docker-compose exec iris iris session iris
do ##class(dc.FhirClient).ServerList()
class(dc.FhirClient).RegsterServer("Server Name","Endpoint","ApiKey"[optional],"EndpointOAuth"[optional]
To Register New Server use RegisterServer class method
do ##class(dc.FhirClient).RegisterServer("INTERSYSTEMS FHIR Server","http://localhost:52773/csp/healthshare/samples/fhir/r4/"," "," ")
do ##class(dc.FhirClient).SetFhirServer(2)
To Retrieve all the resouces for the current server use ListResources() method of dc.FhirClient class
do ##class(dc.FhirClient).ListResources()
In order to display number of recordes of any resources use CountResource() method by passing Resource of dc.FhirClient
set count = ##class(dc.FhirClient).CountResource("Patient")
write count
do ##class(dc.FhirClient).ListResources(1)
- Patient
- Observation
- Procedure
- Immunization
- Encounter
- Organization
- Condition
- Practitioner
do ##class(dc.FhirClient).GetResource("Patient")
do ##class(dc.FhirClient).GetResource("Observation")
- Observation
- Procedure
- Immunization
- Encounter
- Organization
- Condition
- Practitioner
do ##class(dc.FhirClient).GetPatientResources("Observation","1")
do ##class(dc.FhirClient).GetPatientResources("Encounter","1")
Patient Resource search parameter detaisl can be found here Below command will search agaisnt Patient Id 2395
do ##class(dc.FhirClient).GetResource("Patient","_id","2395")
Below command will search Patient given Name and family Name contaning "Don"
do ##class(dc.FhirClient).GetResource("Patient","name","Don")
Below command will search all the male patients
do ##class(dc.FhirClient).GetResource("Patient","gender","male")
ClassMethod CreatePatient(givenName As %String, familyName As %String, birthDate As %String,gender As %String)
do ##class(dc.FhirClient).CreatePatient("PatientGN","PatientFN","2000-06-01","male")
Let's search the newly created resource by it's name
do ##class(dc.FhirClient).CreatePatient("PatientGN","PatientFN","2000-06-01","male)
Patient ID 8111 is created
ClassMethod CreateObservation(patientId As %String, loincCode As %String, ObrCategory As %String, ObrValue As %Integer, ObrUOM As %String, effectiveDate As %String)
- patientId is the Id of Patient
- LioncCode is Lionc Code, Detail can be found here
- ObrCategory is Observation Category, Detail can be found here
- ObrValue is Observatoin Value
- ObrUOM is Observation Unit
- EffectiveDate
do ##class(dc.FhirClient).CreateObservation("8111","8310-5","vital-signs",96.8,"degF","2022-01-22")
Let's List down patient observations
do ##class(dc.FhirClient).GetPatientResources("Observation","8111")
Observation ID 8114 is created
Navigate to http://localhost:55037/csp/fhirclient/index.csp
Index Page will show active server Patients,Observations,Practitioners and Encounters count along with Patient and Registered Servers details
Index page will display FHIR Server List with active server selected. Select other server from the list to view details of selected server
Template used in web application is from Bootstrap 4 Admin Dashboard and it is free to use to develop non-commercial applications.