Version 2021

Diagnose

Returns diagnostic information indicating the health of the adapter. For example, this call can obtain the most recent error.

Request format


HTTP method

GET

Resource URL

/resource/diagnose

Parameters

None.

Response format


Response header

content-Type:application/json

Response body

The status, info and detail fields are required in the diagnose response. The message field is added when the status is either an ERROR or a WARNING to let the caller know the cause of the error or warning.

Success response

Copy
{
  "json_version": "2.0",
  "status":"SUCCESS",
  "info": {Info object},
  "detail": {Detail object}
}

Failure response

Copy
{
  "json_version": "2.0",
  "status":"ERROR",
  "message":"<error_message>",
  "info": {Info object},
  "detail": {Detail object}
}

Warning response

Copy
{
  "json_version": "2.0",
  "status":"WARNING",
  "message":"<warning_message>",
  "info": {Info object},
  "detail": {Detail object}
}

Response body specification

Field Type Description
json_version string Version of the json response calls.
status string SUCCESS, ERROR, or WARNING.
message string Any error or warning message. Omitted if status is SUCCESS. See Messages below for an enumeration of messages.
info Info An object containing the configuration information of the adapter.
detail Detail An object containing detailed diagnostic information about the status of the PACS adapter. Useful to examine when the status field was either ERROR or WARNING.

Info

The Info object contains information about the PACS adapter and the remote PACS server. Typically, the information contained here do not change during the course of a deployment.

Field Type Description
adapter_host string This is the hostname or IP address of the current server. This is useful in a clustering scenario.
adapter_version string The version should be returned for all PACS adapters.
pacs_info PACSInfo A PACSInfo object containing information about the remote/local PACS server.

Detail

Field Type Description
cache_update_time string

The cache update time should be a timestamp formatted as yyyy-MM-dd hh:mm:ss in the time zone of the server. It should reflect the last time the cache was updated from the PACS server.

If the implementation has no cache, this can be omitted. If the cache has never been populated, replace the date with Never. If the cache exists, but the date is not known, replace the date with Unknown. This should happen if a server was upgraded from a version that did not recognize the timestamp to one that does.

cache_status string This reflects the state of the cache as one of the following: Ready, Updating, or Not Ready.
elapsed_request_time string This should reflect the amount of time, in milliseconds, it took to service the diagnose request. This helps you understand the time that simple requests take in the system.
usher_log_messages_to_write string

For adapters that write log messages to the Usher adapter log asynchronously, this should reflect the number of messages in the system that have not actually been written to the database yet. This allows the user to diagnose a possible backup in logging.

If no log database is used, which is not recommended, this may be omitted from the detail JSON.

pacs_log_messages_to_write string If a separate queue exists in the adapter for writing to the log in your PACS web server, this field should output the number of messages yet to be sent to the PACS. If such a queue does not exist for a PACS, this field may be omitted.
uptime string

This field should return the amount of time that the web service process has been running since the last restart. The format should be the following:

If the time is less than a minute, print <1m

If the time is greater than a minute but less than an hour, print xxm, where xx is the number of minutes, rounded to the nearest minute.

If the time is 1 or more hours, print out the number of hours, to one decimal place; for example, 19.4h if it has been running for 19.4 hours. Round as necessary.

most_recent_error string This field should contain details of the most recent error. The details should be concatenated into a single message. For example, if the system has both an error code and message, it could be something like: 0x80044938: Access denied for user tester on panel 17, reader 1, segment 0. If the system has a message but no error code, include the message. If no error has occurred since the server has started, this should be omitted.
thread_pools List<ThreadPool> A collection of ThreadPool objects. This field should be included if a thread pool or a connection pool is used in the PACS adapter. This means that if multiple pools are used, there will be one entry for each pool. If no pooling is used, this field should be omitted.

PACSInfo

The PACSInfo object contains information about a remote PACS server.

Field Type Description
server_host string The hostname or IP address of the remote PACS server
server_version string The version of the remote PACS server
server_api_url string The URL of the remote PACS server used to make API calls
server_api_version string The api version of the remote PACS server

ThreadPool

A ThreadPool object contains the current state of a thread pool i.e. the number of threads in use and number of requests that are waiting in queue. It also contains number of times a request failed to be processed for lack of resources from the pool.

Field Type Description
description string Description is a human-readable description of the pool’s contents.
size string Size should be the total size of the pool, including the total number of threads, total number of connections, and so on.
usage string Usage is the number of items in the pool that are assigned to a caller at the moment the call is serviced.
waiting string Waiting is the number of requests that are waiting for a resource to be freed up at the moment the request is serviced. This should be included if it is possible to timeout waiting for a connection.
timeouts string Timeouts is the number of time outs that have occurred while a request was waiting for a resource from the pool to become available. If this is not possible in an implementation, it should be omitted.

Messages

Field Type Description
SUCCESS - -
ERROR PACS_UNREACHABLE_ERROR Failed to connect to the PACS server
ERROR PACS_ADAPTER_CACHE_ERROR Adapter cache either not available or not updated
WARNING PACS_ADAPTER_CACHE_FILE_ERROR Read/write issue with cache file
WARNING PACS_ADAPTER_LOG_DB_ERROR Lost connection to logging database

Example

Request

http://localhost:8080/Usher.svc/resource/diagnose

Response

Copy
{
  "json_version": "2.0",
  "status": "WARNING",
  "message": "Lost connection to logging DB",
  "info": {
    "adapter_host": "10.11.12.13",
    "adapter_version": "2.1.14",
    "pacs_info": {
      "server_host": "10.11.12.13",
      "server_version": "1.0.4.17",
      "server_api_url": "https://tyco-test/ws/api",
      "server_api_version": "1.0"
    },
  "detail": {
    "cache_update_time": "2014-10-24 09:17:42",
    "cache_status": "Ready",
    "elapsed_request_time": 240,
    "usher_log_messages_to_write": 37,
    "pacs_log_messages_to_write": 12,
    "uptime": "19.4h",
    "most_recent_error": "Access denied for user tester on panel 17, reader 1, segment 0",
    "thread_pools": [
      {
        "description": "Connection Pool",
        "size": 12,
        "usage": 4,
        "waiting": 0,
        "timeouts": 0
      }
    ]
  }
}