Package ca.cdr.api.util
Class TransactionLogRequestDetailsUtil
java.lang.Object
ca.cdr.api.util.TransactionLogRequestDetailsUtil
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAdditionalJsonProperty
(RequestDetails theRequestDetails, String theKey, Object theValue) Utility method to add key/value pairs to a transactionLog.static void
addMessageToRequest
(RequestDetails theDetails, MappingMessage theMessage) static void
addTransactionLogStepForRequest
(ServletRequestDetails theRequestDetails, TransactionLogStepJson theStep) Adds a transaction log step to the attribute which holds the list of steps for the provided request.static void
addTransactionLogStepForRequest
(jakarta.servlet.http.HttpServletRequest theRequest, TransactionLogStepJson theStep) Adds a transaction log step to the attribute which holds the list of steps for the provided request.getAdditionalJsonPropertiesMap
(RequestDetails theRequestDetails) static List<MappingMessage>
getMessagesOnRequest
(RequestDetails theDetails) static List<TransactionLogStepJson>
getTransactionLogStepsFromRequest
(RequestDetails theRequestDetails)
-
Field Details
-
STEPS_LIST_KEY
-
REQUEST_SUBTYPE_KEY
-
-
Method Details
-
addMessageToRequest
-
getMessagesOnRequest
-
getTransactionLogStepsFromRequest
public static List<TransactionLogStepJson> getTransactionLogStepsFromRequest(RequestDetails theRequestDetails) -
addTransactionLogStepForRequest
public static void addTransactionLogStepForRequest(ServletRequestDetails theRequestDetails, TransactionLogStepJson theStep) Adds a transaction log step to the attribute which holds the list of steps for the provided request.- Parameters:
theRequestDetails
- the request detailstheStep
- the transaction log step to add
-
addTransactionLogStepForRequest
public static void addTransactionLogStepForRequest(jakarta.servlet.http.HttpServletRequest theRequest, TransactionLogStepJson theStep) Adds a transaction log step to the attribute which holds the list of steps for the provided request.- Parameters:
theRequest
- the requesttheStep
- the transaction log step to add
-
addAdditionalJsonProperty
public static void addAdditionalJsonProperty(RequestDetails theRequestDetails, String theKey, Object theValue) Utility method to add key/value pairs to a transactionLog. The provided value needs to be serializable with Jackson since pairs are accumulated and subsequently formatted in an inline json string. IllegalArgumentException is thrown iftheValue
is not Json serializable with Jackson ornull
. The additional log properties will be tallied and rendered as inline json in the transactionLogEventJson: { "id": 2, "initialTimestamp": "2023-08-29T14:00:30.096-04:00", "type": "FHIR_REQUEST", "subType": "FHIR_CREATE", "outcome": "SUCCESS", ... "requestId": "r1bW96uhRAn2z8iU", "additionalJson": { "diseases": [ "Tuberculosis", "Polio", "Malaria", "Dengue fever"], "clinic": "Acme Ouest" }, ... "userFamilyName": "GenericUser", "userGivenName": "Admin" }- Parameters:
theRequestDetails
- The request details where the pairs will be storedtheKey
- The key for referencing to theObject. Keys are transformed into json properties when serializing a pair.theValue
- The value needing storage. Values are transformed into json values when serializing a pair.
-
getAdditionalJsonPropertiesMap
-