Med Simplify – Clinical Text to FHIR Graph Generator
Med Simplify is a GenAI-powered Streamlit application designed to process unstructured clinical notes into FHIR-compliant resources, validate them, and visualize the structured data using knowledge graphs. This project is built with LangChain, OpenAI's LLMs, and Neo4j, and deployed on AWS EC2.
Features
Summarization (
Summary_code.py):
UsesChatOpenAIfromlangchain_openaito convert raw unstructured medical notes into clean, structured clinical summaries.
Prompting is done withHumanMessageto guide the LLM's responses.FHIR Conversion (
Summary_to_FHIR.py):
UsesChatOpenAIfromlangchain_openaito transform the summary into FHIR-compliant JSON. Prompting is done withHumanMessageto guide the LLM's responses.Validation:
- Summary Validation (
Validating_summary.py):
UsesOpenAIEmbeddingsto convert generated and ground truth summaries to vectors. Cosine similarity is calculated viascipy.spatial.distance.cosineto estimate confidence. - FHIR Validation (
Validating_FHIR.py):
FHIR resource is converted back into textual form (fhir_to_text) and compared with original summary using the same cosine-based validation technique.
- Summary Validation (
Graph Generation (
insert_and_visualize_graph.py):- Inserts FHIR data into Neo4j using Cypher queries.
- Uses NetworkX to fetch the graph and visualize it.
- Pandas and Matplotlib are used to render the graph and structure the data.
Streamlit UI (
app.py):- Combines all steps into an intuitive web interface.
- Handles file upload, LLM processing, validation metrics, and graph visualization in one place.
Tech Stack
- Language Model:
ChatOpenAI(LangChain wrapper) - prompting: HumanMessage (Prompting)
- Embedding:
OpenAIEmbeddings(LangChain) - Vector Similarity:
scipy.spatial.distance.cosine - Graph DB:
Neo4j - Graph Tools:
NetworkX,Matplotlib,Pandas - UI Framework:
Streamlit - Deployment:
AWS EC2 (Amazon Linux 2)
Deployment
The deployed app is hosted on AWS EC2.
Testing Instructions
- Give your openai_api_key and neo4j aura credentials.
- Write or upload an unstructured clinical note (
.txtfile). - The app will:
- Generate a clinical summary.
- Convert the summary to a FHIR resource.
- Validate both via cosine similarity.
- Insert and display the resulting FHIR graph.
Repository Access
Private repository access has been granted to:
genaihackathon2025@impetus.comtesting@devpost.com
Log in or sign up for Devpost to join the conversation.