You are on page 1of 20

-- Database for EMR Application -- Database Name : EMR CREATE DATABASE EMR; USE EMR; --Country Table CREATE

TABLE COUNTRYMASTER ( COUNTRYID BIGINT PRIMARY KEY AUTO_INCREMENT, COUNTRYNAME VARCHAR(50), CURRCODE CHAR(20), CURRNAME VARCHAR(50), ACTIVE BOOLEAN )TYPE=MYISAM; --State table CREATE TABLE STATEMASTER ( STATEID BIGINT PRIMARY KEY AUTO_INCREMENT, STATENAME VARCHAR(50), COUNTRYID BIGINT REFERENCES COUNTRYMASTER(COUNTRYID), ACTIVE BOOLEAN )TYPE=MYISAM; --City Table CREATE TABLE CITYMASTER ( CITYID BIGINT PRIMARY KEY AUTO_INCREMENT, CITYNAME VARCHAR(50), STATEID BIGINT REFERENCES STATEMASTER(STATEID), ACTIVE BOOLEAN )TYPE=MYISAM; --CLINIC MASTER TABLE CREATE TABLE CLINICMASTER ( CID BIGINT PRIMARY KEY AUTO_INCREMENT, CLINICNAME VARCHAR(256), ADDRESS VARCHAR(100), CITYID BIGINT REFERENCES CITYMASTER(CITYID), ZIP INT(9), PHONE1 BIGINT, PHONE2 BIGINT, FAX VARCHAR(20), EMAIL VARCHAR(30), ID1 VARCHAR(20), ID2 VARCHAR(20), SPECIALIZATION VARCHAR(30), DAYSTARTSAT VARCHAR(10), DAYENDAT VARCHAR(10), ACTIVE BOOLEAN )TYPE=MYISAM; --ROLEMASTER TABLE CREATE TABLE ROLEMASTER ( ROLEID BIGINT PRIMARY KEY AUTO_INCREMENT, ROLENAME VARCHAR(50) )TYPE=MYISAM;

INSERT ROLEMASTER (ROLENAME) VALUE ('ADMIN'); INSERT ROLEMASTER (ROLENAME) VALUE ('CADMIN'); --USERMASTER TABLE CREATE TABLE USERMASTER ( USERID BIGINT PRIMARY KEY AUTO_INCREMENT, USERNAME VARCHAR(20) NOT NULL UNIQUE, PASSWORD VARCHAR(20), FIRSTNAME VARCHAR(20), LASTNAME VARCHAR(20), PHONE1 BIGINT, PHONE2 BIGINT, EMAILID VARCHAR(30), SSN VARCHAR(20), ROLEID BIGINT REFERENCES ROLEMASTER(ROLEID), CID BIGINT REFERENCES CLINICMASTER(CID), ACTIVE BOOLEAN )TYPE=MYISAM; INSERT INTO USERMASTER (USERNAME,PASSWORD,FIRSTNAME,SSN,ROLEID,ACTIVE) VALUES (' Administrator','Administrator','Rakshan','1234567890',1,true); CREATE TABLE LASTPATIENTIDS ( CID BIGINT REFERENCES CLINICMASTER(CID), LASTPATIENTID BIGINT )TYPE=MYISAM; CREATE TABLE ALLERGYMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID), ALLERGYID BIGINT PRIMARY KEY AUTO_INCREMENT, DATED TIMESTAMP NULL DEFAULT NULL, ALLERGYNAME VARCHAR(256), ACTIVE BOOLEAN )TYPE=MYISAM; CREATE TABLE VACCINEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID), VACCINEID BIGINT PRIMARY KEY AUTO_INCREMENT, VACCINENAME VARCHAR(256), ACTIVE BOOLEAN )TYPE=MYISAM; CREATE TABLE ORDERMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID), ORDERID BIGINT PRIMARY KEY AUTO_INCREMENT, ORDERDETAIL VARCHAR(256), ACTIVE BOOLEAN )TYPE=MYISAM; CREATE TABLE ORDER_DETAILSMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID), ORDERID BIGINT REFERENCES ORDERMASTER(ORDERID) ON DELETE CASCADE, ORDERDETAILSID BIGINT PRIMARY KEY AUTO_INCREMENT,

ICDID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE INSURANCEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CITYID BIGINT REFERENCES CITYMASTER(CITYID). CREATE TABLE ICDMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE DIAGNOSISMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). PHONE1 VARCHAR(20). EMAIL VARCHAR(100). MEDICATIONNAME VARCHAR(512). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE IMMUNIZATIONMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ICDDESC VARCHAR(256). PHONE2 VARCHAR(20).ORDERDETAILSNAME VARCHAR(256). ADDRESS VARCHAR(256). INSURANCEID BIGINT PRIMARY KEY AUTO_INCREMENT. MEDICATIONID BIGINT PRIMARY KEY AUTO_INCREMENT. DIAGNOSISCODE VARCHAR(20). CREATE TABLE MEDICATIONMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DIAGNOSISID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE DEMOGRAPHICSMASTER . ACTIVE BOOLEAN )TYPE=MYISAM. ZIP VARCHAR(20). ACTIVE BOOLEAN )TYPE=MYISAM. VENDORNAME VARCHAR(256). DIAGNOSISNAME VARCHAR(256). IMMUNIZATIONNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. ACTIVE BOOLEAN )TYPE=MYISAM. IMMUNIZATIONID BIGINT PRIMARY KEY AUTO_INCREMENT. COMPANYNAME VARCHAR(256). ICDCODE VARCHAR(20). FAX VARCHAR(50).

HOMEPHONE VARCHAR(20). INSURANCE1_SELF BOOLEAN. SSN VARCHAR(20). INSURANCE1_POLICY_NO VARCHAR(128). WORKHONE VARCHAR(20). STATEID BIGINT REFERENCES STATEMASTER(STATEID). EMERGENCY_PHONE VARCHAR(20). INSURANCEID2 BIGINT REFERENCES INSURANCEMASTER(INSURANCEID). EMPLOYER_DESIGNATION VARCHAR(100). INSURANCE1_EXPIRY_DATE VARCHAR(12). EMPLOYER_COUNTRYID BIGINT REFERENCES COUNTRYMASTER(COUNTRYID). INSURANCE2_PLAN VARCHAR(128). DOB DATE. ADDRESS VARCHAR(256). LANGUAGE VARCHAR(50). FIRSTNAME VARCHAR(50). EMPLOYER_STATEID BIGINT REFERENCES STATEMASTER(STATEID). INSURANCE2_ID_NO VARCHAR(128). INSURANCE1_PLAN VARCHAR(128). PATIENTID BIGINT. CID BIGINT REFERENCES CLINICMASTER(CID). EMPLOYER_PHONE VARCHAR(15). MRN_NO VARCHAR(50). LASTNAME VARCHAR(50). GENDER VARCHAR(6). LICENCEID VARCHAR(50). AGE VARCHAR(10). . INSURANCE1_COPAY VARCHAR(128). ZIP VARCHAR(10). INSURANCE2_POLICY_NO VARCHAR(128). INSURANCE2_EXPIRY_DATE VARCHAR(12). INSURANCEID1 BIGINT REFERENCES INSURANCEMASTER(INSURANCEID). EMPLOYER_ADDRESS VARCHAR(256). EMPLOYER_CITYNAME VARCHAR(50). MIDDLENAME VARCHAR(50). INSURANCE1_ID_NO VARCHAR(128). CONFIRMATION1 BOOLEAN. MOBILEPHONE VARCHAR(20). MARITIALSTATUS VARCHAR(50). INSURANCE1_ADD BOOLEAN. RACE VARCHAR(50). CITYNAME VARCHAR(50). INSURANCE1_SUBSCRIBER_CONTACT_NO VARCHAR(15). EMAILID VARCHAR(50). RELATION1 VARCHAR(15).( ID BIGINT PRIMARY KEY AUTO_INCREMENT. DATED TIMESTAMP NULL DEFAULT NULL. EMPLOYER_NAME VARCHAR(128). IMAGE_NAME VARCHAR(256). INSURANCE1_SUBSCRIBER VARCHAR(128). EMPLOYER_ZIP VARCHAR(10). COUNTRYID BIGINT REFERENCES COUNTRYMASTER(COUNTRYID).

HIPAANOTICE BOOLEAN. DEIDENTIFY BOOLEAN. . DIR_APOINTEE VARCHAR(50). CONFIRMATION3 BOOLEAN. MOTHER_CITYNAME VARCHAR(50). GUR_PHONE VARCHAR(15). INSURANCE2_SUBSCRIBER_CONTACT_NO VARCHAR(15). INSURANCE2_SUBSCRIBER VARCHAR(128). DIR_ADVANCED VARCHAR(100). MOTHERLASTNAME VARCHAR(50). CREATE TABLE RACEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). RELATION3 VARCHAR(15). REASON_FOR_EXEMTED VARCHAR(256). DIR_INFO_RELEASE VARCHAR(50). SMS BOOLEAN. INSURANCE3_POLICY_NO VARCHAR(128). VOICEMSG BOOLEAN. GUR_NAME VARCHAR(50). INSURANCEID3 BIGINT REFERENCES INSURANCEMASTER(INSURANCEID). MOTHER_STATEID BIGINT REFERENCES STATEMASTER(STATEID). INSURANCE3_SELF BOOLEAN. SSN_TYPE Varchar(30). INSURANCE3_SUBSCRIBER VARCHAR(128). ALLOW_EMAIL BOOLEAN. INSURANCE3_COPAY VARCHAR(128). MOTHERFIRSTNAME VARCHAR(50). INSURANCE3_EXPIRY_DATE VARCHAR(12). MAILMSG BOOLEAN. ALTERNATESSN VARCHAR(20) )TYPE=MYISAM. EXEMPTED BOOLEAN. RACEID BIGINT PRIMARY KEY AUTO_INCREMENT. CONFIRMATION2 BOOLEAN. MOTHERADDRESS VARCHAR(50). INSURANCE2_SELF BOOLEAN. RACE VARCHAR(256). MOTHERZIP VARCHAR(50). ACTIVE BOOLEAN )TYPE=MYISAM. RELATION2 VARCHAR(15). INSURANCE2_ADD BOOLEAN. INSURANCE3_SUBSCRIBER_CONTACT_NO VARCHAR(15). INSURANCE3_ID_NO VARCHAR(128). ATTENDED_BY BIGINT REFERENCES PROVIDERMASTER(PROVIDERID).INSURANCE2_COPAY VARCHAR(128). MOTHERCONTACTNO VARCHAR(50). INSURANCE3_PLAN VARCHAR(128). MOTHER_COUNTRYID BIGINT REFERENCES COUNTRYMASTER(COUNTRYID). GUR_RELATION VARCHAR(50).

