(
PatientID IDENTITY(1,1) PRIMARY KEY CLUSTERED,
FName Char(25),
MName Char(25),
LName Char(25),
RefBy Char(75),
Age date,
Gender Char(2),
Street Char(100),
City Char(75),
State Char(2),
Zip Char(5),
Phone1 char(20),
Phone2 char(20),
Email char(20)
)
-------------------------------------------------------------------------------------------------------
CREATE TABLE Referrals
(
ReferralID smallint IDENTITY(1,1) PRIMARY KEY CLUSTERED,
PatientID smallint NOT NULL,
RefBy Char(35),
DateVisit date,
HABenefit smallint,
BenefitYN Char(2),
HABenWhom Char(35),
IPA Char(25),
HMO Char(75),
CPTCode Char(25),
ICD9Code Char(25)
CONSTRAINT fk_patientID
FOREIGN KEY (PatientID)
REFERENCES Patients(PatientID)
);
------------------------------------------------------------------------------------------------------
CREATE TABLE financials
(TransactionID smallint IDENTITY(1,1) PRIMARY KEY CLUSTERED,
PatientID smallint NOT NULL,
GrossSale money NOT NULL,
COGS money NOT NULL,
TDate date NOT NULL,
Brand char(25),
Model char(50),
PayMethod char(25),
PayPocketAmt money,
PayInsAmt money,
CONSTRAINT fk_patient
FOREIGN KEY (PatientID)
REFERENCES Patients(PatientID)
);