Demonstration of using OpenAI to generate FHIR Queries for exploring FHIR Server data and summarizing that data. You may also use it as a general GPT prompt response platform.
- A running instance of AHDS FHIR Service or Azure API for FHIR
- A running instance of Azure OpenAI Service and gpt-turbo-35 or gpt-4 deployed conversation completion model resource
- A registered Public Client
- Enable CORS on FHIR Server
Note: This is a SPA client and is not secure it is for demonstration purposes and not to be used in production or with any PHI/PII.
AAD App Registration that is used for access to FHIR Server and OAuth setup needs to have
- SPA redirect URLs registered
- Access and ID tokens enabled
- API permissions granted to access Graph and Azure Healthcare APIs
- Download and install nodejs and npm for your platform
- Switch to root directory of this repo
- Run
npm install
- Provide the following JSON Configuration object info as a single string environment variable named NODE_CONFIG:
{
"aiConfig": {
"aiResourceName": "<your open ai resource name>",
"aiDeploymentName": "<your open ai deployment name>",
"aiAPIVersion": "<your open ai api version>",
"aiKey": "<your open ai key>"
},
"fhirConfig": {
"fhirEndpoint": "<your fhir server endpoint URL>"
},
"authConfig": {
"clientId": "<your fhir server principal client id>",
"authority": "<your fhir server principal client authority e.g. https://login.microsoftonline.com/{tenantid}>",
"redirectUri": "<your fhir server principal client redirect url e.g. http://localhost:3000>"
}
}
Note: example in nodeconfig.json
5. Run npm start