{
  "openapi": "3.1.1",
  "info": {
    "title": "DrPerfectReport HMS API",
    "version": "2.0",
    "description": "Connect hospital OPD and IPD to branch pricing, diagnostic work and approved reports. Staff provisioning uses a bearer token."
  },
  "externalDocs": {
    "url": "https://drperfectreport.com/developers/hms"
  },
  "servers": [
    {
      "url": "https://api.drperfectreport.com",
      "description": "Use your provisioned DrPerfectReport API host"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "HMS integration"
    },
    {
      "name": "Staff provisioning"
    }
  ],
  "paths": {
    "/api/integration/v2/catalog": {
      "get": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "modality",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1,
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCatalogPage"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCatalogPage"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCatalogPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "getHmsCatalog",
        "summary": "List the branch's contracted diagnostic items and prices"
      }
    },
    "/api/integration/v2/orders": {
      "post": {
        "tags": [
          "HMS integration"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsOrder"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsOrder"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderConfirmation"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderConfirmation"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderConfirmation"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "placeHmsOrder",
        "summary": "Accept or replay an OPD or IPD diagnostic request"
      }
    },
    "/api/integration/v2/orders/{orderRef}": {
      "get": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "orderRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "getHmsOrder",
        "summary": "Get a diagnostic order by its order reference"
      }
    },
    "/api/integration/v2/orders/by-external-ref/{requestId}": {
      "get": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsOrderStatus"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "findHmsOrder",
        "summary": "Reconcile an order by the original hospital request reference"
      }
    },
    "/api/integration/v2/orders/{orderRef}/reports": {
      "get": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "orderRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsReport"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsReport"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsReport"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "listHmsReports",
        "summary": "List approved report metadata and release availability"
      }
    },
    "/api/integration/v2/orders/{orderRef}/reports/{reportId}/pdf": {
      "get": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "orderRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "downloadHmsReport",
        "summary": "Download an available report PDF"
      }
    },
    "/api/integration/v2/orders/{orderRef}/items/{itemRef}/cancel": {
      "post": {
        "tags": [
          "HMS integration"
        ],
        "parameters": [
          {
            "name": "orderRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "itemRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelHmsItem"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelHmsItem"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CancelHmsItem"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCancelledItem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCancelledItem"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsCancelledItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "cancelHmsItem",
        "summary": "Cancel a billable item before work starts"
      }
    },
    "/api/hms-connections": {
      "get": {
        "tags": [
          "Staff provisioning"
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsConnectionDetails"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsConnectionDetails"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HmsConnectionDetails"
                  }
                }
              }
            }
          }
        },
        "operationId": "listHmsConnections",
        "summary": "List hospital connections and tariffs",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "Staff provisioning"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsConnection"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsConnection"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHmsConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "createHmsConnection",
        "summary": "Create a connection for a diagnostic branch",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      }
    },
    "/api/hms-connections/{id}/catalog": {
      "put": {
        "tags": [
          "Staff provisioning"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateHmsTariff"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateHmsTariff"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateHmsTariff"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsConnectionDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "replaceHmsTariff",
        "summary": "Replace the connection tariff using the current revision",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      }
    },
    "/api/hms-connections/{id}/patients/{externalPatientId}": {
      "put": {
        "tags": [
          "Staff provisioning"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "externalPatientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkHmsPatient"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkHmsPatient"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LinkHmsPatient"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmsError"
                }
              }
            }
          }
        },
        "operationId": "linkHmsPatient",
        "summary": "Confirm an existing lab patient match",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      }
    },
    "/api/api-keys": {
      "get": {
        "tags": [
          "Staff provisioning"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid staff bearer token"
          },
          "403": {
            "description": "Staff permission or subscription required"
          }
        },
        "operationId": "listApiKeys",
        "summary": "List lab API key metadata",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "Staff provisioning"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              },
              "example": {
                "name": "Example Hospital HMS",
                "scope": "HmsIntegration",
                "hmsConnectionId": "99999999-9999-4999-8999-999999999999"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedApiKeyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedApiKeyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedApiKeyDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid staff bearer token"
          },
          "403": {
            "description": "Staff permission or subscription required"
          },
          "400": {
            "description": "Key request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "generateHmsKey",
        "summary": "Issue a key for the connection",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      }
    },
    "/api/api-keys/{id}/revoke": {
      "post": {
        "tags": [
          "Staff provisioning"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevokeApiKeyDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevokeApiKeyDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevokeApiKeyDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Missing or invalid staff bearer token"
          },
          "403": {
            "description": "Staff permission or subscription required"
          },
          "400": {
            "description": "Key request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "revokeApiKey",
        "summary": "Revoke an old key after a successful rotation",
        "security": [
          {
            "StaffBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AgeUnit": {
        "type": "integer",
        "default": 1
      },
      "ApiKeyDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "analyzerMachineId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "analyzerMachineName": {
            "type": [
              "null",
              "string"
            ]
          },
          "hmsConnectionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedIp": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isAuthorized": {
            "type": "boolean"
          },
          "authorizedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isRevoked": {
            "type": "boolean"
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revokedReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CancelHmsItem": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "CreateApiKeyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "analyzerMachineId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "hmsConnectionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateHmsConnection": {
        "required": [
          "branchId",
          "name",
          "hospitalCollectsPayment"
        ],
        "type": "object",
        "properties": {
          "branchId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "hospitalCollectsPayment": {
            "type": "boolean"
          }
        }
      },
      "CreateHmsOrder": {
        "required": [
          "externalRequestId",
          "externalPatientId",
          "externalEncounterId",
          "encounterType",
          "branchId",
          "catalogRevision",
          "items"
        ],
        "type": "object",
        "properties": {
          "externalRequestId": {
            "type": "string"
          },
          "externalPatientId": {
            "type": "string"
          },
          "externalEncounterId": {
            "type": "string"
          },
          "encounterType": {
            "type": "string"
          },
          "branchId": {
            "type": "string",
            "format": "uuid"
          },
          "catalogRevision": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsOrderItem"
            }
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/HmsPatientDetails"
              }
            ]
          },
          "orderingDoctor": {
            "type": [
              "null",
              "string"
            ]
          },
          "urgency": {
            "$ref": "#/components/schemas/UrgencyLevel"
          },
          "answers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OrderAnswerDto"
            }
          }
        }
      },
      "Gender": {
        "type": "integer"
      },
      "GeneratedApiKeyDto": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ApiKeyDto"
          },
          "plainKey": {
            "type": "string"
          }
        }
      },
      "HmsCancelledItem": {
        "required": [
          "itemRef",
          "status"
        ],
        "type": "object",
        "properties": {
          "itemRef": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "HmsCatalogItem": {
        "required": [
          "itemType",
          "itemId",
          "name",
          "code",
          "department",
          "modalities",
          "unitRate"
        ],
        "type": "object",
        "properties": {
          "itemType": {
            "type": "string"
          },
          "itemId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "modalities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unitRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "HmsCatalogPage": {
        "required": [
          "branchId",
          "catalogRevision",
          "currency",
          "page",
          "pageSize",
          "total",
          "items"
        ],
        "type": "object",
        "properties": {
          "branchId": {
            "type": "string",
            "format": "uuid"
          },
          "catalogRevision": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsCatalogItem"
            }
          }
        }
      },
      "HmsConfirmedItem": {
        "required": [
          "itemRef",
          "itemType",
          "itemId",
          "name",
          "code",
          "unitRate"
        ],
        "type": "object",
        "properties": {
          "itemRef": {
            "type": "string",
            "format": "uuid"
          },
          "itemType": {
            "type": "string"
          },
          "itemId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "HmsConnectionDetails": {
        "required": [
          "id",
          "name",
          "branchId",
          "hospitalCollectsPayment",
          "catalogRevision",
          "items"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "branchId": {
            "type": "string",
            "format": "uuid"
          },
          "hospitalCollectsPayment": {
            "type": "boolean"
          },
          "catalogRevision": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsTariffItem"
            }
          }
        }
      },
      "HmsError": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "HmsItemProgress": {
        "required": [
          "workRef",
          "billableItemRef",
          "modality",
          "resultStatus",
          "imagingStage",
          "sampleStatus"
        ],
        "type": "object",
        "properties": {
          "workRef": {
            "type": "string",
            "format": "uuid"
          },
          "billableItemRef": {
            "type": "string",
            "format": "uuid"
          },
          "modality": {
            "type": "string"
          },
          "resultStatus": {
            "type": "string"
          },
          "imagingStage": {
            "type": [
              "null",
              "string"
            ]
          },
          "sampleStatus": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HmsOrderConfirmation": {
        "required": [
          "orderRef",
          "visitNumber",
          "branchId",
          "externalRequestId",
          "externalPatientId",
          "externalEncounterId",
          "encounterType",
          "currency",
          "total",
          "hospitalCollectsPayment",
          "items"
        ],
        "type": "object",
        "properties": {
          "orderRef": {
            "type": "string",
            "format": "uuid"
          },
          "visitNumber": {
            "type": "string"
          },
          "branchId": {
            "type": "string",
            "format": "uuid"
          },
          "externalRequestId": {
            "type": "string"
          },
          "externalPatientId": {
            "type": "string"
          },
          "externalEncounterId": {
            "type": "string"
          },
          "encounterType": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "hospitalCollectsPayment": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsConfirmedItem"
            }
          }
        }
      },
      "HmsOrderItem": {
        "required": [
          "itemType",
          "itemId",
          "expectedUnitRate"
        ],
        "type": "object",
        "properties": {
          "itemType": {
            "type": "string"
          },
          "itemId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedUnitRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "HmsOrderStatus": {
        "required": [
          "order",
          "visitStatus",
          "sampleStatuses",
          "items"
        ],
        "type": "object",
        "properties": {
          "order": {
            "$ref": "#/components/schemas/HmsOrderConfirmation"
          },
          "visitStatus": {
            "type": "string"
          },
          "sampleStatuses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsItemProgress"
            }
          }
        }
      },
      "HmsPatientDetails": {
        "required": [
          "fullName",
          "gender"
        ],
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "age": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ageUnit": {
            "$ref": "#/components/schemas/AgeUnit"
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "For an unlinked patient, provide dateOfBirth or age. A linked patient may omit patient details entirely."
      },
      "HmsReport": {
        "required": [
          "reportId",
          "reportNumber",
          "version",
          "generatedAt",
          "modality",
          "availability",
          "workRefs",
          "itemRefs"
        ],
        "type": "object",
        "properties": {
          "reportId": {
            "type": "string",
            "format": "uuid"
          },
          "reportNumber": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "modality": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "workRefs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "itemRefs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "HmsTariffItem": {
        "required": [
          "itemType",
          "itemId",
          "unitRate"
        ],
        "type": "object",
        "properties": {
          "itemType": {
            "type": "string"
          },
          "itemId": {
            "type": "string",
            "format": "uuid"
          },
          "unitRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "LinkHmsPatient": {
        "required": [
          "patientId"
        ],
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "OrderAnswerDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayValue": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RevokeApiKeyDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateHmsTariff": {
        "required": [
          "catalogRevision",
          "items"
        ],
        "type": "object",
        "properties": {
          "catalogRevision": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmsTariffItem"
            }
          }
        }
      },
      "UrgencyLevel": {
        "type": "integer",
        "default": 1
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Use an HmsIntegration key issued by the lab."
      },
      "StaffBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
