Exemplo n.º 1
0
        private void CalcBMI()
        {
            //BMI = (lbs*703)/(in^2)
            float height;
            float weight;

            try{
                height = float.Parse(textHeight.Text);
                weight = float.Parse(textWeight.Text);
            }
            catch {
                return;
            }
            if (height == 0)
            {
                return;
            }
            if (weight == 0)
            {
                return;
            }
            float bmi = Vitalsigns.CalcBMI(weight, height);          // ((float)(weight*703)/(height*height));

            textBMI.Text = bmi.ToString("n1");
            return;
        }
Exemplo n.º 2
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Date", 80);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Pulse", 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Height", 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Weight", 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("BP", 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("BMI", 55);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Documentation for Followup or Ineligible", 150);
            gridMain.ListGridColumns.Add(col);
            listVs = Vitalsigns.Refresh(PatNum);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < listVs.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(listVs[i].DateTaken.ToShortDateString());
                row.Cells.Add(listVs[i].Pulse.ToString() + " bpm");
                row.Cells.Add(listVs[i].Height.ToString() + " in.");
                row.Cells.Add(listVs[i].Weight.ToString() + " lbs.");
                row.Cells.Add(listVs[i].BpSystolic.ToString() + "/" + listVs[i].BpDiastolic.ToString());
                //BMI = (lbs*703)/(in^2)
                float bmi = Vitalsigns.CalcBMI(listVs[i].Weight, listVs[i].Height);
                if (bmi != 0)
                {
                    row.Cells.Add(bmi.ToString("n1"));
                }
                else                  //leave cell blank because there is not a valid bmi
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(listVs[i].Documentation);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }