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

fieldtypeattributesnotesexample
entity_calculations.entity_idBIGINT(20)UNSIGNED NOT NULL AUTO_INCREMENTProvided by Pellucid, FOREIGN KEY: links to entities table00000000001
entity_calculations.unique_idVARCHAR(255)DEFAULT NULLNon-IPRO identifierhrr_code
entity_calculations.nameVARCHAR(255)DEFAULT NULLDetermined by IPRO based on measuresNational top 10%
entity_calculations.akaVARCHAR(255)DEFAULT NULLAlternate name for geographical entityUS top 10%
entity_calculations.entity_typeENUM('average', 'median', 'mode','threshold','total')NOT NULL DEFAULT 'average'Determined by entity and measureaverage
entity_calculations.closed_datedateDEFAULT NULLYYYY-MM-DD2009-12-31
entity_calculations.createdtimestampNOT NULL DEFAULT '0000-00-00 00:00:00'Time the row is created, YYYY-MM-DD HH:MM:SS2008-12-19 12:19:24
entity_calculations.modifiedtimestampNOT NULL DEFAULT '0000-00-00 00:00:00'Time the row was last modified, YYYY-MM-DD HH:MM:SS2008-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

 

Notes