Giter Club home page Giter Club logo

akivanc88 / medical-transcribe-summarize-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ikram-shah/iris-fhir-transcribe-summarize-export

0.0 0.0 0.0 2.66 MB

A full-stack application that allows practitioners to record voice notes and also export them to Google Docs/Sheets.

Home Page: https://openexchange.intersystems.com/package/IRIS-FHIR-Transcribe-Summarize-Export

License: MIT License

Shell 0.36% JavaScript 1.05% Python 65.50% CSS 0.05% HTML 0.39% Vue 22.58% Dockerfile 0.32% ObjectScript 9.75%

medical-transcribe-summarize-export's Introduction

IRIS FHIR Transcribe-Summarize-Export

This is a full-stack application that allows practitioners and other clinicians to record voice notes linked to a subject and also export them to Google Docs/Sheets.

  1. The UI enables voice recording and the audio is transcribed to text using Open AI Whisper API.
  2. Then the notes are summarized using Open AI gpt4-turbo model and stored as Document References in FHIR server.
  3. Finally, there is an option to export the stored documents to Google Docs in an account of user's choice through OAuth2. Other data like Observations can be exported to Google Sheets.

Note - This implements a Community ideaπŸ’‘. Docs and Sheets export is directly handled via REST api in IRIS now. It's not an interoperability adapter yet and it's WIP.

The application also acts as a dashboard to view patient and other information like observations and encounters.

The frontend UI is built as a Vue.js app. The backend is powered by IRIS REST api and there is an underlying FHIR server running to store all data. The application uses embedded-python to connect to FHIR api via fhirpy module.

Folder Structure

iris-fhir-transcribe-summarize-export/
β”œβ”€β”€src
β”‚   β”œβ”€β”€ fhir/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ python/                  //backend
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ vue/                     //frontend
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ .env                 //environment file to add the openai_api_key and google_client_id
β”‚   β”‚   └── ...
β”œβ”€β”€ Other/
β”‚   └── IRIS-FHIR-...            //postman collection
β”œβ”€β”€ Scripts/
β”‚   β”œβ”€β”€ iris.script
β”‚   β”œβ”€β”€ rebuild.sh
β”‚   └── synthea-loader.sh
β”œβ”€β”€ Scripts/
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md
└── LICENSE

Build and run

  1. Refer here to create an OpenAI API key. This is used in the transcription and summarizing the voice notes features. Set the key in .env for frontend.
  2. Follow steps in following section to configure OAuth Client ID for Google docs/sheets export. Set it in .env.
  3. Run below script to start frontend and backend apps. UI hot reloads, so no need to rebuild for every change. But backend needs a rebuild every time.
    ./scripts/rebuild.sh

Useful Links

  1. UI - http://localhost:8080
  2. Backend - http://localhost:52773/fhir/api/patient/all
  3. FHIR server - http://localhost:52773/fhir/r4/Patient

Configure Google OAuth Client ID

❗The below steps take only a few minutes to get a new Client ID for testing. But, feel free to raise an issue to add specific mail IDs to our existing client ID to test quickly.❗

  1. Follow steps here to create a OAuth consent screen and client ID for a test project.
  2. Add scope required for docs and sheets export - https://www.googleapis.com/auth/documents, https://www.googleapis.com/auth/spreadsheets
  3. Configure authorized javascript origin and authorized redirect URI as http://localhost:8080 or whichever port you run the frontend vue app on.
  4. Add some test user email IDs to allow testing. Only these users can authorize via the OAuth flow. If you need to open it up for more users, then a mandatory review process is required. More details here.
  5. Set the obtained client ID in .env

Test FHIR REST API

Find the full list of APIs in Postman Collection.

Run in Postman

Basic Auth credentials, username - SuperUser, password - SYS.

Test IRIS commands

Uncomment print(rows) in irisfhirclient to view results

  1. Exec into container
    docker-compose exec iris iris session iris
  2. IRIS commands
    do ##class(fhir.dc.FhirClient).GetResource("Patient")
    do ##class(fhir.dc.FhirClient).GetPatientResources("Observation","1")

Run Unit Tests

  1. Exec into container
    docker-compose exec iris iris session iris
  2. IRIS commands
    zn "FHIRSERVER"
    Set ^UnitTestRoot = "/irisdev/app/src"
    Do ##class(%UnitTest.Manager).RunTest("fhir","/loadudl")

License

This project is licensed under the MIT License.

You can find the full text of the license in the LICENSE file.

medical-transcribe-summarize-export's People

Contributors

akivanc88 avatar ikram-shah avatar strangest-quark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.