Smile CDR v2024.05.PRE
On this page:

35.12.1Transaction Log Endpoint

 

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

35.12.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
  • pageSize=[int] – the number of rows to return per page

The server will produce a response resembling the following:

{
  "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
  } ]
}

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

Note the following details:

  • "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

35.12.3Fetch Individual Event

 
This method requires the VIEW_TRANSACTION_LOG_EVENT permission.

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"
    },
    {
      "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
    }
  ]
}