{
 "use_case": "jottings-note",
 "title": "Write a note from my jottings: a full CBT session and a couples session with gaps",
 "about": "Two made-up therapy sessions. The first has every element an auditor looks for, plus a trap: the client's mother thinks she has bipolar disorder, which must stay the mother's opinion. The second has no start or stop time and no plan, and a joke about violence that must stay a joke (and is not a risk mention). The tool must draft a DAP and a SOAP note where every sentence cites a jotting, list the missing elements as [not in your notes] instead of filling them in, carry the risk line as written, refuse a session recording, and sign a record that verifies.",
 "licence": "Synthetic: the sessions, clients and clinicians are invented (decosa_api/verticals/jottings/data/samples.json). Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/jottings-cbt.txt",
   "what": "Typed jottings for an individual CBT session (panic)."
  },
  {
   "file": "inputs/goals-cbt.json",
   "what": "The treatment-plan goals."
  },
  {
   "file": "inputs/details-cbt.json",
   "what": "Client label (made up), clinician name and credential."
  },
  {
   "file": "inputs/jottings-couples.txt",
   "what": "Typed jottings for a couples session with no times and no plan."
  },
  {
   "file": "inputs/goals-couples.json",
   "what": "The couple's treatment-plan goals."
  }
 ],
 "steps": [
  {
   "id": "cbt",
   "method": "POST",
   "path": "/jottings/note",
   "body": {
    "jottings": {
     "$file": "inputs/jottings-cbt.txt"
    },
    "goals": {
     "$file": "inputs/goals-cbt.json"
    },
    "details": {
     "$file": "inputs/details-cbt.json"
    },
    "format": "dap",
    "synthetic": true
   },
   "timeout": 300
  },
  {
   "id": "gaps",
   "method": "POST",
   "path": "/jottings/note",
   "body": {
    "jottings": {
     "$file": "inputs/jottings-couples.txt"
    },
    "goals": {
     "$file": "inputs/goals-couples.json"
    },
    "format": "soap",
    "synthetic": true
   },
   "timeout": 300
  },
  {
   "id": "refuse",
   "method": "POST",
   "path": "/jottings/note",
   "body": {
    "jottings": {
     "$file": "inputs/jottings-cbt.txt"
    },
    "recording": "session.wav",
    "synthetic": true
   },
   "expect_status": 400
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "$ref": "cbt.report.record"
   }
  }
 ],
 "checks": [
  {
   "says": "every audited element is in the CBT jottings, so nothing is missing",
   "path": "cbt.report.missing",
   "count": 0
  },
  {
   "says": "the risk line carries the jotting as written",
   "path": "cbt.note.plain",
   "contains": "Risk (as written in your notes): \"denies SI/HI\""
  },
  {
   "says": "the start and stop times are the ones written, with the minutes between them",
   "path": "cbt.note.plain",
   "contains": "Total time: 53 minutes"
  },
  {
   "says": "the mother's opinion never becomes a diagnosis",
   "path": "cbt.note.plain",
   "not_contains": "diagnosed"
  },
  {
   "says": "no sentence was kept without a jotting behind it",
   "path": "cbt.note.note.sections[0].items",
   "count_min": 3
  },
  {
   "says": "the couples session is missing its start and stop times and its plan, and the draft says so",
   "path": "gaps.report.missing",
   "contains": [
    "start_time",
    "stop_time",
    "plan"
   ]
  },
  {
   "says": "missing elements are marked, not filled in",
   "path": "gaps.note.plain",
   "contains": "Start time: [not in your notes]"
  },
  {
   "says": "the joke keeps its 'no intent' (in the note, or listed beside it as written)",
   "path": "gaps.note.markdown",
   "contains": [
    "strangle",
    "intent"
   ]
  },
  {
   "says": "a joke is not a risk mention",
   "path": "gaps.report.risk.status",
   "equals": "not_mentioned"
  },
  {
   "says": "a session recording is refused",
   "path": "refuse.error",
   "contains": "never takes a session recording"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 6
  }
 ]
}