Netspective Logo
GuidelinesCompliance Guidelines

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.

HIPAA Overview

Who Must Comply?

Entity TypeDescriptionExamples
Covered EntitiesHealthcare providers, plans, clearinghousesHospitals, insurers, EHR vendors
Business AssociatesOrganizations handling PHI on behalf of covered entitiesCloud providers, IT contractors, billing services

Key Regulations

RulePurpose
Privacy RuleStandards for PHI use and disclosure
Security RuleAdministrative, physical, and technical safeguards
Breach Notification RuleRequirements for breach reporting
Omnibus RuleExtended requirements to business associates

Security Rule Safeguards

Administrative Safeguards

RequirementImplementation
Security ManagementRisk analysis, risk management, sanction policy
Assigned Security ResponsibilityDesignated security officer
Workforce SecurityAuthorization procedures, clearance procedures
Information Access ManagementAccess authorization, access establishment
Security Awareness TrainingSecurity reminders, malware protection, login monitoring
Security Incident ProceduresResponse and reporting
Contingency PlanData backup, disaster recovery, emergency operations
EvaluationPeriodic security evaluation

Physical Safeguards

RequirementImplementation
Facility Access ControlsContingency operations, facility security plan
Workstation UsePolicies for workstation use
Workstation SecurityPhysical safeguards for workstations
Device and Media ControlsDisposal, media re-use, accountability, data backup

Technical Safeguards

RequirementImplementation
Access ControlUnique user identification, automatic logoff, encryption
Audit ControlsHardware, software, and procedural mechanisms
IntegrityMechanism to authenticate ePHI
Person AuthenticationVerify identity of persons accessing ePHI
Transmission SecurityIntegrity controls, encryption

Software Development Requirements

Access Control Implementation

// 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;
}

Audit Logging

// 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)
    );
  }
}

Encryption Requirements

// 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',
  },
};

Breach Notification

Breach Assessment

Breach Assessment Decision Tree

Notification Timelines

NotificationTimelineMethod
IndividualsWithin 60 daysFirst-class mail
HHSVaries by sizeOnline portal
MediaWithin 60 days (if >500 in state)Prominent media outlets

Development Checklist

Design Phase

  • Identify all PHI data elements
  • Document data flows with PHI
  • Design access control model
  • Plan encryption strategy
  • Design audit logging

Implementation Phase

  • Implement authentication (MFA recommended)
  • Implement role-based access control
  • Encrypt PHI at rest and in transit
  • Implement comprehensive audit logging
  • Add automatic session timeout
  • Implement secure password policies

Testing Phase

  • Test access control enforcement
  • Verify encryption implementation
  • Test audit log completeness
  • Conduct security assessment
  • Perform penetration testing

Deployment Phase

  • Verify production encryption
  • Confirm backup procedures
  • Test disaster recovery
  • Document security controls
  • Train workforce on new systems

Best Practices

Do

  • 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

Don't

  • 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


Compliance

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?

Last updated on

On this page