Skip to content

Commit 7860cc5

Browse files
Adding defog Derm treatment database data and questions (#410)
Co-authored-by: knassre-bodo <[email protected]>
1 parent c2405ac commit 7860cc5

File tree

164 files changed

+4992
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+4992
-16
lines changed

demos/notebooks/1_introduction.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
44-
"pydough.active_session.load_metadata_graph(\"../metadata/tpch_demo_graph.json\", \"TPCH\");"
44+
"pydough.active_session.load_metadata_graph(\"../metadata/tpch_demo_graph.json\", \"TPCH\")"
4545
]
4646
},
4747
{
@@ -280,7 +280,7 @@
280280
],
281281
"metadata": {
282282
"kernelspec": {
283-
"display_name": "Python 3 (ipykernel)",
283+
"display_name": "PyDough",
284284
"language": "python",
285285
"name": "python3"
286286
},

tests/gen_data/init_defog_mysql.sql

Lines changed: 272 additions & 0 deletions
Large diffs are not rendered by default.

tests/gen_data/init_defog_sqlite.sql

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,263 @@ INSERT INTO payments_made (_id, vendor_name, payment_date, payment_amount, payme
606606
(15, 'Ford Supplier Co', DATE('now', '-2 days'), 22000.00, 'bank_transfer', 'INV-015', DATE('now', '-7 days'), DATE('now', '+23 days')),
607607
(16, 'Tesla Parts Inc', DATE('now', '-1 day'), 15000.00, 'credit_card', 'INV-016', DATE('now', '-6 days'), DATE('now', '+24 days')),
608608
(17, 'Chevrolet Auto', DATE('now'), 20000.00, 'bank_transfer', 'INV-017', DATE('now', '-5 days'), DATE('now', '+25 days'));
609+
610+
611+
-------------------------------------------------------------------------------
612+
--DERM TREATMENT SCHEMA
613+
614+
-- doctor dimension table
615+
CREATE TABLE doctors (
616+
doc_id INTEGER PRIMARY KEY,
617+
first_name VARCHAR(50),
618+
last_name VARCHAR(50),
619+
specialty VARCHAR(50),
620+
year_reg INT,
621+
med_school_name VARCHAR(100),
622+
loc_city VARCHAR(50),
623+
loc_state CHAR(2),
624+
loc_zip VARCHAR(10),
625+
bd_cert_num VARCHAR(20)
626+
);
627+
628+
-- patient dimension table
629+
CREATE TABLE patients (
630+
patient_id INTEGER PRIMARY KEY,
631+
first_name VARCHAR(50),
632+
last_name VARCHAR(50),
633+
date_of_birth DATE,
634+
date_of_registration DATE,
635+
gender VARCHAR(10),
636+
email VARCHAR(100),
637+
phone VARCHAR(20),
638+
addr_street VARCHAR(100),
639+
addr_city VARCHAR(50),
640+
addr_state CHAR(2),
641+
addr_zip VARCHAR(10),
642+
ins_type VARCHAR(50),
643+
ins_policy_num VARCHAR(20),
644+
height_cm FLOAT,
645+
weight_kg FLOAT
646+
);
647+
648+
-- drug dimension table
649+
CREATE TABLE drugs (
650+
drug_id INTEGER PRIMARY KEY,
651+
drug_name VARCHAR(100),
652+
manufacturer VARCHAR(100),
653+
drug_type VARCHAR(50),
654+
moa VARCHAR(100),
655+
fda_appr_dt DATE,
656+
admin_route VARCHAR(50),
657+
dos_amt DECIMAL(10,2),
658+
dos_unit VARCHAR(20),
659+
dos_freq_hrs INT,
660+
ndc VARCHAR(20)
661+
);
662+
663+
-- diagnosis dimension table
664+
CREATE TABLE diagnoses (
665+
diag_id INTEGER PRIMARY KEY,
666+
diag_code VARCHAR(10),
667+
diag_name VARCHAR(100),
668+
diag_desc VARCHAR(255)
669+
);
670+
671+
-- treatment fact table
672+
CREATE TABLE treatments (
673+
treatment_id INTEGER PRIMARY KEY,
674+
patient_id INT,
675+
doc_id INT,
676+
drug_id INT,
677+
diag_id INT,
678+
start_dt DATE,
679+
end_dt DATE,
680+
is_placebo BOOLEAN,
681+
tot_drug_amt DECIMAL(10,2),
682+
drug_unit VARCHAR(20),
683+
FOREIGN KEY (patient_id) REFERENCES patients(patient_id),
684+
FOREIGN KEY (doc_id) REFERENCES doctors(doc_id),
685+
FOREIGN KEY (drug_id) REFERENCES drugs(drug_id),
686+
FOREIGN KEY (diag_id) REFERENCES diagnoses(diag_id)
687+
);
688+
689+
-- outcome fact table
690+
CREATE TABLE outcomes (
691+
outcome_id INTEGER PRIMARY KEY,
692+
treatment_id INT,
693+
assess_dt DATE,
694+
day7_lesion_cnt INT,
695+
day30_lesion_cnt INT,
696+
day100_lesion_cnt INT,
697+
day7_pasi_score DECIMAL(4,1),
698+
day30_pasi_score DECIMAL(4,1),
699+
day100_pasi_score DECIMAL(4,1),
700+
day7_tewl DECIMAL(5,2),
701+
day30_tewl DECIMAL(5,2),
702+
day100_tewl DECIMAL(5,2),
703+
day7_itch_vas INT,
704+
day30_itch_vas INT,
705+
day100_itch_vas INT,
706+
day7_hfg DECIMAL(4,1),
707+
day30_hfg DECIMAL(4,1),
708+
day100_hfg DECIMAL(4,1),
709+
FOREIGN KEY (treatment_id) REFERENCES treatments(treatment_id)
710+
);
711+
712+
CREATE TABLE adverse_events (
713+
id INTEGER PRIMARY KEY,
714+
treatment_id INT,
715+
reported_dt DATE,
716+
description VARCHAR(255),
717+
FOREIGN KEY (treatment_id) REFERENCES treatments(treatment_id)
718+
);
719+
720+
CREATE TABLE concomitant_meds (
721+
id INTEGER PRIMARY KEY,
722+
treatment_id INT,
723+
med_name VARCHAR(100),
724+
start_dt DATE,
725+
end_dt DATE,
726+
dose_amt DECIMAL(10,2),
727+
dose_unit VARCHAR(20),
728+
freq_hrs INT,
729+
FOREIGN KEY (treatment_id) REFERENCES treatments(treatment_id)
730+
);
731+
732+
-- insert into dimension tables first
733+
734+
INSERT INTO doctors (doc_id, first_name, last_name, specialty, year_reg, med_school_name, loc_city, loc_state, loc_zip, bd_cert_num)
735+
VALUES
736+
(1, 'John', 'Doe', 'dermatology', 2023, 'Johns Hopkins University', 'Baltimore', 'MD', '21201', 'ABC123'),
737+
(2, 'Jane', 'Smith', 'immunology', 2023, 'Harvard Medical School', 'Boston', 'MA', '02115', 'XYZ789'),
738+
(3, 'David', 'Johnson', 'general', 1998, 'University of Pennsylvania', 'Philadelphia', 'PA', '19104', 'DEF456'),
739+
(4, 'Emily', 'Brown', 'dermatology', 2015, 'Stanford University', 'Palo Alto', 'CA', '94304', 'GHI012'),
740+
(5, 'Michael', 'Davis', 'immunology', 2008, 'Duke University', 'Durham', 'NC', '27708', 'JKL345'),
741+
(6, 'Sarah', 'Wilson', 'oncology', 2024, 'University of California, San Francisco', 'San Francisco', 'CA', '94143', 'MNO678'),
742+
(7, 'Robert', 'Taylor', 'dermatology', 2012, 'Yale University', 'New Haven', 'CT', '06510', 'PQR901'),
743+
(8, 'Laura', 'Martinez', 'immunology', 2006, 'University of Michigan', 'Ann Arbor', 'MI', '48109', 'STU234'),
744+
(9, 'Daniel', 'Garcia', 'general', 2022, 'University of Chicago', 'Chicago', 'IL', '60637', 'VWX567'),
745+
(10, 'Olivia', 'Anderson', 'dermatology', 2018, 'Columbia University', 'New York', 'NY', '10027', 'YZA890');
746+
747+
INSERT INTO patients (patient_id, first_name, last_name, date_of_birth, date_of_registration, gender, email, phone, addr_street, addr_city, addr_state, addr_zip, ins_type, ins_policy_num, height_cm, weight_kg)
748+
VALUES
749+
(1, 'Alice', 'Johnson', '1985-03-15', '2023-01-03', 'Female', '[email protected]', '555-123-4567', '123 Main St', 'Anytown', 'CA', '12345', 'private', 'ABC123456', 165, 60),
750+
(2, 'Bob', 'Smith', '1978-11-23', '2023-01-10', 'Male', '[email protected]', '555-987-6543', '456 Oak Ave', 'Somecity', 'NY', '54321', 'medicare', 'XYZ789012', 180, 85),
751+
(3, 'Carol', 'Davis', '1992-07-08', '2022-01-03', 'Female', '[email protected]', '555-246-8135', '789 Elm Rd', 'Anothercity', 'TX', '67890', 'private', 'DEF345678', 158, 52),
752+
(4, 'David', 'Wilson', '1965-09-30', '2022-07-12', 'Male', '[email protected]', '555-369-2580', '321 Pine Ln', 'Somewhere', 'FL', '13579', 'medicaid', 'GHI901234', 175, 78),
753+
(5, 'Eve', 'Brown', '2000-01-01', '2023-08-03', 'Female', '[email protected]', '555-147-2589', '654 Cedar St', 'Nowhere', 'WA', '97531', 'uninsured', NULL, 160, 55),
754+
(6, 'Frank', 'Taylor', '1988-05-12', '2021-12-21', 'Male', '[email protected]', '555-753-9514', '987 Birch Dr', 'Anyplace', 'CO', '24680', 'private', 'JKL567890', 183, 90),
755+
(7, 'Grace', 'Anderson', '1975-12-25', '2023-09-04', 'Others', '[email protected]', '555-951-7532', '159 Maple Rd', 'Somewhere', 'OH', '86420', 'medicare', 'MNO246810', 170, 68),
756+
(8, 'Hannah', 'Garcia', '1982-08-05', '2023-03-23', 'Female', '[email protected]', '555-369-1470', '753 Walnut Ave', 'Somewhere', 'CA', '97531', 'private', 'PQR135790', 162, 57),
757+
(9, 'Isaac', 'Martinez', '1995-02-18', '2021-11-13', 'Male', '[email protected]', '555-147-8520', '951 Spruce Blvd', 'Anytown', 'TX', '13579', 'medicaid', 'STU024680', 178, 82),
758+
(10, 'John', 'Richter', '1980-01-01', '2021-11-24', 'Male', '[email protected]', '555-123-4567', '123 Main St', 'Anytown', 'CA', '12345', 'private', 'ABC123456', 180, 80),
759+
(11, 'Kelly', 'Smith', '1985-05-15', '2024-02-28', 'Female', '[email protected]', '555-987-6543', '456 Oak Ave', 'Somecity', 'NY', '54321', 'medicare', 'XYZ789012', 165, 60);
760+
761+
INSERT INTO drugs (drug_id, drug_name, manufacturer, drug_type, moa, fda_appr_dt, admin_route, dos_amt, dos_unit, dos_freq_hrs, ndc)
762+
VALUES
763+
(1, 'Drugalin', 'Pharma Inc', 'biologic', 'TNF-alpha inhibitor', '2010-01-15', 'injection', 40, 'mg', 336, '12345-678-90'),
764+
(2, 'Medicol', 'Acme Pharma', 'small molecule', 'IL-17A inhibitor', '2015-06-30', 'oral', 30, 'mg', 24, '54321-012-34'),
765+
(3, 'Topizol', 'BioMed Ltd', 'topical', 'PDE4 inhibitor', '2018-11-01', 'topical', 15, 'g', 12, '98765-432-10'),
766+
(4, 'Biologic-X', 'Innova Biologics', 'biologic', 'IL-23 inhibitor', NULL, 'injection', 100, 'mg', 672, '13579-246-80'),
767+
(5, 'Smallazine', 'Chem Co', 'small molecule', 'JAK inhibitor', '2020-03-15', 'oral', 5, 'mg', 24, '97531-864-20'),
768+
(6, 'Topicort', 'Derma Rx', 'topical', 'Corticosteroid', '2005-09-30', 'topical', 30, 'g', 12, '24680-135-79'),
769+
(7, 'Biologic-Y', 'BioPharm Inc', 'biologic', 'IL-12/23 inhibitor', '2012-07-01', 'injection', 50, 'mg', 504, '75319-951-46'),
770+
(8, 'Smallitol', 'PharmaGen', 'small molecule', 'IL-6 inhibitor', '2017-04-15', 'oral', 10, 'mg', 24, '36915-258-07'),
771+
(9, 'Topicalin', 'DermiCare', 'topical', 'Calcineurin inhibitor', '2019-10-01', 'topical', 20, 'g', 12, '14785-369-02'),
772+
(10, 'Biologic-Z', 'BioMed Ltd', 'biologic', 'IL-17F inhibitor', '2021-01-01', 'injection', 80, 'mg', 336, '95146-753-19');
773+
774+
INSERT INTO diagnoses (diag_id, diag_code, diag_name, diag_desc)
775+
VALUES
776+
(1, 'L40.0', 'Psoriasis vulgaris', 'Plaque psoriasis, the most common form'),
777+
(2, 'L40.1', 'Generalized pustular psoriasis', 'Widespread pustules on top of red skin'),
778+
(3, 'L40.4', 'Guttate psoriasis', 'Small, teardrop-shaped lesions'),
779+
(4, 'L40.8', 'Other psoriasis', 'Includes flexural, erythrodermic, and other rare types'),
780+
(5, 'L40.9', 'Psoriasis, unspecified', 'Psoriasis not further specified'),
781+
(6, 'L40.50', 'Arthropathic psoriasis, unspecified', 'Psoriatic arthritis, unspecified'),
782+
(7, 'L40.51', 'Distal interphalangeal psoriatic arthropathy', 'Psoriatic arthritis mainly affecting the ends of fingers and toes'),
783+
(8, 'L40.52', 'Psoriatic arthritis mutilans', 'Severe, deforming psoriatic arthritis'),
784+
(9, 'L40.53', 'Psoriatic spondylitis', 'Psoriatic arthritis of the spine'),
785+
(10, 'L40.59', 'Other psoriatic arthropathy', 'Other specified types of psoriatic arthritis');
786+
787+
-- insert into fact tables
788+
INSERT INTO treatments (treatment_id, patient_id, doc_id, drug_id, diag_id, start_dt, end_dt, is_placebo, tot_drug_amt, drug_unit)
789+
VALUES
790+
(1, 1, 1, 1, 1, '2022-01-01', '2022-06-30', 0, 240, 'mg'),
791+
(2, 2, 2, 2, 2, '2022-02-15', '2022-08-14', 1, 180, 'mg'),
792+
(3, 3, 3, 3, 3, '2022-03-10', '2022-09-09', 0, 360, 'g'),
793+
(4, 4, 4, 4, 4, '2022-04-01', NULL, 0, 200, 'mg'),
794+
(5, 5, 5, 5, 5, '2022-05-01', '2022-10-31', 0, 180, 'mg'),
795+
(6, 6, 6, 6, 6, '2022-06-15', '2022-12-14', 0, 720, 'g'),
796+
(7, 1, 7, 1, 7, '2022-07-01', '2022-12-31', 1, 240, 'mg'),
797+
(8, 2, 1, 2, 8, '2022-08-01', '2023-01-31', 0, 180, 'mg'),
798+
(9, 3, 2, 3, 9, '2022-09-01', '2023-02-28', 0, 360, 'g'),
799+
(10, 4, 3, 4, 10, '2022-10-01', NULL, 1, 0, NULL),
800+
(11, 5, 4, 5, 1, '2022-11-01', '2023-04-30', 1, 180, 'mg'),
801+
(12, 6, 5, 6, 2, '2022-12-01', '2023-05-31', 0, 720, 'g'),
802+
(13, 7, 6, 1, 3, '2023-01-01', '2023-06-30', 0, 240, 'mg'),
803+
(14, 1, 7, 2, 4, '2023-02-01', '2023-07-31', 0, 180, 'mg'),
804+
(15, 2, 1, 3, 5, '2023-03-01', '2023-08-31', 0, 360, 'g'),
805+
(16, 1, 2, 4, 6, date('now', 'start of month', '-24 months'), date('now', 'start of month', '-2 months'), 0, 300, 'mg'),
806+
(17, 2, 5, 1, 8, date('now', 'start of month', '-12 months'), date('now', 'start of month', '-4 months'), 0, 80, 'mg'),
807+
(18, 3, 6, 2, 9, date('now', 'start of month', '-5 months'), NULL, 1, 200, 'mg'),
808+
(19, 1, 7, 3, 10, date('now', 'start of month', '-4 months'), NULL, 0, 150, 'g'),
809+
(20, 2, 1, 4, 1, date('now', 'start of month', '-3 months'), NULL, 0, 100, 'mg'),
810+
(21, 3, 2, 5, 2, date('now', 'start of month', '-2 months'), NULL, 0, 250, 'mg'),
811+
(22, 1, 3, 6, 3, date('now', 'start of month', '-1 month'), NULL, 0, 300, 'g'),
812+
(23, 2, 4, 1, 4, date('now'), NULL, 1, 200, 'mg'),
813+
(24, 3, 5, 2, 5, date('now'), NULL, 0, 150, 'mg'),
814+
(25, 9, 1, 1, 1, case when strftime('%d', 'now', '-6 months') = strftime('%d', 'now') then date('now', '-6 months') else date('now', '-6 months', '-' || (strftime('%d', 'now', '-6 months')) || ' days') end, case when strftime('%d', 'now', '-3 months') = strftime('%d', 'now') then date('now', '-3 months') else date('now', '-3 months', '-' || (strftime('%d', 'now', '-3 months')) || ' days') end, 0, 240, 'mg'),
815+
(26, 10, 2, 2, 2, case when strftime('%d', 'now', '-5 months') = strftime('%d', 'now') then date('now', '-5 months') else date('now', '-5 months', '-' || (strftime('%d', 'now', '-6 months')) || ' days') end, case when strftime('%d', 'now', '-2 months') = strftime('%d', 'now') then date('now', '-2 months') else date('now', '-2 months', '-' || (strftime('%d', 'now', '-2 months')) || ' days') end, 0, 180, 'mg');
816+
817+
INSERT INTO outcomes (outcome_id, treatment_id, assess_dt, day7_lesion_cnt, day30_lesion_cnt, day100_lesion_cnt, day7_pasi_score, day30_pasi_score, day100_pasi_score, day7_tewl, day30_tewl, day100_tewl, day7_itch_vas, day30_itch_vas, day100_itch_vas, day7_hfg, day30_hfg, day100_hfg)
818+
VALUES
819+
(1, 1, '2022-01-08', 20, 15, 5, 12.5, 8.2, 2.1, 18.2, 15.6, 12.1, 60, 40, 20, 1.5, 2.5, 4.0),
820+
(2, 2, '2022-02-22', 25, 18, 8, 15.0, 10.1, 3.5, 20.1, 17.2, 13.5, 70, 50, 30, 1.0, 2.0, 3.5),
821+
(3, 3, '2022-03-17', 18, 12, 3, 10.8, 6.4, 1.2, 16.5, 14.0, 10.8, 55, 35, 15, 2.0, 3.0, 4.5),
822+
(4, 4, '2022-04-08', 30, 25, 12, 18.2, 13.9, 5.8, 22.4, 19.1, 15.2, 80, 60, 40, 0.5, 1.5, 3.0),
823+
(5, 5, '2022-05-08', 22, 16, 6, 13.1, 8.7, 2.6, 19.0, 16.3, 12.7, 65, 45, 25, 1.2, 2.2, 3.8),
824+
(6, 6, '2022-06-22', 28, 21, 10, 16.7, 11.5, 4.3, 21.3, 18.1, 14.3, 75, 55, 35, 0.8, 1.8, 3.3),
825+
(7, 7, '2022-07-08', 19, 13, 4, 11.2, 6.9, 1.5, 17.1, 14.5, 11.2, 58, 38, 18, 1.8, 2.8, 4.3),
826+
(8, 8, '2022-08-08', 26, 19, 9, 15.6, 10.6, 3.8, 20.7, 17.6, 13.9, 72, 52, 32, 0.7, 1.7, 3.2),
827+
(9, 9, '2022-09-08', 21, 15, 5, 12.3, 8.0, 2.0, 18.6, 15.9, 12.4, 62, 42, 22, 1.4, 2.4, 3.9),
828+
(10, 10, '2022-10-08', 32, 30, 25, 19.5, 17.8, 14.1, 23.2, 21.4, 18.7, 85, 80, 70, 0.2, 0.4, 0.8),
829+
(11, 11, '2022-11-08', 23, 17, 7, 13.7, 9.2, 2.9, 19.5, 16.8, 13.1, 68, 48, 28, 1.1, 2.1, 3.6),
830+
(12, 12, '2022-12-08', 29, 23, 11, 17.4, 12.3, 4.9, 21.8, 18.7, 14.8, 78, 58, 38, 0.6, 1.6, 3.1),
831+
(13, 13, '2023-01-08', 18, 12, 3, 10.5, 6.1, 1.0, 16.9, 14.3, 11.0, 56, 36, 16, 1.9, 2.9, 4.4),
832+
(14, 14, '2023-02-08', 27, 20, 10, 16.2, 11.1, 4.1, 21.0, 17.9, 14.1, 74, 54, 34, 0.5, 1.5, 3.0),
833+
(15, 15, '2023-03-08', 20, 14, 4, 11.8, 7.3, 1.7, 17.8, 15.2, 11.8, 60, 40, 20, 1.6, 2.6, 4.1),
834+
(16, 16, date('now', '-5 months', 'start of month', '+7 day'), 24, 18, 8, 14.4, 9.6, 3.2, 20.4, 17.4, 13.7, 70, 50, 30, 0.9, 1.9, 3.4),
835+
(17, 17, date('now', '-1 month', 'start of month', '+7 day'), 22, 16, NULL, 13.2, 8.8, NULL, 19.1, 16.3, NULL, 65, 45, NULL, 1.3, 2.3, NULL),
836+
(18, 25, date('now', '-6 months', '+7 day'), 30, NULL, NULL, 18.0, NULL, NULL, 22.0, NULL, NULL, 80, NULL, NULL, 1.0, NULL, NULL),
837+
(19, 25, date('now', '-2 months'), 30, 18, 10, 18.0, 12.0, 4.0, 22.0, 19.0, 15.0, 80, 60, 40, 1.0, 2.0, 3.0),
838+
(20, 26, date('now', '-5 months', '+7 day'), 25, NULL, NULL, 15.0, NULL, NULL, 20.0, NULL, NULL, 75, NULL, NULL, 0.5, NULL, NULL),
839+
(21, 26, date('now', '-1 month'), 25, 18, 10, 15.0, 10.0, 5.0, 20.0, 17.0, 13.0, 75, 55, 35, 0.5, 1.5, 3.0);
840+
841+
INSERT INTO adverse_events (id, treatment_id, reported_dt, description)
842+
VALUES
843+
(1, 1, '2022-01-15', 'Mild injection site reaction'),
844+
(2, 2, '2022-02-28', 'Headache, nausea'),
845+
(3, 4, '2022-04-10', 'Severe allergic reaction, hospitalization required'),
846+
(4, 5, '2022-05-20', 'Upper respiratory infection'),
847+
(5, 7, '2022-07-22', 'Mild injection site reaction'),
848+
(6, 9, '2022-09-18', 'Diarrhea'),
849+
(7, 11, '2022-11-12', 'Elevated liver enzymes'),
850+
(8, 14, '2023-02-05', 'Mild skin rash');
851+
852+
INSERT INTO concomitant_meds (id, treatment_id, med_name, start_dt, end_dt, dose_amt, dose_unit, freq_hrs)
853+
VALUES
854+
(1, 1, 'Acetaminophen', '2022-01-01', '2022-01-07', 500, 'mg', 6),
855+
(2, 1, 'Ibuprofen', '2022-01-08', '2022-01-14', 200, 'mg', 8),
856+
(3, 2, 'Loratadine', '2022-02-15', '2022-03-15', 10, 'mg', 24),
857+
(4, 3, 'Multivitamin', '2022-03-10', NULL, 1, 'tablet', 24),
858+
(5, 4, 'Epinephrine', '2022-04-10', '2022-04-10', 0.3, 'mg', NULL),
859+
(6, 4, 'Diphenhydramine', '2022-04-10', '2022-04-17', 50, 'mg', 6),
860+
(7, 5, 'Amoxicillin', '2022-05-20', '2022-05-30', 500, 'mg', 8),
861+
(8, 6, 'Calcium supplement', '2022-06-15', NULL, 600, 'mg', 24),
862+
(9, 7, 'Acetaminophen', '2022-07-15', '2022-07-21', 500, 'mg', 6),
863+
(10, 8, 'Cetirizine', '2022-08-01', '2022-08-14', 10, 'mg', 24),
864+
(11, 9, 'Loperamide', '2022-09-18', '2022-09-20', 4, 'mg', 6),
865+
(12, 11, 'Ursodiol', '2022-11-30', '2022-12-30', 300, 'mg', 8),
866+
(13, 12, 'Vitamin D', '2022-12-01', NULL, 1000, 'IU', 24),
867+
(14, 13, 'Acetaminophen', '2023-01-08', '2023-01-14', 500, 'mg', 6),
868+
(15, 14, 'Hydrocortisone cream', '2023-02-25', '2023-03-07', 10, 'g', 12);

tests/test_metadata/defog_graphs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@
15641564
{
15651565
"name": "_id",
15661566
"type": "table column",
1567-
"column name": "diagnosis_id",
1567+
"column name": "diag_id",
15681568
"data type": "numeric",
15691569
"description": "The unique identifier for each diagnosis in the system",
15701570
"sample values": [1, 3, 5, 7, 9],
@@ -1646,7 +1646,7 @@
16461646
{
16471647
"name": "diagnosis_id",
16481648
"type": "table column",
1649-
"column name": "diagnosis_id",
1649+
"column name": "diag_id",
16501650
"data type": "numeric",
16511651
"description": "The id of the diagnosis the patient is being treated for",
16521652
"sample values": [2, 4, 5, 6, 8],

tests/test_metadata/mysql_defog_graphs.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@
12001200
{
12011201
"name": "doctors",
12021202
"type": "simple table",
1203-
"table path": "main.doctors",
1203+
"table path": "doctors",
12041204
"unique properties": ["doc_id"],
12051205
"properties": [
12061206
{
@@ -1299,7 +1299,7 @@
12991299
{
13001300
"name": "patients",
13011301
"type": "simple table",
1302-
"table path": "main.patients",
1302+
"table path": "patients",
13031303
"unique properties": ["patient_id", "email", "phone"],
13041304
"properties": [
13051305
{
@@ -1450,7 +1450,7 @@
14501450
{
14511451
"name": "drugs",
14521452
"type": "simple table",
1453-
"table path": "main.drugs",
1453+
"table path": "drugs",
14541454
"unique properties": ["drug_id", "national_drug_code"],
14551455
"properties": [
14561456
{
@@ -1558,13 +1558,13 @@
15581558
{
15591559
"name": "diagnoses",
15601560
"type": "simple table",
1561-
"table path": "main.diagnoses",
1561+
"table path": "diagnoses",
15621562
"unique properties": ["_id", "code", "name"],
15631563
"properties": [
15641564
{
15651565
"name": "_id",
15661566
"type": "table column",
1567-
"column name": "diagnosis_id",
1567+
"column name": "diag_id",
15681568
"data type": "numeric",
15691569
"description": "The unique identifier for each diagnosis in the system",
15701570
"sample values": [1, 3, 5, 7, 9],
@@ -1604,7 +1604,7 @@
16041604
{
16051605
"name": "treatments",
16061606
"type": "simple table",
1607-
"table path": "main.treatments",
1607+
"table path": "treatments",
16081608
"unique properties": ["treatment_id"],
16091609
"properties": [
16101610
{
@@ -1646,7 +1646,7 @@
16461646
{
16471647
"name": "diagnosis_id",
16481648
"type": "table column",
1649-
"column name": "diagnosis_id",
1649+
"column name": "diag_id",
16501650
"data type": "numeric",
16511651
"description": "The id of the diagnosis the patient is being treated for",
16521652
"sample values": [2, 4, 5, 6, 8],
@@ -1701,7 +1701,7 @@
17011701
{
17021702
"name": "outcomes",
17031703
"type": "simple table",
1704-
"table path": "main.outcomes",
1704+
"table path": "outcomes",
17051705
"unique properties": ["outcome_id"],
17061706
"properties": [
17071707
{
@@ -1872,7 +1872,7 @@
18721872
{
18731873
"name": "concomitant_meds",
18741874
"type": "simple table",
1875-
"table path": "main.concomitant_meds",
1875+
"table path": "concomitant_meds",
18761876
"unique properties": ["_id", ["treatment_id", "medicine_name"]],
18771877
"properties": [
18781878
{
@@ -1952,7 +1952,7 @@
19521952
{
19531953
"name": "adverse_events",
19541954
"type": "simple table",
1955-
"table path": "main.adverse_events",
1955+
"table path": "adverse_events",
19561956
"unique properties": ["_id"],
19571957
"properties": [
19581958
{

0 commit comments

Comments
 (0)