CREATE TABLE medrecord (
    `Oid` BIGINT(19) NOT NULL AUTO_INCREMENT,
	`Tid` INT(10) DEFAULT NULL,
	`IsActive` TINYINT(1) DEFAULT NULL,
	`Notice` VARCHAR(1024) DEFAULT NULL,
	`InsTs` DATETIME DEFAULT NULL,
	`InsUser` VARCHAR(256) DEFAULT NULL,
	`Version` BIGINT(19) DEFAULT NULL,
	`UdpUser` VARCHAR(256) DEFAULT NULL,
	`SystemEntryID` INT(10) DEFAULT NULL,
    `CustomerOid` BIGINT(19) DEFAULT NULL,
    `EmployeeOid` BIGINT(19) DEFAULT NULL,
    `MedName` VARCHAR(256) DEFAULT NULL,
    `MedDate` DATETIME DEFAULT NULL,
    `DosageFormOid` BIGINT(19) DEFAULT NULL,
    `DosageForm` INT(2) DEFAULT NULL,
    `PrescribingDoctor` VARCHAR(256) DEFAULT NULL,
    KEY `FK_DARFORM2MEDRECORD` (`DosageFormOid`),
    KEY `FK_CUSTOMER2MEDRECORD` (`CustomerOid`),
    KEY `FK_EMPLOYEE2MEDRECORD` (`EmployeeOid`),
    CONSTRAINT `FK_DARFORM2MEDRECORD` FOREIGN KEY (`DosageFormOid`) REFERENCES `medverorddarform` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `FK_CUSTOMER2MEDRECORD` FOREIGN KEY (`CustomerOid`) REFERENCES `Customer` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `FK_EMPLOYEE2MEDRECORD` FOREIGN KEY (`EmployeeOid`) REFERENCES `Employee` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    PRIMARY KEY (`Oid`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=LATIN1;