From ecc
의료 애플리케이션 배포를 위한 환자 안전 평가 하니스입니다. CDSS 정확성, PHI 노출, 임상 워크플로 무결성, 연동 적합성을 자동 테스트하며, 안전 실패 시 배포를 차단합니다.
npx claudepluginhub sam42-lab/everything-claude-code-krThis skill uses the workspace's default tool permissions.
의료 애플리케이션 배포를 위한 자동 검증 시스템입니다. CRITICAL 실패가 하나라도 있으면 배포를 막아야 합니다. 환자 안전은 타협 대상이 아닙니다.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
의료 애플리케이션 배포를 위한 자동 검증 시스템입니다. CRITICAL 실패가 하나라도 있으면 배포를 막아야 합니다. 환자 안전은 타협 대상이 아닙니다.
참고: 예시는 Jest를 기본 테스트 러너로 사용합니다. 사용하는 프레임워크(Vitest, pytest, PHPUnit 등)에 맞게 명령만 바꾸면 됩니다. 테스트 범주와 통과 기준은 프레임워크와 무관합니다.
평가 하니스는 다섯 가지 테스트 범주를 순서대로 실행합니다. 처음 세 가지(CDSS 정확성, PHI 노출, 데이터 무결성)는 100% 통과율을 요구하는 CRITICAL 게이트이며, 단 하나의 실패라도 배포를 차단합니다. 나머지 두 가지(임상 워크플로, 연동)는 95% 이상의 통과율을 요구하는 HIGH 게이트입니다.
각 범주는 Jest 테스트 경로 패턴에 매핑됩니다. CI 파이프라인은 CRITICAL 게이트를 --bail(첫 번째 실패 시 중지) 옵션으로 실행하고, --coverage --coverageThreshold를 통해 커버리지 기준을 강제합니다.
1. CDSS Accuracy (CRITICAL — 100% 필수)
모든 임상 의사결정지원 로직을 테스트합니다: 약물 상호작용 쌍(양방향), 용량 검증 규칙, 공인 명세 기반의 임상 점수 계산, false negative(미탐) 없음, 자동 무시되는 실패 없음.
npx jest --testPathPattern='tests/cdss' --bail --ci --coverage
2. PHI Exposure (CRITICAL — 100% 필수)
개인 건강 정보(PHI) 유출을 테스트합니다: API 에러 응답, 콘솔 출력, URL 파라미터, 브라우저 저장소, 시설 간 격리, 미인증 액세스, 서비스 역할 키 노출 여부.
npx jest --testPathPattern='tests/security/phi' --bail --ci
3. Data Integrity (CRITICAL — 100% 필수)
임상 데이터 안전성을 테스트합니다: 잠금된 내원 기록, 감사 추적(audit trail) 항목, 계단식 삭제(cascade delete) 보호, 동시 편집 처리, 고립된(orphaned) 레코드 방지.
npx jest --testPathPattern='tests/data-integrity' --bail --ci
4. Clinical Workflow (HIGH — 95% 이상 필수)
엔드투엔드 흐름을 테스트합니다: 내원 라이프사이클, 템플릿 렌더링, 약물 세트, 약물/진단 검색, 처방전 PDF, 레드 플래그 경고.
tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
echo "No clinical tests found" >&2
exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Clinical pass rate: ${rate}% ($passed/$total)"
5. Integration Compliance (HIGH — 95% 이상 필수)
외부 시스템 연동을 테스트합니다: HL7 메시지 파싱(v2.x), FHIR 검증, 검사 결과 매핑, 잘못된 형식의 메시지 처리.
tmp_json=$(mktemp)
npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$tmp_json" || true
total=$(jq '.numTotalTests // 0' "$tmp_json")
passed=$(jq '.numPassedTests // 0' "$tmp_json")
if [ "$total" -eq 0 ]; then
echo "No integration tests found" >&2
exit 1
fi
rate=$(echo "scale=2; $passed * 100 / $total" | bc)
echo "Integration pass rate: ${rate}% ($passed/$total)"
| 범주 | 기준 | 실패 시 조치 |
|---|---|---|
| CDSS Accuracy | 100% | 배포 차단 (BLOCK) |
| PHI Exposure | 100% | 배포 차단 (BLOCK) |
| Data Integrity | 100% | 배포 차단 (BLOCK) |
| Clinical Workflow | 95% 이상 | 경고(WARN), 리뷰 후 허용 |
| Integration | 95% 이상 | 경고(WARN), 리뷰 후 허용 |
name: Healthcare Safety Gate
on: [push, pull_request]
jobs:
safety-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
# CRITICAL 게이트 — 100% 필수, 첫 실패 시 즉시 중단
- name: CDSS Accuracy
run: npx jest --testPathPattern='tests/cdss' --bail --ci --coverage --coverageThreshold='{"global":{"branches":80,"functions":80,"lines":80}}'
- name: PHI Exposure Check
run: npx jest --testPathPattern='tests/security/phi' --bail --ci
- name: Data Integrity
run: npx jest --testPathPattern='tests/data-integrity' --bail --ci
# HIGH 게이트 — 95% 이상 필수, 커스텀 임계값 체크
- name: Clinical Workflows
run: |
TMP_JSON=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$TMP_JSON" || true
TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
if [ "$TOTAL" -eq 0 ]; then
echo "::error::No clinical tests found"; exit 1
fi
RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
if (( $(echo "$RATE < 95" | bc -l) )); then
echo "::warning::Clinical pass rate ${RATE}% below 95%"
fi
- name: Integration Compliance
run: |
TMP_JSON=$(mktemp)
npx jest --testPathPattern='tests/integration' --ci --json --outputFile="$TMP_JSON" || true
TOTAL=$(jq '.numTotalTests // 0' "$TMP_JSON")
PASSED=$(jq '.numPassedTests // 0' "$TMP_JSON")
if [ "$TOTAL" -eq 0 ]; then
echo "::error::No integration tests found"; exit 1
fi
RATE=$(echo "scale=2; $PASSED * 100 / $TOTAL" | bc)
echo "Pass rate: ${RATE}% ($PASSED/$TOTAL)"
if (( $(echo "$RATE < 95" | bc -l) )); then
echo "::warning::Integration pass rate ${RATE}% below 95%"
fi
--no-bail 옵션을 사용하는 것--coverage 없이 실행하는 것npx jest --testPathPattern='tests/cdss' --bail --ci --coverage && \
npx jest --testPathPattern='tests/security/phi' --bail --ci && \
npx jest --testPathPattern='tests/data-integrity' --bail --ci
tmp_json=$(mktemp)
npx jest --testPathPattern='tests/clinical' --ci --json --outputFile="$tmp_json" || true
jq '{
passed: (.numPassedTests // 0),
total: (.numTotalTests // 0),
rate: (if (.numTotalTests // 0) == 0 then 0 else ((.numPassedTests // 0) / (.numTotalTests // 1) * 100) end)
}' "$tmp_json"
# 예상 출력: { "passed": 21, "total": 22, "rate": 95.45 }
## Healthcare Eval: 2026-03-27 [commit abc1234]
### 환자 안전: PASS
| 범주 | 테스트 수 | 통과 | 실패 | 상태 |
|----------|-------|------|------|--------|
| CDSS Accuracy | 39 | 39 | 0 | PASS |
| PHI Exposure | 8 | 8 | 0 | PASS |
| Data Integrity | 12 | 12 | 0 | PASS |
| Clinical Workflow | 22 | 21 | 1 | 95.5% PASS |
| Integration | 6 | 6 | 0 | PASS |
### 커버리지: 84% (목표: 80% 이상)
### 판정: 배포 가능 (SAFE TO DEPLOY)