docs/architecture/integrations/PM-07-EN-13-jurisdiction-aware-billing-rules-INTEGRATION.md
Overview
Charge-capture timed-unit thresholds, modifier conventions, IOP/PHP compliance thresholds, and program labels are now driven by the organization’s PF-96 jurisdiction profile instead of hardcoded AHCCCS/Arizona constants. The change is backward compatible: organizations on the Arizona/AHCCCS profile (or with no profile resolved) continue to behave exactly as before.What’s Driven by the Jurisdiction Profile
Naming note: the underlying database column ispf_jurisdiction_profiles.billing_rules(JSONB). BothuseJurisdictionProfile()(frontend) andpf_resolve_jurisdiction_profile()(server) expose this JSON under the runtime fieldbilling.*.
Fallback Chain
The charge-capture form and thecl-note-charge-capture edge function resolve billing rules in this order:
- Jurisdiction Profile —
billing.*from the org’s PF-96 profile, resolved by site when applicable. - AHCCCS Defaults — used when the profile RPC fails, the
billingkey is missing, ormodifier_conventionsis empty/undefined.
Configuration
1. Confirm the Org’s Jurisdiction Profile
Jurisdiction profiles are managed at the platform level. Confirm assignment with your platform administrator before relying on overrides. Examples:2. Modifier Conventions
Each entry inbilling.modifier_conventions[] has the shape:
modifier_conventions is provided and non-empty, conventions fully drive auto-modifier assignment — the legacy hardcoded AHCCCS modifier logic is bypassed. Be sure to include conventions for every trigger your jurisdiction needs (group, family, telehealth, court-ordered, etc.) or charges may be missing modifiers.
Supported Triggers
Unknown triggers are silently ignored (forward-compatible). Duplicate codes are de-duplicated.
3. IOP / PHP Thresholds
Override any of the following inclinical.iop_php_compliance:
iop_min_hours_per_week,iop_min_days_per_week,iop_min_hours_per_dayphp_min_hours_per_week,php_min_days_per_week,php_min_hours_per_day
4. Program Label
Setdisplay_name to the program name shown in PM tooltips and labels (e.g., “Medi-Cal”). When unset, “AHCCCS” is shown.
Arizona Parity Checklist
Arizona organizations should see no behavioral change after this enhancement. Validate parity:- 7-minute encounter → 0 units (not billable hint shown).
- 8-minute encounter → 1 unit.
- 23-minute encounter → 2 units.
- 45-minute encounter → 3 units.
- Group telehealth (audio-video) encounter → modifiers
HQ,95. - Family encounter with patient present → modifier
HR. - Family encounter without patient → modifier
HS. - Court-ordered encounter → modifier
H9. - IOP weekly compliance flagged below 9 hr / 3 days / 3 hr/day.
- PHP weekly compliance flagged below 20 hr / 5 days / 4 hr/day.
- UI shows “AHCCCS” program label.
Operational Notes
- Caching:
useJurisdictionProfile()caches per-tenant withstaleTime: 5 min,gcTime: 10 min. The edge function resolves the profile once per request. - No new permissions: Continues to use existing
pm.charges.create/pm.charges.edit. - No PHI in logs: Profile resolution failures log only the org id and a generic warning.
- Tenant safety: Profile reads are scoped by
organization_id(andsite_idwhen supplied) via thepf_resolve_jurisdiction_profile()SECURITY DEFINER RPC.