set search_path = project;


insert into tip_dijabetes(ime)
values
('tip 1')
, ('tip 2');

insert into tip_insulin(ime)
values
('RAPID')
, ('BASAL');

insert into nacin_prigotvuvanje_hrana (ime)
values
('svezho')
, ('zamrznato')
, ('pecheno')
, ('vareno')
, ('dinstano')
, ('przheno')
, ('konzenvirano');

insert into covek(embg, ime, prezime, pol, datum_na_ragjanje)
values
('0101994000000', 'Kristijan', 'Ristovski', 'M', '1994-01-01')
, ('0911996123456', 'Nikola', 'Torbovski', 'M', '1996-11-09')
, ('1809004111111', 'Marija', 'Trajkovska', 'Z', '2004-04-18')
, ('110200299999', 'Luka', 'Markovski', 'M', '2002-02-11')
, ('0606999546872', 'Marionka', 'Japonka', 'Z', '1999-06-06')
, ('1708021333333', 'Nina', 'Jadrovska', 'Z', '2021-08-17');

insert into dijabeticar (id, data_na_otkrivanje, tip_dijabetes_id)
values
(2, '1996-11-09', 1)
, (3, '2010-01-15', 2)
, (6, '2022-09-01', 1);

insert into doktor (id)
values(1)
, (4)
, (5);

insert into datoteka_metapodatoci (ime, hash, opis, mime, tip_datoteka)
values
('zdravstven_rezultat_01_02_2023.pdf', '30e9b774c4691c38f0e3251545d1e238', '', 'application/pdf', 'Z')
, ('faksimil_09_08_2021.pdf', 'f75be9d5c7ee578aeec5fef7005f78a3', '', 'application/pdf', 'F')
, ('faksimil_19_09_2020.pdf', 'a96ef978bcd93a0813000886b09d99b5', 'Faksimil izdaden na 19-09-2020', 'application/pdf', 'F')
, ('zdravstven_rezultat_08_07_2022.pdf', '86e014467d5d5a21645bc17fb4bf328a', 'Opis za zdravstven rezultat...', 'application/pdf', 'Z')
, ('faksimil_07_12_2005.pdf', '0ef75e84f52a9793326dbf3f36fec367', '', 'application/pdf', 'F')
, ('zdravstven_rez_07_01_2001.pdf', '3e7a11c3f47cf8cc55fcf5e7f5bce614', ':)', 'application/pdf', 'Z');

insert into zdrastven_rezultat (id, dijabeticar_id)
values
(1, 2)
, (4, 3)
, (6, 6);

insert into faksimil  (id, doktor_id, dijabeticar_id)
values
(2, 4, 2)
, (3, 4, 2)
, (5, 5, 6);

insert into medikament (ime, proizvoditel, tip_medikament)
values
('Lantus', 'Sanofi Aventis', 'I')
, ('Apidra', 'Sanofi Aventis', 'I')
, ('Novo Rapid', 'Novo Nordisk', 'I')
, ('Tyson Bio AC200', 'Tyson Bioresearch', 'L')
, ('Accu-Chek Active', 'Roche Diabetes Care', 'L')
, ('OneTouch Ultra', 'Lifescan Medical Devices', 'L');


insert into lenti_merenje_shekjer (id)
values
(4)
, (5)
, (6);

insert into insulin (id, tip_insulin_id)
values
(1, 2)
, (2, 1)
, (3, 1);


insert into inventar (dijabeticar_id, medikament_id, rok_na_traenje, kolicina)
values
(2, 1, '2023-05-18', 5)
, (2, 1, '2025-09-17', 4)
, (2, 3, '2022-10-18', 1)
, (3, 5, '2024-12-12', 7)
, (6, 6, '2023-01-19', 13)
, (6, 6, '2023-05-06', 3);

insert into hrana (ime, proizvoditel, glikemiski_indeks, proteini, jaglehidrati, shekjeri, masti, kalorii, nacin_prigotvuvanje_hrana_id)
values
('leb na zar', 'stara furna', 20, 8, 60, 1.3, 1, 300, 3)
, ('leb', 'furna dime', 20, 9, 40, 1, 2, 312, 3)
, ('oriz', 'kamko', 13, 10, 55, 7, 8, 201, 4)
, ('makaroni', 'divela', 7, 11, 51, 8, 3, 135, 3)
, ('tuna', 'blue sea', 1, 22, 13, 2, 18, 400, 7)
, ('kulen', 'zlatibor', 9, 21, 15, 3, 31, 350, 1);

-- 2 3 6
-- '1996-11-09' '2010-01-15' '2022-09-01'

insert into zapis (dijabeticar_id, "data")
values
(2, '1999-02-08')
, (2, '2000-01-01')
, (2, '2001-08-09')
, (3, '2010-05-09')
, (3, '2010-09-09')
, (3, '2012-10-10')
, (6, '2022-10-01')
, (6, '2022-11-10')
, (6, '2022-12-30');

insert into zapis_so_izmeren_sekjer (dijabeticar_id, "data", vrednost)
values
(2, '1999-02-08', 11.5)
,(2, '2000-01-01', 9.8)
, (2, '2001-08-09', 3.1)
, (3, '2010-09-09', 8.1)
, (3, '2012-10-10', 2.3)
, (6, '2022-11-10', 7.9);

insert into zapis_insulin (dijabeticar_id, "data")
values
(2, '1999-02-08')
, (2, '2000-01-01')
, (2, '2001-08-09')
, (3, '2010-09-09')
, (6, '2022-10-01')
, (6, '2022-12-30');

insert into zapis_insulin_doziran_insulin (dijabeticar_id, "data", insulin_id, kolicina)
values
(2, '1999-02-08', 1, 15)
, (2, '2000-01-01', 1, 7)
, (2, '2001-08-09', 2, 1)
, (3, '2010-09-09', 3, 10)
, (6, '2022-10-01', 2, 9)
, (6, '2022-12-30', 2, 6);

insert into zapis_hrana (dijabeticar_id, "data")
values
(2, '1999-02-08')
, (2, '2001-08-09')
, (3, '2010-09-09')
, (6, '2022-10-01')
, (6, '2022-12-30');

insert into obrok (dijabeticar_id, "data", hrana_id, kolicina)
values
(2, '1999-02-08', 1, 100)
, (2, '1999-02-08', 6, 20)
, (2, '1999-02-08', 2, 16)
, (2, '2001-08-09', 2, 35)
, (3, '2010-09-09', 4, 125)
, (3, '2010-09-09', 5, 111)
, (6, '2022-10-01', 1, 37)
, (6, '2022-10-01', 5, 86)
, (6, '2022-12-30', 5, 97)
, (6, '2022-12-30', 1, 172);
