Kulcare Docs
General

Enterprise Schema

Purpose: Employer healthcare benefits, employee health programs, and provider empanelment Tenant Scoped: No (cross-tenant by design) RLS Enabled: No (employer-based access control)

Overview

The enterprise schema manages B2B relationships between employers and healthcare facilities. Employers (companies) are customers of healthcare facilities, not healthcare providers themselves. This schema operates cross-tenant because:

  1. A single employer may contract with multiple healthcare facilities across different tenants
  2. Employees may receive care at any empaneled provider
  3. Benefit plans and claims span multiple facilities

This is similar to the Connect schema, which also operates cross-tenant for professional networking.

Design Principles

Cross-Tenant Architecture

Unlike tenant-scoped schemas (clinical, billing), the enterprise schema uses employer-based access control:

Employer A
    |
    +-- Employees --> Patient links (cross-tenant)
    |       |
    |       +-- Facility 1 (Tenant X)
    |       +-- Facility 2 (Tenant Y)
    |       +-- Facility 3 (Tenant Z)
    |
    +-- Benefit Plans
    |
    +-- Empaneled Providers (cross-tenant)

Employee-Patient Linkage

Employees link to patients in the clinical schema. An employee at one company can be a patient at any facility, and their clinical data remains tenant-scoped while their employment/benefits data is managed here.

enterprise.employer_employees.patient_id --> clinical.patients.id

Entities

Employers

Entity: Employer

Purpose: Company/organization that provides healthcare benefits to employees

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
nameStringYesCompany name
display_nameStringNoMarketing/display name
employer_typeEnumYescorporation, small_business, non_profit, government
industryStringNoIndustry sector
employee_countIntegerNoTotal employee count
identifiersJSONBNoBusiness identifiers
primary_contact_nameStringNoPrimary contact
primary_contact_emailStringNoContact email
primary_contact_phoneStringNoContact phone
addressJSONBNoHeadquarters address
websiteStringNoCompany website
logo_urlStringNoCompany logo
country_codeStringYesPrimary country
timezoneStringNoPrimary timezone
fiscal_year_startIntegerNoFiscal year start month (1-12)
statusEnumYesactive, suspended, terminated
contract_start_dateDateNoContract with platform
contract_end_dateDateNoContract end
settingsJSONBNoEmployer-level settings
created_atTimestampYesRegistration date

Employer Type Values:

  • corporation - Large corporation
  • small_business - Small/medium business
  • non_profit - Non-profit organization
  • government - Government entity

Identifiers Structure:

{
  "ein": "12-3456789",
  "gstin": "29ABCDE1234F1Z5",
  "duns": "123456789"
}

Settings Structure:

{
  "benefits_portal_enabled": true,
  "sso_enabled": true,
  "claims_auto_adjudication": false,
  "wellness_programs_enabled": true,
  "dependent_coverage_allowed": true
}

Relationships:

  • Has many: EmployerEmployees, EmployerFacilities, BenefitPlans, EmpaneledProviders, WellnessPrograms

Entity: EmployerDepartment

Purpose: Organizational units within an employer

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesParent employer
parent_idUUIDNoParent department (hierarchy)
nameStringYesDepartment name
codeStringNoDepartment code
manager_employee_idUUIDNoDepartment manager
is_activeBooleanYesActive status

Relationships:

  • Belongs to: Employer
  • Self-referential: parent_id for hierarchy
  • Has many: EmployerEmployees

Entity: EmployerLocation

Purpose: Physical locations/offices of an employer

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesParent employer
nameStringYesLocation name
location_codeStringNoLocation identifier
addressJSONBNoFull address
cityStringNoCity
stateStringNoState/province
country_codeStringYesCountry
timezoneStringNoLocation timezone
is_primaryBooleanNoPrimary location
is_activeBooleanYesActive status

Relationships:

  • Belongs to: Employer
  • Has many: EmployerEmployees

Employees

Entity: EmployerEmployee

Purpose: Employee records linked to patients

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesParent employer
patient_idUUIDNoLinked patient (cross-tenant)
user_idUUIDNoLinked user account
employee_idStringYesEmployee ID/number
emailStringNoWork email
first_nameStringYesFirst name
last_nameStringNoLast name
date_of_birthDateNoDate of birth
genderEnumNomale, female, other
phoneStringNoContact phone
department_idUUIDNoDepartment
location_idUUIDNoWork location
job_titleStringNoJob title
employment_typeEnumNofull_time, part_time, contractor
hire_dateDateNoEmployment start date
termination_dateDateNoEmployment end date
is_benefits_eligibleBooleanNoEligible for benefits
benefits_effective_dateDateNoBenefits start date
statusEnumYesactive, on_leave, terminated
created_atTimestampYesRecord creation

