
Description
Model and analyze patient journeys through a healthcare system with Neo4j — longitudinal care pathways, comorbidity, treatment-pattern queries across patients, encounters, diagnoses, and more.
SKILL.md
Patient Journey
Use this skill for healthcare patient-journey analysis: mapping individual care pathways, discovering comorbidities across a patient population, understanding provider–patient relationships, and querying longitudinal clinical data modelled as a graph.
Source reference:
This is a graph-modelling and query-pattern aid, not clinical guidance. Treat query results as analytical leads, not clinical diagnoses or regulatory conclusions. The bundled sample data is synthetic (Synthea, Massachusetts, seed 100) and does not represent real patients.
Introducing this package
When the user first opens this package, greet them with a short introduction in your own words — don't recite this file. Convey:
- The core idea: a patient's history is scattered across encounters, lab results, prescriptions, diagnoses, and the providers and facilities that delivered care. A graph represents those connections directly — traverse from a patient along their sequence of encounters, out to the conditions diagnosed, drugs prescribed, and measurements taken at each one, instead of stitching records together with joins.
- The bundled sample data is synthetic (Synthea, Massachusetts) with overlapping conditions such as hypertension and type 2 diabetes — enough to demonstrate single-patient pathways and cross-patient comorbidity patterns.
- What you can help with: explaining the model, walking through the query patterns from a single patient to population-level comorbidity analysis, importing the sample data or adapting the model to their own EHR, FHIR, or OMOP data, and running Cypher once a database is connected.
End with a clear next step, such as asking whether they'd like to explore the model or start importing data.
Model
- Nodes:
Patient {id, name, birthDate},Encounter {id, date, type},Observation {id, code, description, value, units},Condition {code, description},Drug {code, name},Provider {id, name},Speciality {name},Organisation {id, name, address}. - Relationships:
(Patient)-[:HAS_ENCOUNTER]->(Encounter),(Encounter)-[:NEXT]->(Encounter),(Encounter)-[:HAS_OBSERVATION]->(Observation),(Encounter)-[:DIAGNOSED]->(Condition),(Encounter)-[:PRESCRIBED]->(Drug),(Encounter)-[:ATTENDED_BY]->(Provider),(Provider)-[:HAS_SPECIALITY]->(Speciality),(Provider)-[:BELONGS_TO]->(Organisation). - Full schema, mappings, and sample CSVs are in
GRAPH_MODEL.jsonandsample-data/; runnable Cypher with expected results is inQUERIES.md.
Operational Constraints
For runnable examples:
- Prefer the bundled
sample-data/Import flow. Offer any write-based Cypher only after explicit confirmation that database writes are wanted. - Clarify the intended target database and connection before executing anything.
ConditionandDrugnodes are shared across patients by standardised code (SNOMED CT / RxNorm); comorbidity queries depend on this. If source data uses local codes, nodes will not merge and cross-patient queries return misleading results.Observation.valueis stored as a string to hold mixed measurement types; cast withtoFloat(o.value)for numeric comparisons.- Bound every
NEXTchain traversal with an explicit maximum depth.
Response Shape
When returning guidance, keep output structured:
Model assumptions
Cypher (if requested)
What this surfaces
Tuning options
Validation approach
More skills from the studio-agent-use-cases repository
View all 5 skillsev-route-planning
plan electric vehicle routes with graph analysis
Aug 18Graph AnalysisLogisticsNeo4jOptimizationidentity-validation
resolve identities across systems using graph analysis
Aug 18Data EngineeringGraph AnalysisIdentityNeo4jinsurance-claims-fraud
detect insurance claims fraud using graph analysis
Aug 18Data AnalysisFraudGraph AnalysisInsurance +1retail-banking
detect retail banking fraud rings
Aug 18FinanceGraph AnalysisNeo4jSecurity