DESIGNATIONID BIGINT PRIMARY KEY AUTO_INCREMENT. MARRIAGEID BIGINT PRIMARY KEY AUTO_INCREMENT. LANGUAGE VARCHAR(256). PLANNAME VARCHAR(256). DIRADVANCEDNAME VARCHAR(256). CREATE TABLE DIRINFOMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). EXEMPTEDID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE DIRADVANCEDMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). MARITIALSTATUS VARCHAR(256). CREATE TABLE DESIGNATIONMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE EXEMPTEDMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. DIRINFONAME VARCHAR(256).CREATE TABLE LANGUAGEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. --history tables . INSURANCEID BIGINT REFERENCES INSURANCEMASTER(INSURANCEID) ON DELETE CAS CADE. PLANID BIGINT PRIMARY KEY AUTO_INCREMENT. DIRINFOID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE PLANMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. LANGUAGEID BIGINT PRIMARY KEY AUTO_INCREMENT. DIRADVANCEDID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE MARRIAGEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DESIGNATIONNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. EXEMPTEDNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM.

RESOLUTION VARCHAR(20). CREATE TABLE FAMILYHISTORY ( . CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE HISTORY_IMMUNIZATIONS_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. NATUREID BIGINT REFERENCES PROBLEMNATUREMASTER(PROBLEMNATUREID). SIG_2 VARCHAR(50). NEXT_DATE VARCHAR(20) )TYPE=MYISAM. REFILL VARCHAR(50). MEDICATIONID BIGINT REFERENCES MEDICATIONMASTER(MEDICATIONID). CID BIGINT REFERENCES CLINICMASTER(CID). SIG_3 VARCHAR(50). PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). PERFORMED VARCHAR(20). IMMUNIZATIONREVIEWED BOOLEAN )TYPE=MYISAM. STARTDATE VARCHAR(50). CREATE TABLE HISTORY_MASTER_PROBLEM_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. SITE VARCHAR(256). SL_NO INT. STATUS VARCHAR(50) )TYPE=MYISAM. COMMENTS VARCHAR(512) )TYPE=MYISAM. STATUSID BIGINT REFERENCES PROBLEMSTATUSNAME(PROBLEMSTATUSID). KNOWN_ALLERGIES BOOLEAN. CID BIGINT REFERENCES CLINICMASTER(CID). CID BIGINT REFERENCES CLINICMASTER(CID). PATIENTID BIGINT REFERENCES PATIENTMASTER(PATIENTID). PAST_SURGICAL_HISTORY VARCHAR(256). DOSE VARCHAR(128). SL_NO INT. PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). STRENGTH VARCHAR(50). FORM VARCHAR(50). ROUTE VARCHAR(128). IMMUNIZATIONID BIGINT REFERENCES IMMUNIZATIONMASTER(IMMUNIZATIONID).CREATE TABLE HISTORYMASTER ( PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). COMMENTS VARCHAR(50). SIG_1 VARCHAR(50). ONSET VARCHAR(15). ICDID BIGINT REFERENCES ICDMASTER(ICDID). PERFORMEDTIME VARCHAR(20). CREATE TABLE HISTORY_MEDICATION_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. SL_NO INT. ALLERGIESREVIEWED BOOLEAN. DISPENSEQUANTITY VARCHAR(50).

PASTMEDICALNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE SOCIALHISTORY_DESCRIPTION ( CID BIGINT REFERENCES CLINICMASTER(CID). FAMILYHISTORYID BIGINT PRIMARY KEY AUTO_INCREMENT. CID BIGINT REFERENCES CLINICMASTER(CID). DESCRIPTIONID BIGINT PRIMARY KEY AUTO_INCREMENT. PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). SOCIALHISTORYID BIGINT PRIMARY KEY AUTO_INCREMENT. PASTMEDICALID BIGINT PRIMARY KEY AUTO_INCREMENT. DESCRIPTION VARCHAR(256) )TYPE=MYISAM. CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE VARCHAR(128) )TYPE=MYISAM. RELATIONNAME VARCHAR(256). SOCIALHISTORYID BIGINT REFERENCES SOCIALHISTORYMASTER(SOCIALHISTORYID). CREATE TABLE HISTORY_FAMILYHISTORY_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. DESCRIPTION VARCHAR(256). DESCRIPTIONNAME VARCHAR(256). CREATE TABLE SOCIALHISTORYMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DESEASENAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. FAMILYHISTORYID BIGINT REFERENCES SOCIALHISTORYMASTER(ICDID). SOCIALHISTORYNAME VARCHAR(256). SL_NO INT. ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE FAMILYHISTORY_RELATION ( CID BIGINT REFERENCES CLINICMASTER(CID). RELATIONID BIGINT PRIMARY KEY AUTO_INCREMENT.CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). CREATE TABLE HISTORY_SOCIALHISTORY_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE PASTMEDICALHISTORYMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN . SL_NO INT. RELATION VARCHAR(128).

CREATE TABLE MLSIG1MASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. SIG4NAME VARCHAR(256). SIG2ID BIGINT PRIMARY KEY AUTO_INCREMENT. PROBLEMSTATUSNAME VARCHAR(256). DATED TIMESTAMP NULL DEFAULT NULL. DATED TIMESTAMP NULL DEFAULT NULL. CREATE TABLE MLSIG3MASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE PROBLEMSTATUSMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). SIG3NAME VARCHAR(256). PASTSURGICALCODE VARCHAR(256). PROBLEMNATURENAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. ACTIVE BOOLEAN )TYPE=MYISAM. SIG1NAME VARCHAR(256). SIG4ID BIGINT PRIMARY KEY AUTO_INCREMENT. PROBLEMSTATUSID BIGINT PRIMARY KEY AUTO_INCREMENT. SIG2NAME VARCHAR(256). PASTSURGICALID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. PASTSURGICALNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE MLSIG2MASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE MLSIG4MASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DATED TIMESTAMP NULL DEFAULT NULL. SIG3ID BIGINT PRIMARY KEY AUTO_INCREMENT. DATED TIMESTAMP NULL DEFAULT NULL. ACTIVE BOOLEAN )TYPE=MYISAM. . ACTIVE BOOLEAN )TYPE=MYISAM. SIG1ID BIGINT PRIMARY KEY AUTO_INCREMENT.)TYPE=MYISAM. CREATE TABLE PASTSURGICALHISTORYMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). PROBLEMNATUREID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE PROBLEMNATUREMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID).

