Summary
There are multiple attribute tables that exist in Pellucid. Each links to a different table. Each attributes table holds attributes for hospitals. Attribute is the key and value is the value of the attribute (e.g. designation, emergency).
The attributes tables are as follows:
- entity_hospital_attributes
- entity_asc_attributes
- entity_calculation_attributes
- entity_geography attributes
- entity_system_attributes
Table Creation
DROP TABLE IF EXISTS `hospital_attributes`;
CREATE TABLE hospital_attributes (
`attribute_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`entity_id` bigint(20) unsigned NOT NULL,
`attribute` varchar(255) NOT NULL,
`value` varchar(255) 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,
`source` varchar(64) DEFAULT NULL,
PRIMARY KEY (`attribute_id`),
KEY `entity_id` (`entity_id`),
CONSTRAINT `hospital_attributes_ibfk_1` FOREIGN KEY (`entity_id`) REFERENCES `entity_hospitals` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Field Information
`attribute_id` unique ID that identifies each attribute
`entity_id` ID number that indicates an entity or asc. Links to the entity_hospitals or entity_ascs tables
`attribute` descriptors identifying the type of attribute associated with the entity
`value` the value of the attribute
`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 |
---|---|---|---|---|
attribute_id | INT(11) | UNSIGNED NOT NULL AUTO_INCREMENT | Provided by Pellucid | 1234567 |
entity_id | BIGINT(20) | UNSIGNED NOT NULL | Provided by Pellucid, links to entities | 987654321 |
attribute | VARCHAR(255) | NOT NULL | Determined by IPRO | aa_md |
value | VARCHAR(255) | DEFAULT NULL | Determined by IPRO | emergency |
created | timestamp | NOT NULL DEFAULT '0000-00-00 00:00:00' | The date and time the row was created | 2010-09-16 09:15:36 |
modified | timestamp | NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP | The date and time the row was edited | 2010-09-16 09:15:36 |
source | VARCHAR(64) | DEFAULT NULL | The source of the attributes data | abc1 |
PRIMARY KEY (`attribute_id`)
KEY `entity_id` (`entity_id`)
CONSTRAINT `hospital_attributes_ibfk_1` FOREIGN KEY (`entity_id`) REFERENCES `entity_hospitals` (`entity_id`) ON DELETE CASCADE
Notes
Some of the attributes tables will also have a source associated with them. This is a VARCHAR field that allows us to identify where the data is coming from