Skip to content
Merged
779 changes: 779 additions & 0 deletions docs/HIPAA-AUDIT-REPORT.md

Large diffs are not rendered by default.

522 changes: 522 additions & 0 deletions docs/SECURITY-AUDIT-SUMMARY.md

Large diffs are not rendered by default.

1,061 changes: 1,061 additions & 0 deletions docs/SECURITY-HARDENING-ROADMAP.md

Large diffs are not rendered by default.

944 changes: 944 additions & 0 deletions docs/THIRD-PARTY-AUDIT-PROCESS.md

Large diffs are not rendered by default.

1,034 changes: 1,034 additions & 0 deletions docs/ZERO-TRUST-ADMIN-ACCESS.md

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions scripts/tests/auth-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ function parseX12Response(x12Content: string): AuthResponse {
certificationTypeCode: 'A1'
};
}
if (x12Content.includes('STC*A4')) {
return {
authorizationNumber: 'AUTH20241119001',
status: 'PENDED',
certificationTypeCode: 'A4'
};
}
if (x12Content.includes('STC*A3')) {
return {
status: 'DENIED',
certificationTypeCode: 'A3'
};
}
return {
status: 'ERROR',
certificationTypeCode: 'NA'
Expand Down Expand Up @@ -255,7 +268,7 @@ describe('Authorization Request - Outpatient (UM01=HS)', () => {
it('should require service date range for outpatient', () => {
// Test outpatient-specific validation
const hasDateRange = (request: any) => {
return request.serviceDateRange?.fromDate && request.serviceDateRange?.toDate;
return !!(request.serviceDateRange?.fromDate && request.serviceDateRange?.toDate);
};

const request = {
Expand Down Expand Up @@ -353,7 +366,7 @@ describe('Authorization Cancellation (UM02=3)', () => {
describe('Eligibility Integration', () => {

it('should check eligibility before submitting authorization', async () => {
const mockEligibilityCheck = jest.fn().mockResolvedValue({
const mockEligibilityCheck = jest.fn<(params: any) => Promise<{ eligible: boolean; coverageLevel: string }>>().mockResolvedValue({
eligible: true,
coverageLevel: 'Active Coverage'
});
Expand All @@ -369,7 +382,7 @@ describe('Eligibility Integration', () => {
});

it('should reject authorization if member not eligible', async () => {
const mockEligibilityCheck = jest.fn().mockResolvedValue({
const mockEligibilityCheck = jest.fn<(params: any) => Promise<{ eligible: boolean; reason: string }>>().mockResolvedValue({
eligible: false,
reason: 'Coverage terminated'
});
Expand Down Expand Up @@ -416,13 +429,13 @@ describe('Attachment Workflow Integration', () => {
describe('Error Handling', () => {

it('should handle X12 encoding errors gracefully', () => {
const mockEncode = jest.fn().mockRejectedValue(new Error('Integration Account not configured'));
const mockEncode = jest.fn<() => Promise<void>>().mockRejectedValue(new Error('Integration Account not configured'));

expect(mockEncode).rejects.toThrow('Integration Account not configured');
});

it('should handle payer endpoint timeouts', async () => {
const mockPostToPayer = jest.fn().mockRejectedValue(new Error('Request timeout'));
const mockPostToPayer = jest.fn<() => Promise<void>>().mockRejectedValue(new Error('Request timeout'));

await expect(mockPostToPayer()).rejects.toThrow('Request timeout');
});
Expand Down
2 changes: 1 addition & 1 deletion src/ai/__tests__/edi277Resolution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("AI EDI 277 Error Resolution", () => {
const samplePayload = {
transactionId: "TRX555",
payer: "BestMed",
memberId: "123-45-6789", // PHI format for demonstration
memberId: "MBR123456789", // Test member ID (not real PHI)
errorCode: "123X",
errorDesc: "INVALID MEMBER ID",
};
Expand Down
2 changes: 1 addition & 1 deletion src/ai/edi277Resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function resolveEdi277Claim(
return {
transactionId: payload.transactionId,
suggestions: [
"Correct member ID format.",
"Verify the subscriber identifier follows the required format.",
"Check eligibility dates.",
"Resubmit with valid payer code.",
],
Expand Down
Loading