REV_NUROLOGIC VARCHAR(128). TP VARCHAR(50). TP1 VARCHAR(50). H_SIGNS_SYMPTOMS VARCHAR(128). HISTORY_OF_PRESENT_ILLNESS VARCHAR(1024). H_SEVERITY VARCHAR(128). REV_MUSCULOSKELETON VARCHAR(128). BP1 VARCHAR(50). REV_RESPIRATORY VARCHAR(128). H_CONTEXT VARCHAR(128). ENCOUNTER_TYPE VARCHAR(128). H_QUALITY VARCHAR(128). BMI VARCHAR(50). REV_SKIN VARCHAR(128). BP VARCHAR(50). REV_EYE VARCHAR(128). REV_OTHERS VARCHAR(128). REV_GENITOURINARY_FEMALE VARCHAR(128). DETAILS VARCHAR(128). HT1 VARCHAR(50). PAYMENT_BY VARCHAR(20). PAYMENT_TYPE VARCHAR(128). CHIEF_COMPLAINTS VARCHAR(1024). CID BIGINT REFERENCES CLINICMASTER(CID). ENCOUNTER_NO INT. BILLING_NOT_REQUIRED BOOLEAN. REVIEWED_PAST_FAMILIY_SOCIAL_HISTORY BOOLEAN. H_ONSET_TRAINING VARCHAR(128). EMCODE VARCHAR(128). NOTE_FOR_BILLER VARCHAR(128). REV_PCYCHIATRIC VARCHAR(128). SUMMARIZED_OLD_RECORDS BOOLEAN. REV_ENDOCRIME VARCHAR(128). HT VARCHAR(50). REV_CARDIOVASCULAR VARCHAR(128). INTERPRETED_TEST_DATA BOOLEAN. ATTENDED_BY VARCHAR(50). WT VARCHAR(50). REV_ALLERGIC_IMMUNOLOGIC VARCHAR(128). WT1 VARCHAR(50). REV_GENERAL VARCHAR(128). DATED DATE. RECIEVED_AMOUNT VARCHAR(50). H_MODIFYING_FACTOR VARCHAR(128). . REV_HEMTOLOGIC_LYMPHATIC VARCHAR(128). REFERRED_BY VARCHAR(50). H_LOCATION VARCHAR(128). REV_GENITOURINARY_MALE VARCHAR(128). OBTAINED_OLD_RECORDS BOOLEAN. H_DURATION VARCHAR(128). REV_GASTROINTESTINAL VARCHAR(128). REV_ENMT VARCHAR(128).--encounter tables CREATE TABLE ENCOUNTERMASTER ( PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID).

PE_MUSCULOSKELETON VARCHAR(128). JOIN_WORK_SCHOOL VARCHAR(128). CREATE TABLE HPI_LOCATION ( CID BIGINT REFERENCES CLINICMASTER(CID). ENTYPENAME VARCHAR(128). PE_PCYCHIATRIC VARCHAR(128). FOOLOWUP_VISIT VARCHAR(128). ACTIVE BOOLEAN )TYPE=MYISAM.DICUSSED_REVIEWED_TEST BOOLEAN. PE_CARDIOVASCULAR VARCHAR(128). LOCATIONID BIGINT PRIMARY KEY AUTO_INCREMENT. ENTYPEID BIGINT PRIMARY KEY AUTO_INCREMENT. REFER_NEED_IS VARCHAR(128). PE_OTHERS VARCHAR(128). REFER_PATIENT BOOLEAN. LOCATIONNAME VARCHAR(256). PE_GENITOURINARY_FEMALE VARCHAR(128). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE ENTYPEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). . CREATE TABLE CHIEF_COMPLAINTS ( CID BIGINT REFERENCES CLINICMASTER(CID). PE_NUROLOGIC VARCHAR(128). COMPLAINTSID BIGINT PRIMARY KEY AUTO_INCREMENT. PE_GENERAL VARCHAR(128). PE_ALLERGIC_IMMUNOLOGIC VARCHAR(128). COMPLAINTS VARCHAR(256). PE_HEMTOLOGIC_LYMPHATIC VARCHAR(128). PE_SKIN VARCHAR(128). ACTIVE BOOLEAN )TYPE=MYISAM. REFER_TO Varchar(128). PE_ENDOCRIME VARCHAR(128). PE_EYE VARCHAR(128). PE_RESPIRATORY VARCHAR(128). PE_ENMT VARCHAR(128). PE_GENITOURINARY_MALE VARCHAR(128). REFER_REASON VARCHAR(128) )TYPE=MYISAM. PE_GASTROINTESTINAL VARCHAR(128).

