{
  "swagger": "2.0",
  "info": {
    "title": "OmniMed (Clinical NER Detection) API Documentation",
    "version": "1.0.0",
    "description": "API for clinical text analysis and entity extraction."
  },
  "host": "services.forecastica.com",
  "basePath": "/aws/api",
  "securityDefinitions": {
    "Bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header",
      "description": "Send Authorization Header for all API calls with value: Bearer API-KEY (Your API KEY was returned in JSON returned during registration"
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/analyze": {
      "post": {
        "summary": "Synchronous analysis of clinical text",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": { "$ref": "#/definitions/AnalyzeRequest" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful analysis",
            "schema": { "$ref": "#/definitions/AnalyzeResponse" }
          }
        }
      }
    },
    "/analyze/asynch": {
      "post": {
        "summary": "Asynchronous analysis of clinical text",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": { "$ref": "#/definitions/AnalyzeRequest" }
          }
        ],
        "responses": {
          "202": {
            "description": "Job accepted for processing",
            "schema": {
              "type": "object",
              "properties": {
                "jobId": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "/analyze/jobId/{jobId}": {
      "get": {
        "summary": "Retrieve results of an asynchronous analysis job",
        "produces": ["application/json"],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Job completed successfully",
            "schema": { "$ref": "#/definitions/AnalyzeResponse" }
          },
          "202": { "description": "Job still processing" },
          "500": { "description": "Processing failed" }
        }
      }
    }
  },
  "definitions": {
    "AnalyzeRequest": {
      "type": "object",
      "properties": {
        "text": { "type": "string" },
        "model_name": { "type": "string" },
        "confidence_threshold": { "type": "number" },
        "group_entities": { "type": "boolean" },
        "aggregation_strategy": { "type": "string" }
      }
    },
    "AnalyzeResponse": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "text": { "type": "string" },
            "entities": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": { "type": "string" },
                  "label": { "type": "string" },
                  "confidence": { "type": "number" },
                  "start": { "type": "integer" },
                  "end": { "type": "integer" }
                }
              }
            },
            "modelName": { "type": "string" },
            "timestamp": { "type": "string" },
            "processingTime": { "type": "number" }
          }
        }
      }
    }
  }
}