{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://smart.who.int/base/StructureDefinition-UserScenarioSource.schema.json",
  "title": "User Scenario Source",
  "description": "Source reference for User Scenario - exactly one of the following must be provided:\n- url (url data type): URL to retrieve UserScenario definition from input/ or external source\n- canonical (canonical data type): Canonical URI pointing to the UserScenario definition\n- instance: Inline UserScenario instance data",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "const": "UserScenarioSource",
      "description": "Resource type identifier for UserScenarioSource logical model"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "URL to retrieve UserScenario definition from input/ or external source"
    },
    "canonical": {
      "type": "string",
      "format": "uri",
      "description": "Canonical URI pointing to the UserScenario definition"
    },
    "instance": {
      "$ref": "StructureDefinition-UserScenario.schema.json",
      "description": "Inline UserScenario instance data"
    }
  },
  "required": [
    "resourceType"
  ],
  "allOf": [
    {
      "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
    },
    {
      "type": "object",
      "properties": {
        "resourceDefinition": {
          "type": "string",
          "format": "uri",
          "const": "http://smart.who.int/base/StructureDefinition/UserScenarioSource"
        },
        "fhir:parent": {
          "type": "string",
          "const": "http://hl7.org/fhir/StructureDefinition/Base"
        }
      }
    }
  ]
}