HIPAA Guidelines Health Insurance Portability and Accountability Act compliance for software development
HIPAA (Health Insurance Portability and Accountability Act) establishes national standards for protecting sensitive patient health information. Software systems that handle Protected Health Information (PHI) must comply with HIPAA requirements.
Entity Type Description Examples Covered Entities Healthcare providers, plans, clearinghouses Hospitals, insurers, EHR vendors Business Associates Organizations handling PHI on behalf of covered entities Cloud providers, IT contractors, billing services
Rule Purpose Privacy Rule Standards for PHI use and disclosure Security Rule Administrative, physical, and technical safeguards Breach Notification Rule Requirements for breach reporting Omnibus Rule Extended requirements to business associates
Requirement Implementation Security Management Risk analysis, risk management, sanction policy Assigned Security Responsibility Designated security officer Workforce Security Authorization procedures, clearance procedures Information Access Management Access authorization, access establishment Security Awareness Training Security reminders, malware protection, login monitoring Security Incident Procedures Response and reporting Contingency Plan Data backup, disaster recovery, emergency operations Evaluation Periodic security evaluation
Requirement Implementation Facility Access Controls Contingency operations, facility security plan Workstation Use Policies for workstation use Workstation Security Physical safeguards for workstations Device and Media Controls Disposal, media re-use, accountability, data backup
Requirement Implementation Access Control Unique user identification, automatic logoff, encryption Audit Controls Hardware, software, and procedural mechanisms Integrity Mechanism to authenticate ePHI Person Authentication Verify identity of persons accessing ePHI Transmission Security Integrity controls, encryption
// Example: Role-based access control for PHI
interface AccessPolicy {
resource : string ;
actions : ( 'read' | 'write' | 'delete' )[];
roles : string [];
conditions ?: AccessCondition [];
}
const phiAccessPolicies : AccessPolicy [] = [
{
resource: 'patient-records' ,
actions: [ 'read' ],
roles: [ 'physician' , 'nurse' , 'medical-assistant' ],
conditions: [
{ type: 'treatment-relationship' , required: true },
],
},
{
resource: 'patient-records' ,
actions: [ 'read' , 'write' ],
roles: [ 'physician' ],
conditions: [
{ type: 'treatment-relationship' , required: true },
{ type: 'break-glass' , required: false },
],
},
];
// Enforce minimum necessary access
async function checkAccess (
user : User ,
resource : string ,
action : string
) : Promise < boolean > {
const policy = findMatchingPolicy (resource, action);
if ( ! policy) return false ;
if ( ! policy.roles. includes (user.role)) return false ;
for ( const condition of policy.conditions || []) {
if ( !await evaluateCondition (condition, user, resource)) {
return false ;
}
}
// Log access attempt
await auditLog. record ({
userId: user.id,
resource,
action,
timestamp: new Date (),
granted: true ,
});
return true ;
}
// HIPAA-compliant audit logging
interface AuditEntry {
timestamp : string ;
userId : string ;
userName : string ;
userRole : string ;
action : 'CREATE' | 'READ' | 'UPDATE' | 'DELETE' | 'EXPORT' | 'PRINT' ;
resource : string ;
resourceId : string ;
patientId ?: string ;
ipAddress : string ;
userAgent : string ;
outcome : 'SUCCESS' | 'FAILURE' | 'DENIED' ;
reason ?: string ;
dataAccessed ?: string []; // Fields accessed
}
class HipaaAuditLogger {
async logAccess ( entry : AuditEntry ) : Promise < void > {
// Store in immutable audit log
await this .auditStore. append ({
... entry,
id: generateUUID (),
hash: this . computeHash (entry),
});
// Alert on suspicious activity
if ( this . isSuspicious (entry)) {
await this . alertSecurityTeam (entry);
}
}
private isSuspicious ( entry : AuditEntry ) : boolean {
return (
entry.outcome === 'DENIED' ||
entry.action === 'EXPORT' ||
this . isAfterHoursAccess (entry) ||
this . isUnusualVolume (entry)
);
}
}
// Data encryption configuration
const encryptionConfig = {
// At-rest encryption
atRest: {
algorithm: 'AES-256-GCM' ,
keyManagement: 'AWS KMS' , // or HSM
keyRotation: '90 days' ,
},
// In-transit encryption
inTransit: {
protocol: 'TLS 1.3' ,
minVersion: 'TLS 1.2' ,
cipherSuites: [
'TLS_AES_256_GCM_SHA384' ,
'TLS_CHACHA20_POLY1305_SHA256' ,
],
},
// Field-level encryption for highly sensitive fields
fieldLevel: {
enabled: true ,
fields: [ 'ssn' , 'medical_record_number' , 'diagnosis' ],
algorithm: 'AES-256-GCM' ,
},
};
Notification Timeline Method Individuals Within 60 days First-class mail HHS Varies by size Online portal Media Within 60 days (if >500 in state) Prominent media outlets
Implement minimum necessary access
Use strong authentication (MFA)
Encrypt all PHI at rest and in transit
Log all PHI access
Conduct regular risk assessments
Train workforce on HIPAA requirements
Have breach response procedures ready
Store PHI in unencrypted form
Allow shared accounts
Log PHI in application logs
Skip security assessments
Ignore audit log alerts
Assume cloud providers are HIPAA compliant by default
This section fulfills ISO 13485 requirements for confidential information protection (4.2.4) and customer property protection (7.5.4), and ISO 27001 requirements for information classification (A.5.12), access control (A.5.15), and encryption (A.8.24).
View full compliance matrix
How is this guide?
Good Bad