ACTIVE BOOLEAN )TYPE=MYISAM. SEVERITYID BIGINT PRIMARY KEY AUTO_INCREMENT.CREATE TABLE HPI_QUALITY ( CID BIGINT REFERENCES CLINICMASTER(CID). QUALITYNAME VARCHAR(256). CREATE TABLE HPI_SEVERITY ( CID BIGINT REFERENCES CLINICMASTER(CID). QUALITYID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE HPI_MODIFYINGFACTOR ( CID BIGINT REFERENCES CLINICMASTER(CID). SIGNSSYMPTOMSID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. SEVERITYNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE HPI_ONSETTIMING ( CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE HPI_SIGNSSYMPTOMS ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. ONSETTIMINGID BIGINT PRIMARY KEY AUTO_INCREMENT. MODIFYINGFACTORNAME VARCHAR(256). CONTEXTNAME VARCHAR(256). DURATIONID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. SIGNSSYMPTOMSNAME VARCHAR(256). MODIFYINGFACTORID BIGINT PRIMARY KEY AUTO_INCREMENT. CONTEXTID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE ENCOUNTER_INHOUSE_PROBLEM_LIST . CREATE TABLE HPI_DURATION ( CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE HPI_CONTEXT ( CID BIGINT REFERENCES CLINICMASTER(CID). DURATIONNAME VARCHAR(256). ONSETTIMINGNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM.

--Audit Trial CREATE TABLE AUDIT_TRIAL ( CID LONG NOT NULL. ONSET VARCHAR(15). CID BIGINT REFERENCES CLINICMASTER(CID). SL_NO INT. CID BIGINT REFERENCES CLINICMASTER(CID). GEQ_DAW VARCHAR(5). SL_NO INT. CREATE TABLE ENCOUNTER_ORDER_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. STATUS VARCHAR(20) )TYPE=MYISAM. ENCOUNTER_NO INT. SL_NO INT. SIG_2 VARCHAR(20). STATUS VARCHAR(20) )TYPE=MYISAM. SIG_4 VARCHAR(20).( ID BIGINT PRIMARY KEY AUTO_INCREMENT. SIG_1 VARCHAR(20). CREATE TABLE ENCOUNTER_MEDICATION_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). MODULE_NAME VARCHAR(100) NOT NULL. CID BIGINT REFERENCES CLINICMASTER(CID). SIG_3 VARCHAR(20). ORDERNAME VARCHAR(128). NATURE VARCHAR(30). NOTE VARCHAR(512) )TYPE=MYISAM. PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). DESCRIPTION VARCHAR(512) )TYPE=MYISAM. ICD VARCHAR(256). PATIENTID BIGINT REFERENCES PATIENTMASTER(PATIENTID). ALTER TABLE ENCOUNTER_MEDICATION_LIST ADD ENCOUNTERID INT. CODE VARCHAR(128). CID BIGINT REFERENCES CLINICMASTER(CID). . MEDICATIONNAME VARCHAR(512). DIAGNOSIS VARCHAR(256). PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). ENCOUNTER_NO INT. CREATE TABLE ENCOUNTER_MASTER_DIAGNOSIS_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. DATE_TIME TIMESTAMP. SL_NO INT.

INSERT INTO MODULES(MODULE_NAME) VALUES("City Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Folder Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Provider Master Data"). FIELD_NAME Varchar(128) )TYPE=MYISAM. INSERT INTO MODULES(MODULE_NAME) VALUES("Allergy Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("ICDCode Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Immunization Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Vaccine Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Insurance Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Directive Information Master Data"). OLDVALUE VARCHAR(1024). RECORD_ID LONG. INSERT INTO MODULES(MODULE_NAME) VALUES("Designation Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Language Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Directive Advanced Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Medication Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Plan Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Country Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("File Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Diagnosis Master Data"). USER_ID LONG. INSERT INTO MODULES(MODULE_NAME) VALUES("MaritalStatus Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Pharmacy Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Laborder Master Data"). . CREATE TABLE MODULES ( MODULE_NAME VARCHAR(100) NOT NULL )TYPE=MYISAM. INSERT INTO MODULES(MODULE_NAME) VALUES("Race Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("State Master Data").ACTION_TYPE VARCHAR(20).

PHONE1 VARCHAR(20). INSERT INTO MODULES(MODULE_NAME) VALUES("Immunization History Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Allergy History Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("History Data"). FROMID BIGINT REFERENCES USERMASTER (USERID). INSERT INTO MODULES(MODULE_NAME) VALUES("Reaction Master Data"). CREATE TABLE MESSAGE( MESSAGEID BIGINT PRIMARY KEY AUTO_INCREMENT. PHONE2 VARCHAR(20). INSERT INTO MODULES(MODULE_NAME) VALUES("Past Surgical Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Social History Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Family History Data").INSERT INTO MODULES(MODULE_NAME) VALUES("Exempt Reason Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Family History Master Data"). EMAIL VARCHAR(50). INSERT INTO MODULES(MODULE_NAME) VALUES("Problem Nature Master Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Demographic Master Data"). TOID BIGINT REFERENCES USERMASTER (USERID). INSERT INTO MODULES(MODULE_NAME) VALUES("Medication History Data"). PHARMACYNAME VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. PHARMACYID BIGINT PRIMARY KEY AUTO_INCREMENT. ADDRESS VARCHAR(256). CID BIGINT REFERENCES CLINICMASTER(CID). CITYID BIGINT REFERENCES CITYMASTER(CITYID). ZIP VARCHAR(20). INSERT INTO MODULES(MODULE_NAME) VALUES("Social History Data"). DATED TIMESTAMP. VIEWED BOOLEAN . INSERT INTO MODULES(MODULE_NAME) VALUES("Problem History Data"). INSERT INTO MODULES(MODULE_NAME) VALUES("Past Medication History Master Data"). CREATE TABLE PHARMACYMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). INSERT INTO MODULES(MODULE_NAME) VALUES("EMCode Master Data"). FAX VARCHAR(50). INSERT INTO MODULES(MODULE_NAME) VALUES("Problem Status Master Data"). MESSAGE VARCHAR(1024).

ENCOUNTERID INT REFERENCES ENCOUNTERMASTER(ENCOUNTER_NO) )TYPE=MYISAM. ICD VARCHAR(256). ENFOLLOWID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE FILEMASTER ( FILEID BIGINT PRIMARY KEY AUTO_INCREMENT. FILENAME VARCHAR(50).)TYPE=MYISAM. CREATE TABLE ENCOUNTER_MASTER_PROBLEM_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. FOLDERID BIGINT REFERENCES FOLDERMASTER(FOLDERID) ON DELETE CASCADE. ENJOINID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE FOLDERMASTER ( FOLDERID BIGINT PRIMARY KEY AUTO_INCREMENT. DATED TIMESTAMP. CREATE TABLE ROSMASTER ( . FOLDERNAME VARCHAR(50). CREATE TABLE ENJOINMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DESCRIPTION VARCHAR(1028). ACTIVE BOOLEAN )TYPE=MYISAM. ENJOINNAME VARCHAR(128). CREATE TABLE ALERTS( ALERTID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. SL_NO INT. ONSET VARCHAR(15). MESSAGE VARCHAR(1024) )TYPE=MYISAM. CREATE TABLE ENFOLLOWMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ENFOLLOWNAME VARCHAR(128). CID BIGINT REFERENCES CLINICMASTER(CID). CID BIGINT REFERENCES CLINICMASTER(CID). USERID BIGINT REFERENCES USERMASTER (USERID). DATE_TIME TIMESTAMP )TYPE=MYISAM. COMMENTS VARCHAR(512). DATE_TIME TIMESTAMP )TYPE=MYISAM. PATIENTID BIGINT REFERENCES PATIENTMASTER(PATIENTID). NATURE VARCHAR(30). CID BIGINT REFERENCES CLINICMASTER(CID).

CREATE TABLE ALLERGY_MASTER_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. REACTIONTIME VARCHAR(128). CREATE TABLE ROSLISTMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE PEMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). PELISTNAME VARCHAR(256). DESCRIPTION VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. PEID BIGINT REFERENCES PEMASTER(PEID) ON DELETE CASCADE. REACTIONTYPE VARCHAR(128). PESUBLISTNAME VARCHAR(256). ROSID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. ALLERGYID BIGINT REFERENCES ALLERGYMASTER(ALLERGYID). ROSLISTID BIGINT PRIMARY KEY AUTO_INCREMENT. SL_NO INT. REACTIONDATE VARCHAR(128). . STATUS VARCHAR(20). PENAME VARCHAR(128). ACTIVE BOOLEAN )TYPE=MYISAM. PELISTID BIGINT REFERENCES PELIOSTMASTER(PELISTID) ON DELETE CASCADE. CREATE TABLE HISTORY_IMAGE_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. PELISTID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE PESUBLISTMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CID BIGINT REFERENCES CLINICMASTER(CID). PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). ROSNAME VARCHAR(128). ROSID BIGINT REFERENCES ROSMASTER(ROSID) ON DELETE CASCADE. PEID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. CREATE TABLE PELISTMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ACTIVE BOOLEAN )TYPE=MYISAM. ROSLISTNAME VARCHAR(256). PEID BIGINT REFERENCES PEMASTER(PEID) ON DELETE CASCADE. PESUBLISTID BIGINT PRIMARY KEY AUTO_INCREMENT.CID BIGINT REFERENCES CLINICMASTER(CID).

