Beispiel #1
0
        public static string ChanDoanBenh(string trieuchung)
        {
            string res = "Cac benh lien quan: ";

            string[]     tokens = trieuchung.Split(new string[] { " - " }, StringSplitOptions.RemoveEmptyEntries);
            IList <Benh> list   = BenhDAO.getAllList();
            int          index  = 0;

            foreach (Benh b in list)
            {
                bool check = true;
                for (int i = 0; i < tokens.Count(); i++)
                {
                    if (!b.TrieuChung.Contains(tokens[i]))
                    {
                        check = false;
                        break;
                    }
                }
                if (check)
                {
                    if (index != 0)
                    {
                        res += ", ";
                    }
                    res += b.LoaiBenh;
                    index++;
                }
            }

            return(res);
        }
Beispiel #2
0
        public static void init()
        {
            readSettings();
            listAllBenh = BenhDAO.getAllList();
            if (!listAllBenh.Any())
            {
                BenhDAO.addOrUpdateBenh("unidentified", new QuanLyPhongKham.Benh());
                listAllBenh.Add(new Benh());
            }
            listAllThuoc = ThuocDAO.getAllList();
            foreach (Thuoc t in listAllThuoc)
            {
                bindingListAllThuoc.Add(t);
            }
            IList <LuotKham> list = LuotKhamDAO.getAllLuotKhamOfCurrentDay();

            listBenhNhan = new BindingList <BenhNhan>();
            if (list.Any())
            {
                for (int i = 0; i < list.Count; i++)
                {
                    listBenhNhan.Add(list.ElementAt(i).BenhNhan1);
                }
            }
            listLuotKhamTrongNgay = new BindingList <LuotKham>();
            listThongKeLuotkham   = new BindingList <ThongKeLuotKham>();
            listThongKeLuotThuoc  = new BindingList <ThongKeLuotThuoc>();
        }