Abridge CI Integration
Overview
CI/CD pipeline for Abridge clinical documentation integrations. Healthcare CI pipelines require FHIR resource validation, PHI leak scanning, HIPAA compliance checks, and sandbox integration testing.
Instructions
Step 1: GitHub Actions Workflow
# .github/workflows/abridge-ci.yml
name: Abridge Integration CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_VERSION: '20'
jobs:
lint-and-type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '${{ env.NODE_VERSION }}' }
- run: npm ci
- run: npm run lint
- run: npm run typecheck
phi-leak-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for PHI patterns in source code
run: |
echo "Scanning for PHI patterns..."
# SSN patterns
if grep -rn '\b[0-9]\{3\}-[0-9]\{2\}-[0-9]\{4\}\b' src/ --include='*.ts' --include='*.js'; then
echo "FAIL: Possible SSN found in source code"
exit 1
fi
# Hardcoded patient names (common test names)
if grep -rn '"John Doe\|Jane Doe\|Test Patient"' src/ --include='*.ts'; then
echo "WARN: Hardcoded patient names — use synthetic data"
fi
echo "PHI scan passed"
fhir-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '${{ env.NODE_VERSION }}' }
- run: npm ci
- name: Validate FHIR resources
run: |
npm run test:fhir-schemas
echo "FHIR R4 validation passed"
sandbox-integration:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [lint-and-type-check, phi-leak-scan, fhir-validation]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '${{ env.NODE_VERSION }}' }
- run: npm ci
- name: Run sandbox integration tests
env:
ABRIDGE_SANDBOX_URL: ${{ secrets.ABRIDGE_SANDBOX_URL }}
ABRIDGE_CLIENT_SECRET: ${{ secrets.ABRIDGE_CLIENT_SECRET }}
ABRIDGE_ORG_ID: ${{ secrets.ABRIDGE_ORG_ID }}
run: npm run test:integration
Step 2: FHIR Schema Validation Tests
// tests/fhir-validation.test.ts
import { describe, it, expect } from 'vitest';
describe('FHIR R4 Resource Validation', () => {
it('should generate valid DocumentReference', () => {
const docRef = {
resourceType: 'DocumentReference',
status: 'current',
type: { coding: [{ system: 'http://loinc.org', code: '11506-3', display: 'Progress note' }] },
subject: { reference: 'Patient/test-001' },
content: [{ attachment: { contentType: 'text/plain', data: btoa('test note') } }],
};
expect(docRef.resourceType).toBe('DocumentReference');
expect(docRef.status).toBe('current');
expect(docRef.type.coding[0].system).toBe('http://loinc.org');
expect(docRef.content[0].attachment.contentType).toBe('text/plain');
});
it('should generate valid Communication resource for patient summary', () => {
const comm = {
resourceType: 'Communication',
status: 'completed',
category: [{ coding: [{ system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'notification' }] }],
subject: { reference: 'Patient/test-001' },
payload: [{ contentString: 'Your visit summary...' }],
};
expect(comm.resourceType).toBe('Communication');
expect(comm.payload[0].contentString).toBeTruthy();
});
});
Step 3: Integration Test with Sandbox
// tests/integration/sandbox.test.ts
import { describe, it, expect } from 'vitest';
import axios from 'axios';
describe('Abridge Sandbox Integration', () => {
const api = axios.create({
baseURL: process.env.ABRIDGE_SANDBOX_URL,
headers: {
'Authorization': `Bearer ${process.env.ABRIDGE_CLIENT_SECRET}`,
'X-Org-Id': process.env.ABRIDGE_ORG_ID!,
},
});
it('should create and finalize an encounter session', async () => {
const { data: session } = await api.post('/encounters/sessions', {
patient_id: 'ci-test-patient',
provider_id: 'ci-test-provider',
encounter_type: 'outpatient',
specialty: 'internal_medicine',
sandbox: true,
});
expect(session.session_id).toBeTruthy();
expect(session.status).toBe('initialized');
// Submit transcript
await api.post(`/encounters/sessions/${session.session_id}/transcript`, {
speaker: 'provider', text: 'CI test — patient presents with headache.',
});
// Finalize
await api.post(`/encounters/sessions/${session.session_id}/finalize`);
}, 30000);
});
Output
- GitHub Actions workflow with 4 jobs: lint, PHI scan, FHIR validation, sandbox integration
- PHI leak detection scanning source code for SSN/MRN patterns
- FHIR R4 resource validation tests
- Sandbox integration tests (main branch only)
Error Handling
| Issue |
Cause |
Solution |
| PHI scan false positive |
Regex too broad |
Add pattern to allowlist in scan script |
| Sandbox test timeout |
API slow |
Increase vitest timeout to 30s |
| Secrets not available |
Missing GitHub Secrets |
Add to repo Settings > Secrets |
Resources
Next Steps
For deployment procedures, see abridge-deploy-integration.
1---
2name: abridge-ci-integration
3description: |
4 Configure CI/CD pipeline for Abridge clinical AI integrations with GitHub Actions.
5 Use when setting up automated testing, FHIR validation, HIPAA compliance checks,
6 or deployment pipelines for healthcare AI applications.
7 Trigger: "abridge CI", "abridge GitHub Actions", "abridge pipeline",
8 "abridge automated testing", "abridge CI/CD".
9allowed-tools: Read, Write, Edit, Bash(npm:*), Grep
10version: 1.0.0
11license: MIT
12author: Jeremy Longshore <jeremy@intentsolutions.io>
13tags: [saas, healthcare, ai, abridge, ci-cd]
14compatible-with: claude-code
15metadata:
16 source: https://skillmd.com/skills/aibot88/abridge-ci-integration
17---
18
19# Abridge CI Integration
20
21## Overview
22
23CI/CD pipeline for Abridge clinical documentation integrations. Healthcare CI pipelines require FHIR resource validation, PHI leak scanning, HIPAA compliance checks, and sandbox integration testing.
24
25## Instructions
26
27### Step 1: GitHub Actions Workflow
28
29```yaml
30# .github/workflows/abridge-ci.yml
31name: Abridge Integration CI
32
33on:
34 push:
35 branches: [main, develop]
36 pull_request:
37 branches: [main]
38
39env:
40 NODE_VERSION: '20'
41
42jobs:
43 lint-and-type-check:
44 runs-on: ubuntu-latest
45 steps:
46 - uses: actions/checkout@v4
47 - uses: actions/setup-node@v4
48 with: { node-version: '${{ env.NODE_VERSION }}' }
49 - run: npm ci
50 - run: npm run lint
51 - run: npm run typecheck
52
53 phi-leak-scan:
54 runs-on: ubuntu-latest
55 steps:
56 - uses: actions/checkout@v4
57 - name: Scan for PHI patterns in source code
58 run: |
59 echo "Scanning for PHI patterns..."
60 # SSN patterns
61 if grep -rn '\b[0-9]\{3\}-[0-9]\{2\}-[0-9]\{4\}\b' src/ --include='*.ts' --include='*.js'; then
62 echo "FAIL: Possible SSN found in source code"
63 exit 1
64 fi
65 # Hardcoded patient names (common test names)
66 if grep -rn '"John Doe\|Jane Doe\|Test Patient"' src/ --include='*.ts'; then
67 echo "WARN: Hardcoded patient names — use synthetic data"
68 fi
69 echo "PHI scan passed"
70
71 fhir-validation:
72 runs-on: ubuntu-latest
73 steps:
74 - uses: actions/checkout@v4
75 - uses: actions/setup-node@v4
76 with: { node-version: '${{ env.NODE_VERSION }}' }
77 - run: npm ci
78 - name: Validate FHIR resources
79 run: |
80 npm run test:fhir-schemas
81 echo "FHIR R4 validation passed"
82
83 sandbox-integration:
84 runs-on: ubuntu-latest
85 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
86 needs: [lint-and-type-check, phi-leak-scan, fhir-validation]
87 steps:
88 - uses: actions/checkout@v4
89 - uses: actions/setup-node@v4
90 with: { node-version: '${{ env.NODE_VERSION }}' }
91 - run: npm ci
92 - name: Run sandbox integration tests
93 env:
94 ABRIDGE_SANDBOX_URL: ${{ secrets.ABRIDGE_SANDBOX_URL }}
95 ABRIDGE_CLIENT_SECRET: ${{ secrets.ABRIDGE_CLIENT_SECRET }}
96 ABRIDGE_ORG_ID: ${{ secrets.ABRIDGE_ORG_ID }}
97 run: npm run test:integration
98```
99
100### Step 2: FHIR Schema Validation Tests
101
102```typescript
103// tests/fhir-validation.test.ts
104import { describe, it, expect } from 'vitest';
105
106describe('FHIR R4 Resource Validation', () => {
107 it('should generate valid DocumentReference', () => {
108 const docRef = {
109 resourceType: 'DocumentReference',
110 status: 'current',
111 type: { coding: [{ system: 'http://loinc.org', code: '11506-3', display: 'Progress note' }] },
112 subject: { reference: 'Patient/test-001' },
113 content: [{ attachment: { contentType: 'text/plain', data: btoa('test note') } }],
114 };
115
116 expect(docRef.resourceType).toBe('DocumentReference');
117 expect(docRef.status).toBe('current');
118 expect(docRef.type.coding[0].system).toBe('http://loinc.org');
119 expect(docRef.content[0].attachment.contentType).toBe('text/plain');
120 });
121
122 it('should generate valid Communication resource for patient summary', () => {
123 const comm = {
124 resourceType: 'Communication',
125 status: 'completed',
126 category: [{ coding: [{ system: 'http://terminology.hl7.org/CodeSystem/communication-category', code: 'notification' }] }],
127 subject: { reference: 'Patient/test-001' },
128 payload: [{ contentString: 'Your visit summary...' }],
129 };
130
131 expect(comm.resourceType).toBe('Communication');
132 expect(comm.payload[0].contentString).toBeTruthy();
133 });
134});
135```
136
137### Step 3: Integration Test with Sandbox
138
139```typescript
140// tests/integration/sandbox.test.ts
141import { describe, it, expect } from 'vitest';
142import axios from 'axios';
143
144describe('Abridge Sandbox Integration', () => {
145 const api = axios.create({
146 baseURL: process.env.ABRIDGE_SANDBOX_URL,
147 headers: {
148 'Authorization': `Bearer ${process.env.ABRIDGE_CLIENT_SECRET}`,
149 'X-Org-Id': process.env.ABRIDGE_ORG_ID!,
150 },
151 });
152
153 it('should create and finalize an encounter session', async () => {
154 const { data: session } = await api.post('/encounters/sessions', {
155 patient_id: 'ci-test-patient',
156 provider_id: 'ci-test-provider',
157 encounter_type: 'outpatient',
158 specialty: 'internal_medicine',
159 sandbox: true,
160 });
161
162 expect(session.session_id).toBeTruthy();
163 expect(session.status).toBe('initialized');
164
165 // Submit transcript
166 await api.post(`/encounters/sessions/${session.session_id}/transcript`, {
167 speaker: 'provider', text: 'CI test — patient presents with headache.',
168 });
169
170 // Finalize
171 await api.post(`/encounters/sessions/${session.session_id}/finalize`);
172 }, 30000);
173});
174```
175
176## Output
177
178- GitHub Actions workflow with 4 jobs: lint, PHI scan, FHIR validation, sandbox integration
179- PHI leak detection scanning source code for SSN/MRN patterns
180- FHIR R4 resource validation tests
181- Sandbox integration tests (main branch only)
182
183## Error Handling
184
185| Issue | Cause | Solution |
186|-------|-------|----------|
187| PHI scan false positive | Regex too broad | Add pattern to allowlist in scan script |
188| Sandbox test timeout | API slow | Increase vitest timeout to 30s |
189| Secrets not available | Missing GitHub Secrets | Add to repo Settings > Secrets |
190
191## Resources
192
193- [Abridge Platform](https://www.abridge.com/product)
194- [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
195- [FHIR Validator](https://hl7.org/fhir/R4/validation.html)
196
197## Next Steps
198
199For deployment procedures, see `abridge-deploy-integration`.