{
  "openapi": "3.1.0",
  "info": {
    "title": "Functional Requirement (DAK) API",
    "description": "Logical Model for representing functional requirement from a DAK",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-FunctionalRequirement.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-FunctionalRequirement",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-FunctionalRequirement.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-FunctionalRequirement",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-FunctionalRequirement.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-FunctionalRequirement": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-FunctionalRequirement.schema.json",
        "title": "Functional Requirement (DAK)",
        "description": "Logical Model for representing functional requirement from a DAK",
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "const": "FunctionalRequirement",
            "description": "Resource type identifier for FunctionalRequirement logical model"
          },
          "id": {
            "type": "string",
            "description": "An identifier or code for the requirement"
          },
          "activity": {
            "type": "string",
            "description": "Description of the activity being performed"
          },
          "actor": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "FHIR Reference"
            },
            "description": "The actor(s) that should fulfill the requirement"
          },
          "capability[x]": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ],
            "description": "Capability achieved by an actor fulfilling the requirement (I want)"
          },
          "benefit[x]": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ],
            "description": "Benefit to an actor fulfilling the requirement (so that)"
          },
          "classification": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Classification of the identifier"
          }
        },
        "required": [
          "resourceType",
          "id",
          "activity"
        ],
        "allOf": [
          {
            "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
          },
          {
            "type": "object",
            "properties": {
              "resourceDefinition": {
                "type": "string",
                "format": "uri",
                "const": "http://smart.who.int/base/StructureDefinition/FunctionalRequirement"
              },
              "fhir:parent": {
                "type": "string",
                "const": "http://hl7.org/fhir/StructureDefinition/Base"
              }
            }
          }
        ]
      }
    }
  }
}