💻 Contributors - Ikram Shah and Sowmiya Nagarajan.
💪 Built with OpenAI, LangChain & Streamlit
apichain.demo.mp4
🤖 Ask question to any of your chosen FHIR API in natural language 🤖
![Screenshot 2023-07-04 at 12 31 35 AM](https://private-user-images.githubusercontent.com/17762967/250755381-30f0a468-276a-41fe-9695-9c2be85ba86d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzUwMzU0NzQsIm5iZiI6MTczNTAzNTE3NCwicGF0aCI6Ii8xNzc2Mjk2Ny8yNTA3NTUzODEtMzBmMGE0NjgtMjc2YS00MWZlLTk2OTUtOWMyYmU4NWJhODZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjI0VDEwMTI1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4YmZjYmM3OTQ2ZWM2ZGFhZWY5OTA2MzFmNGYzNmMzZjE5MTQ2OTVkZDA0OTViMjFjMTc0Yjg1OTcwMTA1MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3NbvnhwXgL_aI8XJIsneWS0GZasWsaXw-iRSDmQbzlI)
Try online on Streamlit
- Get OpenAI Key from OpenAI Platform
- 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
Get OpenAI Key from OpenAI Platform
- Prerequisites: Git & Docker desktop
- Installation:
$ git clone https://github.com/ikram-shah/fhir-ai-and-openapi-chain.git
$ docker-compose up -d
- 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")
- Test FHIR R4 API by visitng http://localhost:32783/fhir/r4/metadata
pip install -r requirements.txt
streamlit run src/streamlit/src/main.py
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
└── LICENSE
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](https://private-user-images.githubusercontent.com/17762967/250776955-81d6cba7-8f74-4807-9197-5a3eca62427d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzUwMzU0NzQsIm5iZiI6MTczNTAzNTE3NCwicGF0aCI6Ii8xNzc2Mjk2Ny8yNTA3NzY5NTUtODFkNmNiYTctOGY3NC00ODA3LTkxOTctNWEzZWNhNjI0MjdkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjI0VDEwMTI1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiNTVkMzQ0MzA5YTlhN2U5ZTlmYWFhYzg1OWM4YzM2ODNmMDg4MzQ4MDZiYjk4Yjc2YTBlM2VjZjU3ODA2MTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TVBv13zNdnZ8pV_-Zr8jZkFtcV1ezWw2qED2xVxYGis)
FHIR Postman collection by apievangelist
InterSystems IRIS FHIR Documentation
This project is licensed under the MIT License.
You can find the full text of the license in the LICENSE file.