PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "Laboratory" (
"ID" INT,
"Date" DATE,
"RNP" TEXT,
"SM" TEXT,
"SSA" TEXT,
PRIMARY KEY ("ID", "Date"),
FOREIGN KEY ("ID") REFERENCES "Patient"("ID")
);

CREATE TABLE "Patient" (
"ID" INT UNIQUE,
"Admission" TEXT,
"Diagnosis" TEXT,
PRIMARY KEY ("ID")
);



INSERT INTO "Patient" VALUES ("1", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("2", "+", "Deep Vein Thrombosis");
INSERT INTO "Patient" VALUES ("3", "-", "Pulmonary Embolism");
INSERT INTO "Patient" VALUES ("4", "+", "Stroke");
INSERT INTO "Patient" VALUES ("5", "-", "Myocardial Infarction");
INSERT INTO "Patient" VALUES ("6", "+", "Thrombophilia");
INSERT INTO "Patient" VALUES ("7", "+", "Venous Thrombosis");
INSERT INTO "Patient" VALUES ("8", "-", "Arterial Thrombosis");
INSERT INTO "Patient" VALUES ("9", "+", "Thrombosis");
INSERT INTO "Patient" VALUES ("10", "+", "Deep Vein Thrombosis");
INSERT INTO "Laboratory" VALUES ("1", "2024-01-10", "-", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("1", "2024-02-15", "+-", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("2", "2024-01-12", "+", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("3", "2024-01-20", "-", "abnormal", "normal");
INSERT INTO "Laboratory" VALUES ("4", "2024-01-25", "+-", "normal", "abnormal");
INSERT INTO "Laboratory" VALUES ("5", "2024-02-01", "+", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("6", "2024-02-05", "-", "abnormal", "abnormal");
INSERT INTO "Laboratory" VALUES ("7", "2024-02-10", "+-", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("8", "2024-02-15", "-", "normal", "normal");
INSERT INTO "Laboratory" VALUES ("9", "2024-02-20", "+", "abnormal", "normal");
INSERT INTO "Laboratory" VALUES ("10", "2024-02-25", "-", "normal", "abnormal");