{
  "openapi": "3.0.3",
  "info": {
    "title": "LogicalModels Enumeration API",
    "description": "API endpoint providing an enumeration of all available Logical Model schemas",
    "version": "1.0.0"
  },
  "paths": {
    "/LogicalModels.schema.json": {
      "get": {
        "summary": "Get enumeration of all logical_model schemas",
        "description": "Returns a list of all available logical_model schemas with metadata",
        "responses": {
          "200": {
            "description": "Successfully retrieved logical_model enumeration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnumerationResponse"
                },
                "example": {
                  "type": "logical_model",
                  "count": 2,
                  "schemas": [
                    {
                      "filename": "StructureDefinition-MedicationOverviewMin.schema.json",
                      "id": "http://smart.who.int/base/StructureDefinition-MedicationOverviewMin.schema.json",
                      "title": "Medication Overview (Minimal)",
                      "description": "Minimal medication overview payload for use within a QR code payload. Based on the IHE Pharmacy Medication Overview logical model, with short element labels (one or two letters) and simple data",
                      "url": "./StructureDefinition-MedicationOverviewMin.schema.json",
                      "propertyCount": 10
                    },
                    {
                      "filename": "StructureDefinition-MedicationTreatmentLineMin.schema.json",
                      "id": "http://smart.who.int/base/StructureDefinition-MedicationTreatmentLineMin.schema.json",
                      "title": "Medication Treatment Line (Minimal)",
                      "description": "Minimal medication treatment line payload for use within a QR code payload. Based on the IHE Pharmacy Medication Treatment Line logical model, with short element labels (one or two letters) and simple data types suitable for encoding in a compact QR code payload.",
                      "url": "./StructureDefinition-MedicationTreatmentLineMin.schema.json",
                      "propertyCount": 10
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EnumerationResponse": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/LogicalModels.schema.json",
        "title": "Logical Model Enumeration Schema",
        "description": "JSON Schema defining the structure of the Logical Model enumeration endpoint response",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "logical_model"
          },
          "count": {
            "type": "integer"
          },
          "schemas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "logicalModelUrl": {
                  "type": "string"
                },
                "propertyCount": {
                  "type": "integer"
                }
              },
              "required": [
                "filename",
                "title",
                "url"
              ]
            }
          }
        },
        "required": [
          "type",
          "count",
          "schemas"
        ],
        "example": {
          "type": "logical_model",
          "count": 2,
          "schemas": [
            {
              "filename": "StructureDefinition-MedicationOverviewMin.schema.json",
              "id": "http://smart.who.int/base/StructureDefinition-MedicationOverviewMin.schema.json",
              "title": "Medication Overview (Minimal)",
              "description": "Minimal medication overview payload for use within a QR code payload. Based on the IHE Pharmacy Medication Overview logical model, with short element labels (one or two letters) and simple data",
              "url": "./StructureDefinition-MedicationOverviewMin.schema.json",
              "propertyCount": 10
            },
            {
              "filename": "StructureDefinition-MedicationTreatmentLineMin.schema.json",
              "id": "http://smart.who.int/base/StructureDefinition-MedicationTreatmentLineMin.schema.json",
              "title": "Medication Treatment Line (Minimal)",
              "description": "Minimal medication treatment line payload for use within a QR code payload. Based on the IHE Pharmacy Medication Treatment Line logical model, with short element labels (one or two letters) and simple data types suitable for encoding in a compact QR code payload.",
              "url": "./StructureDefinition-MedicationTreatmentLineMin.schema.json",
              "propertyCount": 10
            }
          ]
        }
      }
    }
  }
}