{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/abcclinicaldemandforecast/versions/1.0.0.json",
  "title": "ABCClinicalDemandForecast JSON Schema",
  "description": "Schema defining the structure of ABCClinicalDemandForecast used for clinical trial demand forecasting in ABC-Plan.",
  "x-lintel": {
    "source": "https://www.schemastore.org/abc-clinical-demand-forecast-1.0.0.json",
    "sourceSha256": "e17835334a79571b53c9316f623f2b5f66c012dbf667c94f6ed623108803a6db",
    "fileMatch": [
      "abc-clinical-demand-forecast-*.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "$schema": {
      "description": "Link to <https://json.schemastore.org/abc-clinical-demand-forecast-1.0.0.json>",
      "type": "string",
      "enum": [
        "https://json.schemastore.org/abc-clinical-demand-forecast-1.0.0.json"
      ]
    },
    "planNotes": {
      "type": "string",
      "title": "Plan Notes",
      "description": "Optional notes about the clinical demand forecast plan."
    },
    "analytics": {
      "$comment": "SINGLE SOURCE OF TRUTH for analytics configuration. Used by scripts/assemble-schemas.js to replace __ABC_JSON_SCHEMA_PLACEHOLDER_ANALYTICS__ in each template. DO NOT reference this file directly — it is inlined into parent schemas at build time.",
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "title": "Analytics Item",
            "description": "An analytics item that can be either a time series or an analytics note",
            "oneOf": [
              {
                "type": "object",
                "title": "Time Series",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "TIME_SERIES"
                    ]
                  },
                  "subtitle": {
                    "type": "string"
                  },
                  "excludeMonthsFromBeginning": {
                    "type": "number",
                    "description": "Number of months to exclude from the beginning of the time series. Positive values trim, negative values add months before the plan start date."
                  },
                  "excludeMonthsFromEnd": {
                    "type": "number",
                    "description": "Number of months to exclude from the end of the time series. Positive values trim, negative values add months after the plan end date."
                  },
                  "timeAggregateType": {
                    "type": "string",
                    "enum": [
                      "Annual",
                      "Quarterly",
                      "Monthly"
                    ],
                    "title": "Time Aggregate Type",
                    "description": "The aggregation level for time series data display"
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "metricType": {
                          "type": "string",
                          "enum": [
                            "enrolled",
                            "active",
                            "completed",
                            "kitDemand",
                            "sites",
                            "screened",
                            "screenedOut",
                            "droppedOut",
                            "siteSeedingKitDemand",
                            "kitItemDemand"
                          ]
                        },
                        "abcMaterialIDs": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visualization": {
                          "type": "object",
                          "oneOf": [
                            {
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "line"
                                  ]
                                },
                                "strokeWidth": {
                                  "type": "number"
                                },
                                "strokeDasharray": {
                                  "type": "string"
                                },
                                "dotSize": {
                                  "type": "number",
                                  "minimum": 0
                                },
                                "dotFill": {
                                  "type": "string"
                                },
                                "showDataPointValues": {
                                  "type": "boolean",
                                  "description": "Display data point values directly on the chart"
                                }
                              },
                              "required": [
                                "type",
                                "strokeWidth",
                                "strokeDasharray",
                                "dotSize",
                                "dotFill",
                                "showDataPointValues"
                              ],
                              "additionalProperties": false,
                              "type": "object"
                            },
                            {
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "bar"
                                  ]
                                },
                                "barWidth": {
                                  "type": "number"
                                },
                                "radius": {
                                  "type": "number"
                                },
                                "stackId": {
                                  "type": "string"
                                },
                                "showAsPercent": {
                                  "type": "boolean"
                                },
                                "showDataPointValues": {
                                  "type": "boolean",
                                  "description": "Display data point values directly on the chart"
                                }
                              },
                              "required": [
                                "type",
                                "barWidth",
                                "radius",
                                "stackId",
                                "showAsPercent",
                                "showDataPointValues"
                              ],
                              "additionalProperties": false,
                              "type": "object"
                            },
                            {
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "area"
                                  ]
                                },
                                "fillOpacity": {
                                  "type": "number"
                                },
                                "strokeWidth": {
                                  "type": "number"
                                },
                                "stackId": {
                                  "type": "string"
                                },
                                "showAsPercent": {
                                  "type": "boolean"
                                },
                                "showDataPointValues": {
                                  "type": "boolean",
                                  "description": "Display data point values directly on the chart"
                                }
                              },
                              "required": [
                                "type",
                                "fillOpacity",
                                "strokeWidth",
                                "stackId",
                                "showAsPercent",
                                "showDataPointValues"
                              ],
                              "additionalProperties": false,
                              "type": "object"
                            }
                          ]
                        },
                        "yAxisIndex": {
                          "type": "number"
                        },
                        "color": {
                          "type": "string"
                        },
                        "zIndex": {
                          "type": "number"
                        },
                        "label": {
                          "type": "string"
                        },
                        "showQuantitiesAs": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "oneOf": [
                            {
                              "type": "string",
                              "enum": [
                                "Units",
                                "Lots",
                                "Monetary"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "title": "Show Quantities As",
                          "description": "How to display the quantities for this metric"
                        },
                        "comparisonPlanID": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "title": "Comparison Plan ID",
                          "description": "The ID of the comparison plan to use for this metric or null if no comparison plan is used"
                        },
                        "regionID": {
                          "type": "string",
                          "title": "Region ID",
                          "description": "Optional region filter for Clinical Demand Forecast metrics"
                        },
                        "armID": {
                          "type": "string",
                          "title": "Arm ID",
                          "description": "Optional treatment arm filter for Clinical Demand Forecast metrics"
                        },
                        "kitID": {
                          "type": "string",
                          "title": "Kit ID",
                          "description": "Optional kit filter for Clinical Demand Forecast metrics"
                        },
                        "itemID": {
                          "type": "string",
                          "title": "Item ID",
                          "description": "Optional item filter for Clinical Demand Forecast metrics"
                        },
                        "isCumulative": {
                          "type": "boolean",
                          "title": "Is Cumulative",
                          "description": "Whether to display cumulative values"
                        }
                      },
                      "required": [
                        "metricType",
                        "abcMaterialIDs",
                        "visualization",
                        "yAxisIndex",
                        "color",
                        "zIndex",
                        "label",
                        "showQuantitiesAs",
                        "comparisonPlanID"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "id",
                  "name",
                  "type",
                  "subtitle",
                  "excludeMonthsFromBeginning",
                  "excludeMonthsFromEnd",
                  "timeAggregateType",
                  "metrics"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "title": "Analytics Note Item",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "ANALYTICS_NOTE"
                    ]
                  },
                  "subtitle": {
                    "type": "string"
                  },
                  "backgroundColor": {
                    "type": "string"
                  },
                  "imageUrl": {
                    "type": "string"
                  },
                  "text": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "type": "string"
                      },
                      "fontFamily": {
                        "type": "string"
                      },
                      "fontSize": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "horizontalAlignment": {
                        "type": "string",
                        "enum": [
                          "left",
                          "center",
                          "right"
                        ]
                      },
                      "verticalAlignment": {
                        "type": "string",
                        "enum": [
                          "top",
                          "center",
                          "bottom"
                        ]
                      }
                    },
                    "required": [
                      "content",
                      "fontFamily",
                      "fontSize",
                      "color",
                      "horizontalAlignment",
                      "verticalAlignment"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "name",
                  "type",
                  "subtitle"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "layouts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "contentId": {
                "type": "string"
              },
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 11,
                "description": "Grid column position (0-11 for 12-column grid)"
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "description": "Grid row position"
              },
              "tabID": {
                "type": "string",
                "description": "ID of the tab this layout item belongs to"
              },
              "w": {
                "type": "number",
                "minimum": 1,
                "maximum": 12,
                "description": "Width in grid units (1-12)"
              },
              "h": {
                "type": "number",
                "minimum": 1,
                "description": "Height in grid units"
              },
              "minH": {
                "type": "number",
                "minimum": 1,
                "description": "Minimum height in grid units"
              },
              "maxH": {
                "type": "number",
                "minimum": 1,
                "description": "Maximum height in grid units"
              },
              "minW": {
                "type": "number",
                "minimum": 1,
                "description": "Minimum width in grid units"
              },
              "maxW": {
                "type": "number",
                "minimum": 1,
                "description": "Maximum width in grid units"
              },
              "isDraggable": {
                "type": "boolean",
                "description": "Whether the item can be dragged"
              },
              "isResizable": {
                "type": "boolean",
                "description": "Whether the item can be resized"
              }
            },
            "required": [
              "contentId",
              "x",
              "y",
              "tabID",
              "w",
              "h"
            ],
            "additionalProperties": false
          }
        },
        "tabs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "ordering": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "name",
              "ordering"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "items",
        "layouts",
        "tabs"
      ],
      "additionalProperties": false
    },
    "clinicalDemandForecastConfiguration": {
      "$ref": "#/$defs/ClinicalDemandForecastConfiguration",
      "title": "Clinical Demand Forecast Configuration",
      "description": "All algorithm inputs that affect forecast calculation. Any change to this object invalidates clinicalDemandCalculatedForecast."
    },
    "clinicalDemandCalculatedForecast": {
      "$ref": "#/$defs/ClinicalDemandCalculatedForecast",
      "title": "Clinical Demand Calculated Forecast",
      "description": "Calculated demand forecast with atomic monthly data per-region, per-arm."
    }
  },
  "required": [
    "planNotes",
    "analytics",
    "clinicalDemandForecastConfiguration",
    "clinicalDemandCalculatedForecast"
  ],
  "additionalProperties": false,
  "$comment": "AUTO-GENERATED by scripts/assemble-schemas.js — DO NOT EDIT BY HAND",
  "$defs": {
    "ClinicalDemandForecastConfiguration": {
      "type": "object",
      "title": "Clinical Demand Forecast Configuration",
      "description": "All algorithm inputs that affect forecast calculation. Any change to this object should invalidate the calculated forecast.",
      "properties": {
        "studyOverview": {
          "$ref": "#/$defs/StudyOverview",
          "title": "Study Overview",
          "description": "Basic information about the clinical trial study."
        },
        "enrollment": {
          "$ref": "#/$defs/Enrollment",
          "title": "Enrollment",
          "description": "Patient enrollment targets and rates."
        },
        "kitConfiguration": {
          "type": "object",
          "title": "Kit Configuration",
          "description": "Configuration of kits with containers and items, keyed by kit ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/Kit"
            }
          }
        },
        "dosingRegimens": {
          "type": "object",
          "title": "Dosing Regimens",
          "description": "Available dosing regimens for the study, keyed by ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/DosingRegimen"
            }
          }
        },
        "treatmentArms": {
          "type": "object",
          "title": "Treatment Arms",
          "description": "Treatment arms in the clinical trial, keyed by ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/TreatmentArm"
            }
          }
        },
        "subjectFlow": {
          "$ref": "#/$defs/SubjectFlow",
          "title": "Subject Flow",
          "description": "Site supply and region configuration."
        },
        "actuals": {
          "$ref": "#/$defs/ClinicalDemandActuals",
          "title": "Clinical Demand Actuals",
          "description": "Actual enrollment data entered by users to reconcile with forecast."
        },
        "trialDesign": {
          "type": "string",
          "title": "Trial Design",
          "description": "Trial design type: parallel (single regimen per arm) or crossOver (sequence of treatments with washout periods).",
          "enum": [
            "parallel",
            "crossOver"
          ],
          "default": "parallel"
        }
      },
      "required": [
        "studyOverview",
        "enrollment",
        "kitConfiguration",
        "dosingRegimens",
        "treatmentArms",
        "subjectFlow",
        "actuals",
        "trialDesign"
      ],
      "additionalProperties": false
    },
    "StudyOverview": {
      "type": "object",
      "title": "Study Overview",
      "description": "Basic study information from wizard step 1.",
      "properties": {
        "studyName": {
          "type": "string",
          "title": "Study Name",
          "description": "Name of the clinical trial study."
        },
        "studyPhase": {
          "type": "string",
          "title": "Study Phase",
          "description": "Phase of the clinical trial.",
          "enum": [
            "phase_i",
            "phase_ii",
            "phase_iii",
            "phase_iv"
          ]
        },
        "protocolSummary": {
          "type": "string",
          "title": "Protocol Summary",
          "description": "Summary of the trial protocol. Optional field with recommended default: empty string."
        },
        "therapeuticArea": {
          "type": "string",
          "title": "Therapeutic Area",
          "description": "Disease category being treated (e.g., Oncology, CNS, Rare Disease). Will be normalized by LLM for benchmarking. Required field with recommended default: empty string."
        }
      },
      "required": [
        "studyName",
        "studyPhase",
        "protocolSummary",
        "therapeuticArea"
      ],
      "additionalProperties": false
    },
    "Enrollment": {
      "type": "object",
      "title": "Enrollment",
      "description": "Enrollment configuration from wizard step 2.",
      "properties": {
        "targetCompleted": {
          "type": "integer",
          "title": "Target Completed",
          "description": "Target number of subjects to complete the trial.",
          "minimum": 0
        },
        "screenFailureRate": {
          "type": "number",
          "title": "Screen Failure Rate",
          "description": "Percentage of subjects who fail screening (0-100).",
          "minimum": 0,
          "maximum": 100
        },
        "attritionRate": {
          "type": "number",
          "title": "Attrition Rate",
          "description": "Percentage of enrolled subjects who drop out of the study entirely and stop receiving all doses (0-100). NOTE: This is different from adverse events in dose escalation regimens. Attrition causes subjects to exit the study early, while adverse events only prevent dose escalation but subjects continue receiving doses at their maximum tolerated level.",
          "minimum": 0,
          "maximum": 100
        }
      },
      "required": [
        "targetCompleted",
        "screenFailureRate",
        "attritionRate"
      ],
      "additionalProperties": false
    },
    "Kit": {
      "type": "object",
      "title": "Kit",
      "description": "A kit containing items and containers. The kit ID is the key in the kitConfiguration map.",
      "properties": {
        "name": {
          "type": "string",
          "title": "Kit Name",
          "description": "Display name of the kit."
        },
        "items": {
          "type": "object",
          "title": "Items",
          "description": "Items and containers within this kit, keyed by node ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/KitNode"
            }
          }
        }
      },
      "required": [
        "name",
        "items"
      ],
      "additionalProperties": false
    },
    "KitNode": {
      "oneOf": [
        {
          "$ref": "#/$defs/KitContainer"
        },
        {
          "$ref": "#/$defs/KitItem"
        }
      ]
    },
    "KitContainer": {
      "type": "object",
      "title": "Kit Container",
      "description": "A structural container (bottle, blister pack) that holds other nodes. The container ID is the key in the parent items/children map.",
      "properties": {
        "nodeType": {
          "type": "string",
          "const": "container",
          "title": "Node Type",
          "description": "Discriminator identifying this as a container node."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the container."
        },
        "deliveryForm": {
          "type": "string",
          "title": "Delivery Form",
          "description": "Type of container.",
          "enum": [
            "bottle",
            "carton",
            "dose_pack",
            "blister_pack"
          ]
        },
        "children": {
          "type": "object",
          "title": "Children",
          "description": "Items contained within this container, keyed by node ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/KitNode"
            }
          }
        },
        "ordering": {
          "type": "integer",
          "title": "Ordering",
          "description": "Display order of this node within its parent. Lower numbers appear first."
        }
      },
      "required": [
        "nodeType",
        "name",
        "deliveryForm",
        "children",
        "ordering"
      ],
      "additionalProperties": false
    },
    "KitItem": {
      "type": "object",
      "title": "Kit Item",
      "description": "An actual pharmaceutical item (tablet, capsule, vial) with dosage. The item ID is the key in the parent items/children map.",
      "properties": {
        "nodeType": {
          "type": "string",
          "const": "item",
          "title": "Node Type",
          "description": "Discriminator identifying this as an item node."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the item."
        },
        "deliveryForm": {
          "type": "string",
          "title": "Delivery Form",
          "description": "Type of pharmaceutical item.",
          "enum": [
            "tablet",
            "capsule",
            "vial",
            "syringe",
            "sachet"
          ]
        },
        "quantity": {
          "type": "integer",
          "title": "Quantity",
          "description": "Number of units contained in this item within one kit. For example, if this is a bottle containing tablets, quantity=10 means the bottle contains 10 tablets. This is NOT the same as dosingRegimen.kitItemQuantities, which specifies consumption per dose. This quantity field defines the container/packaging size.",
          "minimum": 0
        },
        "dosage": {
          "type": "number",
          "title": "Dosage",
          "description": "Dosage amount.",
          "minimum": 0
        },
        "units": {
          "type": "string",
          "title": "Units",
          "description": "Units of dosage (e.g., mg, ml)."
        },
        "ordering": {
          "type": "integer",
          "title": "Ordering",
          "description": "Display order of this node within its parent. Lower numbers appear first."
        }
      },
      "required": [
        "nodeType",
        "name",
        "deliveryForm",
        "quantity",
        "dosage",
        "units",
        "ordering"
      ],
      "additionalProperties": false
    },
    "DosingRegimen": {
      "type": "object",
      "title": "Dosing Regimen",
      "description": "Dosing regimen configuration with nested dosingRegimenDefinition discriminated union.",
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the dosing regimen."
        },
        "description": {
          "type": "string",
          "title": "Description",
          "description": "Description of the dosing regimen."
        },
        "dosingRegimenDefinition": {
          "oneOf": [
            {
              "$ref": "#/$defs/ActiveRegimenDefinition"
            },
            {
              "$ref": "#/$defs/PlaceboRegimenDefinition"
            }
          ],
          "title": "Dosing Regimen Definition",
          "description": "Discriminated union: either an active regimen definition (isPlacebo: false) or a placebo definition (isPlacebo: true)."
        }
      },
      "required": [
        "name",
        "description",
        "dosingRegimenDefinition"
      ],
      "additionalProperties": false
    },
    "ActiveRegimenDefinition": {
      "type": "object",
      "title": "Active Regimen Definition",
      "description": "Definition for an active (non-placebo) dosing regimen.",
      "properties": {
        "isPlacebo": {
          "type": "boolean",
          "const": false,
          "title": "Is Placebo",
          "description": "Discriminator: false for active regimens."
        },
        "treatmentDuration": {
          "type": "number",
          "title": "Treatment Duration",
          "description": "Total duration of treatment for all subjects.",
          "minimum": 0
        },
        "treatmentDurationUnit": {
          "type": "string",
          "title": "Treatment Duration Unit",
          "description": "Unit of treatment duration.",
          "enum": [
            "days",
            "weeks",
            "months",
            "years"
          ]
        },
        "dosingFrequency": {
          "type": "string",
          "title": "Dosing Frequency",
          "description": "Frequency of dose administration.",
          "enum": [
            "once_daily_qd",
            "twice_daily_bid",
            "three_times_daily_tid",
            "four_times_daily_qid",
            "once_weekly_qw",
            "every_2_weeks_q2w",
            "every_3_weeks_q3w",
            "every_4_weeks_q4w",
            "monthly",
            "every_6_weeks_q6w",
            "every_8_weeks_q8w",
            "every_12_weeks_q12w",
            "every_other_day"
          ]
        },
        "fixedConfig": {
          "anyOf": [
            {
              "$ref": "#/$defs/FixedDoseConfig"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fixed Dose Configuration",
          "description": "Configuration for fixed dose regimens. Null if using another regimen type."
        },
        "doseEscalationConfig": {
          "anyOf": [
            {
              "$ref": "#/$defs/DoseEscalationConfig"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dose Escalation Configuration",
          "description": "Configuration for dose escalation regimens. Null if using another regimen type."
        },
        "weightBasedConfig": {
          "anyOf": [
            {
              "$ref": "#/$defs/WeightBasedConfig"
            },
            {
              "type": "null"
            }
          ],
          "title": "Weight-Based Configuration",
          "description": "Configuration for weight-based dosing regimens. Null if using another regimen type."
        },
        "ageBasedConfig": {
          "anyOf": [
            {
              "$ref": "#/$defs/AgeBasedConfig"
            },
            {
              "type": "null"
            }
          ],
          "title": "Age-Based Configuration",
          "description": "Configuration for age-based dosing regimens. Null if using another regimen type."
        }
      },
      "required": [
        "isPlacebo",
        "treatmentDuration",
        "treatmentDurationUnit",
        "dosingFrequency",
        "fixedConfig",
        "doseEscalationConfig",
        "weightBasedConfig",
        "ageBasedConfig"
      ],
      "additionalProperties": false
    },
    "PlaceboRegimenDefinition": {
      "type": "object",
      "title": "Placebo Regimen Definition",
      "description": "Definition for a placebo regimen that references an active regimen.",
      "properties": {
        "isPlacebo": {
          "type": "boolean",
          "const": true,
          "title": "Is Placebo",
          "description": "Discriminator: true for placebo regimens."
        },
        "placeboOf": {
          "type": "string",
          "title": "Placebo Of",
          "description": "ID of the active dosing regimen this placebo references. Placebo inherits all dosing configuration from the active regimen."
        }
      },
      "required": [
        "isPlacebo",
        "placeboOf"
      ],
      "additionalProperties": false
    },
    "FixedDoseConfig": {
      "type": "object",
      "title": "Fixed Dose Configuration",
      "description": "Configuration for fixed dose regimens.",
      "properties": {
        "kitItemQuantities": {
          "type": "object",
          "title": "Kit Item Quantities",
          "description": "Mapping of kit item IDs to quantities consumed per dose.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "number",
              "minimum": 0
            }
          }
        }
      },
      "required": [
        "kitItemQuantities"
      ],
      "additionalProperties": false
    },
    "DoseEscalationConfig": {
      "type": "object",
      "title": "Dose Escalation Configuration",
      "description": "Configuration for dose escalation levels.",
      "properties": {
        "levels": {
          "type": "object",
          "title": "Escalation Levels",
          "description": "Map of level IDs to dose escalation levels. Use ordering property to maintain display order.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/DoseEscalationLevel"
            }
          }
        }
      },
      "required": [
        "levels"
      ],
      "additionalProperties": false
    },
    "DoseEscalationLevel": {
      "title": "Dose Escalation Level",
      "description": "Individual dose escalation level configuration. This is a discriminated union with three variants: First level (isFirstLevel=true), Intermediate level (isFinalLevel=false, has adverseEventRate), and Final level (isFinalLevel=true, no duration).",
      "oneOf": [
        {
          "$ref": "#/$defs/DoseEscalationLevelFirst"
        },
        {
          "$ref": "#/$defs/DoseEscalationLevelIntermediate"
        },
        {
          "$ref": "#/$defs/DoseEscalationLevelFinal"
        }
      ]
    },
    "DoseEscalationLevelBase": {
      "$comment": "additionalProperties is true because this object acts as a base schema and is composed with variant-specific definitions via allOf.",
      "type": "object",
      "title": "Dose Escalation Level Base",
      "description": "Base properties shared by all dose escalation level variants.",
      "properties": {
        "kitItemQuantities": {
          "type": "object",
          "title": "Kit Item Quantities",
          "description": "Mapping of kit item IDs to quantities consumed per dose at this escalation level.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "ordering": {
          "type": "number",
          "title": "Ordering",
          "description": "Display order of this level within the escalation sequence. Lower numbers appear first."
        }
      },
      "required": [
        "kitItemQuantities",
        "ordering"
      ],
      "additionalProperties": true
    },
    "DoseEscalationLevelFirst": {
      "title": "First Dose Escalation Level",
      "description": "First escalation level. Has isFirstLevel=true, isFinalLevel=false, duration and durationUnit. Does NOT have adverseEventRate because adverse events occur when trialing a level, and there is no previous level to trial from.",
      "allOf": [
        {
          "$ref": "#/$defs/DoseEscalationLevelBase"
        },
        {
          "type": "object",
          "properties": {
            "kitItemQuantities": {},
            "isFirstLevel": {
              "type": "boolean",
              "const": true,
              "title": "Is First Level",
              "description": "Must be true for first level."
            },
            "isFinalLevel": {
              "type": "boolean",
              "const": false,
              "title": "Is Final Level",
              "description": "Must be false for first level (first level cannot also be final)."
            },
            "duration": {
              "type": "number",
              "title": "Duration",
              "description": "Duration of this escalation level.",
              "exclusiveMinimum": 0
            },
            "durationUnit": {
              "type": "string",
              "title": "Duration Unit",
              "description": "Unit of duration for this level.",
              "enum": [
                "days",
                "weeks",
                "months",
                "years"
              ]
            },
            "ordering": {}
          },
          "required": [
            "isFirstLevel",
            "isFinalLevel",
            "duration",
            "durationUnit"
          ],
          "additionalProperties": false
        }
      ]
    },
    "DoseEscalationLevelIntermediate": {
      "title": "Intermediate Dose Escalation Level",
      "description": "Intermediate escalation level (not first, not final). Has isFinalLevel=false, duration, durationUnit, and adverseEventRate. Does NOT have isFirstLevel property.",
      "allOf": [
        {
          "$ref": "#/$defs/DoseEscalationLevelBase"
        },
        {
          "type": "object",
          "properties": {
            "kitItemQuantities": {},
            "isFinalLevel": {
              "type": "boolean",
              "const": false,
              "title": "Is Final Level",
              "description": "Must be false for intermediate level."
            },
            "duration": {
              "type": "number",
              "title": "Duration",
              "description": "Duration of this escalation level.",
              "exclusiveMinimum": 0
            },
            "durationUnit": {
              "type": "string",
              "title": "Duration Unit",
              "description": "Unit of duration for this level.",
              "enum": [
                "days",
                "weeks",
                "months",
                "years"
              ]
            },
            "adverseEventRate": {
              "type": "number",
              "title": "Adverse Event Rate",
              "description": "Percentage of subjects who experience adverse events when TRIALING THIS level from the previous level.",
              "minimum": 0,
              "maximum": 100
            },
            "ordering": {}
          },
          "required": [
            "isFinalLevel",
            "duration",
            "durationUnit",
            "adverseEventRate"
          ],
          "additionalProperties": false
        }
      ]
    },
    "DoseEscalationLevelFinal": {
      "title": "Final Dose Escalation Level",
      "description": "Final escalation level. Has isFinalLevel=true and adverseEventRate. Does NOT have duration or durationUnit (subjects continue at final level until treatment ends).",
      "allOf": [
        {
          "$ref": "#/$defs/DoseEscalationLevelBase"
        },
        {
          "type": "object",
          "properties": {
            "kitItemQuantities": {},
            "isFinalLevel": {
              "type": "boolean",
              "const": true,
              "title": "Is Final Level",
              "description": "Must be true for final level."
            },
            "adverseEventRate": {
              "type": "number",
              "title": "Adverse Event Rate",
              "description": "Percentage of subjects who experience adverse events when TRIALING THIS level from the previous level.",
              "minimum": 0,
              "maximum": 100
            },
            "ordering": {}
          },
          "required": [
            "isFinalLevel",
            "adverseEventRate"
          ],
          "additionalProperties": false
        }
      ]
    },
    "WeightBasedConfig": {
      "type": "object",
      "title": "Weight-Based Configuration",
      "description": "Configuration for weight-based dosing.",
      "properties": {
        "weightUnit": {
          "type": "string",
          "title": "Weight Unit",
          "description": "Unit of weight measurement.",
          "enum": [
            "lbs",
            "kg"
          ]
        },
        "ranges": {
          "type": "object",
          "title": "Weight Ranges",
          "description": "Map of range IDs to weight ranges for kit assignment. Use ordering property to maintain display order.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/WeightRange"
            }
          }
        }
      },
      "required": [
        "weightUnit",
        "ranges"
      ],
      "additionalProperties": false
    },
    "WeightRange": {
      "type": "object",
      "title": "Weight Range",
      "description": "Weight range configuration for dosing.",
      "properties": {
        "kitItemQuantities": {
          "type": "object",
          "title": "Kit Item Quantities",
          "description": "Mapping of kit item IDs to quantities consumed per dose for subjects in THIS weight range. Each value represents the number of units (e.g., tablets) of that item required for a single dose. Different weight ranges can specify different quantities for the same item.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "fromWeight": {
          "type": [
            "number",
            "null"
          ],
          "title": "From Weight",
          "description": "Minimum weight for this range (null for no lower bound).",
          "minimum": 0
        },
        "toWeight": {
          "type": [
            "number",
            "null"
          ],
          "title": "To Weight",
          "description": "Maximum weight for this range (null for no upper bound).",
          "minimum": 0
        },
        "expectedPercentage": {
          "type": "number",
          "title": "Expected Percentage",
          "description": "Expected percentage of subjects in this weight range.",
          "minimum": 0,
          "maximum": 100
        },
        "ordering": {
          "type": "number",
          "title": "Ordering",
          "description": "Display order of this range. Lower numbers appear first."
        }
      },
      "required": [
        "kitItemQuantities",
        "fromWeight",
        "toWeight",
        "expectedPercentage",
        "ordering"
      ],
      "additionalProperties": false
    },
    "AgeBasedConfig": {
      "type": "object",
      "title": "Age-Based Configuration",
      "description": "Configuration for age-based dosing.",
      "properties": {
        "ageUnit": {
          "type": "string",
          "title": "Age Unit",
          "description": "Unit of age measurement.",
          "enum": [
            "years",
            "months"
          ]
        },
        "ranges": {
          "type": "object",
          "title": "Age Ranges",
          "description": "Map of range IDs to age ranges for kit assignment. Use ordering property to maintain display order.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/AgeRange"
            }
          }
        }
      },
      "required": [
        "ageUnit",
        "ranges"
      ],
      "additionalProperties": false
    },
    "AgeRange": {
      "type": "object",
      "title": "Age Range",
      "description": "Age range configuration for dosing.",
      "properties": {
        "kitItemQuantities": {
          "type": "object",
          "title": "Kit Item Quantities",
          "description": "Mapping of kit item IDs to quantities consumed per dose for subjects in THIS age range. Each value represents the number of units (e.g., tablets) of that item required for a single dose. Different age ranges can specify different quantities for the same item.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "fromAge": {
          "type": [
            "number",
            "null"
          ],
          "title": "From Age",
          "description": "Minimum age for this range (null for no lower bound).",
          "minimum": 0
        },
        "toAge": {
          "type": [
            "number",
            "null"
          ],
          "title": "To Age",
          "description": "Maximum age for this range (null for no upper bound).",
          "minimum": 0
        },
        "expectedPercentage": {
          "type": "number",
          "title": "Expected Percentage",
          "description": "Expected percentage of subjects in this age range.",
          "minimum": 0,
          "maximum": 100
        },
        "ordering": {
          "type": "number",
          "title": "Ordering",
          "description": "Display order of this range. Lower numbers appear first."
        }
      },
      "required": [
        "kitItemQuantities",
        "fromAge",
        "toAge",
        "expectedPercentage",
        "ordering"
      ],
      "additionalProperties": false
    },
    "TreatmentPeriod": {
      "type": "object",
      "title": "Treatment Period",
      "description": "Treatment period in a dosing regimen sequence.",
      "properties": {
        "periodType": {
          "type": "string",
          "const": "treatment",
          "title": "Period Type",
          "description": "Discriminator identifying this as a treatment period."
        },
        "dosingRegimenId": {
          "type": "string",
          "title": "Dosing Regimen ID",
          "description": "ID of the dosing regimen used during this treatment period."
        },
        "ordering": {
          "type": "number",
          "title": "Ordering",
          "description": "Order position of this period in the sequence."
        }
      },
      "required": [
        "periodType",
        "dosingRegimenId",
        "ordering"
      ],
      "additionalProperties": false
    },
    "WashoutPeriod": {
      "type": "object",
      "title": "Washout Period",
      "description": "Washout period (no dosing) in a dosing regimen sequence.",
      "properties": {
        "periodType": {
          "type": "string",
          "const": "washout",
          "title": "Period Type",
          "description": "Discriminator identifying this as a washout period."
        },
        "duration": {
          "type": "number",
          "title": "Duration",
          "description": "Duration of the washout period.",
          "exclusiveMinimum": 0
        },
        "durationUnit": {
          "type": "string",
          "title": "Duration Unit",
          "description": "Unit of washout duration.",
          "enum": [
            "days",
            "weeks",
            "months",
            "years"
          ]
        },
        "ordering": {
          "type": "number",
          "title": "Ordering",
          "description": "Order position of this period in the sequence."
        }
      },
      "required": [
        "periodType",
        "duration",
        "durationUnit",
        "ordering"
      ],
      "additionalProperties": false
    },
    "SequencePeriod": {
      "oneOf": [
        {
          "$ref": "#/$defs/TreatmentPeriod"
        },
        {
          "$ref": "#/$defs/WashoutPeriod"
        }
      ]
    },
    "SequencePeriodMap": {
      "type": "object",
      "title": "Sequence Periods",
      "description": "Ordered sequence of treatment and washout periods, keyed by unique period ID.",
      "additionalProperties": false,
      "minProperties": 1,
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/SequencePeriod"
        }
      }
    },
    "TreatmentArm": {
      "type": "object",
      "title": "Treatment Arm",
      "description": "Treatment arm configuration from wizard step 5.",
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the treatment arm."
        },
        "allocationPercentage": {
          "type": "number",
          "title": "Allocation Percentage",
          "description": "Percentage of subjects allocated to this arm.",
          "minimum": 0,
          "maximum": 100
        },
        "dosingRegimenSequence": {
          "$ref": "#/$defs/SequencePeriodMap",
          "title": "Dosing Regimen Sequence",
          "description": "Sequence of treatment and washout periods for this treatment arm."
        }
      },
      "required": [
        "name",
        "allocationPercentage",
        "dosingRegimenSequence"
      ],
      "additionalProperties": false
    },
    "SubjectFlow": {
      "type": "object",
      "title": "Subject Flow",
      "description": "Site supply and region configuration from wizard step 6.",
      "properties": {
        "regions": {
          "type": "object",
          "title": "Countries",
          "description": "Region-specific site configuration, keyed by ID.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/RegionConfig"
            }
          }
        }
      },
      "required": [
        "regions"
      ],
      "additionalProperties": false
    },
    "RegionConfig": {
      "oneOf": [
        {
          "$ref": "#/$defs/RegionContainer"
        },
        {
          "$ref": "#/$defs/RegionLeaf"
        }
      ]
    },
    "RegionContainer": {
      "type": "object",
      "title": "Region Container",
      "description": "Container node for grouping regions. Has subregions but no sites.",
      "properties": {
        "nodeType": {
          "type": "string",
          "const": "container",
          "title": "Node Type",
          "description": "Discriminator identifying this as a container node."
        },
        "regionName": {
          "type": "string",
          "title": "Region Name",
          "description": "Name of the region container."
        },
        "subregions": {
          "type": "object",
          "title": "Subregions",
          "description": "Child regions within this container.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "$ref": "#/$defs/RegionConfig"
            }
          }
        },
        "activationStartDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "title": "Activation Start Date",
          "description": "Default activation start date for child regions. Null means no default."
        },
        "screenRate": {
          "type": [
            "number",
            "null"
          ],
          "title": "Screen Rate",
          "description": "Default screen rate for child regions. Null means no default.",
          "exclusiveMinimum": 0
        },
        "siteActivationRate": {
          "type": [
            "number",
            "null"
          ],
          "title": "Site Activation Rate",
          "description": "Default site activation rate for child regions. Null means no default.",
          "exclusiveMinimum": 0
        },
        "maxEnrollmentPerSite": {
          "type": [
            "number",
            "null"
          ],
          "title": "Maximum Enrollment Per Site",
          "description": "Default max enrollment per site for child regions. Null means no default.",
          "minimum": 0
        },
        "siteSeeding": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": {
                "type": "number",
                "minimum": 0
              }
            }
          ],
          "title": "Site Seeding",
          "description": "Default site seeding quantity per kit for child regions. Map of kitId to quantity, or null to inherit."
        }
      },
      "required": [
        "nodeType",
        "regionName",
        "subregions"
      ],
      "additionalProperties": false
    },
    "RegionLeaf": {
      "type": "object",
      "title": "Region Leaf",
      "description": "Leaf node representing an operational region with sites.",
      "properties": {
        "nodeType": {
          "type": "string",
          "const": "region",
          "title": "Node Type",
          "description": "Discriminator identifying this as a leaf region node."
        },
        "regionName": {
          "type": "string",
          "title": "Region Name",
          "description": "Name of the region."
        },
        "numberOfSites": {
          "type": "integer",
          "title": "Number of Sites",
          "description": "Total number of sites in this region.",
          "minimum": 1
        },
        "activationStartDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "title": "Activation Start Date",
          "description": "Date when site activation begins. Null inherits from parent container."
        },
        "screenRate": {
          "type": [
            "number",
            "null"
          ],
          "title": "Screen Rate",
          "description": "Number of subjects screened per site per month. Null inherits from parent container.",
          "exclusiveMinimum": 0
        },
        "siteActivationRate": {
          "type": [
            "number",
            "null"
          ],
          "title": "Site Activation Rate",
          "description": "Number of sites activated per month. Null inherits from parent container.",
          "exclusiveMinimum": 0
        },
        "maxEnrollmentPerSite": {
          "type": [
            "number",
            "null"
          ],
          "title": "Maximum Enrollment Per Site",
          "description": "Maximum number of patients that can be enrolled per site. Null for unlimited or inherited.",
          "minimum": 0
        },
        "siteSeeding": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": {
                "type": "number",
                "minimum": 0
              }
            }
          ],
          "title": "Site Seeding",
          "description": "Site seeding quantity per kit. Map of kitId to quantity, or null to inherit from parent."
        }
      },
      "required": [
        "nodeType",
        "regionName",
        "numberOfSites"
      ],
      "additionalProperties": false
    },
    "RegionForecast": {
      "type": "object",
      "title": "Region Forecast",
      "description": "Atomic monthly forecast data for a single region. All values are monthly (not cumulative). UI computes cumulative views.",
      "properties": {
        "sites": {
          "$ref": "#/$defs/PositiveDateMap",
          "title": "Sites",
          "description": "Monthly count of sites opened this month."
        },
        "subjectsScreened": {
          "$ref": "#/$defs/PositiveDateMap",
          "title": "Subjects Screened",
          "description": "Monthly count of subjects screened this month."
        },
        "subjectsScreenedOut": {
          "$ref": "#/$defs/PositiveDateMap",
          "title": "Subjects Screened Out",
          "description": "Monthly count of subjects who failed screening this month."
        },
        "subjectsEnrolled": {
          "$ref": "#/$defs/ByArmDateMap",
          "title": "Subjects Enrolled",
          "description": "Monthly subjects enrolled, broken down by treatment arm."
        },
        "subjectsActive": {
          "$ref": "#/$defs/ByArmDateMap",
          "title": "Subjects Active",
          "description": "Monthly change in active subjects (new active this month), broken down by treatment arm."
        },
        "subjectsCompleted": {
          "$ref": "#/$defs/ByArmDateMap",
          "title": "Subjects Completed",
          "description": "Monthly subjects who completed treatment, broken down by treatment arm."
        },
        "subjectsDroppedOut": {
          "$ref": "#/$defs/ByArmDateMap",
          "title": "Subjects Dropped Out",
          "description": "Monthly subjects who dropped out, broken down by treatment arm."
        },
        "kitDemand": {
          "$ref": "#/$defs/ByArmSequenceKitDateMap",
          "title": "Kit Demand",
          "description": "Monthly kit demand (whole kits rounded up), broken down by treatment arm and kit ID. Use this for supply planning - it accounts for buffer/waste in partially-used bottles."
        },
        "kitItemDemand": {
          "$ref": "#/$defs/ByArmSequenceKitItemDateMap",
          "title": "Kit Item Demand",
          "description": "Monthly kit item consumption (what patients actually receive), broken down by treatment arm and item ID. Displayed as 'Dosing' in the UI. Note: This is consumption, not supply demand - it does not include buffer/waste from partially-used bottles. For supply planning, use kitDemand."
        },
        "siteSeedingKitDemand": {
          "$ref": "#/$defs/ByKitDateMap",
          "title": "Site Seeding Kit Demand",
          "description": "Site seeding kit demand - kits shipped when sites activate (not treatment-driven). Keyed by kit ID."
        }
      },
      "required": [
        "sites",
        "subjectsScreened",
        "subjectsScreenedOut",
        "subjectsEnrolled",
        "subjectsActive",
        "subjectsCompleted",
        "subjectsDroppedOut",
        "kitDemand",
        "kitItemDemand",
        "siteSeedingKitDemand"
      ],
      "additionalProperties": false
    },
    "ClinicalDemandCalculatedForecast": {
      "type": "object",
      "title": "Clinical Demand Calculated Forecast",
      "description": "Atomic monthly forecast data. Contains per-region data only. UI computes global totals and cumulative views.",
      "properties": {
        "byRegion": {
          "type": "object",
          "title": "By Region",
          "description": "Region-specific forecast data keyed by region ID.",
          "additionalProperties": {
            "$ref": "#/$defs/RegionForecast"
          }
        }
      },
      "required": [
        "byRegion"
      ],
      "additionalProperties": false
    },
    "PositiveDateMap": {
      "type": "object",
      "title": "Positive Date Map",
      "description": "Mapping of dates to positive numerical values.",
      "additionalProperties": false,
      "patternProperties": {
        "^\\d{4}-(0[1-9]|1[0-2])-01$": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "ByArmDateMap": {
      "type": "object",
      "title": "By Arm Date Map",
      "description": "Mapping of treatment arm IDs to date-value maps. Each arm ID maps to a PositiveDateMap.",
      "additionalProperties": false,
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/PositiveDateMap"
        }
      }
    },
    "KitDemandEntry": {
      "type": "object",
      "title": "Kit Demand Entry",
      "description": "Kit demand with placeboOf tagging for active/placebo separation.",
      "properties": {
        "demand": {
          "$ref": "#/$defs/PositiveDateMap",
          "description": "Monthly kit demand values keyed by YYYY-MM-DD date."
        },
        "placeboOf": {
          "type": [
            "string",
            "null"
          ],
          "description": "Regimen ID this is placebo of, or null if active."
        }
      },
      "required": [
        "demand",
        "placeboOf"
      ],
      "additionalProperties": false
    },
    "KitItemDemandEntry": {
      "type": "object",
      "title": "Kit Item Demand Entry",
      "description": "Kit item consumption entry with placeboOf tagging for active/placebo separation. Represents what patients actually receive, not supply demand.",
      "properties": {
        "demand": {
          "$ref": "#/$defs/PositiveDateMap",
          "description": "Monthly kit item demand values keyed by YYYY-MM-DD date."
        },
        "placeboOf": {
          "type": [
            "string",
            "null"
          ],
          "description": "Regimen ID this is placebo of, or null if active."
        }
      },
      "required": [
        "demand",
        "placeboOf"
      ],
      "additionalProperties": false
    },
    "ByArmSequenceKitDateMap": {
      "type": "object",
      "title": "By Arm Sequence Kit Date Map",
      "description": "Mapping of treatment arm IDs to sequence periods to kit demand. Structure: arm → sequenceId → kit → KitDemandEntry. The sequence ID matches keys in dosingRegimenSequence.",
      "additionalProperties": false,
      "patternProperties": {
        ".*": {
          "type": "object",
          "description": "Mapping of sequence period IDs to kit demand for this arm.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "description": "Mapping of kit IDs to KitDemandEntry for this sequence period.",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "$ref": "#/$defs/KitDemandEntry"
                }
              }
            }
          }
        }
      }
    },
    "ByArmSequenceKitItemDateMap": {
      "type": "object",
      "title": "By Arm Sequence Kit Item Date Map",
      "description": "Mapping of treatment arm IDs to sequence periods to kit item consumption. Structure: arm → sequenceId → item → KitItemDemandEntry. The sequence ID matches keys in dosingRegimenSequence. Displayed as 'Dosing' in the UI.",
      "additionalProperties": false,
      "patternProperties": {
        ".*": {
          "type": "object",
          "description": "Mapping of sequence period IDs to kit item demand for this arm.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "description": "Mapping of item IDs to KitItemDemandEntry for this sequence period.",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "$ref": "#/$defs/KitItemDemandEntry"
                }
              }
            }
          }
        }
      }
    },
    "ByKitDateMap": {
      "type": "object",
      "title": "By Kit Date Map",
      "description": "Mapping of kit IDs to date-value maps for site-level kit demand (not per-arm).",
      "additionalProperties": false,
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/PositiveDateMap"
        }
      }
    },
    "ClinicalDemandActuals": {
      "type": "object",
      "title": "Clinical Demand Actuals",
      "description": "Actual enrollment data entered by users to reconcile with forecast.",
      "properties": {
        "enrollment": {
          "type": "object",
          "title": "Enrollment Actuals",
          "description": "Actual enrollment by region and month.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "number",
                      "title": "Total Enrolled",
                      "description": "Total subjects enrolled for this region and month.",
                      "minimum": 0
                    },
                    "byArm": {
                      "type": "object",
                      "title": "Enrollment by Arm",
                      "description": "Enrollment count per treatment arm.",
                      "additionalProperties": false,
                      "patternProperties": {
                        ".*": {
                          "type": "number",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "required": [
                    "total",
                    "byArm"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "sites": {
          "type": "object",
          "title": "Sites Actuals",
          "description": "Actual site counts by region and month.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          }
        },
        "notes": {
          "type": "object",
          "title": "Actuals Notes",
          "description": "Explanatory notes for enrollment actuals by region and month.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "type": "string"
                }
              }
            }
          }
        },
        "siteNotes": {
          "type": "object",
          "title": "Site Actuals Notes",
          "description": "Explanatory notes for site activation actuals by region and month.",
          "additionalProperties": false,
          "patternProperties": {
            ".*": {
              "type": "object",
              "additionalProperties": false,
              "patternProperties": {
                ".*": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "required": [
        "enrollment",
        "sites",
        "notes",
        "siteNotes"
      ],
      "additionalProperties": false
    }
  },
  "abcHasValidKitItemReferences": true
}
