The Transaction Log endpoint can be used to inspect the system transaction log.
This method returns the list of available Transaction Log module IDs. This is useful for discovering which modules are configured and can be queried via the other Transaction Log endpoints.
To invoke:
GET http://localhost:9000/transaction-log/modules
The server will produce a response resembling the following:
["transaction_log", "broker_txlog"]
This method returns the complete list of valid event type and subtype codes along with their human-readable descriptions. This is useful for programmatically discovering all available codes that can be used when configuring event whitelists and blacklists, or when filtering results from the Fetch Transaction Log endpoint.
To invoke:
GET http://localhost:9000/transaction-log/event-codes
The server will produce a response resembling the following:
{
"eventTypes" : [ {
"code" : "FHIR_REQUEST",
"description" : "FHIR Request"
}, {
"code" : "HL7V2_INBOUND",
"description" : "HL7 v2.x Inbound"
} ],
"eventSubTypes" : [ {
"code" : "FHIR_READ",
"description" : "FHIR Read"
}, {
"code" : "FHIR_SEARCH",
"description" : "FHIR Search"
} ]
}
For brevity only a few entries are shown; the actual response includes all available codes. See Event Types and SubTypes for the full reference list.
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:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| from | date | No | - | The inclusive start range time (in FHIR dateTime format) |
| to | date | No | - | The inclusive end range time (in FHIR dateTime format) |
| pageIndex | int | No | 0 | The page number to return (minimum: 0) |
| pageSize | int | No | 100 | The number of rows to return per page (maximum: 10000) |
| transactionId | string | No | - | Filter by specific transaction ID |
| userName | string | No | - | Filter by username |
| moduleId | string | No | First available module | Specify which Transaction Log module to query |
| completeUrl | string | No | - | Filter by complete URL |
| endpoint | string | No | - | Filter by endpoint module ID |
| eventType | string | No | - | Filter by event type code (e.g. FHIR_REQUEST); see Event Types for valid codes |
| eventSubType | string | No | - | Filter by event subtype code (e.g. FHIR_READ); see Event SubTypes for valid codes. Multiple comma-delimited codes may be supplied (e.g. eventSubType=FHIR_OPERATION_SDH_CDA_TO_FHIR,FHIR_TRANSACTION) to match any of the listed subtypes |
| outcome | string | No | - | Filter by outcome code (e.g. SUCCESS); see Transaction Log Outcomes for valid codes |
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,
"totalRecords" : 1,
"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/{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):
GET http://localhost:9000/transaction-log/event/{transaction_id}
You may also add the following URL parameter:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| includeBody | boolean | No | false | Include the request/response body in the response |
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"
}
]
}
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}
The following path elements are required:
| Parameter | Type | Required | Description |
|---|---|---|---|
| moduleId | string | Yes | The Transaction Log module ID that stores the transaction records |
| transaction_id | long | Yes | The ID of the specific transaction event to retrieve |
You may also add the following URL parameter:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| includeBody | boolean | No | false | Include the request/response body in the response |
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"
}
]
}
You are about to leave the Smile Digital Health documentation and navigate to the Open Source HAPI-FHIR Documentation.