{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://smart.who.int/base/StructureDefinition-UserScenario.schema.json",
  "title": "User Scenario (DAK)",
  "description": "Logical Model for representing User Scenarios from a DAK. Narratives that describe how the different personas may interact with each other.",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "const": "UserScenario",
      "description": "Resource type identifier for UserScenario logical model"
    },
    "title": {
      "type": "string",
      "description": "Title of the user scenario"
    },
    "id": {
      "type": "string",
      "description": "An identifier for the user scenario"
    },
    "description[x]": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "format": "uri"
        }
      ],
      "description": "Description of the scenario - either Markdown content or a URI to a Markdown file (absolute or relative to repository root, like input/pagecontent/scenario-XYZ.md)"
    },
    "personas": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "References to persona IDs that participate in this scenario"
    }
  },
  "required": [
    "resourceType",
    "title",
    "id",
    "description[x]"
  ],
  "allOf": [
    {
      "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
    },
    {
      "type": "object",
      "properties": {
        "resourceDefinition": {
          "type": "string",
          "format": "uri",
          "const": "http://smart.who.int/base/StructureDefinition/UserScenario"
        },
        "fhir:parent": {
          "type": "string",
          "const": "http://hl7.org/fhir/StructureDefinition/Base"
        }
      }
    }
  ]
}