Employment Type Values:

  • full_time - Full-time employee
  • part_time - Part-time employee
  • contractor - Contractor (may have limited benefits)

Relationships:

  • Belongs to: Employer, EmployerDepartment, EmployerLocation
  • Links to: clinical.patients (cross-tenant), identity.users
  • Has many: EmployeeEnrollments, EmployeeDependents

Entity: EmployeeDependent

Purpose: Employee dependents for family coverage

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_employee_idUUIDYesEmployee reference
patient_idUUIDNoLinked patient (if exists)
first_nameStringYesFirst name
last_nameStringNoLast name
date_of_birthDateNoDate of birth
genderEnumNomale, female, other
relationshipEnumYesspouse, child, domestic_partner, parent
is_benefits_eligibleBooleanNoEligible for coverage
coverage_start_dateDateNoCoverage start
coverage_end_dateDateNoCoverage end
statusEnumYesactive, inactive

Relationships:

  • Belongs to: EmployerEmployee
  • Links to: clinical.patients (cross-tenant)

Benefit Plans

Entity: BenefitPlan

Purpose: Healthcare benefit plan definitions

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesOffering employer
nameStringYesPlan name
descriptionTextNoPlan description
plan_typeEnumYesmedical, dental, vision, wellness, ichra
coverage_typeEnumNoemployee_only, employee_spouse, employee_children, family
contribution_typeEnumNoemployer_paid, employee_paid, shared
employer_contributionDecimalNoEmployer contribution amount/percentage
employee_contributionDecimalNoEmployee contribution amount/percentage
contribution_frequencyEnumNomonthly, bi_weekly, per_paycheck
deductible_individualDecimalNoIndividual deductible
deductible_familyDecimalNoFamily deductible
out_of_pocket_max_individualDecimalNoIndividual OOP max
out_of_pocket_max_familyDecimalNoFamily OOP max
plan_detailsJSONBNoDetailed plan benefits
network_typeEnumNoopen, preferred, exclusive
effective_dateDateYesPlan start date
termination_dateDateNoPlan end date
enrollment_start_dateDateNoOpen enrollment start
enrollment_end_dateDateNoOpen enrollment end
is_activeBooleanYesActive plan
currencyStringYesCurrency code

Plan Type Values:

  • medical - Medical/health insurance
  • dental - Dental coverage
  • vision - Vision coverage
  • wellness - Wellness allowance
  • ichra - Individual Coverage HRA

Network Type Values:

  • open - Any provider
  • preferred - PPO-style (in/out of network)
  • exclusive - HMO-style (empaneled only)

Plan Details Structure:

{
  "copay": {
    "primary_care": 20,
    "specialist": 40,
    "urgent_care": 50,
    "emergency": 150
  },
  "coinsurance": {
    "in_network": 20,
    "out_of_network": 40
  },
  "covered_services": ["preventive", "specialist", "hospital", "rx", "mental_health"],
  "excluded_services": ["cosmetic", "experimental"],
  "annual_max": null,
  "lifetime_max": null,
  "rx_tiers": {
    "tier1_generic": 10,
    "tier2_preferred": 30,
    "tier3_non_preferred": 50,
    "tier4_specialty": "30%"
  }
}

Relationships:

  • Belongs to: Employer
  • Has many: EmployeeEnrollments, EmpanelmentRates

Entity: EmployeeEnrollment

Purpose: Employee enrollment in benefit plans

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_employee_idUUIDYesEmployee reference
benefit_plan_idUUIDYesEnrolled plan
coverage_levelEnumYesemployee_only, employee_spouse, employee_children, family
effective_dateDateYesCoverage start
termination_dateDateNoCoverage end
termination_reasonEnumNovoluntary, involuntary, life_event, employer_termination
employee_contributionDecimalNoPer-period contribution
employer_contributionDecimalNoPer-period contribution
enrolled_dependentsJSONBNoCovered dependent IDs
statusEnumYespending, active, terminated
enrollment_sourceEnumNoopen_enrollment, new_hire, life_event
life_event_typeStringNoIf life event enrollment
life_event_dateDateNoLife event date
created_atTimestampYesEnrollment date

