entity_calculations
Summary
This table holds information that is specific to entities that are calculated. For example, if we are looking to store the score for the National top 10% of Aspirin on Arrival, you would treat 'National top 10%' as the entity and 'Aspirin on Arrival' as the measure. As such, calculated entities are treated and stored differently than brick-and-mortar locations and reside in separate tables from hospitals, ascs, and geographies.
entity_id is a foreign key on the entities table, and is unique across all referenced tables. Attributes for calculated entities are stored as key value pairs in entity_calculation_attributes and entity_calculations_overrides.
This table includes averages, percentages, and nationally calculated benchmarks.
The two main types of entity_calculations are averages and thresholds
Table Creation
DROP TABLE IF EXISTS `entity_calculations`;
CREATE TABLE entity_calculations (
`entity_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`unique_id` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`aka` varchar(255) DEFAULT NULL,
`entity_type` enum('average', 'median', 'mode','threshold','total') NOT NULL DEFAULT 'average',
`closed_date` date DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`entity_id`),
CONSTRAINT `entity_calculations_ibfk_1` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`entity_id`) ON DELETE CASCADE -- Pellucid only constraint
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Field Information
`entity_id` the primary key for the table. This is unique to each geographic entity and should link to the entities table
`unique_id` stores a unique, non-IPRO ID, such as hrr_code
`name` description about the entity, such as 'top 10%'
`aka` alternate alias for the entity
`entity_type` the scope/size/description of the entity being measured
`closed_date` the date the entity stopped being measured
`created` the date and time the row was created in YYYY-MM-DD HH:MM:SS format
`modified` the date and time the row was last edited in YYYY-MM-DD HH:MM:SS format
Fields
field | type | attributes | notes | example |
---|---|---|---|---|
entity_calculations.entity_id | BIGINT(20) | UNSIGNED NOT NULL AUTO_INCREMENT | Provided by Pellucid, FOREIGN KEY: links to entities table | 00000000001 |
entity_calculations.unique_id | VARCHAR(255) | DEFAULT NULL | Non-IPRO identifier | hrr_code |
entity_calculations.name | VARCHAR(255) | DEFAULT NULL | Determined by IPRO based on measures | National top 10% |
entity_calculations.aka | VARCHAR(255) | DEFAULT NULL | Alternate name for geographical entity | US top 10% |
entity_calculations.entity_type | ENUM('average', 'median', 'mode','threshold','total') | NOT NULL DEFAULT 'average' | Determined by entity and measure | average |
entity_calculations.closed_date | date | DEFAULT NULL | YYYY-MM-DD | 2009-12-31 |
entity_calculations.created | timestamp | NOT NULL DEFAULT '0000-00-00 00:00:00' | Time the row is created, YYYY-MM-DD HH:MM:SS | 2008-12-19 12:19:24 |
entity_calculations.modified | timestamp | NOT NULL DEFAULT '0000-00-00 00:00:00' | Time the row was last modified, YYYY-MM-DD HH:MM:SS | 2008-12-19 12:19:24 |
PRIMARY KEY (`entity_id`)
CONSTRAINT `entity_calculations_ibfk_1` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`entity_id`) ON DELETE CASCADE -- Pellucid only constraint