def magic(action, magic_params: MagicParams.format)
      full_path = build_request_path("/MagicJson")
      body = build_magic_body(action, magic_params)
      response =
        conn.post do |req|
          req.url(full_path)
          req.body = body
        end
      read_magic_response(action, response)
    end
def magic(action, magic_params: MagicParams.format)
      full_path = build_request_path("/MagicJson")
      body = build_magic_body(action, magic_params)
      response =
        conn.post do |req|
          req.url(full_path)
          req.body = body
        end
      read_magic_response(action, response)
    end
Main method for interacting with the Allscripts UnityAPI

 @param action [String] the API action to be performed
 @param magic_params [MagicParams] a params object
 used to build the Magic Action request body's user_id,
 patient_id, and magic parameters. The patient_id
 is sometimes oprional and the numbered
 params are generally optional, but must be sent
 as blank strings if unused.
 @return [Hash, MagicError] the parsed JSON response from Allscripts or
 a `MagicError` with the API error message(hopefully)