IMAGENAME vARCHAR(128) )TYPE=MYISAM. ACTIVE BOOLEAN )TYPE=MYISAM.PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). . SL_NO INT. CREATE TABLE PROVIDERMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). ENCOUNTER_NO INT. DOB VARCHAR(10). EMID BIGINT PRIMARY KEY AUTO_INCREMENT. ZIP2 VARCHAR(15). EMDESC VARCHAR(256). CITYID2 BIGINT REFERENCES CITYMASTER(CITYID). CREATE TABLE ENCOUNTER_VITALS_LIST ( ID BIGINT PRIMARY KEY AUTO_INCREMENT. EN_VITALS VARCHAR(128). QUALIFICATION VARCHAR(256). PHONE2 VARCHAR(15). FIRSTNAME VARCHAR(50). LASTNAME VARCHAR(50). SSN VARCHAR(20). PROVIDERID BIGINT PRIMARY KEY AUTO_INCREMENT. CREATE TABLE EMMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). PHONE1 VARCHAR(15). EMCODE VARCHAR(20). PATIENTID BIGINT REFERENCES DEMOGRAPHICSMASTER(PATIENTID). CREATE TABLE REACTIONMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). CID BIGINT REFERENCES CLINICMASTER(CID). EN_TIME VARCHAR(50) )TYPE=MYISAM. ADDRESS1 VARCHAR(256). REACTIONID BIGINT PRIMARY KEY AUTO_INCREMENT. ZIP1 VARCHAR(15). ADDRESS2 VARCHAR(256). ACTIVE BOOLEAN )TYPE=MYISAM. EN_DESC VARCHAR(512). CITYID1 BIGINT REFERENCES CITYMASTER(CITYID). GENDER VARCHAR(10). EMAILID1 VARCHAR(50). EMAILID2 VARCHAR(50). REACTIONNAME VARCHAR(256). SPECIALIZATION VARCHAR(256).

