Class TransactionLogRequestDetailsUtil

java.lang.Object
ca.cdr.api.util.TransactionLogRequestDetailsUtil

  • Field Details

  • Method Details

    • addMessageToRequest

      public static void addMessageToRequest(RequestDetails theDetails, MappingMessage theMessage)
    • getMessagesOnRequest

    • getTransactionLogStepsFromRequest

    • 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 details
      theStep - 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 request
      theStep - 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 if theValue is not Json serializable with Jackson or null. 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 stored
      theKey - 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

      public static Map<String,Object> getAdditionalJsonPropertiesMap(RequestDetails theRequestDetails)