43.16.1Transaction Log Endpoint

 

The Transaction Log endpoint can be used to inspect the system transaction log.

43.16.2Fetch Transaction Log

 
This method requires the VIEW_TRANSACTION_LOG permission.

This method will return summary information about the transaction log, including timestamps, event types, connecting IP addresses, etc. – but without exposing specific details about the contents of requests and responses.


To invoke:

GET http://localhost:9000/transaction-log

You may also add the following URL parameters:

  • from=[date] – the inclusive start range time (in FHIR dateTime format)
  • to=[date] – the inclusive end range time (in FHIR dateTime format)
  • pageIndex=[int] – the page number to return (default: 0, minimum: 0)
  • pageSize=[int] – the number of rows to return per page (default: 100, maximum: 10000)
  • transactionId=[String] – filter by specific transaction ID
  • userName=[String] – filter by username
  • moduleId=[String] – specify which Transaction Log module to query
  • completeUrl=[String] – filter by complete URL

The server will produce a response resembling the following:

{
  "moduleId" : "transaction",
  "from" : "2016-12-15T00:00:00.000-05:00",
  "to" : "2016-12-23T00:00:00.000-05:00",
  "pageIndex" : 0,
  "pageSize" : 100,
  "events" : [ {
    "id" : 1,
    "initialTimestamp" : "2016-12-21T15:51:15.571-05:00",
    "type" : "FHIR_REQUEST",
    "subType" : "FHIR_HISTORY_SYSTEM",
    "outcome" : "SUCCESS",
    "endpointNodeId" : "local",
    "endpointModuleId" : "fhir_endpoint",
    "processingTime" : 3831,
    "endpointLocalHost" : "192.168.0.19",
    "endpointLocalPort" : 8000,
    "endpointRemoteHost" : "192.168.10.132",
    "endpointRemotePort" : 49881,
    "userModuleId" : "local_security"
  } ]
}

For brevity only 1 event is shown but a real response might contain many more.

Note the following details:

  • "moduleId": "transaction" – the module ID of the module that stores the transaction records
  • "type": "FHIR_REQUEST" – this code gives the high level category of the interaction; see Transaction Log Event Types for possible codes
  • "subType" : "FHIR_HISTORY_SYSTEM" – this code gives the specific interaction for this event; see Transaction Log Event SubTypes for possible codes
  • "outcome" : "SUCCESS" – this code shows whether the transaction was completed successfully; see Transaction Log Outcomes for possible codes
  • "endpointModuleId": "fhir_endpoint" – the module ID of the endpoint module that received the request and generated the record
  • "userModuleId": "local_security" – the module ID of the module that manages the security for the user that generated the record

43.16.3Fetch Individual Event (Deprecated)

 
This method requires the VIEW_TRANSACTION_LOG_EVENT permission.
Deprecated since 2023.05.R01 - Use /{moduleId}/event/{id} instead. See Fetch Individual Event by Module below.

This method will return the details of a given transaction, including request URL, detailed timing information, and request/response bodies for some transaction types. Note this information may have special privacy and security implications so you should consider carefully before exposing this data.


To invoke (substitute a transaction ID into the path below):

http://localhost:9000/transaction-log/event/{transaction_id}

You may also add the following URL parameter:

  • includeBody=true – by default the request/response body is not included in the response. You can override this behaviour by using this parameter.

The server will produce a response resembling the following:

{
  "id": 1,
  "initialTimestamp": "2016-12-21T15:51:15.571-05:00",
  "type": "FHIR_REQUEST",
  "subType": "FHIR_HISTORY_SYSTEM",
  "outcome": "SUCCESS",
  "endpointNodeId": "local",
  "endpointModuleId": "fhir_endpoint",
  "processingTime": 3831,
  "endpointLocalHost": "192.168.0.19",
  "endpointLocalPort": 8000,
  "endpointRemoteHost": "192.168.10.132",
  "endpointRemotePort": 49881,
  "events": [
    {
      "endpointLocalHost": "192.168.0.19",
      "endpointLocalPort": 8000,
      "endpointModuleId": "fhir_endpoint",
      "endpointNodeId": "local",
      "endpointRemoteHost": "192.168.10.132",
      "endpointRemotePort": 49881,
      "initialTimestamp": "2016-12-21T15:51:15.571-05:00",
      "requestUrl": "http://localhost:8000/_history",
      "requestVerb": "GET",
      "type": "ENDPOINT_RECEIVE",
      "userModuleId": "local_security"
    },
    {
      "endpointLocalHost": "192.168.0.19",
      "endpointLocalPort": 8000,
      "endpointModuleId": "fhir_endpoint",
      "endpointNodeId": "local",
      "endpointRemoteHost": "192.168.10.132",
      "endpointRemotePort": 49881,
      "initialTimestamp": "2016-12-21T15:51:19.402-05:00",
      "outcome": "SUCCESS",
      "type": "ENDPOINT_REPLY",
      "responseStatus": 200,
      "userModuleId": "local_security"
    }
  ]
}

43.16.4Fetch Individual Event by Module

 
This method requires the VIEW_TRANSACTION_LOG_EVENT permission.

This method will return the details of a given transaction from a specific Transaction Log module, including request URL, detailed timing information, and request/response bodies for some transaction types. Note this information may have special privacy and security implications so you should consider carefully before exposing this data.

This is the current recommended method for fetching individual transaction events, replacing the deprecated endpoint that did not specify a module ID.


To invoke (substitute a module ID and transaction ID into the path below):

GET http://localhost:9000/transaction-log/{moduleId}/event/{transaction_id}

Note the following path elements:

  • moduleId – The Transaction Log module ID that stores the transaction records
  • transaction_id – The ID of the specific transaction event to retrieve

You may also add the following URL parameter:

  • includeBody=true – by default the request/response body is not included in the response. You can override this behaviour by using this parameter.

The server will produce a response resembling the following:

{
  "id": 1,
  "initialTimestamp": "2016-12-21T15:51:15.571-05:00",
  "type": "FHIR_REQUEST",
  "subType": "FHIR_HISTORY_SYSTEM",
  "outcome": "SUCCESS",
  "endpointNodeId": "local",
  "endpointModuleId": "fhir_endpoint",
  "processingTime": 3831,
  "endpointLocalHost": "192.168.0.19",
  "endpointLocalPort": 8000,
  "endpointRemoteHost": "192.168.10.132",
  "endpointRemotePort": 49881,
  "events": [
    {
      "endpointLocalHost": "192.168.0.19",
      "endpointLocalPort": 8000,
      "endpointModuleId": "fhir_endpoint",
      "endpointNodeId": "local",
      "endpointRemoteHost": "192.168.10.132",
      "endpointRemotePort": 49881,
      "initialTimestamp": "2016-12-21T15:51:15.571-05:00",
      "requestUrl": "http://localhost:8000/_history",
      "requestVerb": "GET",
      "type": "ENDPOINT_RECEIVE",
      "userModuleId": "local_security"
    },
    {
      "endpointLocalHost": "192.168.0.19",
      "endpointLocalPort": 8000,
      "endpointModuleId": "fhir_endpoint",
      "endpointNodeId": "local",
      "endpointRemoteHost": "192.168.10.132",
      "endpointRemotePort": 49881,
      "initialTimestamp": "2016-12-21T15:51:19.402-05:00",
      "outcome": "SUCCESS",
      "type": "ENDPOINT_REPLY",
      "responseStatus": 200,
      "userModuleId": "local_security"
    }
  ]
}