Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | VARCHAR | 36 | null |
|
|
||||||||||||
| location_business_line_id | VARCHAR | 36 | null |
|
|
||||||||||||
| case_id | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| service_plan_id | VARCHAR | 36 | √ | null |
|
|
FK to service_plans.id - the plan in force for this encounter’s case on its service date, pinned at creation and never recomputed (issue #197) |
||||||||||
| address_id | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| client_id | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| encounter_type_id | VARCHAR | 36 | null |
|
|
FK to encounter_types.id |
|||||||||||
| parent_encounter_id | VARCHAR | 36 | √ | null |
|
|
FK to parent encounters.id for sub-events |
||||||||||
| rendering_user_id | VARCHAR | 36 | null |
|
|
FK to users.id - primary provider |
|||||||||||
| supervising_user_id | VARCHAR | 36 | √ | null |
|
|
FK to users.id - supervisor |
||||||||||
| service_start | DATETIME | 19 | null |
|
|
Start datetime of service |
|||||||||||
| service_end | DATETIME | 19 | null |
|
|
End datetime of service |
|||||||||||
| location_id | VARCHAR | 36 | √ | null |
|
|
FK to location_business_lines.id for service location |
||||||||||
| place_of_service_code | VARCHAR | 10 | √ | null |
|
|
CMS Place of Service code (e.g., 02, 11, 12) |
||||||||||
| status | enum('CREATED', 'INCOMPLETED', 'COMPLETED', 'READY_FOR_SUPERVISOR_REVIEW', 'READY_FOR_REVIEW', 'DEFICIENT', 'LOCKED', 'AUTO_LOCKED', 'BILLED', 'CANCELED', 'NO_SHOW', 'DELETED') | 27 | CREATED |
|
|
||||||||||||
| previous_status | VARCHAR | 50 | √ | null |
|
|
|||||||||||
| notes | TEXT | 65535 | √ | null |
|
|
Session notes |
||||||||||
| additional_data_json | JSON | 1073741824 | √ | null |
|
|
Freeform additional data |
||||||||||
| submitted_at | DATETIME | 19 | √ | null |
|
|
When encounter was submitted |
||||||||||
| submitted_by | VARCHAR | 36 | √ | null |
|
|
User who submitted |
||||||||||
| billed_at | DATETIME | 19 | √ | null |
|
|
When encounter was billed |
||||||||||
| billed_by | VARCHAR | 36 | √ | null |
|
|
User who billed |
||||||||||
| created_at | TIMESTAMP | 19 | CURRENT_TIMESTAMP |
|
|
||||||||||||
| updated_at | TIMESTAMP | 19 | CURRENT_TIMESTAMP |
|
|
||||||||||||
| created_by | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| updated_by | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| canceled_at | DATETIME | 19 | √ | null |
|
|
|||||||||||
| canceled_by | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| cancel_reason | VARCHAR | 500 | √ | null |
|
|
|||||||||||
| deleted_at | DATETIME | 19 | √ | null |
|
|
|||||||||||
| deleted_by | VARCHAR | 36 | √ | null |
|
|
|||||||||||
| delete_reason | VARCHAR | 500 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| PRIMARY | Primary key | Asc | id |
| fk_encounters_service_location | Performance | Asc | location_id |
| idx_encounters_case | Performance | Asc | case_id |
| idx_encounters_client | Performance | Asc | client_id |
| idx_encounters_location | Performance | Asc | location_business_line_id |
| idx_encounters_location_date | Performance | Asc/Asc | location_business_line_id + service_start |
| idx_encounters_parent | Performance | Asc | parent_encounter_id |
| idx_encounters_rendering_user | Performance | Asc | rendering_user_id |
| idx_encounters_service_end | Performance | Asc | service_end |
| idx_encounters_service_plan | Performance | Asc | service_plan_id |
| idx_encounters_service_start | Performance | Asc | service_start |
| idx_encounters_status | Performance | Asc | status |
| idx_encounters_status_service_start | Performance | Asc/Asc/Asc | location_business_line_id + status + service_start |
| idx_encounters_supervising_user | Performance | Asc | supervising_user_id |
| idx_encounters_type | Performance | Asc | encounter_type_id |