private void label1_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            Symptoms Symptoms = new Symptoms();

            Symptoms.ShowDialog();
        }
        private void AddSymptom_Click(object sender, RoutedEventArgs e)
        {
            if (Simptom.Text.Equals(""))
            {
            }
            else
            {
                Symptoms simptom = new Symptoms(Simptom.Text);

                Problems.ItemsSource = new List <ModelHCI.SymptomsHCI>();
                List <String> potencijalne = new List <String>();

                var record = medicalRecordController.GetMedicalRecord(Informations.currentRecord.MedicalRecord.IdRecord);

                foreach (Diagnosis diagnosis in record.IllnessHistory)
                {
                    foreach (Symptoms symptom in diagnosis.Symptoms)
                    {
                        simptomi.Add(symptom);
                    }
                }
                simptomi.Add(simptom);

                foreach (Diagnosis diagnosis in diagnosisController.GetAllDiagnosisBySymptoms(simptomi))
                {
                    potencijalne.Add(diagnosis.Name);
                }

                Simptom.Text          = "";
                Dijagnoze.ItemsSource = potencijalne;
                Problems.ItemsSource  = simptomi;
            }
        }
Beispiel #3
0
    public static Symptoms GetsubQuiz(string sym_sub, int sym_ID)
    {
        try
        {
            string query = String.Format("select Symptoms_host,Symptoms_host_num,Sub_Symtoms,result_comment,Diagnose_ID from Symptoms_detail  where Sub_Symtoms = '{0}' AND Symptoms_ID = {1}", sym_sub, sym_ID);
            conn.Open();
            command.CommandText = query;

            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                string symtom_host = reader.GetString(0);
                int    sym_num     = reader.GetInt32(1);
                string sub_symtom  = reader.GetString(2);
                string result      = reader.GetString(3);
                int    Diagnose_ID = reader.GetInt32(4);


                Symptoms symptoms = new Symptoms(symtom_host, sym_num, sub_symtom, result, Diagnose_ID);
                return(symptoms);
            }
        }
        finally
        {
            conn.Close();
        }

        return(null);
    }
        /// <summary>
        /// If was not find symptom from the `symptoms` list in the `contextSymptoms`:
        /// then add it in the Symptoms DB collection,
        /// else edit a found symptom in `contextSymptoms` list.
        /// </summary>
        /// <param name="symptoms">sourse list</param>
        /// <param name="contextSymptoms">edit in this list if found a symptom with same Id</param>
        private void AddOrEditSymptomsRange(ICollection <Symptom> symptoms, ICollection <Symptom> contextSymptoms)
        {
            foreach (var symptom in symptoms)
            {
                if (String.IsNullOrEmpty(symptom.Name))
                {
                    continue;
                }

                var item = contextSymptoms.FirstOrDefault(x => x.SymptomId == symptom.SymptomId);

                if (item != null)
                {
                    item.Name = symptom.Name;
                }
                else
                {
                    Symptoms.Add(new Symptom()
                    {
                        SymptomId = 0,
                        Name      = symptom.Name
                    });
                }
            }
        }
 public void AddSymptom(string symptom)
 {
     if (!Symptoms.Contains(symptom))
     {
         Symptoms.Add(symptom);
     }
 }
        public async Task <IActionResult> Edit(int id, [Bind("SymptomId,Name,Description")] Symptoms symptoms)
        {
            if (id != symptoms.SymptomId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(symptoms);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SymptomsExists(symptoms.SymptomId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(symptoms));
        }
        public Diagnosis AddSymptom(Diagnosis diagnosis, Symptoms symptom)
        {
            Diagnosis diagnosisToUpdate = diagnosisRepository.GetObject(diagnosis.Code);

            diagnosisToUpdate.Symptoms.Add(symptom);
            return(diagnosisRepository.Update(diagnosisToUpdate));
        }
Beispiel #8
0
        public IActionResult PutBook(int id, [FromBody] Symptoms symp)
        {
            if (id != symp.SympId)
            {
                return(BadRequest());
            }
            try
            {
                _database.Entry(symp).State = EntityState.Modified;

                _database.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SympExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(new JsonResult(new { message = "Updated" }));
        }
        public ActionResult FindDisease(Symptoms model)
        {
            DB50Entities  db          = new DB50Entities();
            List <string> DiseaseName = new List <string>();
            List <Int32>  Id          = new List <int>();

            foreach (var sym in db.Symptoms)
            {
                if (sym.SymptomName == model.SymptomName)
                {
                    Id.Add(sym.SymptomID);
                }
            }
            foreach (int id in Id)
            {
                foreach (var i in db.Diseases)
                {
                    if (id == i.SymptomID)
                    {
                        DiseaseName.Add(i.Name);
                    }
                }
            }

            ViewBag.name = DiseaseName;
            return(View());
        }
Beispiel #10
0
    /*
     * protected void DropDownListdiagnose_SelectedIndexChanged(object sender, EventArgs e)
     * {
     *  System.Threading.Thread.Sleep(3000);
     *
     *
     *  if (IsPostBack)
     *  {
     *
     *       quiz = Symptoms.GetQuiz(Convert.ToInt32(DropDownListdiagnose.SelectedValue));
     * //       quiz = test();
     *      if (quiz != null)
     *      {
     *
     *          txtCheck.Text = "เจอข้อมูล";
     *      }
     *      else
     *      {
     *          txtCheck.Text = "ไม่เจอเจอข้อมูล";
     *      }
     *  }
     *
     *
     *
     *
     *      }
     */
    private string sym_host()
    {
        //    Panel1.Visible = true;
        StringBuilder output = new StringBuilder();
        DataTable     dt     = new DataTable();

        dt = Symptoms.showdataquiz((int)Session["number_symtom"]);

        output.Append("[");
        for (int i = 0; i < dt.Rows.Count; ++i)
        {
            output.Append("\"" + dt.Rows[i]["Symptoms_host"].ToString() + "\"");

            if (i != (dt.Rows.Count - 1))
            {
                output.Append(",");
            }
        }


        output.Append("];");



        return(output.ToString());
    }
Beispiel #11
0
    protected void txtsymtomhost_TextChanged(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(3000);
        Symptoms quiz = Symptoms.GetQuiz(txtsymptomhost.Text, (int)Session["number_symtom"]);

        // doctor quiz = doctor.Login_doctor("ge","12345");
        if (quiz != null)
        {
            Session["number_subsymtom"] = quiz.Symptoms_host;
            if (quiz.Subsymptom == "")
            {
                txtCheck.Text = "" + quiz.Diagnose_ID;
            }
            else
            {
                Response.Redirect("../page/subsymtom.aspx");
                // txtCheck.Text = "รหัส"+quiz.Symtoms_host_ID;
                Session["sub_host"] = quiz.Symtoms_host_ID;

                //  Response.Redirect("../page/subsymtom.aspx");
                //   txtCheck.Text = (string)Session["number_subsymtom"];
            }
        }
        else
        {
            txtCheck.Text = "ไม่มีข้อมูลที่กรอก";
        }
        //   listFilter = test();
    }
 public void Reset()
 {
     Symptoms.Clear();
     Diagnoses.Clear();
     Treatments.Clear();
     DialogList.Clear();
     Variables.ValuesDictionary.Clear();
 }
        public ActionResult Delete(int id)
        {
            Symptoms symptoms = db.Symptoms.Find(id);

            db.Symptoms.Remove(symptoms);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #14
0
        public UpdateSymptomsPage(Symptoms symptoms)
        {
            InitializeComponent();
            var viewModel = new UpdateSymptomsViewModel();

            viewModel.Symptoms = symptoms;
            BindingContext     = viewModel;
        }
Beispiel #15
0
        private async void Update_Symptoms(object sender, EventArgs e)
        {
            TappedEventArgs tappedEventArgs = (TappedEventArgs)e;
            Symptoms        symptoms        = ((SymptomsViewModel)BindingContext).Symptoms.Where(ser => ser.data.id == (int)tappedEventArgs.Parameter).FirstOrDefault();
            await PopupNavigation.Instance.PushAsync(new UpdateSymptomsPage(symptoms));

            Debug.WriteLine("********symptoms*************");
            Debug.WriteLine(symptoms.data.id);
        }
Beispiel #16
0
    protected void Unnamed1_Click(object sender, EventArgs e)
    {
        Symptoms quiz = Symptoms.GetQuiz1(TextBox1.Text);

        if (quiz != null)
        {
            Response.Write(quiz.Symptoms_host);
        }
    }
Beispiel #17
0
 public TriggeringEvent()
 {
     oEvent                  = new Event();
     oDisease                = new Disease();
     oSymptoms               = new Symptoms();
     m_emInferenceType       = EnumInferenceType.PRIMARY;
     m_emInferenceResultType = EnumInferenceResultType.OTHER;
     strRuleName             = string.Empty;
 }
Beispiel #18
0
 public async Task<IActionResult> Create([Bind("Id,Name")] Symptoms symptoms)
 {
     if (ModelState.IsValid)
     {
         _context.Add(symptoms);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(symptoms);
 }
 public ActionResult Edit(Symptoms symptoms)
 {
     if (ModelState.IsValid)
     {
         db.Entry(symptoms).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(symptoms));
 }
 public ActionResult Create(Symptoms symptoms)
 {
     if (ModelState.IsValid)
     {
         db.Symptoms.Add(symptoms);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(symptoms));
 }
Beispiel #21
0
        private async Task <List <Symptom> > GetSymptomsByIds(ICollection <Symptom> symptoms)
        {
            var symptomsIds = symptoms
                              .Select(x => x.SymptomId)
                              .AsEnumerable();

            return(await Symptoms
                   .Where(x => symptomsIds.Contains(x.SymptomId))
                   .ToListAsync());
        }
Beispiel #22
0
        public void AddSymptom()
        {
            var symptom = new Symptom()
            {
                SymptomId   = Guid.NewGuid(),
                SymptomName = Symptom.SymptomName,
                DoctorId    = DoctorId
            };

            Symptoms.Add(symptom);
        }
Beispiel #23
0
 public override int GetHashCode()
 {
     return(RecoveryDate.GetHashCode()
            ^ HowDetected.GetHashCode()
            ^ Impacts?.GetHashCode() ?? 0
            ^ OcurrenceDate.GetHashCode()
            ^ RecoverySteps?.GetHashCode() ?? 0
            ^ RootCauses?.GetHashCode() ?? 0
            ^ Symptoms?.GetHashCode() ?? 0
            ^ MonitorName?.GetHashCode() ?? 0);
 }
Beispiel #24
0
 private void AddNewSymptomsRange(ICollection <Symptom> symptoms) => Symptoms
 .AddRange(
     symptoms
     .Where(x => !String.IsNullOrEmpty(x.Name))
     .Select(x =>
 {
     x.SymptomId = 0;
     return(x);
 })
     .AsEnumerable()
     );
Beispiel #25
0
        public async ValueTask <bool> DeleteSymptomsAsync(List <int> symptoms)
        {
            var contextSymptoms = Symptoms
                                  .Where(x => symptoms.Contains(x.SymptomId))
                                  .AsEnumerable();

            Symptoms.RemoveRange(contextSymptoms);

            await SaveChangesAsync();

            return(true);
        }
 public string ForExport(string delimiter)
 {
     return
         (PatientAddress.ToString() + delimiter +
          Country + delimiter +
          Region + delimiter +
          Birthyear + delimiter +
          TreatmentAddress + delimiter +
          TreatmentBeginDate.ToString("yyyy-MM-dd hh:mm:ss") + delimiter +
          Symptoms.Aggregate("", (x, y) => x + y + "|") + delimiter +
          Diagnoses.Aggregate("", (x, y) => x + y + "|"));
 }
Beispiel #27
0
        async void SymptomPickerChanged(object sender, EventArgs e)
        {
            if (sympPicker.SelectedIndex != -1)
            {
                saveCase.Symptom = sympPicker.Items[sympPicker.SelectedIndex];
                Symptoms symptom = await App.DB.getSymptom(saveCase.Symptom);

                saveCase.SymptomColour = symptom.Colour;
            }

            PopulateIncidentPicker();
        }
        public ActionResult Edit([Bind(Include = "Id,NameAr,NameEn,CreationDate,CategoryId")] Symptoms symptoms)
        {
            if (ModelState.IsValid)
            {
                db.Entry(symptoms).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Categories = db.Categories.ToList();

            return(View(symptoms));
        }
        public ActionResult Create([Bind(Include = "Id,NameAr,NameEn,CreationDate,CategoryId")] Symptoms symptoms)
        {
            symptoms.CreationDate = DateTime.Now;
            if (ModelState.IsValid)
            {
                db.Symptoms.Add(symptoms);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.Categories = db.Categories.ToList();

            return(View(symptoms));
        }
Beispiel #30
0
 public Symptoms Create(Symptoms entity)
 {
     if (!ExistsInSystem(entity))
     {
         var allSymptoms = stream.GetAll().ToList();
         allSymptoms.Add(entity);
         stream.SaveAll(allSymptoms);
         return(entity);
     }
     else
     {
         throw new EntityAlreadyExists(ALREADY_EXISTS);
     }
 }
Beispiel #31
0
 public TriggeringEvent()
 {
     oEvent = new Event();
     oDisease = new Disease();
     oSymptoms = new Symptoms();
     m_emInferenceType = EnumInferenceType.PRIMARY;
     m_emInferenceResultType = EnumInferenceResultType.OTHER;
     strRuleName = string.Empty;
 }