Generated by npm run db:docs:generate — DO NOT EDIT BY HAND. Change the schema via a migration, then regenerate.
Core: pm_ · Tables: 156 · Source generated: 2026-06-10T02:55:32.169Z
Entity relationships
Tables
pm_ai_coding_suggestion_audits
RLS: ✅ enabled (4 policies)
Foreign keys:
coder_id→users(id)created_by→users(id)organization_id→pf_organizations(id)suggestion_id→pm_ai_coding_suggestions(id)updated_by→users(id)
pm_ai_coding_audits_insert(INSERT)pm_ai_coding_audits_no_delete(DELETE)pm_ai_coding_audits_no_update(UPDATE)pm_ai_coding_audits_select(SELECT)
pm_ai_coding_suggestions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_ai_coding_suggestions_insert(INSERT)pm_ai_coding_suggestions_no_delete(DELETE)pm_ai_coding_suggestions_select(SELECT)pm_ai_coding_suggestions_update(UPDATE)
pm_analytics_appointment_confirmed_log
PM-41: Immutable appointment confirmation/no-show/cancel event log
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_appt_confirmed_log_insert(INSERT)pm_analytics_appt_confirmed_log_select(SELECT)
pm_analytics_appointment_created_log
PM-41: Immutable appointment creation event log
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_appt_created_log_insert(INSERT)pm_analytics_appt_created_log_select(SELECT)
pm_analytics_funnel_daily
PM-41: Pre-aggregated intake funnel metrics per org per day
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_funnel_daily_insert(INSERT)pm_analytics_funnel_daily_select(SELECT)pm_analytics_funnel_daily_update(UPDATE)
pm_analytics_no_show_risk
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_no_show_risk_insert(INSERT)pm_analytics_no_show_risk_select(SELECT)pm_analytics_no_show_risk_update(UPDATE)
pm_analytics_revenue_impact
PM-41-P3: Per-lead revenue impact tracking with drop-off attribution
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_revenue_impact_insert(INSERT)pm_revenue_impact_select(SELECT)pm_revenue_impact_update(UPDATE)
pm_analytics_screening_log
PM-41: Immutable screening event log
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_screening_log_insert(INSERT)pm_analytics_screening_log_select(SELECT)
pm_analytics_waitlist_abandon_risk
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_waitlist_abandon_risk_insert(INSERT)pm_analytics_waitlist_abandon_risk_select(SELECT)pm_analytics_waitlist_abandon_risk_update(UPDATE)
pm_analytics_waitlist_log
PM-41: Immutable waitlist entry/exit event log
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_analytics_waitlist_log_insert(INSERT)pm_analytics_waitlist_log_select(SELECT)pm_analytics_waitlist_log_update(UPDATE)
pm_appeal_submissions
PM-29: Appeal submissions against denials with status and outcome tracking
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→users(id)denial_id→pm_claim_denials(id)organization_id→pf_organizations(id)submitted_by→users(id)template_id→pm_appeal_templates(id)updated_by→users(id)
pm_appeal_submissions_insert(INSERT)pm_appeal_submissions_select(SELECT)pm_appeal_submissions_update(UPDATE)
pm_appeal_templates
PM-29: Reusable appeal letter templates with merge-field support
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→users(id)
pm_appeal_templates_insert(INSERT)pm_appeal_templates_select(SELECT)pm_appeal_templates_update(UPDATE)
pm_appointment_match_log
PM-38: Immutable audit log of automated provider matching decisions for intake appointments
RLS: ✅ enabled (2 policies)
Foreign keys:
appointment_id→pm_appointments(id)coordinator_override_from→hr_employees(id)coordinator_override_to→hr_employees(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)screening_id→ce_screening_attempts(id)selected_provider_id→hr_employees(id)
pm_appointment_match_log_insert(INSERT)pm_appointment_match_log_select(SELECT)
pm_appointment_reminders
PM-03: Reminder records. PF-10 delivery deferred to Phase 2.
RLS: ✅ enabled (3 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_appointment_reminders_insert(INSERT)pm_appointment_reminders_select(SELECT)pm_appointment_reminders_update(UPDATE)
pm_appointments
PM-03: Core appointment entity. PHI-adjacent; FORCE RLS enforced.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)location_id→pf_sites(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)provider_id→pf_profiles(id)room_id→pm_rooms(id)updated_by→pf_profiles(id)
pm_appointments_delete(DELETE)pm_appointments_insert(INSERT)pm_appointments_select(SELECT)pm_appointments_update(UPDATE)
pm_assistance_program_referrals
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)policy_id→pm_insurance_policies(id)updated_by→users(id)
pm_assistance_program_referrals_delete(DELETE)pm_assistance_program_referrals_insert(INSERT)pm_assistance_program_referrals_select(SELECT)pm_assistance_program_referrals_update(UPDATE)
pm_audit_log
PM-26: Append-only audit log for billing entity changes (claims, charges, payments). Supports compliance reporting and payer audit response.
RLS: ✅ enabled (1 policies)
Foreign keys:
changed_by→pf_profiles(id)organization_id→pf_organizations(id)
pm_audit_log_select(SELECT)
pm_auth_concurrent_reviews
PM-47: Concurrent review submissions and outcomes for managed care authorizations
RLS: ✅ enabled (3 policies)
Foreign keys:
authorization_id→pm_managed_care_authorizations(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)reviewer_id→pf_profiles(id)updated_by→pf_profiles(id)
pm_acr_insert(INSERT)pm_acr_select(SELECT)pm_acr_update(UPDATE)
pm_auth_denial_appeals
PM-47: Auth denial appeal lifecycle tracking with justification and outcome
RLS: ✅ enabled (3 policies)
Foreign keys:
authorization_id→pm_managed_care_authorizations(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_ada_insert(INSERT)pm_ada_select(SELECT)pm_ada_update(UPDATE)
pm_auth_reviews
PM-10: Concurrent and retrospective reviews for prior authorizations
RLS: ✅ enabled (4 policies)
Foreign keys:
authorization_id→pm_prior_authorizations(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_auth_reviews_delete(DELETE)pm_auth_reviews_insert(INSERT)pm_auth_reviews_select(SELECT)pm_auth_reviews_update(UPDATE)
pm_bad_debt_writeoffs
PM-45: Bad debt write-off requests with approval workflow
RLS: ✅ enabled (3 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)payment_plan_id→pm_patient_payment_plans(id)requested_by→pf_profiles(id)updated_by→pf_profiles(id)
pm_writeoffs_insert(INSERT)pm_writeoffs_select(SELECT)pm_writeoffs_update(UPDATE)
pm_batch_jobs
PM-24: Batch job audit and progress tracking for claim generation, submission, eligibility, and charge approval.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)
pm_batch_jobs_insert(INSERT)pm_batch_jobs_select(SELECT)pm_batch_jobs_update(UPDATE)
pm_benefit_details
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)eligibility_check_id→pm_eligibility_checks(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_benefit_details_delete(DELETE)pm_benefit_details_insert(INSERT)pm_benefit_details_select(SELECT)pm_benefit_details_update(UPDATE)
pm_benefit_estimates
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→pf_profiles(id)eligibility_check_id→pm_eligibility_checks(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_benefit_estimates_delete(DELETE)pm_benefit_estimates_insert(INSERT)pm_benefit_estimates_select(SELECT)pm_benefit_estimates_update(UPDATE)
pm_billing_suggestion_rules
CL-41: Payer-specific billing suggestion override rules
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_billing_suggestion_rules_delete(DELETE)pm_billing_suggestion_rules_insert(INSERT)pm_billing_suggestion_rules_select(SELECT)pm_billing_suggestion_rules_update(UPDATE)
pm_capitation_contracts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_capitation_contracts_delete(DELETE)pm_capitation_contracts_insert(INSERT)pm_capitation_contracts_select(SELECT)pm_capitation_contracts_update(UPDATE)
pm_capitation_periods
RLS: ✅ enabled (4 policies)
Foreign keys:
contract_id→pm_capitation_contracts(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_capitation_periods_delete(DELETE)pm_capitation_periods_insert(INSERT)pm_capitation_periods_select(SELECT)pm_capitation_periods_update(UPDATE)
pm_capitation_reconciliations
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)period_id→pm_capitation_periods(id)reconciled_by→pf_profiles(id)updated_by→pf_profiles(id)
pm_capitation_reconciliations_delete(DELETE)pm_capitation_reconciliations_insert(INSERT)pm_capitation_reconciliations_select(SELECT)pm_capitation_reconciliations_update(UPDATE)
pm_capitation_roster_events
RLS: ✅ enabled (4 policies)
Foreign keys:
contract_id→pm_capitation_contracts(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_capitation_roster_events_delete(DELETE)pm_capitation_roster_events_insert(INSERT)pm_capitation_roster_events_select(SELECT)pm_capitation_roster_events_update(UPDATE)
pm_carc_codes
PM-29: Claim Adjustment Reason Codes (CARC)
RLS: ✅ enabled (1 policies)
Policies:
pm_carc_codes_select(SELECT)
pm_charge_recon_daily_summary
PM-36: One row per org per nightly reconciliation run. Feeds PM-11 dashboard KPI cards and trend charts.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_recon_summary_insert(INSERT)pm_recon_summary_select(SELECT)pm_recon_summary_update(UPDATE)
pm_charge_reconciliation_results
PM-36: Stores individual charge reconciliation gap results detected by nightly edge function.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)resolved_by→pf_profiles(id)site_id→pf_sites(id)task_id→pf_tasks(id)updated_by→pf_profiles(id)
pm_charge_recon_insert(INSERT)pm_charge_recon_select(SELECT)pm_charge_recon_update(UPDATE)
pm_charges
PM-07: Billable charges captured from clinical encounters
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→users(id)created_by→users(id)encounter_id→pm_encounters(id)fee_schedule_id→pm_fee_schedules(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)provider_id→pf_profiles(id)reviewed_by→users(id)updated_by→users(id)
pm_charges_delete(DELETE)pm_charges_insert(INSERT)pm_charges_select(SELECT)pm_charges_update(UPDATE)
pm_charity_care_applications
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→users(id)
pm_charity_care_applications_delete(DELETE)pm_charity_care_applications_insert(INSERT)pm_charity_care_applications_select(SELECT)pm_charity_care_applications_update(UPDATE)
pm_checkin_discrepancies
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→users(id)eligibility_check_id→pm_eligibility_checks(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)resolved_by→users(id)updated_by→users(id)
pm_checkin_discrepancies_delete(DELETE)pm_checkin_discrepancies_insert(INSERT)pm_checkin_discrepancies_select(SELECT)pm_checkin_discrepancies_update(UPDATE)
pm_claim_denials
PM-29: Tracks payer denials with appeal deadlines and resolution status
RLS: ✅ enabled (3 policies)
Foreign keys:
assigned_to→users(id)carc_code→pm_carc_codes(code)claim_id→pm_claims(id)claim_line_id→pm_claim_lines(id)created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)rarc_code→pm_rarc_codes(code)resolved_by→users(id)updated_by→users(id)
pm_claim_denials_insert(INSERT)pm_claim_denials_select(SELECT)pm_claim_denials_update(UPDATE)
pm_claim_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
charge_id→pm_charges(id)claim_id→pm_claims(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_claim_lines_delete(DELETE)pm_claim_lines_insert(INSERT)pm_claim_lines_select(SELECT)pm_claim_lines_update(UPDATE)
pm_claim_notes
RLS: ✅ enabled (4 policies)
Foreign keys:
claim_id→pm_claims(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_claim_notes_delete(DELETE)pm_claim_notes_insert(INSERT)pm_claim_notes_select(SELECT)pm_claim_notes_update(UPDATE)
pm_claims
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)facility_id→pf_sites(id)organization_id→pf_organizations(id)original_claim_id→pm_claims(id)patient_id→pm_patients(id)payer_id→pm_payers(id)policy_id→pm_insurance_policies(id)updated_by→pf_profiles(id)
pm_claims_delete(DELETE)pm_claims_insert(INSERT)pm_claims_select(SELECT)pm_claims_update(UPDATE)
pm_clearinghouse_config
PM-15: Clearinghouse connection configurations per organization.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_clearinghouse_config_delete(DELETE)pm_clearinghouse_config_insert(INSERT)pm_clearinghouse_config_select(SELECT)pm_clearinghouse_config_update(UPDATE)
pm_code_modifier_rules
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_code_modifier_rules_delete(DELETE)pm_code_modifier_rules_insert(INSERT)pm_code_modifier_rules_select(SELECT)pm_code_modifier_rules_update(UPDATE)
pm_collection_actions
PM-45: Append-only audit trail of all collections actions
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)payment_plan_id→pm_patient_payment_plans(id)performed_by→pf_profiles(id)
pm_collection_actions_delete(DELETE)pm_collection_actions_insert(INSERT)pm_collection_actions_select(SELECT)
pm_collections_external_referrals
PM-45: External collections agency referral tracking
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payment_plan_id→pm_patient_payment_plans(id)updated_by→pf_profiles(id)
pm_ext_referrals_insert(INSERT)pm_ext_referrals_select(SELECT)pm_ext_referrals_update(UPDATE)
pm_contract_modeling_scenarios
PM-UX-19: Persisted payer contract modeling simulation scenarios with assumptions, rate adjustments, and forecast outputs. Tenant-scoped; no PHI.
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)parent_scenario_id→pm_contract_modeling_scenarios(id)
pm_contract_modeling_scenarios_delete(DELETE)pm_contract_modeling_scenarios_insert(INSERT)pm_contract_modeling_scenarios_select(SELECT)pm_contract_modeling_scenarios_update(UPDATE)
pm_contracted_rates
PM-23: Contracted rates per contract and CPT (with optional modifiers)
RLS: ✅ enabled (4 policies)
Foreign keys:
contract_id→pm_payer_contracts(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_contracted_rates_delete(DELETE)pm_contracted_rates_insert(INSERT)pm_contracted_rates_select(SELECT)pm_contracted_rates_update(UPDATE)
pm_coordinator_tasks
PM-42: Intake coordinator task queue for appointment confirmation, waitlist calls, packet reminders
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_coordinator_tasks_insert(INSERT)pm_coordinator_tasks_select(SELECT)pm_coordinator_tasks_update(UPDATE)
pm_cost_categories
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_cost_categories_insert(INSERT)pm_cost_categories_select(SELECT)pm_cost_categories_update(UPDATE)
pm_cost_estimate_line_items
PM-48: Per-service line items for patient cost estimates
RLS: ✅ enabled (4 policies)
Foreign keys:
estimate_id, organization_id→pm_patient_cost_estimates(id, organization_id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_estimate_lines_delete(DELETE)pm_estimate_lines_insert(INSERT)pm_estimate_lines_select(SELECT)pm_estimate_lines_update(UPDATE)
pm_cost_rates
RLS: ✅ enabled (3 policies)
Foreign keys:
cost_category_id→pm_cost_categories(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_cost_rates_insert(INSERT)pm_cost_rates_select(SELECT)pm_cost_rates_update(UPDATE)
pm_denial_models
PM-50: ML model registry for denial prediction.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_denial_models_delete(DELETE)pm_denial_models_insert(INSERT)pm_denial_models_select(SELECT)pm_denial_models_update(UPDATE)
pm_denial_predictions
PM-50: ML-based denial risk predictions for claims.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_denial_predictions_delete(DELETE)pm_denial_predictions_insert(INSERT)pm_denial_predictions_select(SELECT)pm_denial_predictions_update(UPDATE)
pm_edi_enrollment_status_history
PM-46: Append-only audit trail of EDI enrollment status changes
RLS: ✅ enabled (4 policies)
Foreign keys:
changed_by→pf_profiles(id)enrollment_id→pm_payer_edi_enrollments(id)organization_id→pf_organizations(id)
pm_edi_status_history_delete(DELETE)pm_edi_status_history_insert(INSERT)pm_edi_status_history_select(SELECT)pm_edi_status_history_update(UPDATE)
pm_eligibility_checks
RLS: ✅ enabled (3 policies)
Foreign keys:
appointment_id→pm_appointments(id)checked_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)policy_id→pm_insurance_policies(id)updated_by→pf_profiles(id)
pm_eligibility_checks_insert(INSERT)pm_eligibility_checks_select(SELECT)pm_eligibility_checks_update(UPDATE)
pm_emergency_contacts
PM-01: Patient emergency contacts. Soft-delete for audit.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_emergency_contacts_delete(DELETE)pm_emergency_contacts_insert(INSERT)pm_emergency_contacts_select(SELECT)pm_emergency_contacts_update(UPDATE)
pm_encounter_costs
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)encounter_id→pm_encounters(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_encounter_costs_insert(INSERT)pm_encounter_costs_select(SELECT)pm_encounter_costs_update(UPDATE)
pm_encounters
PM-03 (owned): Links appointments to clinical docs and charges. Central for PM-07.
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)rendering_provider_id→pf_profiles(id)service_location_id→pf_sites(id)supervising_provider_id→pf_profiles(id)updated_by→pf_profiles(id)
pm_encounters_delete(DELETE)pm_encounters_insert(INSERT)pm_encounters_select(SELECT)pm_encounters_update(UPDATE)
pm_era_files
PM-09: Electronic Remittance Advice (835) files
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)site_id→pf_sites(id)updated_by→users(id)
pm_era_files_delete(DELETE)pm_era_files_insert(INSERT)pm_era_files_select(SELECT)pm_era_files_update(UPDATE)
pm_era_orphan_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)matched_by→pf_profiles(id)matched_claim_id→pm_claims(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)remittance_id→pm_era_files(id)updated_by→pf_profiles(id)
pm_eol_delete(DELETE)pm_eol_insert(INSERT)pm_eol_select(SELECT)pm_eol_update(UPDATE)
pm_era_reconciliation_results
PM-44: Stores ERA payment reconciliation results comparing paid vs contracted amounts per claim line
RLS: ✅ enabled (4 policies)
Foreign keys:
claim_id→pm_claims(id)claim_line_id→pm_claim_lines(id)created_by→pf_profiles(id)era_payment_id→pm_payments(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)reviewed_by→pf_profiles(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_era_recon_delete(DELETE)pm_era_recon_insert(INSERT)pm_era_recon_select(SELECT)pm_era_recon_update(UPDATE)
pm_fee_schedule_entries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)fee_schedule_id→pm_fee_schedules(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_fee_schedule_entries_delete(DELETE)pm_fee_schedule_entries_insert(INSERT)pm_fee_schedule_entries_select(SELECT)pm_fee_schedule_entries_update(UPDATE)
pm_fee_schedules
PM-07: Payer fee schedules defining rates for CPT/HCPCS codes
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→users(id)
pm_fee_schedules_delete(DELETE)pm_fee_schedules_insert(INSERT)pm_fee_schedules_select(SELECT)pm_fee_schedules_update(UPDATE)
pm_fhir_access_log
PM-55: Append-only audit log of every FHIR resource request. No UPDATE/DELETE permitted (HIPAA 6yr retention).
RLS: ✅ enabled (2 policies)
Foreign keys:
app_registration_id→pm_fhir_app_registrations(id)consent_id→pm_patient_access_consents(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)
pm_fhir_log_insert(INSERT)pm_fhir_log_select(SELECT)
pm_fhir_app_registrations
PM-55: Third-party SMART-on-FHIR apps registered for patient access per tenant.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_fhir_app_reg_delete(DELETE)pm_fhir_app_reg_insert(INSERT)pm_fhir_app_reg_select(SELECT)pm_fhir_app_reg_update(UPDATE)
pm_financial_assistance_applications
PM-16: Financial assistance / charity-care application and decision.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_financial_assistance_applications_delete(DELETE)pm_financial_assistance_applications_insert(INSERT)pm_financial_assistance_applications_select(SELECT)pm_financial_assistance_applications_update(UPDATE)
pm_financial_counseling_sessions
RLS: ✅ enabled (4 policies)
Foreign keys:
counselor_id→pf_profiles(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→users(id)
pm_financial_counseling_sessions_delete(DELETE)pm_financial_counseling_sessions_insert(INSERT)pm_financial_counseling_sessions_select(SELECT)pm_financial_counseling_sessions_update(UPDATE)
pm_fpl_thresholds
PM-21: HHS federal poverty level thresholds by household size.
RLS: ✅ enabled (1 policies)
Policies:
pm_fpl_thresholds_select(SELECT)
pm_gfe_appointment_cpt_mapping
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_gfe_cpt_mapping_delete(DELETE)pm_gfe_cpt_mapping_insert(INSERT)pm_gfe_cpt_mapping_select(SELECT)pm_gfe_cpt_mapping_update(UPDATE)
pm_gfe_disputes
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)gfe_id→pm_good_faith_estimates(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_gfe_disputes_delete(DELETE)pm_gfe_disputes_insert(INSERT)pm_gfe_disputes_select(SELECT)pm_gfe_disputes_update(UPDATE)
pm_good_faith_estimates
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_gfe_delete(DELETE)pm_gfe_insert(INSERT)pm_gfe_select(SELECT)pm_gfe_update(UPDATE)
pm_group_definitions
PM-04: Group therapy/session definitions. Reusable templates for recurring group sessions.
RLS: ✅ enabled (4 policies)
Foreign keys:
co_facilitator_id→pf_profiles(id)created_by→pf_profiles(id)facilitator_id→pf_profiles(id)location_id→pf_sites(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_group_definitions_delete(DELETE)pm_group_definitions_insert(INSERT)pm_group_definitions_select(SELECT)pm_group_definitions_update(UPDATE)
pm_group_enrollments
PM-04: Patient enrollment in group definitions. Tracks enrolled, waitlisted, and disenrolled patients.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)group_definition_id→pm_group_definitions(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_group_enrollments_delete(DELETE)pm_group_enrollments_insert(INSERT)pm_group_enrollments_select(SELECT)pm_group_enrollments_update(UPDATE)
pm_group_schedule
PM-04: Individual group session occurrences. Each row is one scheduled session date/time.
RLS: ✅ enabled (4 policies)
Foreign keys:
co_facilitator_id→pf_profiles(id)created_by→pf_profiles(id)facilitator_id→pf_profiles(id)group_definition_id→pm_group_definitions(id)location_id→pf_sites(id)organization_id→pf_organizations(id)room_id→pm_rooms(id)updated_by→pf_profiles(id)
pm_group_schedule_delete(DELETE)pm_group_schedule_insert(INSERT)pm_group_schedule_select(SELECT)pm_group_schedule_update(UPDATE)
pm_guarantors
PM-01: Patient guarantors. Soft-delete for billing audit.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_guarantors_delete(DELETE)pm_guarantors_insert(INSERT)pm_guarantors_select(SELECT)pm_guarantors_update(UPDATE)
pm_information_blocking_log
PM-55: ONC information-blocking exception log with 8 denial categories and Compliance Officer disposition workflow.
RLS: ✅ enabled (3 policies)
Foreign keys:
app_registration_id→pm_fhir_app_registrations(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)reviewed_by→users(id)updated_by→users(id)
pm_ibl_insert(INSERT)pm_ibl_select(SELECT)pm_ibl_update(UPDATE)
pm_institutional_claim_details
RLS: ✅ enabled (4 policies)
Foreign keys:
claim_id→pm_claims(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_inst_claim_delete(DELETE)pm_inst_claim_insert(INSERT)pm_inst_claim_select(SELECT)pm_inst_claim_update(UPDATE)
pm_insurance_policies
PM: Patient insurance policies (link patient to payer)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)payer_id→pm_payers(id)updated_by→users(id)
pm_insurance_policies_delete(DELETE)pm_insurance_policies_insert(INSERT)pm_insurance_policies_select(SELECT)pm_insurance_policies_update(UPDATE)
pm_kiosk_checkins
PM-34-EN-01: Tracks patient self-service kiosk check-in sessions including demographics, insurance capture, consent signing, and copay collection.
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→pf_profiles(id)insurance_card_back_id→pf_documents(id)insurance_card_front_id→pf_documents(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_kiosk_checkins_delete(DELETE)pm_kiosk_checkins_insert(INSERT)pm_kiosk_checkins_select(SELECT)pm_kiosk_checkins_update(UPDATE)
pm_managed_care_authorizations
PM-47: Managed care authorization lifecycle tracking with expiration, utilization, and review scheduling
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)payer_id→pm_payers(id)prior_auth_id→pm_prior_authorizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_mca_insert(INSERT)pm_mca_select(SELECT)pm_mca_update(UPDATE)
pm_module_settings
PM module operational parameters: MRN formatting, claim deadlines, scheduling reminders, revenue cycle targets.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)default_fee_schedule_id→pm_fee_schedules(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_module_settings_insert(INSERT)pm_module_settings_select(SELECT)pm_module_settings_update(UPDATE)
pm_otp_billing_periods
RLS: ✅ enabled (3 policies)
Foreign keys:
charge_id→pm_charges(id)claim_id→pm_claims(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)program_id→pm_otp_programs(id)updated_by→pf_profiles(id)
pm_otp_billing_periods_insert(INSERT)pm_otp_billing_periods_select(SELECT)pm_otp_billing_periods_update(UPDATE)
pm_otp_programs
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_otp_programs_delete(DELETE)pm_otp_programs_insert(INSERT)pm_otp_programs_select(SELECT)pm_otp_programs_update(UPDATE)
pm_otp_service_components
RLS: ✅ enabled (4 policies)
Foreign keys:
billing_period_id→pm_otp_billing_periods(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_otp_service_components_delete(DELETE)pm_otp_service_components_insert(INSERT)pm_otp_service_components_select(SELECT)pm_otp_service_components_update(UPDATE)
pm_patient_access_consents
PM-55: Per-patient consent records for SMART app FHIR access. Revocation propagates within 60s.
RLS: ✅ enabled (4 policies)
Foreign keys:
app_registration_id→pm_fhir_app_registrations(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→users(id)
pm_pac_delete(DELETE)pm_pac_insert(INSERT)pm_pac_select(SELECT)pm_pac_update(UPDATE)
pm_patient_addresses
PM-01: Patient address history. Soft-delete preserves audit trail.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_patient_addresses_delete(DELETE)pm_patient_addresses_insert(INSERT)pm_patient_addresses_select(SELECT)pm_patient_addresses_update(UPDATE)
pm_patient_communication_preferences
PM-45: TCPA opt-out tracking per patient for collections communications
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_comm_prefs_insert(INSERT)pm_comm_prefs_select(SELECT)pm_comm_prefs_update(UPDATE)
pm_patient_cost_estimates
PM-48: Patient cost estimates with financial clearance checklist and accuracy tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
clearance_completed_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)override_approved_by→pf_profiles(id)patient_id→pm_patients(id)payer_id→pm_payers(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_cost_estimates_delete(DELETE)pm_cost_estimates_insert(INSERT)pm_cost_estimates_select(SELECT)pm_cost_estimates_update(UPDATE)
pm_patient_financial_assessments
PM-21: Patient income/FPL assessment and sliding fee tier assignment.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)verified_by→pf_profiles(id)
pm_patient_financial_assessments_delete(DELETE)pm_patient_financial_assessments_insert(INSERT)pm_patient_financial_assessments_select(SELECT)pm_patient_financial_assessments_update(UPDATE)
pm_patient_merge_conflicts
PM-01-EN-01: Field-level conflict resolutions captured during a patient merge.
RLS: ✅ enabled (2 policies)
Foreign keys:
merge_log_id→pm_patient_merge_log(id)organization_id→pf_organizations(id)
pm_patient_merge_conflicts_no_direct_write(ALL)pm_patient_merge_conflicts_select(SELECT)
pm_patient_merge_log
PM-01-EN-01: Append-only audit of patient merges. Used for traceability and undo.
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)performed_by→users(id)undone_by→users(id)
pm_patient_merge_log_no_direct_write(ALL)pm_patient_merge_log_select(SELECT)
pm_patient_payment_plans
PM-45: Patient payment plan records with installment scheduling and consent tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_payment_plans_delete(DELETE)pm_payment_plans_insert(INSERT)pm_payment_plans_select(SELECT)pm_payment_plans_update(UPDATE)
pm_patient_site_transfers
PM-27: Patient site-to-site transfer records with optional billing handoff notes
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)from_site_id→pf_sites(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)to_site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_patient_site_transfers_delete(DELETE)pm_patient_site_transfers_insert(INSERT)pm_patient_site_transfers_select(SELECT)pm_patient_site_transfers_update(UPDATE)
pm_patient_statements
PM-09: Patient balance statements (UI deferred to PM-12)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)statement_run_id→pm_statement_runs(id)updated_by→users(id)
pm_statements_delete(DELETE)pm_statements_insert(INSERT)pm_statements_select(SELECT)pm_statements_update(UPDATE)
pm_patients
PM-01: Core patient demographics. Organization-scoped. Soft-delete via deleted_at.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_identity_id→pf_patient_identities(id)updated_by→pf_profiles(id)
pm_patients_delete(DELETE)pm_patients_insert(INSERT)pm_patients_select(SELECT)pm_patients_update(UPDATE)
pm_payer_clearinghouse_routes
PM-15-P2-EN-01: Per-payer clearinghouse vendor overrides. Precedence: payer override > primary vendor > failover secondary.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_pcr_delete(DELETE)pm_pcr_insert(INSERT)pm_pcr_select(SELECT)pm_pcr_update(UPDATE)
pm_payer_contracts
PM-23: Payer contracts with terms and effective/termination dates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→users(id)
pm_payer_contracts_delete(DELETE)pm_payer_contracts_insert(INSERT)pm_payer_contracts_select(SELECT)pm_payer_contracts_update(UPDATE)
pm_payer_edi_enrollments
PM-46: Tracks EDI enrollment status per payer/NPI/transaction type combination
RLS: ✅ enabled (4 policies)
Foreign keys:
clearinghouse_id→pm_clearinghouse_config(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_edi_enrollments_delete(DELETE)pm_edi_enrollments_insert(INSERT)pm_edi_enrollments_select(SELECT)pm_edi_enrollments_update(UPDATE)
pm_payer_enrollments
PM-15: Payer enrollment status with clearinghouses.
RLS: ✅ enabled (4 policies)
Foreign keys:
clearinghouse_id→pm_clearinghouse_config(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_payer_enrollments_delete(DELETE)pm_payer_enrollments_insert(INSERT)pm_payer_enrollments_select(SELECT)pm_payer_enrollments_update(UPDATE)
pm_payer_modifier_rule_versions
PM-07-EN-14: Immutable version history for payer modifier rules
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)rule_id→pm_payer_modifier_rules(id)
pm_payer_modifier_rule_versions_insert(INSERT)pm_payer_modifier_rule_versions_select(SELECT)
pm_payer_modifier_rules
PM-07-EN-14: Payer-specific modifier rules for claim scrubbing and charge validation
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_payer_modifier_rules_delete(DELETE)pm_payer_modifier_rules_insert(INSERT)pm_payer_modifier_rules_select(SELECT)pm_payer_modifier_rules_update(UPDATE)
pm_payer_performance_snapshots
PM-44: Aggregated payer performance metrics computed daily by cron function
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_payer_perf_insert(INSERT)pm_payer_perf_select(SELECT)pm_payer_perf_update(UPDATE)
pm_payers
PM: Payers (insurance, Medicaid, Medicare, etc.) per organization
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_payers_delete(DELETE)pm_payers_insert(INSERT)pm_payers_select(SELECT)pm_payers_update(UPDATE)
pm_payment_applications
PM-09: Line-level payment applications linking payments to claim lines
RLS: ✅ enabled (4 policies)
Foreign keys:
claim_id→pm_claims(id)claim_line_id→pm_claim_lines(id)created_by→users(id)organization_id→pf_organizations(id)payment_id→pm_payments(id)updated_by→users(id)
pm_payment_apps_delete(DELETE)pm_payment_apps_insert(INSERT)pm_payment_apps_select(SELECT)pm_payment_apps_update(UPDATE)
pm_payment_plan_installments
PM-45: Individual installment records for payment plans
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payment_plan_id→pm_patient_payment_plans(id)updated_by→pf_profiles(id)
pm_installments_insert(INSERT)pm_installments_select(SELECT)pm_installments_update(UPDATE)
pm_payment_plans
PM-16: Patient installment payment plans with status and terms.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_payment_plans_delete(DELETE)pm_payment_plans_insert(INSERT)pm_payment_plans_select(SELECT)pm_payment_plans_update(UPDATE)
pm_payments
PM-09: Payment records for insurance ERA and patient payments
RLS: ✅ enabled (4 policies)
Foreign keys:
era_file_id→pm_era_files(id)created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)payer_id→pm_payers(id)posted_by→pf_profiles(id)site_id→pf_sites(id)updated_by→users(id)
pm_payments_delete(DELETE)pm_payments_insert(INSERT)pm_payments_select(SELECT)pm_payments_update(UPDATE)
pm_portal_packet_assignments
PM-12-EN-01: Tracks digital intake packets assigned to portal patients.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
pm_portal_packet_assignments_delete(DELETE)pm_portal_packet_assignments_insert(INSERT)pm_portal_packet_assignments_select(SELECT)pm_portal_packet_assignments_update(UPDATE)
pm_portal_packet_items
PM-12-EN-01: Individual items inside a portal intake packet.
RLS: ✅ enabled (4 policies)
Foreign keys:
assignment_id→pm_portal_packet_assignments(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_portal_packet_items_delete(DELETE)pm_portal_packet_items_insert(INSERT)pm_portal_packet_items_select(SELECT)pm_portal_packet_items_update(UPDATE)
pm_portal_sessions
PM-12: Append-only portal session audit log. No UPDATE or DELETE allowed via RLS.
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)portal_user_id→pm_portal_users(id)
pm_portal_sessions_delete(DELETE)pm_portal_sessions_insert(INSERT)pm_portal_sessions_select(SELECT)pm_portal_sessions_update(UPDATE)
pm_portal_users
PM-12: Patient portal user metadata and proxy relationships. Authentication via Supabase Auth (no password_hash). Proxy grants managed by staff.
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id, patient_id→pm_patients(organization_id, id)organization_id, proxy_for_patient_id→pm_patients(organization_id, id)auth_user_id→users(id)created_by→users(id)updated_by→users(id)
pm_portal_users_delete(DELETE)pm_portal_users_insert(INSERT)pm_portal_users_select(SELECT)pm_portal_users_update(UPDATE)
pm_preadmission_form_templates
PM-40: Template definitions for preadmission form packets, versioned per program type
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_preadmission_form_templates_delete(DELETE)pm_preadmission_form_templates_insert(INSERT)pm_preadmission_form_templates_select(SELECT)pm_preadmission_form_templates_update(UPDATE)
pm_preadmission_packets
PM-40: Tracks individual preadmission packets sent to patients before intake appointments
RLS: ✅ enabled (3 policies)
Foreign keys:
appointment_id→pm_appointments(id)created_by→users(id)exception_marked_by→users(id)organization_id→pf_organizations(id)packet_template_id→pm_preadmission_form_templates(id)patient_id→pm_patients(id)updated_by→users(id)
pm_preadmission_packets_insert(INSERT)pm_preadmission_packets_select(SELECT)pm_preadmission_packets_update(UPDATE)
pm_prior_authorizations
PM-10: Prior authorization requests for behavioral health services
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)facility_id→pf_sites(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)payer_id→pm_payers(id)requesting_provider_id→pf_profiles(id)servicing_provider_id→pf_profiles(id)site_id→pf_sites(id)submitted_by→users(id)updated_by→users(id)
pm_prior_auth_delete(DELETE)pm_prior_auth_insert(INSERT)pm_prior_auth_select(SELECT)pm_prior_auth_update(UPDATE)
pm_program_insurance_revenue_matrix
PM-41-P3: Per-program per-insurance estimated revenue lookup matrix
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_revenue_matrix_delete(DELETE)pm_revenue_matrix_insert(INSERT)pm_revenue_matrix_select(SELECT)pm_revenue_matrix_update(UPDATE)
pm_provider_caseloads
PM-05: Provider caseload capacity and panel status
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)provider_id→pf_profiles(id)updated_by→users(id)
pm_provider_caseloads_delete(DELETE)pm_provider_caseloads_insert(INSERT)pm_provider_caseloads_select(SELECT)pm_provider_caseloads_update(UPDATE)
pm_provider_enrollment_events
PM-17: Append-only audit log of enrollment lifecycle events. No updated_at or custom_fields (audit table exemption).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)organization_id, provider_enrollment_id→pm_provider_enrollments(organization_id, id)
pm_provider_enrollment_events_delete(DELETE)pm_provider_enrollment_events_insert(INSERT)pm_provider_enrollment_events_select(SELECT)pm_provider_enrollment_events_update(UPDATE)
pm_provider_enrollments
PM-17: Provider-level payer enrollment and credentialing records. Distinct from pm_payer_enrollments (PM-15) which tracks clearinghouse-level enrollment.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_provider_enrollments_delete(DELETE)pm_provider_enrollments_insert(INSERT)pm_provider_enrollments_select(SELECT)pm_provider_enrollments_update(UPDATE)
pm_provider_identifier_validations
PM-17: Append-only NPI/taxonomy validation results. No updated_at or custom_fields (audit table exemption).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)
pm_provider_identifier_validations_delete(DELETE)pm_provider_identifier_validations_insert(INSERT)pm_provider_identifier_validations_select(SELECT)pm_provider_identifier_validations_update(UPDATE)
pm_provider_schedules
PM-05: Recurring weekly availability blocks for providers
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)location_id→pf_sites(id)organization_id→pf_organizations(id)provider_id→pf_profiles(id)updated_by→users(id)
pm_provider_schedules_delete(DELETE)pm_provider_schedules_insert(INSERT)pm_provider_schedules_select(SELECT)pm_provider_schedules_update(UPDATE)
pm_provider_time_off
PM-05: Provider time-off requests with approval workflow
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→users(id)coverage_provider_id→pf_profiles(id)created_by→users(id)organization_id→pf_organizations(id)provider_id→pf_profiles(id)updated_by→users(id)
pm_provider_time_off_delete(DELETE)pm_provider_time_off_insert(INSERT)pm_provider_time_off_select(SELECT)pm_provider_time_off_update(UPDATE)
pm_rarc_codes
PM-29: Remittance Advice Remark Codes (RARC)
RLS: ✅ enabled (1 policies)
Policies:
pm_rarc_codes_select(SELECT)
pm_rcm_automation_rules
PM-49: Revenue cycle automation rule definitions with conditions and actions
RLS: ✅ enabled (4 policies)
Foreign keys:
activated_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_rcm_automation_rules_delete(DELETE)pm_rcm_automation_rules_insert(INSERT)pm_rcm_automation_rules_select(SELECT)pm_rcm_automation_rules_update(UPDATE)
pm_rcm_benchmarks
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
pm_rcm_benchmarks_delete(DELETE)pm_rcm_benchmarks_insert(INSERT)pm_rcm_benchmarks_select(SELECT)pm_rcm_benchmarks_update(UPDATE)
pm_rcm_rule_executions
PM-49: Immutable audit trail of every rule execution action. No UPDATE or DELETE allowed.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)original_execution_id→pm_rcm_rule_executions(id)rule_id→pm_rcm_automation_rules(id)
pm_rcm_rule_executions_insert(INSERT)pm_rcm_rule_executions_no_delete(DELETE)pm_rcm_rule_executions_no_update(UPDATE)pm_rcm_rule_executions_select(SELECT)
pm_rcm_snapshots
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
pm_rcm_snapshots_delete(DELETE)pm_rcm_snapshots_insert(INSERT)pm_rcm_snapshots_select(SELECT)pm_rcm_snapshots_update(UPDATE)
pm_rcm_work_queue_items
PM-49: Dynamic AR work queue with priority scoring for claim follow-up
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_rcm_work_queue_delete(DELETE)pm_rcm_work_queue_insert(INSERT)pm_rcm_work_queue_select(SELECT)pm_rcm_work_queue_update(UPDATE)
pm_referral_documents
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)referral_id→pm_referrals(id)uploaded_by→users(id)
pm_referral_documents_delete(DELETE)pm_referral_documents_insert(INSERT)pm_referral_documents_select(SELECT)pm_referral_documents_update(UPDATE)
pm_referral_packet_items
PM-06-EN-01: Packet checklist items for outbound referrals.
RLS: ✅ enabled (4 policies)
Foreign keys:
completed_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)referral_id→pm_referrals(id)updated_by→pf_profiles(id)
pm_referral_packet_items_delete(DELETE)pm_referral_packet_items_insert(INSERT)pm_referral_packet_items_select(SELECT)pm_referral_packet_items_update(UPDATE)
pm_referrals
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)site_id→pf_sites(id)status_changed_by→users(id)updated_by→users(id)
pm_referrals_delete(DELETE)pm_referrals_insert(INSERT)pm_referrals_select(SELECT)pm_referrals_update(UPDATE)
pm_resources
PM-03-EN-08: Generic schedulable resources. Schema-only in this release.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
pm_resources_delete(DELETE)pm_resources_insert(INSERT)pm_resources_select(SELECT)pm_resources_update(UPDATE)
pm_revenue_code_mappings
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→users(id)
pm_rev_code_delete(DELETE)pm_rev_code_insert(INSERT)pm_rev_code_select(SELECT)pm_rev_code_update(UPDATE)
pm_rooms
PM-03-EN-08: Physical rooms used for in-person appointments and group sessions.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
pm_rooms_delete(DELETE)pm_rooms_insert(INSERT)pm_rooms_select(SELECT)pm_rooms_update(UPDATE)
pm_rpa_bot_configurations
PM-51: RPA bot configurations for payer portal automation. One row per payer-portal-type combination.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credential_vault_id→pf_credential_vault(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_rpa_bot_configurations_delete(DELETE)pm_rpa_bot_configurations_insert(INSERT)pm_rpa_bot_configurations_select(SELECT)pm_rpa_bot_configurations_update(UPDATE)
pm_rpa_bot_executions
PM-51: RPA bot execution log. One row per bot run with status, timing, and error details.
RLS: ✅ enabled (2 policies)
Foreign keys:
bot_configuration_id, organization_id→pm_rpa_bot_configurations(id, organization_id)created_by→pf_profiles(id)organization_id→pf_organizations(id)
pm_rpa_bot_executions_insert(INSERT)pm_rpa_bot_executions_select(SELECT)
pm_rpa_execution_daily_summaries
PM-51: Aggregated daily execution metrics. Insert-only after archiver aggregation.
RLS: ✅ enabled (1 policies)
Foreign keys:
bot_configuration_id→pm_rpa_bot_configurations(id)organization_id→pf_organizations(id)
pm_rpa_execution_daily_summaries_select(SELECT)
pm_rpa_module_settings
PM-51: Per-organization RPA module settings.
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)
pm_rpa_module_settings_select(SELECT)pm_rpa_module_settings_update(UPDATE)
pm_rpa_staged_documents
PM-51: Downloaded remittance/EOB documents staged for PM-09 processing.
RLS: ✅ enabled (3 policies)
Foreign keys:
execution_id, organization_id→pm_rpa_bot_executions(id, organization_id)organization_id→pf_organizations(id)processed_by→pf_profiles(id)
pm_rpa_staged_documents_delete(DELETE)pm_rpa_staged_documents_select(SELECT)pm_rpa_staged_documents_update(UPDATE)
pm_scrub_custom_edits
PM-18-EN-06: Organization-defined custom scrub rules with condition expressions, severity, and message templates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→pf_profiles(id)
pm_scrub_custom_edits_delete(DELETE)pm_scrub_custom_edits_insert(INSERT)pm_scrub_custom_edits_select(SELECT)pm_scrub_custom_edits_update(UPDATE)
pm_scrub_rule_definitions
PM-18: System-wide scrub rule definitions. Read-only reference table.
RLS: ✅ enabled (1 policies)
Policies:
pm_scrub_rule_definitions_select(SELECT)
pm_scrub_rule_overrides
PM-18: Per-organization scrub rule overrides.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)rule_key→pm_scrub_rule_definitions(rule_key)updated_by→pf_profiles(id)
pm_scrub_rule_overrides_delete(DELETE)pm_scrub_rule_overrides_insert(INSERT)pm_scrub_rule_overrides_select(SELECT)pm_scrub_rule_overrides_update(UPDATE)
pm_secondary_claims
PM-30: Secondary/tertiary claim records linking primary ERA to secondary claim generation
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)primary_claim_id→pm_claims(id)primary_remittance_id→pm_payments(id)secondary_claim_id→pm_claims(id)updated_by→users(id)
pm_secondary_claims_delete(DELETE)pm_secondary_claims_insert(INSERT)pm_secondary_claims_select(SELECT)pm_secondary_claims_update(UPDATE)
pm_site_billing_config
PM-27: Site-level billing NPI, tax ID, addresses, fee schedule, clearinghouse, claim defaults
RLS: ✅ enabled (4 policies)
Foreign keys:
clearinghouse_config_id→pm_clearinghouse_config(id)created_by→pf_profiles(id)default_fee_schedule_id→pm_fee_schedules(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
pm_site_billing_config_delete(DELETE)pm_site_billing_config_insert(INSERT)pm_site_billing_config_select(SELECT)pm_site_billing_config_update(UPDATE)
pm_sliding_fee_schedules
PM-21: Sliding fee discount schedules with FPL brackets and discount %. Exactly one active per org.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_sliding_fee_schedules_delete(DELETE)pm_sliding_fee_schedules_insert(INSERT)pm_sliding_fee_schedules_select(SELECT)pm_sliding_fee_schedules_update(UPDATE)
pm_statement_deliveries
PM-16: Per-statement delivery attempt (print/email/portal) with outcome. Append-only.
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)statement_id→pm_patient_statements(id)updated_by→pf_profiles(id)
pm_statement_deliveries_insert(INSERT)pm_statement_deliveries_select(SELECT)
pm_statement_runs
PM-16: Batch run for statement generation (scheduled or on-demand).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_statement_runs_delete(DELETE)pm_statement_runs_insert(INSERT)pm_statement_runs_select(SELECT)pm_statement_runs_update(UPDATE)
pm_superbills
PM-22: Generated superbills/patient receipts for encounters; persisted for audit and portal re-download.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)encounter_id→pm_encounters(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_superbills_delete(DELETE)pm_superbills_insert(INSERT)pm_superbills_select(SELECT)pm_superbills_update(UPDATE)
pm_task_audit_log
PM-42: Append-only audit log for coordinator task actions. Immutable — no UPDATE/DELETE allowed.
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)task_id→pm_coordinator_tasks(id)
pm_task_audit_log_insert(INSERT)pm_task_audit_log_select(SELECT)
pm_telehealth_configuration
PM-13: Per-org telehealth platform configuration.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_telehealth_configuration_delete(DELETE)pm_telehealth_configuration_insert(INSERT)pm_telehealth_configuration_select(SELECT)pm_telehealth_configuration_update(UPDATE)
pm_telehealth_sessions
PM-13: Per-encounter telehealth session with lifecycle tracking.
RLS: ✅ enabled (4 policies)
Foreign keys:
appointment_id→pm_appointments(id)configuration_id→pm_telehealth_configuration(id)created_by→pf_profiles(id)encounter_id→pm_encounters(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)provider_id→pf_profiles(id)updated_by→pf_profiles(id)
pm_telehealth_sessions_delete(DELETE)pm_telehealth_sessions_insert(INSERT)pm_telehealth_sessions_select(SELECT)pm_telehealth_sessions_update(UPDATE)
pm_transaction_batches
PM-15: X12 transaction batches submitted to or received from clearinghouses.
RLS: ✅ enabled (4 policies)
Foreign keys:
clearinghouse_id→pm_clearinghouse_config(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
pm_transaction_batches_delete(DELETE)pm_transaction_batches_insert(INSERT)pm_transaction_batches_select(SELECT)pm_transaction_batches_update(UPDATE)
pm_transaction_log
PM-15: Append-only transaction log. No UPDATE or DELETE allowed.
RLS: ✅ enabled (4 policies)
Foreign keys:
batch_id→pm_transaction_batches(id)claim_id→pm_claims(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)
pm_transaction_log_deny_delete(DELETE)pm_transaction_log_deny_update(UPDATE)pm_transaction_log_insert(INSERT)pm_transaction_log_select(SELECT)
pm_vbp_incentive_payments
PM-25: Incentive payments earned from VBP programs.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)program_id→pm_vbp_programs(id)updated_by→users(id)
pm_vbp_incentive_payments_delete(DELETE)pm_vbp_incentive_payments_insert(INSERT)pm_vbp_incentive_payments_select(SELECT)pm_vbp_incentive_payments_update(UPDATE)
pm_vbp_measures
PM-25: Quality measures tracked within a VBP program.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)program_id→pm_vbp_programs(id)updated_by→users(id)
pm_vbp_measures_delete(DELETE)pm_vbp_measures_insert(INSERT)pm_vbp_measures_select(SELECT)pm_vbp_measures_update(UPDATE)
pm_vbp_programs
PM-25: Value-based payment and APM program tracking.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payer_id→pm_payers(id)updated_by→users(id)
pm_vbp_programs_insert(INSERT)pm_vbp_programs_select(SELECT)pm_vbp_programs_update(UPDATE)
pm_waitlist
PM-03: Patient waitlist for appointment slots.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)offered_appointment_id→pm_appointments(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)provider_id→pf_profiles(id)updated_by→pf_profiles(id)
pm_waitlist_delete(DELETE)pm_waitlist_insert(INSERT)pm_waitlist_select(SELECT)pm_waitlist_update(UPDATE)
pm_waitlist_entries
PM-39: Waitlist entries tracking patients waiting for program slots with priority scoring
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)patient_id→pm_patients(id)updated_by→pf_profiles(id)
pm_waitlist_entries_insert(INSERT)pm_waitlist_entries_select(SELECT)pm_waitlist_entries_update(UPDATE)
pm_waitlist_outreach_log
PM-39: Immutable audit log of outreach attempts to waitlisted patients
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)waitlist_id→pm_waitlist_entries(id)
pm_waitlist_outreach_log_insert(INSERT)pm_waitlist_outreach_log_select(SELECT)