encounter_rules


Description

Configured encounter validation rules

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id VARCHAR 36 null
location_business_line_id VARCHAR 36 null
location_business_lines.id fk_encounter_rules_location R
rule_type_id VARCHAR 36 null
encounter_rule_types.id fk_encounter_rules_rule_type C

FK to encounter_rule_types.id

scope VARCHAR 30 null

GLOBAL, ENCOUNTER_TYPE, CPT_CODE, CASE, LOCATION

encounter_type_id VARCHAR 36 √ null
encounter_types.id fk_encounter_rules_encounter_type C

FK to encounter_types.id (if scope=ENCOUNTER_TYPE)

cpt_code_id VARCHAR 36 √ null
cpt_codes.id fk_encounter_rules_cpt C

FK to cpt_codes.id (if scope=CPT_CODE)

case_id VARCHAR 36 √ null
cases.id fk_encounter_rules_case C

FK to cases.id (if scope=CASE)

scope_location_id VARCHAR 36 √ null
location_business_lines.id fk_encounter_rules_scope_location C

FK to location_business_lines.id (if scope=LOCATION)

applies_on_json JSON 1073741824 null

“ON_CREATE”, “ON_UPDATE”, “ON_FINALIZE”, “ON_BILL”

severity VARCHAR 20 ERROR

ERROR, WARNING, INFO

parameters_json JSON 1073741824 √ null

Rule parameters e.g., {“maxHours”: 72}

custom_error_message VARCHAR 500 √ null

Custom error message override

is_enabled BIT 1 1
created_at TIMESTAMP 19 CURRENT_TIMESTAMP
updated_at TIMESTAMP 19 CURRENT_TIMESTAMP
created_by VARCHAR 36 √ null
updated_by VARCHAR 36 √ null

Indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc id
fk_encounter_rules_scope_location Performance Asc scope_location_id
idx_encounter_rules_case Performance Asc case_id
idx_encounter_rules_cpt Performance Asc cpt_code_id
idx_encounter_rules_encounter_type Performance Asc encounter_type_id
idx_encounter_rules_is_enabled Performance Asc is_enabled
idx_encounter_rules_location Performance Asc location_business_line_id
idx_encounter_rules_rule_type Performance Asc rule_type_id
idx_encounter_rules_scope Performance Asc scope

Relationships