Coverage Level Values:

  • employee_only - Employee only
  • employee_spouse - Employee + spouse/partner
  • employee_children - Employee + children
  • family - Employee + spouse + children

Enrollment Source Values:

  • open_enrollment - Annual open enrollment
  • new_hire - New employee enrollment
  • life_event - Qualifying life event (marriage, birth, etc.)

Relationships:

  • Belongs to: EmployerEmployee, BenefitPlan
  • Links to: billing.patient_policies (creates policy record)

Provider Empanelment

Entity: EmployerFacility

Purpose: Links employers to contracted healthcare facilities

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesEmployer reference
facility_idUUIDYesFacility reference (cross-tenant)
contract_typeEnumNoexclusive, preferred, in_network
contract_start_dateDateNoContract start
contract_end_dateDateNoContract end
discount_percentageDecimalNoNegotiated discount
termsJSONBNoContract terms
statusEnumYesactive, suspended, terminated
created_atTimestampYesCreation date

Contract Type Values:

  • exclusive - Exclusive provider for employer
  • preferred - Preferred provider (lower copay)
  • in_network - Standard in-network provider

Relationships:

  • Belongs to: Employer
  • Links to: identity.facilities (cross-tenant)

Entity: EmpaneledProvider

Purpose: Individual practitioners empaneled for an employer

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesEmployer reference
practitioner_idUUIDYesPractitioner reference (cross-tenant)
specialty_idUUIDNoPracticing specialty
empanelment_typeEnumNopreferred, standard
effective_dateDateNoEmpanelment start
termination_dateDateNoEmpanelment end
max_patientsIntegerNoCapacity limit
current_patient_countIntegerNoCurrent assignments
statusEnumYesactive, suspended, terminated

Relationships:

  • Belongs to: Employer
  • Links to: identity.practitioners (cross-tenant)
  • References: reference.specialties

Entity: EmpanelmentRate

Purpose: Negotiated rates for empaneled providers under benefit plans

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesEmployer reference
benefit_plan_idUUIDYesBenefit plan
facility_idUUIDNoFacility (if facility-specific)
practitioner_idUUIDNoPractitioner (if practitioner-specific)
service_typeStringNoService category
procedure_codeStringNoSpecific procedure
rate_typeEnumYesfixed, percentage_of_billed, fee_schedule
rate_amountDecimalNoRate value
effective_dateDateYesRate start
termination_dateDateNoRate end
currencyStringYesCurrency code

Rate Type Values:

  • fixed - Fixed fee per service
  • percentage_of_billed - Percentage of billed amount
  • fee_schedule - Reference to fee schedule

Relationships:

  • Belongs to: Employer, BenefitPlan
  • Links to: identity.facilities, identity.practitioners (cross-tenant)

Wellness Programs

Entity: WellnessProgram

Purpose: Employer-sponsored wellness initiatives

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
employer_idUUIDYesSponsoring employer
nameStringYesProgram name
descriptionTextNoProgram description
program_typeEnumYeshealth_camp, screening, challenge, education, incentive
categoryStringNoHealth category
target_audienceEnumNoall_employees, at_risk, voluntary
start_dateDateNoProgram start
end_dateDateNoProgram end
registration_deadlineDateNoRegistration cutoff
max_participantsIntegerNoCapacity
incentive_typeEnumNopoints, cash, pto, gift_card
incentive_valueDecimalNoIncentive amount
completion_criteriaJSONBNoHow to complete
partner_vendor_idUUIDNoPartner vendor (if external)
is_activeBooleanYesActive program
created_atTimestampYesCreation date

Program Type Values:

  • health_camp - On-site health camp/screening event
  • screening - Health screening program
  • challenge - Fitness/wellness challenge
  • education - Health education sessions
  • incentive - Incentive-based wellness

Completion Criteria Structure:

{
  "type": "challenge",
  "requirements": [
    { "action": "log_steps", "target": 10000, "frequency": "daily", "duration_days": 30 },
    { "action": "complete_assessment", "required": true }
  ],
  "verification": "self_reported"
}

Relationships:

  • Belongs to: Employer
  • Links to: identity.vendors (if partner)
  • Has many: ProgramRegistrations

Entity: ProgramRegistration

Purpose: Employee registration for wellness programs

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
wellness_program_idUUIDYesProgram reference
employer_employee_idUUIDYesEmployee reference
registration_dateTimestampYesRegistration time
statusEnumYesregistered, in_progress, completed, withdrawn
completion_dateDateNoCompletion date
completion_percentageDecimalNoProgress percentage
incentive_earnedBooleanNoEarned incentive
incentive_paid_dateDateNoIncentive payment date
progress_dataJSONBNoProgress tracking
notesTextNoNotes

