Inconsistency checker


The inconsistency checker tool is designed to analyze clinical notes and identify potential inconsistencies, such as conflicting information or missing data. By flagging these issues, the tool helps ensure the accuracy and reliability of the generated clinical notes, ultimately improving the quality of patient care and documentation.

Below we will describe the entire process that allows the successful completion of inconsistency checking.

Request description

Endpoint: /api/v1/inconsistency-checker
Method: POST

{
  "Content-Type": "application/json",
  "Authorization": "Bearer <accessToken>"
}

Authorization: We'll pass the token obtained during the authentication process. You can reuse the generated tokens, as they have a 2-hour lifespan. Review this page: Credentials

To set the API version on a specific request, you can add a specific header named X-Invox-Medical-Api-Version with the value of the version you are targeting:

X-Invox-Medical-Api-Version: 2026-03-01

Payload structure

type IInconsistencyCheckerRequest = {
  text: string; // Clinical note text to analyze for inconsistencies
  language?: string; // Language of results. Supported values: "es", "en", "pt", "pt-PT", "pt-BR", and "ca". If omitted, language will be automatically detected from the content.
  report_type?: InconsistencyCheckerTypes; // Type of report to analyze. Supported values: "RADIOLOGY", "PATHOLOGY", "NUCLEAR_MEDICINE" and "GENERIC". Default is "GENERIC".
  sections?: string[]; // reserverd for future use to specify sections of the clinical note to analyze (e.g., ["history", "diagnosis", "treatment"])
};

type InconsistencyCheckerTypes =
  | "RADIOLOGY"
  | "PATHOLOGY"
  | "NUCLEAR_MEDICINE"
  | "GENERIC";

Depends on the type of report specified in the request:

  1. RADIOLOGY: The inconsistency checker will prioritize identifying contradictions or missing information related to radiological findings, imaging results, and interpretations.
    Items marked as "RADIOLOGY" will be analyzed with a focus on Findings and Conclusions.
  2. PATHOLOGY: The tool will focus on inconsistencies related to pathological findings, tissue analysis, and diagnostic conclusions.
    Items marked as "PATHOLOGY" will be analyzed with a focus on Macroscopy, Microscopy and Diagnostic conclusions.
  3. NUCLEAR_MEDICINE: The tool will focus on inconsistencies related to nuclear medicine findings, imaging results, and diagnostic conclusions.
    Items marked as "NUCLEAR_MEDICINE" will be analyzed with a focus on Procedures, Findings and Impressions / Conclusions.
  4. GENERIC: The inconsistency checker will provide a more general analysis of inconsistencies across various types of clinical notes.
    Items marked as "GENERIC" will be analyzed with a focus on History / Summary, Findings and Conclusions/Plan.

Responses

Correct response

Successful request

Describe the characteristics of a satisfactory response

200

Response example:

{
  "issues": [
    {
      "severity": "error",
      "issue_type": "contradiction",
      "message": "Contradiction detected between different sections of the report affecting medical consistency.",
      "evidence": "A 45-year-old patient presented with chest pain. A 3cm pulmonary mass was observed on examination. Conclusion: The patient was 52 years old with no relevant findings.",
      "code": "contradiction",
      "section": "general",
      "evidence_start": 0,
      "evidence_end": 166
    }
  ],
  "summary": "A critical contradiction was detected between different sections of the report requiring immediate review.",
  "is_consistent": false,
  "message": null,
  "request_id": "5c1b47ae-b986-4f77-8c85-59cb5a5bf3b7"
}
Response structure
interface IInconsistencyCheckerResponse {
  issues: IInconsistencyCheckerIssue[]; // List of identified inconsistencies with details
  summary: string; // A brief summary of the overall consistency of the clinical note
  is_consistent: boolean; // Indicates whether the clinical note is consistent or not based on the analysis
  message: string | null; // Additional message or information about the analysis, if applicable
  request_id: string; // Unique identifier for the request, useful for tracking and debugging purposes
}
interface IInconsistencyCheckerIssue {
  severity: string; // Severity level of the issue (e.g., "error", "warning", "info")
  issue_type: string; // Type of the issue detected (e.g., "contradiction", "omission_sections, etc.")
  message: string; // Description of the issue
  evidence: string | null; // Evidence supporting the identified issue
  code: string; // Code representing the type of issue
  section: string; // Section of the clinical note where the issue was found
  evidence_start: number | null; // Start position of the evidence in the clinical note text
  evidence_end: number | null; // End position of the evidence in the clinical note text
}

Severity levels dictionary

  • error: Indicates a critical inconsistency that could significantly impact the accuracy of the clinical note and may require immediate attention.
  • warning: Indicates a potential issue that may affect the interpretation of the clinical note but is not immediately critical.
  • info: Provides informational messages that do not indicate a direct problem but may be useful for understanding the context or clarity of the clinical note.

Issue types dictionary

  • contradiction: Indicates that there is a contradiction between sections. Example: "Right vs Left", "Present vs Absent", "Normal vs Abnormal", etc. This issue is marked as error severity.
  • omission_sections: Missing information in important sections. Example: "No conclusions provided". This issue is marked as error severity.
  • numeric_missmatch: Numeric values that are inconsistent across sections. Example: "52 cm vs 50 cm". This issue is marked as error severity.
  • omission_detail: Missing relevant details that could affect the interpretation of the report. Example: "Without contours". This issue is marked as warning severity.
  • laterality_missing: Missing laterality information when it is relevant. Example: "Lung injury ". This issue is marked as warning severity.
  • unsupported_inference: Conclusion without sufficient evidence. Example: "The mass is likely benign". This issue is marked as warning severity.
  • ambiguity: Language imprecise or unclear. Example: "The findings are suggestive of a possible condition". This issue is marked as info severity.

Wrong responses

Unauthorized request

Describes the response when the request is not authorized


401

Response body

type InconsistencyCheckerResponseType = {
  message: string;
};


Forbidden request

Describes the response when the API Key is not allowed to consume this service


403

Response body

type InconsistencyCheckerResponseType = {
  messsage: string;
  errorType: string;
};

Remember that to consume this service, the API Key must have the permission: INCONSISTENCY-CHECKER

Validation error

Describe the features of a validation error

422

Response body

type InconsistencyCheckerResponseType = {
  statusCode: number;
  message: string;
  error: string;
  details: {
    errorCode: string;
    message: string;
    requestId: string;
    timestamp: string;
  };
};