{
 "site": "Care Review",
 "domain": "carereview",
 "description": "Prior authorization and utilization review: AI-drafted clinical summaries and criteria checks, nurse review, physician-only denials with peer-to-peer, appeals to a different physician, full audit.",
 "roles": [
  "physician",
  "admin",
  "intake",
  "nurse"
 ],
 "resources": [
  {
   "name": "policy",
   "description": "A clinical coverage policy: which service it covers and the criteria it applies.",
   "field": "status",
   "machine": {
    "initial": "draft",
    "states": {
     "draft": {
      "description": "",
      "transitions": {
       "activate": {
        "to": "active",
        "guards": [
         "physician",
         "admin"
        ],
        "requiredFields": [],
        "sets": {},
        "rules": []
       }
      }
     },
     "active": {
      "description": "",
      "transitions": {
       "retire": {
        "to": "retired",
        "guards": [
         "physician",
         "admin"
        ],
        "requiredFields": [],
        "sets": {},
        "rules": []
       }
      }
     },
     "retired": {
      "description": "",
      "transitions": {}
     }
    }
   }
  },
  {
   "name": "request",
   "description": "A prior-authorization request, from receipt to determination.",
   "field": "status",
   "machine": {
    "initial": "received",
    "states": {
     "received": {
      "description": "",
      "transitions": {
       "assign": {
        "to": "in_review",
        "guards": [
         "intake",
         "nurse",
         "admin"
        ],
        "requiredFields": [
         "nurse"
        ],
        "sets": {},
        "rules": []
       }
      }
     },
     "in_review": {
      "description": "",
      "transitions": {
       "approve": {
        "to": "approved",
        "guards": [
         "nurse",
         "physician",
         "admin"
        ],
        "requiredFields": [],
        "sets": {
         "decidedAt": "now()"
        },
        "rules": [
         {
          "name": "approveAfterHumanReview",
          "description": "No determination while AI work is still unreviewed, and none without a criteria check.",
          "action": "reject",
          "message": "Review the AI summary and complete the criteria check first."
         },
         {
          "name": "approveHasNoGaps",
          "description": "A criterion with insufficient information means pend, not approve.",
          "action": "reject",
          "message": "Some criteria lack information. Pend the request instead."
         }
        ]
       },
       "pend": {
        "to": "pended",
        "guards": [
         "nurse",
         "physician",
         "admin"
        ],
        "requiredFields": [
         "infoRequested"
        ],
        "sets": {
         "pendedAt": "now()"
        },
        "rules": []
       },
       "proposeDenial": {
        "to": "pending_p2p",
        "guards": [
         "physician"
        ],
        "requiredFields": [
         "physician",
         "denialReason"
        ],
        "sets": {
         "p2pOfferedAt": "now()",
         "deniedBy": "$user.id"
        },
        "rules": [
         {
          "name": "denialAfterHumanReview",
          "description": "A proposed denial also needs reviewed AI work and a criteria check.",
          "action": "reject",
          "message": "Review the AI summary and complete the criteria check first."
         },
         {
          "name": "denialCitesUnmetCriterion",
          "description": "A denial must rest on at least one criterion found not met.",
          "action": "reject",
          "message": "Cite at least one unmet criterion to propose a denial."
         }
        ]
       }
      }
     },
     "pended": {
      "description": "",
      "transitions": {
       "infoReceived": {
        "to": "in_review",
        "guards": [
         "intake",
         "nurse",
         "admin"
        ],
        "requiredFields": [],
        "sets": {},
        "rules": []
       },
       "lapse": {
        "to": "closed",
        "guards": [
         "admin"
        ],
        "requiredFields": [],
        "sets": {},
        "rules": []
       }
      }
     },
     "pending_p2p": {
      "description": "",
      "transitions": {
       "deny": {
        "to": "denied",
        "guards": [
         "physician"
        ],
        "requiredFields": [],
        "sets": {
         "decidedAt": "now()"
        },
        "rules": []
       },
       "approve": {
        "to": "approved",
        "guards": [
         "physician"
        ],
        "requiredFields": [],
        "sets": {
         "decidedAt": "now()"
        },
        "rules": [
         {
          "name": "approveAfterHumanReview",
          "description": "No determination while AI work is still unreviewed, and none without a criteria check.",
          "action": "reject",
          "message": "Review the AI summary and complete the criteria check first."
         },
         {
          "name": "approveHasNoGaps",
          "description": "A criterion with insufficient information means pend, not approve.",
          "action": "reject",
          "message": "Some criteria lack information. Pend the request instead."
         }
        ]
       }
      }
     },
     "approved": {
      "description": "",
      "transitions": {}
     },
     "denied": {
      "description": "",
      "transitions": {
       "reinstate": {
        "to": "approved_on_appeal",
        "guards": [
         "physician",
         "admin"
        ],
        "requiredFields": [],
        "sets": {},
        "rules": [
         {
          "name": "reinstateNeedsAnOverturnedAppeal",
          "description": "A denial is reversed only by an appeal that overturned it.",
          "action": "reject",
          "message": "No appeal has overturned this denial."
         },
         {
          "name": "reinstateByADifferentPhysician",
          "description": "And not by the account that made the denial.",
          "action": "reject",
          "message": "You made this denial. Its appeal must be decided by another physician."
         }
        ]
       }
      }
     },
     "approved_on_appeal": {
      "description": "",
      "transitions": {}
     },
     "closed": {
      "description": "",
      "transitions": {}
     }
    }
   }
  },
  {
   "name": "summary",
   "description": "An AI-drafted clinical summary and recommendation. It stays a draft until a nurse or physician accepts, edits or rejects it.\n",
   "field": "status",
   "machine": {
    "initial": "draft",
    "states": {
     "draft": {
      "description": "",
      "transitions": {
       "accept": {
        "to": "accepted",
        "guards": [
         "nurse",
         "physician"
        ],
        "requiredFields": [],
        "sets": {
         "reviewedBy": "$user.id",
         "reviewedAt": "now()"
        },
        "rules": []
       },
       "edit": {
        "to": "edited",
        "guards": [
         "nurse",
         "physician"
        ],
        "requiredFields": [
         "reviewNote"
        ],
        "sets": {
         "reviewedBy": "$user.id",
         "reviewedAt": "now()"
        },
        "rules": []
       },
       "reject": {
        "to": "rejected",
        "guards": [
         "nurse",
         "physician"
        ],
        "requiredFields": [
         "reviewNote"
        ],
        "sets": {
         "reviewedBy": "$user.id",
         "reviewedAt": "now()"
        },
        "rules": []
       }
      }
     },
     "accepted": {
      "description": "",
      "transitions": {}
     },
     "edited": {
      "description": "",
      "transitions": {}
     },
     "rejected": {
      "description": "",
      "transitions": {}
     }
    }
   }
  },
  {
   "name": "appeal",
   "description": "An appeal of a denial, heard by a physician who did not make it.",
   "field": "status",
   "machine": {
    "initial": "filed",
    "states": {
     "filed": {
      "description": "",
      "transitions": {
       "uphold": {
        "to": "upheld",
        "guards": [
         "physician"
        ],
        "requiredFields": [
         "outcomeNote"
        ],
        "sets": {
         "decidedAt": "now()"
        },
        "rules": [
         {
          "name": "appealUpheldByADifferentPhysician",
          "description": "The account that proposed the denial cannot uphold it on appeal, whoever the appeal names.",
          "action": "reject",
          "message": "You made this denial. Its appeal must be decided by another physician."
         }
        ]
       },
       "overturn": {
        "to": "overturned",
        "guards": [
         "physician"
        ],
        "requiredFields": [
         "outcomeNote"
        ],
        "sets": {
         "decidedAt": "now()"
        },
        "rules": [
         {
          "name": "appealOverturnedByADifferentPhysician",
          "description": "Nor overturn it: the appeal is someone else's decision either way.",
          "action": "reject",
          "message": "You made this denial. Its appeal must be decided by another physician."
         }
        ]
       }
      }
     },
     "upheld": {
      "description": "",
      "transitions": {}
     },
     "overturned": {
      "description": "",
      "transitions": {}
     }
    }
   }
  }
 ]
}
