Case authoring schema¶
Cases live in app/cases_draft/*.json (general practice) and app/cases_oncology/*.json. This page documents fields, not case content.
Top-level fields¶
| Field | Audience | Meaning |
|---|---|---|
id, title, schema_version, status |
All | Identity and draft status (demonstration_* for unreviewed drafts). |
specialty |
Progress | Specialty track: family_medicine (non-specialist consultations such as fevers and general complaints), infectious_disease, pulmonology, gastroenterology, endocrinology, oncology or palliative_care (app/specialties.py). The compiler rejects any other value. Pending clinician confirmation. |
persona |
Authoring, speech style | Independent dimensions: age, gender, occupation, area, language, register, literacy, health literacy, household, constraints. Never infer one from another. |
opening |
Patient | What the patient says first. |
patient_knowledge |
Patient policy | What the patient knows and does not know. |
speech_style |
Realizer | Conversational variation, independent of demographics. |
voice |
Speech | sarvam_speaker and gemini_voice (validated against provider lists, matched to the speaker's gender), baseline_affect, affect_range, pace range within 0.5–2.0. |
facts[] |
Patient policy | See below. |
permitted_negatives |
Improviser | Topics the patient may deny when asked (id from the shared library, about, triggers, review). Never a feature the case's truth makes plausible. |
attendant |
Speech, policy | Optional family member or caregiver: relation, gender, a voice that must differ from the patient's, facts[] (same shape, plus optional interject), review. |
examination |
Examiner channel | granularity (ask_to_specify or general_survey) and components keyed by system (vitals, chest, ...). |
exam, tests |
Examiner channel | Raw authored vitals and test results; every test key must map to a concept in services.KEY_CONCEPTS. |
kernel |
Assessor only | clue, followup, unlocks, miss, plus fact (the patient fact carrying the clue) and use_actions (authored exams/orders that count as using it). |
critical_rules |
Assessor only | Deterministic required / unsafe rules: match on facts, action types, released items_any, text_any, with optional unless_facts. |
truth, timeline, ddx, kernel, actions, unsafe, closure, assessment, review |
Assessor only | Never sent to a patient realizer. |
Paper personas¶
Three draft cases implement the personas in the paper's figure (app/cases_draft/persona_*.json, cohort Clinical practice):
| Persona | Case | Notes |
|---|---|---|
| A | persona_a_kiln_cough |
50-year-old woman, brick-kiln worker, western Uttar Pradesh; Western Hindi register; persistent cough whose household-contact clue must be elicited |
| B | persona_b_kundli_diabetes |
65-year-old farmer from Kundli, Haryana; Haryanvi/Hindi code-mixing; glycaemic decompensation with a painless infected foot ulcer; his son interjects about missed tablets |
| C | persona_c_bengali_goals_of_care |
62-year-old Bengali-speaking retired teacher; difficult goals-of-care conversation; his daughter interrupts with a different concern. The catalogue suggests Bengali (suggested_language) and the Hindi source is realized in Bengali |
Register is chosen by faculty independently of literacy, income or occupation; dialect negations such as कोनी are protected like नहीं. All three are pending clinician and native-speaker review.
Facts¶
{
"id": "intake_output",
"disclosure": "Targeted hydration",
"patient_known": true,
"requires": [],
"affect": "worried",
"about": "fever: when it started, how high, what helps",
"attributes": {
"max_temperature": {"about": "how high the fever goes", "triggers": ["बुखार कितना", "fever kitna", "thermometer"],
"patient_voice": {"hi-IN": {"levels": ["..."], "review": "draft_..."}}}
},
"content": "Clinical note for faculty and assessment",
"patient_voice": {
"hi-IN": {
"levels": ["vague gist", "characterized detail", "precise detail"],
"review": "draft_pending_native_speaker_and_clinician_review"
}
}
}
Rules enforced by the compiler:
- Fact ids are unique;
requiresrefers only to existing facts and has no cycles. - Every fact has 1–3 non-empty
patient_voice["hi-IN"].levels, gist first. Each level adds new detail rather than repeating earlier ones; together they cover the clinical note. - Patient voice is first person, uses lay quantities (fever in °F, approximate durations) and contains no clinical shorthand.
A rendering becomes reviewed when its review is approved. Case-level review.clinical, review.language and review.source_applicability work the same way.