From 157c7a2571dd23e65ea116b9d50b75f3cb3d9801 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 5 Jun 2026 01:35:04 -0500 Subject: [PATCH] test(npi): add slug consistency check across all wiring places --- scripts/check_npi_slug_consistency.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/check_npi_slug_consistency.sh diff --git a/scripts/check_npi_slug_consistency.sh b/scripts/check_npi_slug_consistency.sh new file mode 100755 index 0000000..e0d1167 --- /dev/null +++ b/scripts/check_npi_slug_consistency.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Verify every NPI healthcare slug exists in all 5 wiring places. +set -u +SLUGS="npi-revalidation npi-reactivation nppes-update medicare-enrollment oig-sam-screening provider-compliance-bundle" +FAIL=0 +for s in $SLUGS; do + # 1. API COMPLIANCE_SERVICES + grep -q "\"$s\"" api/src/routes/compliance-orders.ts || { echo "MISSING in compliance-orders.ts: $s"; FAIL=1; } + # 2. intake_manifest (both INTAKE_MANIFEST + SERVICE_META => expect >=2 hits) + n=$(grep -c "\"$s\"" site/src/lib/intake_manifest.ts) + [ "$n" -ge 2 ] || { echo "intake_manifest.ts has $n hits (<2) for: $s"; FAIL=1; } + # 3. worker handler registration + grep -q "$s" scripts/workers/services/__init__.py || { echo "MISSING in worker __init__.py: $s"; FAIL=1; } + # 4. ERPNext item.json (uppercase code) + U=$(echo "$s" | tr 'a-z-' 'A-Z_') + grep -qi "$U\|$s" performancewest_erpnext/performancewest_erpnext/fixtures/item.json || { echo "MISSING in item.json: $s ($U)"; FAIL=1; } + # 5. orders.py portal label + grep -q "$s" performancewest_erpnext/performancewest_erpnext/www/orders.py || { echo "MISSING in orders.py: $s"; FAIL=1; } + # 6. order page exists + [ -f "site/src/pages/order/$s.astro" ] || { echo "MISSING order page: $s.astro"; FAIL=1; } +done +[ "$FAIL" -eq 0 ] && echo "ALL 6 SLUGS CONSISTENT across all places" || echo "CONSISTENCY FAILURES ABOVE" +exit $FAIL