SESSION1_IN4 BIGINT. DEPARTNAME VARCHAR(256). DAY4 BOOLEAN. SESSION2_OUT1 BIGINT. SESSION1_IN1 BIGINT(20). SESSION2_OUT2 BIGINT. ACTIVE BOOLEAN )TYPE=MYISAM. SESSION2_IN1 BIGINT. ROLE_SCHEDULE BOOLEAN. CID BIGINT REFERENCES CLINICMASTER(CID). CREATE TABLE PROVIDER_SCHEDULE ( PSID BIGINT PRIMARY KEY AUTO_INCREMENT.PHOTO VARCHAR(128). DEPARTID BIGINT PRIMARY KEY AUTO_INCREMENT. SESSION2_IN4 BIGINT. ACTIVE BOOLEAN )TYPE=MYISAM. SSLOTID BIGINT PRIMARY KEY AUTO_INCREMENT. ACTIVE BOOLEAN )TYPE=MYISAM. DEPARTID BIGINT. DAY1 BOOLEAN. CREATE TABLE SSLOTMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). DATED TIMESTAMP NULL DEFAULT NULL. SESSION1_IN2 BIGINT. DAY3 BOOLEAN. DATED TIMESTAMP NULL DEFAULT NULL. . SESSION2_OUT4 BIGINT. SESSION2_OUT3 BIGINT. CREATE TABLE DEPARTMENTMASTER ( CID BIGINT REFERENCES CLINICMASTER(CID). SESSION1_OUT2 BIGINT. SESSION2_IN3 BIGINT. DAY2 BOOLEAN. SESSION2_IN2 BIGINT. SSLOTNAME VARCHAR(256). SESSION1_IN3 BIGINT. SESSION1_OUT3 BIGINT. SESSION1_OUT4 BIGINT. SESSION1_OUT1 BIGINT(20).

SESSION1_IN7 BIGINT(20). SESSION1_IN5 BIGINT. SESSION2_OUT7 BIGINT(20) )TYPE=MYISAM. SCDATE VARCHAR(10). SSLOTID BIGINT.DAY5 BOOLEAN. SESSION2_IN7 BIGINT(20). SESSION2_IN6 BIGINT. SESSION1_OUT6 BIGINT. PROVIDERID BIGINT. SESSION2_IN5 BIGINT. PHONE VARCHAR(20). ACTIVE BOOLEAN )TYPE=MYISAM. REASON VARCHAR(256). SESSION1_OUT5 BIGINT. CREATE TABLE APPOINTMENT ( AID BIGINT PRIMARY KEY AUTO_INCREMENT. FIRSTNAME VARCHAR(256). SSN VARCHAR(20). CID BIGINT REFERENCES CLINICMASTER(CID). SESSION2_OUT5 BIGINT. . SESSION1_IN6 BIGINT. DAY6 BOOLEAN. LASTNAME VARCHAR(256). SESSION1_OUT7 BIGINT(20). PATIENTID BIGINT. DAY7 BOOLEAN. SESSION2_OUT6 BIGINT.