Blueprint: healthcare

Connected patient context for care-team workflows.

Connect ENCOUNTER and NOTE records to the PATIENT record alongside CONDITION and MEDICATION history, so a follow-up note like the A1c trend on encounter enc-90 stays linked to the type 2 diabetes condition it addresses. A care-team assistant retrieves notes about glucose control scoped to patient-3471 instead of reassembling that history from separate systems each session.

Healthcare Care Context is a RushDB pattern that connects PATIENT, ENCOUNTER, NOTE, CONDITION, and MEDICATION records with semantic search over note text so care-team workflows retrieve relevant history scoped to one patient instead of rebuilding it each session.

Patient context is fragmented across visits and systems.

Encounters, notes, conditions, and medications accumulate across visits and systems that rarely talk to each other. Without a connected record, encounters and notes stay scattered, conditions and medications are hard to view together, a workflow rebuilds relevant history from scratch on every run, and keyword search misses a note worded differently than the last one — so a care-team workflow spends effort reassembling context before it can surface what matters.

Before

  • Encounters and notes scattered across systems
  • Conditions and medications hard to view together
  • Relevant history rebuilt for each workflow run
  • Keyword search misses differently worded notes

With RushDB

  • Encounters, notes, and history connected per patient
  • Conditions and medications linked to the patient record
  • Relevant context retrieved by meaning and scope
  • One backend for search, filters, and relationships

Graph intelligence on ingest

Incoming data becomes queryable graph context.

Visit data lands as a PATIENT record with nested CONDITION, ENCOUNTER, and NOTE records, like the follow-up note on encounter enc-90 for patient-3471. RushDB types those fields on write, auto-links ENCOUNTER and NOTE records to their parent PATIENT, and keeps note text searchable so a query about glucose control surfaces the right note even when it is not the exact phrase used in the record.

01

Normalize as encounters arrive

PATIENT, ENCOUNTER, CONDITION, and NOTE payloads are typed on write, so fields like status and kind are filterable as soon as a visit is recorded.

02

Auto-link nested structure

ENCOUNTER and NOTE records nested under a PATIENT are automatically related to it, keeping the A1c note attached to patient-3471 without manual foreign keys.

03

Enrich scattered sources

Suggested-relationship analysis surfaces links between a CONDITION like type 2 diabetes and the MEDICATION and NOTE records that reference it across visits.

Suggested relationship analysis requires an LLM configured for the project. Suggestions stay in draft form until you approve them, so inferred domain meaning never mutates the graph silently. You can also add explicit relationships through the SDK or API.

Review suggested relationship patterns

Data model

One flexible graph for the workflow.

Start with the payload shape your product already produces. RushDB stores it as Records, infers typed properties, and keeps nested or approved domain relationships queryable.

Schema sketch
Patient payload

One patient write can carry conditions, encounters, and notes while later visits append new encounters and observations.

{
  "patientRef": "patient-3471",
  "CONDITION": [{ "name": "type 2 diabetes", "status": "active" }],
  "MEDICATION": [{ "name": "metformin", "status": "active" }],
  "ENCOUNTER": [{
    "encounterId": "enc-90",
    "kind": "follow-up",
    "NOTE": [{ "author": "care-team", "text": "A1c trending down after medication change." }],
    "OBSERVATION": [{ "code": "a1c", "value": 6.9, "unit": "%" }]
  }]
}

Working example

Connect the visit history. Retrieve the relevant note.

An encounter stores its note linked to the patient and condition. A later workflow retrieves notes about glucose control scoped to that patient.

Input
PATIENT patient-3471
  CONDITION "type 2 diabetes"  status: active
  ENCOUNTER enc-90  kind: follow-up
    NOTE "A1c trending down after medication change."
Query
{
  "labels": ["NOTE"],
  "propertyName": "text",
  "query": "recent changes in glucose control",
  "where": { "PATIENT": { "patientRef": "patient-3471" } }
}
Result
{
  "patient": "patient-3471",
  "encounter": "enc-90",
  "note": "A1c trending down after medication change.",
  "condition": "type 2 diabetes"
}

Python SDK

Connect the patient graph. Retrieve relevant context by scope.

RushDB stores encounters, notes, conditions, and medications as connected records and keeps note text searchable. Clinical interpretation stays with your application, workflow, and care team.

from rushdb import RushDB

db = RushDB('RUSHDB_API_KEY')

db.ai.indexes.create({'label': 'NOTE', 'propertyName': 'text'})

db.records.import_json({
    'label': 'PATIENT',
    'data': {
        'patientRef': 'patient-3471',
        'CONDITION': [{'name': 'type 2 diabetes', 'status': 'active'}],
        'ENCOUNTER': [{
            'encounterId': 'enc-90',
            'kind': 'follow-up',
            'NOTE': [{'author': 'care-team', 'text': 'A1c trending down after medication change.'}],
        }],
    },
})

history = db.ai.search({
    'labels': ['NOTE'],
    'propertyName': 'text',
    'query': 'recent changes in glucose control',
    'where': {'PATIENT': {'patientRef': 'patient-3471'}},
    'limit': 10,
})

Implementation blueprint

Build the healthcare care-context path.

Use this sequence to connect patient history and retrieve relevant context for care-team workflows.

  1. 01Import PATIENT records with ENCOUNTER, NOTE, CONDITION, and MEDICATION records
  2. 02Create a managed index for NOTE.text
  3. 03Append encounters and notes to the patient record over time
  4. 04Retrieve relevant history by patient, condition, and semantic query
  5. 05Return linked conditions and medications with each match

Build path

  • Scope every encounter, note, and observation to a patient reference.
  • Keep conditions and medications as records linked to the patient.
  • Recall by meaning with where filters so context stays on the right patient.
  • Present this as care-team support, not clinical decision automation.

How it works

Build the smallest useful workflow first.

01

Connect the patient graph

Import patients with their encounters, notes, conditions, and medications so history stays connected across visits.

02

Index note text

Create a managed embedding index once on the note text so history is retrieved by meaning, not exact keywords.

03

Retrieve relevant context

Pull notes, conditions, and medications scoped to the patient before a care-team workflow acts on them.

Know where it fits.

Care-team support, not medical advice

This pattern organizes and retrieves patient context for workflows. It does not replace clinical validation, governance, or medical judgment.

Keep data-control requirements in view

Review the available deployment paths, including using your own Neo4j instance, and validate the operational and compliance requirements for your environment.

Questions developers ask.