Progress Data Structure:

{
  "steps_logged": 250000,
  "days_completed": 25,
  "assessment_completed": true,
  "milestones": [
    { "name": "Week 1", "completed_at": "2024-01-07" },
    { "name": "Week 2", "completed_at": "2024-01-14" }
  ]
}

Relationships:

  • Belongs to: WellnessProgram, EmployerEmployee

Schema Diagram

+------------------------------------------------------------------+
|                       ENTERPRISE SCHEMA                           |
|                     (Cross-Tenant Design)                         |
+------------------------------------------------------------------+
|                                                                    |
|  +---------------+                                                 |
|  |   employers   |                                                 |
|  +---------------+                                                 |
|         |                                                          |
|         +----------------+----------------+----------------+       |
|         |                |                |                |       |
|         v                v                v                v       |
|  +---------------+ +---------------+ +---------------+ +---------+ |
|  | employer_     | | employer_     | | benefit_      | | wellness| |
|  | departments   | | locations     | | plans         | | programs| |
|  +---------------+ +---------------+ +---------------+ +---------+ |
|         |                |                |                |       |
|         v                v                v                v       |
|  +---------------+ +---------------+ +---------------+ +---------+ |
|  | employer_     | | employer_     | | employee_     | | program_| |
|  | employees     | | facilities    | | enrollments   | | regist- | |
|  +---------------+ +---------------+ +---------------+ | rations | |
|         |                |                             +---------+ |
|         v                v                                         |
|  +---------------+ +---------------+                               |
|  | employee_     | | empaneled_    |                               |
|  | dependents    | | providers     |                               |
|  +---------------+ +---------------+                               |
|                          |                                         |
|                          v                                         |
|                   +---------------+                                |
|                   | empanelment_  |                                |
|                   | rates         |                                |
|                   +---------------+                                |
|                                                                    |
+------------------------------------------------------------------+

                    CROSS-TENANT LINKAGES
+------------------------------------------------------------------+
|                                                                    |
|  enterprise.employer_employees.patient_id                          |
|      --> clinical.patients.id (any tenant)                         |
|                                                                    |
|  enterprise.employer_facilities.facility_id                        |
|      --> identity.facilities.id (any tenant)                       |
|                                                                    |
|  enterprise.empaneled_providers.practitioner_id                    |
|      --> identity.practitioners.id (cross-tenant)                  |
|                                                                    |
|  enterprise.employee_enrollments                                   |
|      --> billing.patient_policies (creates policy records)         |
|                                                                    |
+------------------------------------------------------------------+

Access Control

Since this schema is cross-tenant, access control is based on employer membership rather than tenant isolation:

-- Example: Employer-based access
CREATE POLICY employer_access ON enterprise.employer_employees
    USING (
        employer_id IN (
            SELECT employer_id
            FROM enterprise.employer_admins
            WHERE user_id = current_setting('app.current_user_id')::uuid
        )
    );

Access Patterns

RoleAccess LevelDescription
Employer AdminFullAll employer data
HR ManagerDepartmentDepartment employees and enrollments
Benefits AdminBenefitsBenefit plans and enrollments
EmployeeSelfOwn records and dependents
Facility StaffLimitedEmployee eligibility verification

Integration with Other Schemas

Clinical Schema

  • employer_employees.patient_id links to clinical.patients
  • When an employee visits a facility, their patient record is tenant-scoped
  • The employee linkage allows eligibility verification

Billing Schema

  • employee_enrollments create billing.patient_policies
  • Claims filed under employer benefit plans
  • Reimbursements tracked for ICHRA plans

Identity Schema

  • employer_facilities links to identity.facilities
  • empaneled_providers links to identity.practitioners
  • These are cross-tenant references

Entity Summary

EntityDescription
EmployerCompany/organization providing benefits
EmployerDepartmentOrganizational units
EmployerLocationPhysical office locations
EmployerEmployeeEmployee records (links to patients)
EmployeeDependentEmployee family members
BenefitPlanHealthcare benefit definitions
EmployeeEnrollmentEmployee plan enrollments
EmployerFacilityContracted healthcare facilities
EmpaneledProviderEmpaneled practitioners
EmpanelmentRateNegotiated provider rates
WellnessProgramWellness initiatives
ProgramRegistrationProgram participation

On this page