A strict requirement for most health applciations is the ability to properly log the history of access and usage of data that contains personal health information (PHI). To log events that capture or deal with PHI, use the /hipaa/audit
endpoint. This will allow you to create a HIPAA audit record in the database that is searchable by customers within PerformanceBridge Service Tools. To utilize any service of PerformanceBridge you must be an authorized application.
Here are examples of how to create a request to the audit service. For more technical details refer to the api documentation.
require 'restclient'
# See app auth for headers function
def hipaa_log(request_info, requesting_ip, user_login, user_domain, table_name, ids)
body = JSON.dump({request_info: request_info,
requesting_ip: requesting_ip,
user_login: user_login,
user_domain: user_domain,
table_name: table_name,
ids: ids})
RestClient.post("https://example.performancebridge.com/pb/api/hipaa/audit",body,headers(body))
end
import requests
import json
import datetime
import hashlib
# See app auth for headers function
def audit(audit_record):
body = json.dumps(audit_record)
# You'll need to change the url here to the platform's hostname
r = requests.post("https://example.performancebridge.com/pb/api/hipaa/audit",data=body,headers=headers(body))
if r.status_code != 200:
return "HTTP Error " + str(r.status_code) + ": " + r.content
return r.json()
# example usage
audit_record = {
"request_info": "http://performancebridge.example.com/service-tools/view?exam=1",
"requesting_ip": "127.0.0.1",
"user_login": "bridgeadm",
"user_domain": "realm",
"table_name": "rad_exams",
"ids": [1,2,3],
}
audit(audit_record)
const request = require('sync-request');
// See note below for request headers setup
const headers = require('../headers.js')
exports.audit = function(data, params) {
if (params == undefined) { params = [] };
var args = {
body: JSON.stringify(data),
headers: headers(JSON.stringify(data)),
};
var res = request('POST', process.env.PB_API_URL + "/hipaa/audit", args);
return JSON.parse(res.body.toString());
}
// Usage
const audit_data = {
"request_info": "http://performancebridge.example.com/service-tools/view?exam=1",
"requesting_ip": "127.0.0.1",
"user_login": "bridgeadm",
"user_domain": "realm",
"table_name": "rad_exams",
"ids": [1,2,3],
}
const response = api.audit(data) // POST to '/hipaa/audit'
console.log(response);