{
  "openapi": "3.1.0",
  "info": {
    "title": "Program Indicator (DAK) API",
    "description": "Logical Model for representing Program Indicators from a DAK. Core set of indicators that need to be aggregated for decision-making, performance metrics and subnational and national reporting.",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-ProgramIndicator.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-ProgramIndicator",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-ProgramIndicator.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-ProgramIndicator",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-ProgramIndicator.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-ProgramIndicator": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-ProgramIndicator.schema.json",
        "title": "Program Indicator (DAK)",
        "description": "Logical Model for representing Program Indicators from a DAK. Core set of indicators that need to be aggregated for decision-making, performance metrics and subnational and national reporting.",
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "const": "ProgramIndicator",
            "description": "Resource type identifier for ProgramIndicator logical model"
          },
          "id": {
            "type": "string",
            "description": "Identifier for the program indicator"
          },
          "description[x]": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "string",
                "format": "uri"
              }
            ],
            "description": "Description of the program indicator - either Markdown content or a URI to a Markdown file (absolute or relative to repository root)"
          },
          "name": {
            "type": "string",
            "description": "Name of the indicator"
          },
          "definition": {
            "type": "string",
            "description": "Definition of what the indicator measures"
          },
          "numerator": {
            "type": "string",
            "description": "Description of the numerator calculation"
          },
          "denominator": {
            "type": "string",
            "description": "Description of the denominator calculation"
          },
          "disaggregation": {
            "type": "string",
            "description": "Description of how the indicator should be disaggregated"
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "References to Health Intervention IDs providing additional context"
          }
        },
        "required": [
          "resourceType",
          "id",
          "name",
          "definition",
          "numerator",
          "denominator",
          "disaggregation"
        ],
        "allOf": [
          {
            "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
          },
          {
            "type": "object",
            "properties": {
              "resourceDefinition": {
                "type": "string",
                "format": "uri",
                "const": "http://smart.who.int/base/StructureDefinition/ProgramIndicator"
              },
              "fhir:parent": {
                "type": "string",
                "const": "http://hl7.org/fhir/StructureDefinition/Base"
              }
            }
          }
        ]
      }
    }
  }
}