diff --git a/app/Database/Migrations/2025-09-02-070826_Init.php b/app/Database/Migrations/2025-09-02-070826_Init.php new file mode 100644 index 0000000..0e5bfc1 --- /dev/null +++ b/app/Database/Migrations/2025-09-02-070826_Init.php @@ -0,0 +1,269 @@ +forge->addField([ + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CodingSysID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'IntCountryID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'CountryID' => ['type' => 'VARCHAR', 'constraint' => 10], + 'Country' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('IntCountryID', true); + $this->forge->addUniqueKey('CountryID'); + $this->forge->createTable('country'); + + // ethnic + $this->forge->addField([ + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CodingSysID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'EthnicID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'Ethnic' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('EthnicID', true); + $this->forge->createTable('ethnic'); + + // patatt + $this->forge->addField([ + 'PatAttID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'Address' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'UserID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatAttID', true); + $this->forge->createTable('patatt'); + + // patcom + $this->forge->addField([ + 'PatComID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'Comment' => ['type' => 'TEXT', 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatComID', true); + $this->forge->createTable('patcom'); + + // patdiag + $this->forge->addField([ + 'PatDiagID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPVID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'InternalPID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'DiagCode' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Comment' => ['type' => 'TEXT', 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchivedDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatDiagID', true); + $this->forge->createTable('patdiag'); + + // patidt + $this->forge->addField([ + 'PatIdtID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'IdentifierType'=> ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Identifier' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'EffectiveDate' => ['type' => 'DATETIME', 'null' => true], + 'ExpirationDate'=> ['type' => 'DATETIME', 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatIdtID', true); + $this->forge->createTable('patidt'); + + // patient + $this->forge->addField([ + 'InternalPID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'PatientID' => ['type' => 'VARCHAR', 'constraint' => 255], + 'AlternatePID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Prefix' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'NameFirst' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'NameMiddle' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'NameMaiden' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'NameLast' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Suffix' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'NameAlias' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Gender' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'PlaceOfBirth' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Birthdate' => ['type' => 'DATETIME', 'null' => true], + 'Street_1' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Street_2' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Street_3' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'City' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Province' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'ZIP' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'IntCountryID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'EmailAddress1' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'EmailAddress2' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Phone' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'MobilePhone' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Custodian' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'AccountNumber' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'RaceID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'MaritalStatus' => ['type' => 'VARCHAR', 'constraint' => 1, 'null' => true], + 'ReligionID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'EthnicID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'Citizenship' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'DeathIndicator'=> ['type' => 'BIT', 'constraint' => 1, 'null' => true], + 'DeathDateTime' => ['type' => 'DATETIME', 'null' => true], + 'LinkTo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('InternalPID', true); + $this->forge->addUniqueKey('PatientID'); + $this->forge->addUniqueKey('AlternatePID'); + $this->forge->addUniqueKey('EmailAddress1'); + $this->forge->createTable('patient'); + + // patreglog + $this->forge->addField([ + 'PatRegLogID'=> ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'TblName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'RecID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'FldName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'FldValuePrev'=> ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'UserID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'DIDType' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'DID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'MachineID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'SessionID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'AppID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'ProcessID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'WebPageID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'LogDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatRegLogID', true); + $this->forge->createTable('patreglog'); + + // patrelation + $this->forge->addField([ + 'PatRelID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatRelID', true); + $this->forge->createTable('patrelation'); + + // patvisit + $this->forge->addField([ + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'InternalPVID'=> ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'PVID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'InternalPID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'Episode' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'VisitClass' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'BillAcc' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'BillStatus' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchivedDate'=> ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('InternalPVID', true); + $this->forge->createTable('patvisit'); + + // patvisitadt + $this->forge->addField([ + 'PVADTID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'InternalPVID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'Code' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'LocationID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'AttDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'ReffDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'AdmDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CnsDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + 'ArchivedDate'=> ['type' => 'DATETIME', 'null' => true], + 'DelDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PVADTID', true); + $this->forge->createTable('patvisitadt'); + + // patvisitlog + $this->forge->addField([ + 'PatVisLogID'=> ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'TblName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'RecID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'FldName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'FldValuePrev'=> ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'UserID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'DIDType' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'DID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'MachineID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'SessionID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'AppID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'ProcessID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'WebPageID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'LogDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('PatVisLogID', true); + $this->forge->createTable('patvisitlog'); + + // race + $this->forge->addField([ + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CodingSysID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'RaceID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'Race' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('RaceID', true); + $this->forge->createTable('race'); + + // religion + $this->forge->addField([ + 'SiteID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'CodingSysID' => ['type' => 'INT', 'constraint' => 11, 'null' => true], + 'ReligionID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], + 'Religion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'CreateDate' => ['type' => 'DATETIME', 'null' => true], + 'EndDate' => ['type' => 'DATETIME', 'null' => true], + ]); + $this->forge->addKey('ReligionID', true); + $this->forge->createTable('religion'); + } + + public function down() + { + $this->forge->dropTable('country', true); + $this->forge->dropTable('ethnic', true); + $this->forge->dropTable('patatt', true); + $this->forge->dropTable('patcom', true); + $this->forge->dropTable('patdiag', true); + $this->forge->dropTable('patidt', true); + $this->forge->dropTable('patient', true); + $this->forge->dropTable('patreglog', true); + $this->forge->dropTable('patrelation', true); + $this->forge->dropTable('patvisit', true); + $this->forge->dropTable('patvisitadt', true); + $this->forge->dropTable('patvisitlog', true); + $this->forge->dropTable('race', true); + $this->forge->dropTable('religion', true); + } +} diff --git a/public/clqms01.sql b/public/clqms01.sql deleted file mode 100644 index 9fd211b..0000000 --- a/public/clqms01.sql +++ /dev/null @@ -1,594 +0,0 @@ --- Adminer 5.3.0 MariaDB 11.8.2-MariaDB-1 from Debian dump - -SET NAMES utf8; -SET time_zone = '+00:00'; -SET foreign_key_checks = 0; -SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; - -SET NAMES utf8mb4; - -CREATE DATABASE `clqms01`; -USE `clqms01`; - -DROP TABLE IF EXISTS `country`; -CREATE TABLE `country` ( - `SiteID` int(11) DEFAULT NULL, - `CodingSysID` int(11) DEFAULT NULL, - `IntCountryID` int(11) NOT NULL AUTO_INCREMENT, - `CountryID` varchar(10) NOT NULL, - `Country` varchar(255) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`IntCountryID`), - UNIQUE KEY `CountryID` (`CountryID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `country` (`SiteID`, `CodingSysID`, `IntCountryID`, `CountryID`, `Country`, `CreateDate`, `EndDate`) VALUES -(NULL, NULL, 1, 'AFG', 'Afghanistan', NULL, NULL), -(NULL, NULL, 2, 'ALA', 'Åland Islands', NULL, NULL), -(NULL, NULL, 3, 'ALB', 'Albania', NULL, NULL), -(NULL, NULL, 4, 'DZA', 'Algeria', NULL, NULL), -(NULL, NULL, 5, 'ASM', 'American Samoa', NULL, NULL), -(NULL, NULL, 6, 'AND', 'Andorra', NULL, NULL), -(NULL, NULL, 7, 'AGO', 'Angola', NULL, NULL), -(NULL, NULL, 8, 'AIA', 'Anguilla', NULL, NULL), -(NULL, NULL, 9, 'ATA', 'Antarctica', NULL, NULL), -(NULL, NULL, 10, 'ATG', 'Antigua and Barbuda', NULL, NULL), -(NULL, NULL, 11, 'ARG', 'Argentina', NULL, NULL), -(NULL, NULL, 12, 'ARM', 'Armenia', NULL, NULL), -(NULL, NULL, 13, 'ABW', 'Aruba', NULL, NULL), -(NULL, NULL, 14, 'AUS', 'Australia', NULL, NULL), -(NULL, NULL, 15, 'AUT', 'Austria', NULL, NULL), -(NULL, NULL, 16, 'AZE', 'Azerbaijan', NULL, NULL), -(NULL, NULL, 17, 'BHS', 'Bahamas', NULL, NULL), -(NULL, NULL, 18, 'BHR', 'Bahrain', NULL, NULL), -(NULL, NULL, 19, 'BGD', 'Bangladesh', NULL, NULL), -(NULL, NULL, 20, 'BRB', 'Barbados', NULL, NULL), -(NULL, NULL, 21, 'BLR', 'Belarus', NULL, NULL), -(NULL, NULL, 22, 'BEL', 'Belgium', NULL, NULL), -(NULL, NULL, 23, 'BLZ', 'Belize', NULL, NULL), -(NULL, NULL, 24, 'BEN', 'Benin', NULL, NULL), -(NULL, NULL, 25, 'BMU', 'Bermuda', NULL, NULL), -(NULL, NULL, 26, 'BTN', 'Bhutan', NULL, NULL), -(NULL, NULL, 27, 'BOL', 'Bolivia, Plurinational State of', NULL, NULL), -(NULL, NULL, 28, 'BES', 'Bonaire, Sint Eustatius and Saba[d]', NULL, NULL), -(NULL, NULL, 29, 'BIH', 'Bosnia and Herzegovina', NULL, NULL), -(NULL, NULL, 30, 'BWA', 'Botswana', NULL, NULL), -(NULL, NULL, 31, 'BVT', 'Bouvet Island', NULL, NULL), -(NULL, NULL, 32, 'BRA', 'Brazil', NULL, NULL), -(NULL, NULL, 33, 'IOT', 'British Indian Ocean Territory', NULL, NULL), -(NULL, NULL, 34, 'BRN', 'Brunei Darussalam', NULL, NULL), -(NULL, NULL, 35, 'BGR', 'Bulgaria', NULL, NULL), -(NULL, NULL, 36, 'BFA', 'Burkina Faso', NULL, NULL), -(NULL, NULL, 37, 'BDI', 'Burundi', NULL, NULL), -(NULL, NULL, 38, 'CPV', 'Cabo Verde', NULL, NULL), -(NULL, NULL, 39, 'KHM', 'Cambodia', NULL, NULL), -(NULL, NULL, 40, 'CMR', 'Cameroon', NULL, NULL), -(NULL, NULL, 41, 'CAN', 'Canada', NULL, NULL), -(NULL, NULL, 42, 'CYM', 'Cayman Islands', NULL, NULL), -(NULL, NULL, 43, 'CAF', 'Central African Republic', NULL, NULL), -(NULL, NULL, 44, 'TCD', 'Chad', NULL, NULL), -(NULL, NULL, 45, 'CHL', 'Chile', NULL, NULL), -(NULL, NULL, 46, 'CHN', 'China[c]', NULL, NULL), -(NULL, NULL, 47, 'CXR', 'Christmas Island', NULL, NULL), -(NULL, NULL, 48, 'CCK', 'Cocos (Keeling) Islands', NULL, NULL), -(NULL, NULL, 49, 'COL', 'Colombia', NULL, NULL), -(NULL, NULL, 50, 'COM', 'Comoros', NULL, NULL), -(NULL, NULL, 51, 'COG', 'Congo', NULL, NULL), -(NULL, NULL, 52, 'COD', 'Congo, Democratic Republic of the', NULL, NULL), -(NULL, NULL, 53, 'COK', 'Cook Islands', NULL, NULL), -(NULL, NULL, 54, 'CRI', 'Costa Rica', NULL, NULL), -(NULL, NULL, 55, 'CIV', 'Côte d\'Ivoire', NULL, NULL), -(NULL, NULL, 56, 'HRV', 'Croatia', NULL, NULL), -(NULL, NULL, 57, 'CUB', 'Cuba', NULL, NULL), -(NULL, NULL, 58, 'CUW', 'Curaçao', NULL, NULL), -(NULL, NULL, 59, 'CYP', 'Cyprus[c]', NULL, NULL), -(NULL, NULL, 60, 'CZE', 'Czechia', NULL, NULL), -(NULL, NULL, 61, 'DNK', 'Denmark', NULL, NULL), -(NULL, NULL, 62, 'DJI', 'Djibouti', NULL, NULL), -(NULL, NULL, 63, 'DMA', 'Dominica', NULL, NULL), -(NULL, NULL, 64, 'DOM', 'Dominican Republic', NULL, NULL), -(NULL, NULL, 65, 'ECU', 'Ecuador', NULL, NULL), -(NULL, NULL, 66, 'EGY', 'Egypt', NULL, NULL), -(NULL, NULL, 67, 'SLV', 'El Salvador', NULL, NULL), -(NULL, NULL, 68, 'GNQ', 'Equatorial Guinea', NULL, NULL), -(NULL, NULL, 69, 'ERI', 'Eritrea', NULL, NULL), -(NULL, NULL, 70, 'EST', 'Estonia', NULL, NULL), -(NULL, NULL, 71, 'SWZ', 'Eswatini', NULL, NULL), -(NULL, NULL, 72, 'ETH', 'Ethiopia', NULL, NULL), -(NULL, NULL, 73, 'FLK', 'Falkland Islands (Malvinas)[c]', NULL, NULL), -(NULL, NULL, 74, 'FRO', 'Faroe Islands', NULL, NULL), -(NULL, NULL, 75, 'FJI', 'Fiji', NULL, NULL), -(NULL, NULL, 76, 'FIN', 'Finland', NULL, NULL), -(NULL, NULL, 77, 'FRA', 'France', NULL, NULL), -(NULL, NULL, 78, 'GUF', 'French Guiana', NULL, NULL), -(NULL, NULL, 79, 'PYF', 'French Polynesia', NULL, NULL), -(NULL, NULL, 80, 'ATF', 'French Southern Territories', NULL, NULL), -(NULL, NULL, 81, 'GAB', 'Gabon', NULL, NULL), -(NULL, NULL, 82, 'GMB', 'Gambia', NULL, NULL), -(NULL, NULL, 83, 'GEO', 'Georgia', NULL, NULL), -(NULL, NULL, 84, 'DEU', 'Germany', NULL, NULL), -(NULL, NULL, 85, 'GHA', 'Ghana', NULL, NULL), -(NULL, NULL, 86, 'GIB', 'Gibraltar', NULL, NULL), -(NULL, NULL, 87, 'GRC', 'Greece', NULL, NULL), -(NULL, NULL, 88, 'GRL', 'Greenland', NULL, NULL), -(NULL, NULL, 89, 'GRD', 'Grenada', NULL, NULL), -(NULL, NULL, 90, 'GLP', 'Guadeloupe', NULL, NULL), -(NULL, NULL, 91, 'GUM', 'Guam', NULL, NULL), -(NULL, NULL, 92, 'GTM', 'Guatemala', NULL, NULL), -(NULL, NULL, 93, 'GGY', 'Guernsey', NULL, NULL), -(NULL, NULL, 94, 'GIN', 'Guinea', NULL, NULL), -(NULL, NULL, 95, 'GNB', 'Guinea-Bissau', NULL, NULL), -(NULL, NULL, 96, 'GUY', 'Guyana', NULL, NULL), -(NULL, NULL, 97, 'HTI', 'Haiti', NULL, NULL), -(NULL, NULL, 98, 'HMD', 'Heard Island and McDonald Islands', NULL, NULL), -(NULL, NULL, 99, 'VAT', 'Holy See', NULL, NULL), -(NULL, NULL, 100, 'HND', 'Honduras', NULL, NULL), -(NULL, NULL, 101, 'HKG', 'Hong Kong', NULL, NULL), -(NULL, NULL, 102, 'HUN', 'Hungary', NULL, NULL), -(NULL, NULL, 103, 'ISL', 'Iceland', NULL, NULL), -(NULL, NULL, 104, 'IND', 'India', NULL, NULL), -(NULL, NULL, 105, 'IDN', 'Indonesia', NULL, NULL), -(NULL, NULL, 106, 'IRN', 'Iran, Islamic Republic of', NULL, NULL), -(NULL, NULL, 107, 'IRQ', 'Iraq', NULL, NULL), -(NULL, NULL, 108, 'IRL', 'Ireland', NULL, NULL), -(NULL, NULL, 109, 'IMN', 'Isle of Man', NULL, NULL), -(NULL, NULL, 110, 'ISR', 'Israel', NULL, NULL), -(NULL, NULL, 111, 'ITA', 'Italy', NULL, NULL), -(NULL, NULL, 112, 'JAM', 'Jamaica', NULL, NULL), -(NULL, NULL, 113, 'JPN', 'Japan', NULL, NULL), -(NULL, NULL, 114, 'JEY', 'Jersey', NULL, NULL), -(NULL, NULL, 115, 'JOR', 'Jordan', NULL, NULL), -(NULL, NULL, 116, 'KAZ', 'Kazakhstan', NULL, NULL), -(NULL, NULL, 117, 'KEN', 'Kenya', NULL, NULL), -(NULL, NULL, 118, 'KIR', 'Kiribati', NULL, NULL), -(NULL, NULL, 119, 'PRK', 'Korea, Democratic People\'s Republic of', NULL, NULL), -(NULL, NULL, 120, 'KOR', 'Korea, Republic of', NULL, NULL), -(NULL, NULL, 121, 'KWT', 'Kuwait', NULL, NULL), -(NULL, NULL, 122, 'KGZ', 'Kyrgyzstan', NULL, NULL), -(NULL, NULL, 123, 'LAO', 'Lao People\'s Democratic Republic', NULL, NULL), -(NULL, NULL, 124, 'LVA', 'Latvia', NULL, NULL), -(NULL, NULL, 125, 'LBN', 'Lebanon', NULL, NULL), -(NULL, NULL, 126, 'LSO', 'Lesotho', NULL, NULL), -(NULL, NULL, 127, 'LBR', 'Liberia', NULL, NULL), -(NULL, NULL, 128, 'LBY', 'Libya', NULL, NULL), -(NULL, NULL, 129, 'LIE', 'Liechtenstein', NULL, NULL), -(NULL, NULL, 130, 'LTU', 'Lithuania', NULL, NULL), -(NULL, NULL, 131, 'LUX', 'Luxembourg', NULL, NULL), -(NULL, NULL, 132, 'MAC', 'Macao', NULL, NULL), -(NULL, NULL, 133, 'MDG', 'Madagascar', NULL, NULL), -(NULL, NULL, 134, 'MWI', 'Malawi', NULL, NULL), -(NULL, NULL, 135, 'MYS', 'Malaysia', NULL, NULL), -(NULL, NULL, 136, 'MDV', 'Maldives', NULL, NULL), -(NULL, NULL, 137, 'MLI', 'Mali', NULL, NULL), -(NULL, NULL, 138, 'MLT', 'Malta', NULL, NULL), -(NULL, NULL, 139, 'MHL', 'Marshall Islands', NULL, NULL), -(NULL, NULL, 140, 'MTQ', 'Martinique', NULL, NULL), -(NULL, NULL, 141, 'MRT', 'Mauritania', NULL, NULL), -(NULL, NULL, 142, 'MUS', 'Mauritius', NULL, NULL), -(NULL, NULL, 143, 'MYT', 'Mayotte', NULL, NULL), -(NULL, NULL, 144, 'MEX', 'Mexico', NULL, NULL), -(NULL, NULL, 145, 'FSM', 'Micronesia, Federated States of', NULL, NULL), -(NULL, NULL, 146, 'MDA', 'Moldova, Republic of', NULL, NULL), -(NULL, NULL, 147, 'MCO', 'Monaco', NULL, NULL), -(NULL, NULL, 148, 'MNG', 'Mongolia', NULL, NULL), -(NULL, NULL, 149, 'MNE', 'Montenegro', NULL, NULL), -(NULL, NULL, 150, 'MSR', 'Montserrat', NULL, NULL), -(NULL, NULL, 151, 'MAR', 'Morocco', NULL, NULL), -(NULL, NULL, 152, 'MOZ', 'Mozambique', NULL, NULL), -(NULL, NULL, 153, 'MMR', 'Myanmar', NULL, NULL), -(NULL, NULL, 154, 'NAM', 'Namibia', NULL, NULL), -(NULL, NULL, 155, 'NRU', 'Nauru', NULL, NULL), -(NULL, NULL, 156, 'NPL', 'Nepal', NULL, NULL), -(NULL, NULL, 157, 'NLD', 'Netherlands, Kingdom of the', NULL, NULL), -(NULL, NULL, 158, 'NCL', 'New Caledonia', NULL, NULL), -(NULL, NULL, 159, 'NZL', 'New Zealand', NULL, NULL), -(NULL, NULL, 160, 'NIC', 'Nicaragua', NULL, NULL), -(NULL, NULL, 161, 'NER', 'Niger', NULL, NULL), -(NULL, NULL, 162, 'NGA', 'Nigeria', NULL, NULL), -(NULL, NULL, 163, 'NIU', 'Niue', NULL, NULL), -(NULL, NULL, 164, 'NFK', 'Norfolk Island', NULL, NULL), -(NULL, NULL, 165, 'MKD', 'North Macedonia', NULL, NULL), -(NULL, NULL, 166, 'MNP', 'Northern Mariana Islands', NULL, NULL), -(NULL, NULL, 167, 'NOR', 'Norway', NULL, NULL), -(NULL, NULL, 168, 'OMN', 'Oman', NULL, NULL), -(NULL, NULL, 169, 'PAK', 'Pakistan', NULL, NULL), -(NULL, NULL, 170, 'PLW', 'Palau', NULL, NULL), -(NULL, NULL, 171, 'PSE', 'Palestine, State of[c]', NULL, NULL), -(NULL, NULL, 172, 'PAN', 'Panama', NULL, NULL), -(NULL, NULL, 173, 'PNG', 'Papua New Guinea', NULL, NULL), -(NULL, NULL, 174, 'PRY', 'Paraguay', NULL, NULL), -(NULL, NULL, 175, 'PER', 'Peru', NULL, NULL), -(NULL, NULL, 176, 'PHL', 'Philippines', NULL, NULL), -(NULL, NULL, 177, 'PCN', 'Pitcairn', NULL, NULL), -(NULL, NULL, 178, 'POL', 'Poland', NULL, NULL), -(NULL, NULL, 179, 'PRT', 'Portugal', NULL, NULL), -(NULL, NULL, 180, 'PRI', 'Puerto Rico', NULL, NULL), -(NULL, NULL, 181, 'QAT', 'Qatar', NULL, NULL), -(NULL, NULL, 182, 'REU', 'Réunion', NULL, NULL), -(NULL, NULL, 183, 'ROU', 'Romania', NULL, NULL), -(NULL, NULL, 184, 'RUS', 'Russian Federation', NULL, NULL), -(NULL, NULL, 185, 'RWA', 'Rwanda', NULL, NULL), -(NULL, NULL, 186, 'BLM', 'Saint Barthélemy', NULL, NULL), -(NULL, NULL, 187, 'SHN', 'Saint Helena, Ascension and Tristan da Cunha[e]', NULL, NULL), -(NULL, NULL, 188, 'KNA', 'Saint Kitts and Nevis', NULL, NULL), -(NULL, NULL, 189, 'LCA', 'Saint Lucia', NULL, NULL), -(NULL, NULL, 190, 'MAF', 'Saint Martin (French part)', NULL, NULL), -(NULL, NULL, 191, 'SPM', 'Saint Pierre and Miquelon', NULL, NULL), -(NULL, NULL, 192, 'VCT', 'Saint Vincent and the Grenadines', NULL, NULL), -(NULL, NULL, 193, 'WSM', 'Samoa', NULL, NULL), -(NULL, NULL, 194, 'SMR', 'San Marino', NULL, NULL), -(NULL, NULL, 195, 'STP', 'Sao Tome and Principe', NULL, NULL), -(NULL, NULL, 196, 'SAU', 'Saudi Arabia', NULL, NULL), -(NULL, NULL, 197, 'SEN', 'Senegal', NULL, NULL), -(NULL, NULL, 198, 'SRB', 'Serbia', NULL, NULL), -(NULL, NULL, 199, 'SYC', 'Seychelles', NULL, NULL), -(NULL, NULL, 200, 'SLE', 'Sierra Leone', NULL, NULL), -(NULL, NULL, 201, 'SGP', 'Singapore', NULL, NULL), -(NULL, NULL, 202, 'SXM', 'Sint Maarten (Dutch part)', NULL, NULL), -(NULL, NULL, 203, 'SVK', 'Slovakia', NULL, NULL), -(NULL, NULL, 204, 'SVN', 'Slovenia', NULL, NULL), -(NULL, NULL, 205, 'SLB', 'Solomon Islands', NULL, NULL), -(NULL, NULL, 206, 'SOM', 'Somalia', NULL, NULL), -(NULL, NULL, 207, 'ZAF', 'South Africa', NULL, NULL), -(NULL, NULL, 208, 'SGS', 'South Georgia and the South Sandwich Islands', NULL, NULL), -(NULL, NULL, 209, 'SSD', 'South Sudan', NULL, NULL), -(NULL, NULL, 210, 'ESP', 'Spain', NULL, NULL), -(NULL, NULL, 211, 'LKA', 'Sri Lanka', NULL, NULL), -(NULL, NULL, 212, 'SDN', 'Sudan', NULL, NULL), -(NULL, NULL, 213, 'SUR', 'Suriname', NULL, NULL), -(NULL, NULL, 214, 'SJM', 'Svalbard and Jan Mayen[f]', NULL, NULL), -(NULL, NULL, 215, 'SWE', 'Sweden', NULL, NULL), -(NULL, NULL, 216, 'CHE', 'Switzerland', NULL, NULL), -(NULL, NULL, 217, 'SYR', 'Syrian Arab Republic', NULL, NULL), -(NULL, NULL, 218, 'TWN', 'Taiwan, Province of China[c]', NULL, NULL), -(NULL, NULL, 219, 'TJK', 'Tajikistan', NULL, NULL), -(NULL, NULL, 220, 'TZA', 'Tanzania, United Republic of', NULL, NULL), -(NULL, NULL, 221, 'THA', 'Thailand', NULL, NULL), -(NULL, NULL, 222, 'TLS', 'Timor-Leste', NULL, NULL), -(NULL, NULL, 223, 'TGO', 'Togo', NULL, NULL), -(NULL, NULL, 224, 'TKL', 'Tokelau', NULL, NULL), -(NULL, NULL, 225, 'TON', 'Tonga', NULL, NULL), -(NULL, NULL, 226, 'TTO', 'Trinidad and Tobago', NULL, NULL), -(NULL, NULL, 227, 'TUN', 'Tunisia', NULL, NULL), -(NULL, NULL, 228, 'TUR', 'Türkiye', NULL, NULL), -(NULL, NULL, 229, 'TKM', 'Turkmenistan', NULL, NULL), -(NULL, NULL, 230, 'TCA', 'Turks and Caicos Islands', NULL, NULL), -(NULL, NULL, 231, 'TUV', 'Tuvalu', NULL, NULL), -(NULL, NULL, 232, 'UGA', 'Uganda', NULL, NULL), -(NULL, NULL, 233, 'UKR', 'Ukraine', NULL, NULL), -(NULL, NULL, 234, 'ARE', 'United Arab Emirates', NULL, NULL), -(NULL, NULL, 235, 'GBR', 'United Kingdom of Great Britain and Northern Ireland', NULL, NULL), -(NULL, NULL, 236, 'USA', 'United States of America', NULL, NULL), -(NULL, NULL, 237, 'UMI', 'United States Minor Outlying Islands[g]', NULL, NULL), -(NULL, NULL, 238, 'URY', 'Uruguay', NULL, NULL), -(NULL, NULL, 239, 'UZB', 'Uzbekistan', NULL, NULL), -(NULL, NULL, 240, 'VUT', 'Vanuatu', NULL, NULL), -(NULL, NULL, 241, 'VEN', 'Venezuela, Bolivarian Republic of', NULL, NULL), -(NULL, NULL, 242, 'VNM', 'Viet Nam', NULL, NULL), -(NULL, NULL, 243, 'VGB', 'Virgin Islands (British)', NULL, NULL), -(NULL, NULL, 244, 'VIR', 'Virgin Islands (U.S.)', NULL, NULL), -(NULL, NULL, 245, 'WLF', 'Wallis and Futuna', NULL, NULL), -(NULL, NULL, 246, 'ESH', 'Western Sahara[c]', NULL, NULL), -(NULL, NULL, 247, 'YEM', 'Yemen', NULL, NULL), -(NULL, NULL, 248, 'ZMB', 'Zambia', NULL, NULL), -(NULL, NULL, 249, 'ZWE', 'Zimbabwe', NULL, NULL); - -DROP TABLE IF EXISTS `ethnic`; -CREATE TABLE `ethnic` ( - `SiteID` int(11) DEFAULT NULL, - `CodingSysID` int(11) DEFAULT NULL, - `EthnicID` int(11) NOT NULL AUTO_INCREMENT, - `Ethnic` varchar(255) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`EthnicID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `ethnic` (`SiteID`, `CodingSysID`, `EthnicID`, `Ethnic`, `CreateDate`, `EndDate`) VALUES -(NULL, NULL, 1, 'Papua Melanezoid', NULL, NULL), -(NULL, NULL, 2, 'Negroid', NULL, NULL), -(NULL, NULL, 3, 'Weddoid', NULL, NULL), -(NULL, NULL, 4, 'Melayu Mongoloid_Proto Melayu', NULL, NULL), -(NULL, NULL, 5, 'Melayu Mongoloid_Deutro Melayu', NULL, NULL), -(NULL, NULL, 6, 'Tionghoa', NULL, NULL), -(NULL, NULL, 7, 'India', NULL, NULL), -(NULL, NULL, 8, 'Arab', NULL, NULL); - -DROP TABLE IF EXISTS `patatt`; -CREATE TABLE `patatt` ( - `PatAttID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPID` int(11) DEFAULT NULL, - `Address` varchar(255) DEFAULT NULL, - `UserID` int(11) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatAttID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patcom`; -CREATE TABLE `patcom` ( - `PatComID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPID` int(11) DEFAULT NULL, - `Comment` text DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatComID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patdiag`; -CREATE TABLE `patdiag` ( - `PatDiagID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPVID` int(11) DEFAULT NULL, - `InternalPID` int(11) DEFAULT NULL, - `DiagCode` varchar(255) DEFAULT NULL, - `Comment` text DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - `ArchivedDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatDiagID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patidt`; -CREATE TABLE `patidt` ( - `PatIdtID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPID` int(11) DEFAULT NULL, - `IdentifierType` varchar(255) DEFAULT NULL, - `Identifier` varchar(255) DEFAULT NULL, - `EffectiveDate` datetime DEFAULT NULL, - `ExpirationDate` datetime DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatIdtID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `patidt` (`PatIdtID`, `InternalPID`, `IdentifierType`, `Identifier`, `EffectiveDate`, `ExpirationDate`, `CreateDate`, `DelDate`) VALUES -(11, 26, 'KTP', '3174011505900001', NULL, NULL, NULL, NULL), -(12, 28, 'KTP', '3174011505900000', NULL, NULL, NULL, NULL), -(13, 29, 'KTP', '32132132', NULL, NULL, NULL, NULL), -(14, 30, 'KTP', 'Q0026', NULL, NULL, NULL, NULL), -(15, 31, 'KTP', 'Q0027', NULL, NULL, NULL, NULL), -(16, 32, 'KTP', 'Q0028', NULL, NULL, '2025-08-09 02:30:29', NULL), -(17, 33, 'KTP', 'Q0029', NULL, NULL, '2025-08-09 05:12:16', NULL), -(18, 34, 'KTP', 'Q0030', NULL, NULL, '2025-08-11 02:31:45', NULL), -(19, 35, 'KTAS', '32232327474', NULL, NULL, '2025-08-11 03:53:04', NULL), -(20, 35, 'KTP', '21321312', NULL, NULL, NULL, NULL), -(22, 36, 'SIM', '23131131', NULL, NULL, '2025-08-11 06:12:13', NULL), -(23, 37, 'KTP', '122121312', NULL, NULL, '2025-08-11 07:14:28', NULL), -(24, 38, 'KTP', 'Q0001', NULL, NULL, '2025-08-12 02:04:16', NULL), -(25, 39, 'KTP', 'Q0002', NULL, NULL, '2025-08-12 02:26:42', NULL), -(26, 40, 'KTP', 'Q0003', NULL, NULL, '2025-08-12 04:00:16', NULL), -(27, 41, 'KTP', 'Q0004', NULL, NULL, '2025-08-12 04:03:37', NULL), -(28, 42, 'PASS', 'Q0005', NULL, NULL, '2025-08-12 04:11:26', NULL), -(29, 43, 'SIM', 'Q0006', NULL, NULL, '2025-08-12 06:11:09', NULL), -(30, 44, 'SSN', 'Q0007', NULL, NULL, '2025-08-12 06:40:15', NULL), -(31, 45, 'KTP', 'Q0008', NULL, NULL, '2025-08-25 02:26:26', NULL), -(32, 46, 'KTP', 'Q0009', NULL, NULL, '2025-08-25 03:02:29', NULL), -(33, 47, 'KTP', 'Q0010', NULL, NULL, '2025-08-25 03:08:34', NULL), -(34, 48, 'KTP', 'Q0011', NULL, NULL, '2025-08-25 03:11:58', NULL), -(35, 49, 'KTP', 'Q0012', NULL, NULL, '2025-08-25 03:28:26', NULL), -(36, 50, 'KTP', 'Q0013', NULL, NULL, '2025-08-25 03:32:41', NULL); - -DROP TABLE IF EXISTS `patient`; -CREATE TABLE `patient` ( - `InternalPID` int(11) NOT NULL AUTO_INCREMENT, - `PatientID` varchar(255) NOT NULL, - `AlternatePID` varchar(255) DEFAULT NULL, - `Prefix` varchar(255) DEFAULT NULL, - `NameFirst` varchar(255) DEFAULT NULL, - `NameMiddle` varchar(255) DEFAULT NULL, - `NameMaiden` varchar(255) DEFAULT NULL, - `NameLast` varchar(255) DEFAULT NULL, - `Suffix` varchar(255) DEFAULT NULL, - `NameAlias` varchar(255) DEFAULT NULL, - `Gender` int(11) DEFAULT NULL, - `PlaceOfBirth` varchar(255) DEFAULT NULL, - `Birthdate` datetime DEFAULT NULL, - `Street_1` varchar(255) DEFAULT NULL, - `Street_2` varchar(255) DEFAULT NULL, - `Street_3` varchar(255) DEFAULT NULL, - `City` varchar(255) DEFAULT NULL, - `Province` varchar(255) DEFAULT NULL, - `ZIP` varchar(255) DEFAULT NULL, - `IntCountryID` int(11) DEFAULT NULL, - `EmailAddress1` varchar(255) DEFAULT NULL, - `EmailAddress2` varchar(255) DEFAULT NULL, - `Phone` varchar(255) DEFAULT NULL, - `MobilePhone` varchar(255) DEFAULT NULL, - `Custodian` int(11) DEFAULT NULL, - `AccountNumber` int(11) DEFAULT NULL, - `RaceID` int(11) DEFAULT NULL, - `MaritalStatus` varchar(1) DEFAULT NULL, - `ReligionID` int(11) DEFAULT NULL, - `EthnicID` int(11) DEFAULT NULL, - `Citizenship` varchar(255) DEFAULT NULL, - `DeathIndicator` bit(1) DEFAULT NULL, - `DeathDateTime` datetime DEFAULT NULL, - `LinkTo` varchar(255) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`InternalPID`), - UNIQUE KEY `PatientID` (`PatientID`), - UNIQUE KEY `AlternatePID` (`AlternatePID`), - UNIQUE KEY `Emailaddress1` (`EmailAddress1`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `patient` (`InternalPID`, `PatientID`, `AlternatePID`, `Prefix`, `NameFirst`, `NameMiddle`, `NameMaiden`, `NameLast`, `Suffix`, `NameAlias`, `Gender`, `PlaceOfBirth`, `Birthdate`, `Street_1`, `Street_2`, `Street_3`, `City`, `Province`, `ZIP`, `IntCountryID`, `EmailAddress1`, `EmailAddress2`, `Phone`, `MobilePhone`, `Custodian`, `AccountNumber`, `RaceID`, `MaritalStatus`, `ReligionID`, `EthnicID`, `Citizenship`, `DeathIndicator`, `DeathDateTime`, `LinkTo`, `CreateDate`, `DelDate`) VALUES -(37, 'Q0050', '0050', 'Kyai', 'Kyai', 'Kyai', 'Kyai', 'Kyai', 'Kyai', 'Kyai', 2, 'Kyai', '2025-08-01 00:00:00', 'Kyai', 'Kyai', 'Kyai', 'jakarta', 'dki', '', 36, 'Kyai@gmail.com', 'Kyai@gmail.comq', '231312312', '143242312', NULL, NULL, 18, 'A', 1, 1, 'Kyai', CONVERT(b'0', UNSIGNED), NULL, '40', '2025-08-11 07:14:28', NULL), -(38, 'Q0001', 'Q0001', 'mr', 'Q0001', 'mid', 'maidn', '', '', '', 2, '', '2025-08-01 00:00:00', '', '', '', '', '', '', 0, 'Q0001@gmail.com', '', '', NULL, NULL, NULL, 0, 'S', 1, 0, '', CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-12 02:04:16', NULL), -(39, 'Q0002', 'Q0002', 'mr', 'Q0002', 'mid', 'mad', 'asat', 'ffx', 'boy', 1, 'rere', '2025-08-10 00:00:00', 'st1', 'st2', 'st4', NULL, NULL, NULL, 136, 'Q0002@gmail.com', 'Q0002@gmail.com', '6232324231', '62372837823', NULL, NULL, 17, 'D', 6, 7, 'wna', CONVERT(b'1', UNSIGNED), '2025-08-01 00:12:00', NULL, '2025-08-12 02:26:42', NULL), -(40, 'Q0003', 'Q0003', NULL, 'Q0003', NULL, NULL, NULL, NULL, NULL, 2, NULL, '2025-08-02 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 0, 'Q0003@gmail.com', NULL, '6232132132166', '6232132132166', NULL, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-12 04:00:16', NULL), -(41, 'Q0004', 'Q0004', '', 'Q0004', '', '', '', '', '', 1, '', '2025-08-01 00:00:00', '', '', '', '', '', '', 0, 'Q0004@gmail.com', '', '623909090', NULL, NULL, NULL, 0, '', 0, 0, '', CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-12 04:03:37', NULL), -(42, 'Q0005', 'Q0005', NULL, 'Q0005', NULL, NULL, NULL, NULL, NULL, 1, NULL, '2025-08-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 0, 'Q0005@gmail.com', NULL, '62389238298', '664324324343', 50, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-12 04:11:26', NULL), -(43, 'Q0006', 'Q0006', 'mr', 'Q0006', NULL, NULL, 'boi', NULL, 'Baboy', 2, 'Semarang', '2025-08-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 105, 'Q0006@gmail.com', NULL, '62327837283', NULL, NULL, NULL, NULL, 'M', 2, NULL, 'indon', CONVERT(b'1', UNSIGNED), '2025-08-11 00:13:00', '37,38', '2025-08-12 06:11:09', NULL), -(44, 'Q0007', 'Q0007', 'mr', 'Q0007', 'midone', 'maidun', 'Q0007 mwehehe', NULL, 'babouy', 2, 'Sini', '2025-08-01 00:00:00', 'jl1', NULL, NULL, NULL, NULL, NULL, 19, 'Q0007@gmail.com', NULL, '6237823782', NULL, 43, NULL, 19, 'D', 1, 1, 'ara ara', CONVERT(b'1', UNSIGNED), '2025-08-12 00:13:00', '38,39,40,42', '2025-08-12 06:40:15', '2025-08-12 09:02:59'), -(45, 'Q0008', 'Q0008', NULL, 'Mie', 'Sedaap', NULL, 'Cup', NULL, NULL, 2, NULL, '2025-08-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Q0008@gmail.com', NULL, '627382737823', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'1', UNSIGNED), '2025-08-19 00:16:00', NULL, '2025-08-25 02:26:26', NULL), -(46, 'Q0009', 'Q0009', NULL, 'Pet', NULL, NULL, 'Food', NULL, NULL, 1, NULL, '2025-08-01 00:00:00', 'st1', NULL, NULL, NULL, NULL, NULL, NULL, 'Q0009@gmail.com', NULL, '623232733', NULL, 43, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'1', UNSIGNED), '2025-08-14 10:12:00', '45', '2025-08-25 03:02:29', NULL), -(47, 'Q0010', 'Q0010', NULL, 'Berat', NULL, NULL, 'Bersih', NULL, NULL, 2, NULL, '2025-08-01 00:00:00', 'st1', NULL, NULL, NULL, NULL, NULL, NULL, 'Q0010@gmail.com', NULL, '62783928933', NULL, 44, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-25 03:08:34', NULL), -(48, 'Q0011', 'Q0011', 'mr', 'Pangeran', NULL, NULL, 'Nipunegoro', NULL, NULL, 1, NULL, '2025-08-01 00:00:00', 'st1', NULL, NULL, NULL, NULL, NULL, NULL, 'Q0011@gmail.com', NULL, '62473434343', NULL, 45, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-25 03:11:58', NULL), -(49, 'Q0012', 'Q0012', 'mr', 'Pangeran', NULL, NULL, 'Nipunegoro', NULL, NULL, 1, NULL, '2025-08-01 00:00:00', 'st1', NULL, NULL, NULL, NULL, NULL, NULL, 'Q0011@gmail1.com', NULL, '62473434343', NULL, 45, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-25 03:28:26', NULL), -(50, 'Q0013', 'Q0013', 'mr', 'Pangeran', NULL, NULL, 'Nipunegoro', NULL, NULL, 1, NULL, '2025-08-01 00:00:00', 'st1', NULL, NULL, NULL, NULL, NULL, NULL, 'Q001211@gmail1.com', NULL, '62473434343', NULL, 45, NULL, NULL, NULL, NULL, NULL, NULL, CONVERT(b'0', UNSIGNED), NULL, NULL, '2025-08-25 03:32:41', NULL); - -DROP TABLE IF EXISTS `patreglog`; -CREATE TABLE `patreglog` ( - `PatRegLogID` int(11) NOT NULL AUTO_INCREMENT, - `TblName` varchar(255) DEFAULT NULL, - `RecID` int(11) DEFAULT NULL, - `FldName` varchar(255) DEFAULT NULL, - `FldValuePrev` varchar(255) DEFAULT NULL, - `UserID` int(11) DEFAULT NULL, - `SiteID` int(11) DEFAULT NULL, - `DIDType` varchar(255) DEFAULT NULL, - `DID` varchar(255) DEFAULT NULL, - `MachineID` varchar(255) DEFAULT NULL, - `SessionID` varchar(255) DEFAULT NULL, - `AppID` varchar(255) DEFAULT NULL, - `ProcessID` varchar(255) DEFAULT NULL, - `WebPageID` varchar(255) DEFAULT NULL, - `EventID` varchar(255) DEFAULT NULL, - `ActivityID` varchar(255) DEFAULT NULL, - `Reason` varchar(255) DEFAULT NULL, - `LogDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatRegLogID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patrelation`; -CREATE TABLE `patrelation` ( - `PatRelID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPID` int(11) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatRelID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patvisit`; -CREATE TABLE `patvisit` ( - `SiteID` int(11) DEFAULT NULL, - `InternalPVID` int(11) NOT NULL AUTO_INCREMENT, - `PVID` varchar(255) DEFAULT NULL, - `InternalPID` int(11) DEFAULT NULL, - `Episode` varchar(255) DEFAULT NULL, - `VisitClass` varchar(255) DEFAULT NULL, - `BillAcc` varchar(255) DEFAULT NULL, - `BillStatus` int(11) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - `ArchivedDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`InternalPVID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patvisitadt`; -CREATE TABLE `patvisitadt` ( - `PVADTID` int(11) NOT NULL AUTO_INCREMENT, - `InternalPVID` int(11) DEFAULT NULL, - `Code` varchar(255) DEFAULT NULL, - `LocationID` int(11) DEFAULT NULL, - `AttDoc` int(11) DEFAULT NULL, - `ReffDoc` int(11) DEFAULT NULL, - `AdmDoc` int(11) DEFAULT NULL, - `CnsDoc` int(11) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - `ArchivedDate` datetime DEFAULT NULL, - `DelDate` datetime DEFAULT NULL, - PRIMARY KEY (`PVADTID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `patvisitlog`; -CREATE TABLE `patvisitlog` ( - `PatVisLogID` int(11) NOT NULL AUTO_INCREMENT, - `TblName` varchar(255) DEFAULT NULL, - `RecID` int(11) DEFAULT NULL, - `FldName` varchar(255) DEFAULT NULL, - `FldValuePrev` varchar(255) DEFAULT NULL, - `UserID` int(11) DEFAULT NULL, - `SiteID` int(11) DEFAULT NULL, - `DIDType` varchar(255) DEFAULT NULL, - `DID` varchar(255) DEFAULT NULL, - `MachineID` varchar(255) DEFAULT NULL, - `SessionID` varchar(255) DEFAULT NULL, - `AppID` varchar(255) DEFAULT NULL, - `ProcessID` varchar(255) DEFAULT NULL, - `WebPageID` varchar(255) DEFAULT NULL, - `EventID` varchar(255) DEFAULT NULL, - `ActivityID` varchar(255) DEFAULT NULL, - `Reason` varchar(255) DEFAULT NULL, - `LogDate` datetime DEFAULT NULL, - PRIMARY KEY (`PatVisLogID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - - -DROP TABLE IF EXISTS `race`; -CREATE TABLE `race` ( - `SiteID` int(11) DEFAULT NULL, - `CodingSysID` int(11) DEFAULT NULL, - `RaceID` int(11) NOT NULL AUTO_INCREMENT, - `Race` varchar(255) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`RaceID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `race` (`SiteID`, `CodingSysID`, `RaceID`, `Race`, `CreateDate`, `EndDate`) VALUES -(NULL, NULL, 1, 'Jawa', NULL, NULL), -(NULL, NULL, 2, 'Sunda', NULL, NULL), -(NULL, NULL, 3, 'Batak', NULL, NULL), -(NULL, NULL, 4, 'Suku asal Sulawesi lainnya', NULL, NULL), -(NULL, NULL, 5, 'Madura', NULL, NULL), -(NULL, NULL, 6, 'Betawi', NULL, NULL), -(NULL, NULL, 7, 'Minangkabau', NULL, NULL), -(NULL, NULL, 8, 'Bugis', NULL, NULL), -(NULL, NULL, 9, 'Melayu', NULL, NULL), -(NULL, NULL, 10, 'Suku asal Sumatera Selatan', NULL, NULL), -(NULL, NULL, 11, 'Suku asal Banten', NULL, NULL), -(NULL, NULL, 12, 'Suku asal Nusa Tenggara Timur', NULL, NULL), -(NULL, NULL, 13, 'Banjar', NULL, NULL), -(NULL, NULL, 14, 'Aceh', NULL, NULL), -(NULL, NULL, 15, 'Bali', NULL, NULL), -(NULL, NULL, 16, 'Sasak', NULL, NULL), -(NULL, NULL, 17, 'Dayak', NULL, NULL), -(NULL, NULL, 18, 'Tionghoa', NULL, NULL), -(NULL, NULL, 19, 'Suku asal Papua', NULL, NULL), -(NULL, NULL, 20, 'Makassar', NULL, NULL), -(NULL, NULL, 21, 'Suku asal Sumatera lainnya', NULL, NULL), -(NULL, NULL, 22, 'Suku asal Maluku', NULL, NULL), -(NULL, NULL, 23, 'Suku asal Kalimantan lainnya', NULL, NULL), -(NULL, NULL, 24, 'Cirebon', NULL, NULL), -(NULL, NULL, 25, 'Suku asal Jambi', NULL, NULL), -(NULL, NULL, 26, 'Suku Lampung', NULL, NULL), -(NULL, NULL, 27, 'Suku asal Nusa Tenggara Barat lainnya', NULL, NULL), -(NULL, NULL, 28, 'Gorontalo', NULL, NULL), -(NULL, NULL, 29, 'Minahasa', NULL, NULL), -(NULL, NULL, 30, 'Nias', NULL, NULL), -(NULL, NULL, 31, 'Asing/luar negeri', NULL, NULL); - -DROP TABLE IF EXISTS `religion`; -CREATE TABLE `religion` ( - `SiteID` int(11) DEFAULT NULL, - `CodingSysID` int(11) DEFAULT NULL, - `ReligionID` int(11) NOT NULL AUTO_INCREMENT, - `Religion` varchar(255) DEFAULT NULL, - `CreateDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL, - PRIMARY KEY (`ReligionID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - -INSERT INTO `religion` (`SiteID`, `CodingSysID`, `ReligionID`, `Religion`, `CreateDate`, `EndDate`) VALUES -(NULL, NULL, 1, 'Islam', NULL, NULL), -(NULL, NULL, 2, 'Kristen', NULL, NULL), -(NULL, NULL, 3, 'Katolik', NULL, NULL), -(NULL, NULL, 4, 'Hindu', NULL, NULL), -(NULL, NULL, 5, 'Buddha', NULL, NULL), -(NULL, NULL, 6, 'Konghucu', NULL, NULL), -(NULL, NULL, 7, 'Lainnya', NULL, NULL); - --- 2025-09-02 05:55:52 UTC