iris-fhir-client

Downloads52
Subscribe
0
Bookmark
1
This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.
Details
Releases
Reviews
Issues

What's new in this version

Patient Resource Search added
Creation of Patient Resource added
Creation of Patient Observations added

Summary

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)

Application Layout

ezgif com-gif-maker (2)

Online Demo

https://irisfhirclient.demo.community.intersystems.com/csp/fhirclient/index.csp by using SuperUser | SYS

Video on YouTube

https://youtu.be/xaRoIcuDD_M

Features

  • 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

Recommendation

How to Run

To start coding with this repo, you do the following:

  1. Clone/git pull the repo into any local directory
git clone https://github.com/mwaseem75/iris-fhir-client.git
  1. Open the terminal in this directory and run:
docker-compose build
  1. Run the IRIS container with your project:
docker-compose up -d

Installation with ZPM

zpm "install iris-fhir-client"

Repo Contents

  • 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.

Requirements:

Getting Started

Registered FHIR Servers

Connect to IRIS Terminal
docker-compose exec iris iris session iris
To list down registered server use ServerList() of dc.FhirClient class
do ##class(dc.FhirClient).ServerList()

image

To Register New Server use RegisterServer() function of dc.FhirClient class
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/"," "," ")

image

To Activate server, call below method by passing server ID
do ##class(dc.FhirClient).SetFhirServer(2)

Get Resources from the FHIR Servers

To Retrieve all the resouces for the current server use ListResources() method of dc.FhirClient class
do ##class(dc.FhirClient).ListResources()

image

In order to display number of recordes of any resources use CountResource() method by passing Resource of dc.FhirClient
Below command will get counter of Patient Resource against active FHIR Server
set count = ##class(dc.FhirClient).CountResource("Patient")
write count
To Retrieve all the created Resources along with their count just pass 1 to ListResource() function
do ##class(dc.FhirClient).ListResources(1)

image

Get Resources information by providing resource from active server

To get details of the resource use GetResource() by passing Resource of dc.FhirClient class
Currently list of following resources is available
  • Patient
  • Observation
  • Procedure
  • Immunization
  • Encounter
  • Organization
  • Condition
  • Practitioner
Below command will retrieve all the Patients from the active FHIR Server
do ##class(dc.FhirClient).GetResource("Patient")

image

Below command will retrieve all the Observations from the active FHIR Server
do ##class(dc.FhirClient).GetResource("Observation")

image

Get Resources for particular patient from the FHIR Servers

Currently list of following resources against the patient is available
  • Observation
  • Procedure
  • Immunization
  • Encounter
  • Organization
  • Condition
  • Practitioner
Below command will retrieve Observations detail against Patinet ID 1 from the active FHIR Server
do ##class(dc.FhirClient).GetPatientResources("Observation","1")

image

Below command will retrieve detail of Encounters against Patinet ID 1 from the active FHIR Server
do ##class(dc.FhirClient).GetPatientResources("Encounter","1")

image

Search in Patient Resource

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")

image

Below command will search Patient given Name and family Name contaning "Don"

do ##class(dc.FhirClient).GetResource("Patient","name","Don")

image

Below command will search all the male patients

do ##class(dc.FhirClient).GetResource("Patient","gender","male")

image

Create Patient Resource

below CreatePatient() function of dc.FhirClient can be use to Create Patient Resource
ClassMethod CreatePatient(givenName As %String, familyName As %String, birthDate As %String,gender As %String)
function requires giveName,failyName,birthDate and gender to create Patient Resource
below command will create Patient
do ##class(dc.FhirClient).CreatePatient("PatientGN","PatientFN","2000-06-01","male")

image

Let's search the newly created resource by it's name

do ##class(dc.FhirClient).CreatePatient("PatientGN","PatientFN","2000-06-01","male)

image

Patient ID 8111 is created

Create Patient Observation Resource

Let us create Observation against our newly created Patient Resource
below CreateObservatoin() function of dc.FhirClient can be use to Create Patient Observatoins
ClassMethod CreateObservation(patientId As %String, loincCode As %String, ObrCategory As %String, ObrValue As %Integer, ObrUOM As %String, effectiveDate As %String)
Parametres
  • 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
below command will create Patient Vital Sign Observation
do ##class(dc.FhirClient).CreateObservation("8111","8310-5","vital-signs",96.8,"degF","2022-01-22")

image

Let's List down patient observations

do ##class(dc.FhirClient).GetPatientResources("Observation","8111")

image

Observation ID 8114 is created

View FHIR Server information from CSP Web application

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

170881284-b18aebca-e6a2-4a6e-ad20-a537c13ff51c

Index page will display FHIR Server List with active server selected. Select other server from the list to view details of selected server

image

Hover to Patient ID and select to get details of Patient Resources

image

This page will display count of some of Patient Resources along with Patient Observations details

170881340-a9cd0c77-bf24-4e8e-85f7-84e04b527b49

Other information

Template used in web application is from Bootstrap 4 Admin Dashboard and it is free to use to develop non-commercial applications.

Thanks

ZPM installation
zpm "install iris-fhir-client"
Rating
5 (1)
Category
Frameworks
Works with
InterSystems IRIS for Health
Tags
Info
Version
1.0.2
Last updated
2022-06-04
Repository
Open
License
Link
Rewards