{
  "key": "synthetic-adult-oncology-complex-v1",
  "name": "Adult oncology sample: multidisciplinary review and two planned cycles",
  "workflow_domain": "oncology",
  "status": "draft",
  "definition": {
    "synthetic": true,
    "example_version": "1.0.0",
    "purpose": "Coordinate parallel reviews, clinician decisions, holds, and complication follow-up across two planned cycles.",
    "clinical_scope": "Sample workflow for coordinating care. Clinicians choose treatments and record decisions and authorisations.",
    "binding_status": "unbound_draft",
    "binding_requirements": [
      {
        "stage_key": "referral_intake",
        "capture_contract": "Referral or episode review",
        "queue_key": "care-coordination",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "diagnostic_review",
        "capture_contract": "Diagnostic evidence review",
        "queue_key": "oncology-diagnostics",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "staging_review",
        "capture_contract": "Staging review",
        "queue_key": "oncology-staging",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "comorbidity_review",
        "capture_contract": "Comorbidity review",
        "queue_key": "medical-review",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "mdt_review",
        "capture_contract": "Multidisciplinary decision",
        "queue_key": "oncology-mdt",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "consent_review",
        "capture_contract": "Consent review",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "pharmacy_review",
        "capture_contract": "Pharmacy verification",
        "queue_key": "oncology-pharmacy",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "support_plan",
        "capture_contract": "Supportive care plan",
        "queue_key": "supportive-care",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "readiness_decision",
        "capture_contract": "Readiness decision",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "hold_resolution",
        "capture_contract": "Hold reassessment",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "treatment_authorisation",
        "capture_contract": "Treatment authorisation",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "cycle1_administration_record",
        "capture_contract": "Administration record",
        "queue_key": "oncology-administration",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "postcycle_review",
        "capture_contract": "Post-treatment review",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "complication_decision",
        "capture_contract": "Complication review",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "complication_management",
        "capture_contract": "Complication management record",
        "queue_key": "acute-oncology",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "cycle2_review",
        "capture_contract": "Cycle review",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "cycle2_authorisation",
        "capture_contract": "Treatment authorisation",
        "queue_key": "oncology-clinical",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "cycle2_administration_record",
        "capture_contract": "Administration record",
        "queue_key": "oncology-administration",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "response_review",
        "capture_contract": "Response review",
        "queue_key": "oncology-mdt",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "followup_plan",
        "capture_contract": "Follow-up plan",
        "queue_key": "care-coordination",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      },
      {
        "stage_key": "close_episode",
        "capture_contract": "Episode closure",
        "queue_key": "care-coordination",
        "required_composition_type": "event",
        "mapping_status": "required_before_clinical_use",
        "binding_instructions": "Select local templates, published forms where needed, queues, and permitted roles. Create each binding using the imported stage ID."
      }
    ],
    "runtime_limits": [
      "Finite directed acyclic graph; cycles are represented as separate stages.",
      "Connect the listed requirements to templates and forms before starting the workflow.",
      "Starting the workflow requires a patient and template/form bindings for every stage. Complete each task with matching saved clinical records as well as the required acknowledgements.",
      "A held or failed task needs explicit review; no automatic retry, prescribing, medication administration or clinical escalation is encoded."
    ],
    "validation_paths": [
      {
        "key": "proceed_without_complication",
        "outcomes": {
          "readiness_decision": {
            "decision": "proceed"
          },
          "complication_decision": {
            "decision": "no_complication"
          }
        },
        "skipped_stage_keys": [
          "hold_resolution",
          "complication_management"
        ]
      },
      {
        "key": "hold_then_complication",
        "outcomes": {
          "readiness_decision": {
            "decision": "hold"
          },
          "complication_decision": {
            "decision": "complication"
          }
        },
        "skipped_stage_keys": []
      }
    ]
  },
  "stages": [
    {
      "stage_key": "referral_intake",
      "name": "Referral and episode review",
      "stage_type": "task",
      "order_index": 0,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "diagnostic_review",
      "name": "Diagnostic evidence review",
      "stage_type": "task",
      "order_index": 1,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "staging_review",
      "name": "Staging evidence review",
      "stage_type": "task",
      "order_index": 2,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "comorbidity_review",
      "name": "Diabetes, renal function and comorbidity review",
      "stage_type": "task",
      "order_index": 3,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "mdt_review",
      "name": "Multidisciplinary team decision",
      "stage_type": "task",
      "order_index": 4,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "consent_review",
      "name": "Consent and patient preferences review",
      "stage_type": "task",
      "order_index": 5,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "pharmacy_review",
      "name": "Pharmacy verification",
      "stage_type": "task",
      "order_index": 6,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "support_plan",
      "name": "Supportive care and follow-up coordination",
      "stage_type": "task",
      "order_index": 7,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "readiness_decision",
      "name": "Readiness decision: proceed or hold",
      "stage_type": "task",
      "order_index": 8,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "required_outcome_fields": [
          "decision"
        ],
        "completion_conditions": [
          "outcome.decision = 'proceed' OR outcome.decision = 'hold'"
        ],
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "hold_resolution",
      "name": "Resolve hold and document reassessment",
      "stage_type": "task",
      "order_index": 9,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "ready_for_review": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "treatment_authorisation",
      "name": "Clinician authorisation for cycle 1",
      "stage_type": "task",
      "order_index": 10,
      "definition": {
        "join_policy": "any",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "authorised": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "cycle1_administration_record",
      "name": "Cycle 1 administration documentation",
      "stage_type": "task",
      "order_index": 11,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "administration_documented": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "postcycle_review",
      "name": "Post-cycle 1 review",
      "stage_type": "task",
      "order_index": 12,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "complication_decision",
      "name": "Complication pathway decision",
      "stage_type": "task",
      "order_index": 13,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "required_outcome_fields": [
          "decision"
        ],
        "completion_conditions": [
          "outcome.decision = 'complication' OR outcome.decision = 'no_complication'"
        ],
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "complication_management",
      "name": "Complication management and reassessment record",
      "stage_type": "task",
      "order_index": 14,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "reassessment_ready": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "cycle2_review",
      "name": "Cycle 2 review of updated evidence",
      "stage_type": "task",
      "order_index": 15,
      "definition": {
        "join_policy": "any",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "cycle2_authorisation",
      "name": "Clinician authorisation for cycle 2",
      "stage_type": "task",
      "order_index": 16,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "authorised": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "cycle2_administration_record",
      "name": "Cycle 2 administration documentation",
      "stage_type": "task",
      "order_index": 17,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "administration_documented": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "response_review",
      "name": "Response and next-care review",
      "stage_type": "task",
      "order_index": 18,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "followup_plan",
      "name": "Follow-up and ongoing-care plan",
      "stage_type": "task",
      "order_index": 19,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "plan_recorded": true
        },
        "requires_clinical_evidence": true
      }
    },
    {
      "stage_key": "close_episode",
      "name": "Close the demonstrated workflow episode",
      "stage_type": "task",
      "order_index": 20,
      "definition": {
        "join_policy": "all",
        "required_outcome_values": {
          "clinician_reviewed": true,
          "closed_by_clinician": true
        },
        "requires_clinical_evidence": true
      }
    }
  ],
  "transitions": [
    {
      "from_stage_key": "referral_intake",
      "to_stage_key": "diagnostic_review",
      "transition_key": "referral_intake-to-diagnostic_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "referral_intake",
      "to_stage_key": "staging_review",
      "transition_key": "referral_intake-to-staging_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "referral_intake",
      "to_stage_key": "comorbidity_review",
      "transition_key": "referral_intake-to-comorbidity_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "diagnostic_review",
      "to_stage_key": "mdt_review",
      "transition_key": "diagnostic_review-to-mdt_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "staging_review",
      "to_stage_key": "mdt_review",
      "transition_key": "staging_review-to-mdt_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "comorbidity_review",
      "to_stage_key": "mdt_review",
      "transition_key": "comorbidity_review-to-mdt_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "mdt_review",
      "to_stage_key": "consent_review",
      "transition_key": "mdt_review-to-consent_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "mdt_review",
      "to_stage_key": "pharmacy_review",
      "transition_key": "mdt_review-to-pharmacy_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "mdt_review",
      "to_stage_key": "support_plan",
      "transition_key": "mdt_review-to-support_plan",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "consent_review",
      "to_stage_key": "readiness_decision",
      "transition_key": "consent_review-to-readiness_decision",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "pharmacy_review",
      "to_stage_key": "readiness_decision",
      "transition_key": "pharmacy_review-to-readiness_decision",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "support_plan",
      "to_stage_key": "readiness_decision",
      "transition_key": "support_plan-to-readiness_decision",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "readiness_decision",
      "to_stage_key": "treatment_authorisation",
      "transition_key": "readiness_decision-to-treatment_authorisation",
      "definition": {
        "conditions": [
          "outcome.decision = 'proceed'"
        ]
      }
    },
    {
      "from_stage_key": "readiness_decision",
      "to_stage_key": "hold_resolution",
      "transition_key": "readiness_decision-to-hold_resolution",
      "definition": {
        "conditions": [
          "outcome.decision = 'hold'"
        ]
      }
    },
    {
      "from_stage_key": "hold_resolution",
      "to_stage_key": "treatment_authorisation",
      "transition_key": "hold_resolution-to-treatment_authorisation",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "treatment_authorisation",
      "to_stage_key": "cycle1_administration_record",
      "transition_key": "treatment_authorisation-to-cycle1_administration_record",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "cycle1_administration_record",
      "to_stage_key": "postcycle_review",
      "transition_key": "cycle1_administration_record-to-postcycle_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "postcycle_review",
      "to_stage_key": "complication_decision",
      "transition_key": "postcycle_review-to-complication_decision",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "complication_decision",
      "to_stage_key": "complication_management",
      "transition_key": "complication_decision-to-complication_management",
      "definition": {
        "conditions": [
          "outcome.decision = 'complication'"
        ]
      }
    },
    {
      "from_stage_key": "complication_decision",
      "to_stage_key": "cycle2_review",
      "transition_key": "complication_decision-to-cycle2_review",
      "definition": {
        "conditions": [
          "outcome.decision = 'no_complication'"
        ]
      }
    },
    {
      "from_stage_key": "complication_management",
      "to_stage_key": "cycle2_review",
      "transition_key": "complication_management-to-cycle2_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "cycle2_review",
      "to_stage_key": "cycle2_authorisation",
      "transition_key": "cycle2_review-to-cycle2_authorisation",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "cycle2_authorisation",
      "to_stage_key": "cycle2_administration_record",
      "transition_key": "cycle2_authorisation-to-cycle2_administration_record",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "cycle2_administration_record",
      "to_stage_key": "response_review",
      "transition_key": "cycle2_administration_record-to-response_review",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "response_review",
      "to_stage_key": "followup_plan",
      "transition_key": "response_review-to-followup_plan",
      "definition": {
        "conditions": []
      }
    },
    {
      "from_stage_key": "followup_plan",
      "to_stage_key": "close_episode",
      "transition_key": "followup_plan-to-close_episode",
      "definition": {
        "conditions": []
      }
    }
  ]
}
