{
 "use_case": "hcc-evidence-file",
 "title": "HCC evidence file: a member with eight submitted codes, three of them resting on records an audit would not accept",
 "about": "A synthetic Medicare Advantage member (service year 2025) with nine submitted diagnosis codes (eight map to CMS-HCC V28 payment HCCs) and four notes plus an addendum: an internist's visit, a cardiology visit, an audio-only phone call, a diagnostic radiologist's CT report, and an addendum a coder wrote five months after the visit. The review must delete the 2021 heart attack coded as acute and the breast cancer treated in 2016, hold the codes whose only evidence is in the phone call and the radiology report, keep diabetes with CKD, CKD 3b and heart failure with MEAT quotes, report the net effect, refuse an 'opportunities' mode, and sign a record that verifies and fails when changed.",
 "licence": "Synthetic: the member, providers and notes are invented (decosa_api/verticals/hcc/synth.py). ICD-10-CM and the CMS-HCC V28 mapping are CMS/CDC public-domain works. Part of decosa-api, AGPL-3.0-or-later.",
 "inputs": [
  {
   "file": "inputs/member.json",
   "what": "Member id (fictional) and service year."
  },
  {
   "file": "inputs/codes.json",
   "what": "The diagnosis codes submitted for the year."
  },
  {
   "file": "inputs/notes.json",
   "what": "The notes: date, record type, provider, credential, specialty, signature, addenda and text."
  }
 ],
 "steps": [
  {
   "id": "review",
   "method": "POST",
   "path": "/hcc/review",
   "body": {
    "member": {
     "$file": "inputs/member.json"
    },
    "codes": {
     "$file": "inputs/codes.json"
    },
    "notes": {
     "$file": "inputs/notes.json"
    },
    "synthetic": true
   },
   "timeout": 300
  },
  {
   "id": "refuse",
   "method": "POST",
   "path": "/hcc/review",
   "body": {
    "member": {
     "$file": "inputs/member.json"
    },
    "codes": {
     "$file": "inputs/codes.json"
    },
    "notes": {
     "$file": "inputs/notes.json"
    },
    "synthetic": true,
    "mode": "opportunities"
   },
   "expect_status": 400
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "$ref": "review.record"
   }
  },
  {
   "id": "tampered",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "$ref": "review.record"
   },
   "tamper": {
    "at": "statement.status",
    "set": "all_supported"
   }
  }
 ],
 "checks": [
  {
   "says": "the 2021 heart attack coded as acute is not supported (delete)",
   "path": "review.codes[code=I214][0].verdict",
   "equals": "not_supported"
  },
  {
   "says": "breast cancer treated in 2016 is not supported (delete)",
   "path": "review.codes[code=C50911][0].verdict",
   "equals": "not_supported"
  },
  {
   "says": "morbid obesity is held: its only evidence is an audio-only call",
   "path": "review.codes[code=E6601][0].reasons",
   "equals": [
    "invalid_record"
   ]
  },
  {
   "says": "COPD is held: its only evidence is a diagnostic radiologist's report",
   "path": "review.codes[code=J449][0].reasons",
   "equals": [
    "invalid_record"
   ]
  },
  {
   "says": "diabetes with CKD is kept",
   "path": "review.codes[code=E1122][0].verdict",
   "equals": "supported"
  },
  {
   "says": "chronic systolic heart failure is kept",
   "path": "review.codes[code=I5022][0].verdict",
   "equals": "supported"
  },
  {
   "says": "at least two codes are to be deleted",
   "path": "review.net_effect.codes.delete",
   "min": 2
  },
  {
   "says": "the net effect covers all eight HCC codes",
   "path": "review.net_effect.codes.submitted",
   "equals": 8
  },
  {
   "says": "the code outside the model (I10) is listed as not reviewed",
   "path": "review.not_reviewed[code=I10]",
   "count": 1
  },
  {
   "says": "the coder's late addendum is not an acceptable record",
   "path": "review.notes[id=N1-A1][0].valid",
   "equals": false
  },
  {
   "says": "the evidence file lists deletions first",
   "path": "review.evidence_file_md",
   "contains": "## Delete: not supported, do not submit"
  },
  {
   "says": "an opportunities mode is refused",
   "path": "refuse.error",
   "contains": "only checks the diagnosis codes you submitted"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "a record with its status changed no longer verifies",
   "path": "tampered.ok",
   "equals": false
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 10
  }
 ]
}