FHIR - AI and OpenAPI Chain

Downloads57
Subscribe
1
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
Videos
Articles

What's new in this version

Added ZPM package

FHIR - AI and OpenAPI Chain

Gitter
Quality Gate Status

πŸ’» Contributors - Ikram Shah and Sowmiya Nagarajan.

πŸ’ͺ Built with OpenAI, LangChain & Streamlit

Demo

https://github.com/ikram-shah/fhir-ai-and-openapi-chain/assets/17762967/99512028-8190-4581-9f0a-fd7b699c7d2c

Overview

πŸ€– Ask question to any of your chosen FHIR API in natural language πŸ€–

Screenshot 2023-07-04 at 12 31 35 AM

Try online on Streamlit

  1. Get OpenAI Key from OpenAI Platform
  2. Get FHIR Server API endpoint
    • You may either enter your own sample FHIR server (unauthenticated access needed)
    • You may create a temporary sample server in Intersystems IRIS FHIR platform

Try locally using local FHIR server

OpenAI API Key

Get OpenAI Key from OpenAI Platform

Setup Local FHIR Server

  1. Prerequisites: Git & Docker desktop
  2. Installation:
    $ git clone https://github.com/ikram-shah/fhir-ai-and-openapi-chain.git
    
    $ docker-compose up -d
    
  3. Generate sample patient data ref
    ./synthea-loader.sh 10
    
    docker-compose exec iris iris session iris -U FHIRServer
    
    FHIRSERVER>d ##class(fhirtemplate.Setup).LoadPatientData("/irisdev/app/output/fhir","FHIRSERVER","/fhir/r4")
    
  4. Test FHIR R4 API by visitng http://localhost:32783/fhir/r4/metadata

Streamlit

pip install -r requirements.txt
streamlit run src/streamlit/src/main.py

Folder Structure

fhir-ai-and-openapi-chain/
β”œβ”€β”€src
β”‚   β”œβ”€β”€ streamlit/              //streamlit code             
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ main.py                 
β”‚   β”‚   β”‚   └── ...
β”‚   └── fhirtemplate/
β”‚       β”œβ”€β”€ setup.cls
β”‚       └── ...
.
.
.
β”œβ”€β”€ requirements.txt            //requirements for streamlit to run
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md
└── https://github.com/ikram-shah/fhir-ai-and-openapi-chain/blob/master/LICENSE

Known Limitations

Due to the limitations imposed by OpenAI’s token usage, if the reference data + prompt being sent to the OpenAI API exceeds the specified limit, an error may be encountered.

Screenshot 2023-07-04 at 12 46 09 AM

Useful Resouces

HL7 OpenAPI Specifications

FHIR Postman collection by apievangelist

Run in Postman

InterSystems IRIS FHIR Documentation

FHIR API

Intersystems Community

License

This project is licensed under the MIT License.

You can find the full text of the license in the https://github.com/ikram-shah/fhir-ai-and-openapi-chain/blob/master/LICENSE file.

IPM installation
zpm "install fhir-ai-and-open-api-chain"
Rating
0 (0)
ObjectScript quality test
Passed
Updated on 06 December 2023
ObjectScript quality report
Category
Solutions
Works with
InterSystems IRIS for HealthInterSystems FHIR
Tags
Info
Version
1.0.1
Last updated
2023-07-07
Repository
Open
License
Link