Menampilkan Data Heart Rate BUlanan dan Harian Berdasarkan ID

Posted: February 12, 2013 by genisurga in C Sharp, Server
Tags: , , , , ,

Dalam dashboard pasien data yang ditampilkan dapat berupa sebuah algoritma denyut rata0rata dan ditambah dengan heart resting.

Berikut ini adalah Progress tugas akhir saya. Tentang membuat Heartrate dar beberapa filter yang di dalam database SQL Server 2012

Berikut ini adalah Tampilan dari Diagram harian dan bulanan dari pasien beserta hasil diagnosa system pakar yang diambil dari perhitungan teori Heart resting .

tohesen copy

Sample Data tersebut diambil dari Pasien bernama manohara dengan umur 23 tahun berjenis kelamin perempuan.
Jika disesuaikan dengan teori Heart Resting maka hasil “rata-rata ” yang ditampilkan oleh system tersebut sudah benar.

Sekian laporan progress tugas akhir nya

berikut ini adalah lampiran untuk menampilkan kode tersebut.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace tugasakhir.pasien
{
 public partial class summary_pasien : System.Web.UI.Page
 {
 protected void Page_Load(object sender, EventArgs e)
 {

 string user = Request.QueryString["id"];
SqlConnection conn = new SqlConnection();
 conn.ConnectionString = ConfigurationManager.ConnectionStrings["uehealthConnectionString1"].ConnectionString;
 SqlCommand komand = new SqlCommand("Select * from v_cek_perhari where id_pasien='" + user + "'", conn);
 komand.Connection = conn;
 SqlDataAdapter adp = new SqlDataAdapter();
 adp.SelectCommand = komand;
 DataTable dt = new DataTable();
 adp.Fill(dt);
 string c, d;
 try
 {
 c = dt.Rows[0]["nama_depan"].ToString();
 d = dt.Rows[0]["usia"].ToString();
 Label2.Text = c;
 Label3.Text = user;
 }
 catch (IndexOutOfRangeException Error)
 {
 ScriptManager.RegisterStartupScript(this, GetType(), "tampilalert", "alert('belum ada id');window.history.go(-1)", true);
 return;
 }
//SqlCommand cmd = new SqlCommand("Select count(id_pasien) from v_cek_perhari where id_pasien=" + user, conn);
 //cmd.Connection = conn;
 //SqlDataAdapter adap = new SqlDataAdapter();
 //adap.SelectCommand = cmd;
 //DataTable data = new DataTable();
 //adp.Fill(data);
//string k = dt.Rows[0][""].ToString();
 //Label5.Text = k;
//melakukan penghitungan akses
 string myScalarQuery = "Select count(id_pasien) from v_cek_perhari where id_pasien='" + user+"'";
SqlCommand myCommand = new SqlCommand(myScalarQuery, conn);
 myCommand.Connection.Open();
 int count = (int)myCommand.ExecuteScalar();
 Label5.Text = count.ToString();
 //conn.Close();
 //Select avg(detak_jantung)as ndut from v_cek_perhari where id_pasien=3 group by id_pasien
 //algoritma pakar mencari resting jantung
SqlCommand kmd = new SqlCommand("Select usia,detak_jantung,jenis_kelamin from v_cek_perhari where id_pasien='" + user+"'", conn);
 kmd.Connection = conn;
 SqlDataAdapter adapt = new SqlDataAdapter();
 adapt.SelectCommand = kmd;
 DataTable dat = new DataTable();
 adp.Fill(dat);
SqlCommand kmt = new SqlCommand("Select usia,detak_jantung,jenis_kelamin from v_cek_perhari where id_pasien='" + user+"'", conn);
 kmt.Connection = conn;
 SqlDataAdapter adpt = new SqlDataAdapter();
 adpt.SelectCommand = kmt;
 DataTable dati = new DataTable();
 adp.Fill(dati);

 string jk= dat.Rows[0]["jenis_kelamin"].ToString();
 int usia = int.Parse(dat.Rows[0]["usia"].ToString());
 int hr = int.Parse(dati.Rows[0]["detak_jantung"].ToString());
 //////////
 string ust = usia.ToString();
 string hst = usia.ToString();

 //algoritma
 if (jk=="l")
 {
 if (usia>0 && usia<=25)
 { 
 if (hr>=49 && hr<=54)Label7.Text = "atlet";
 else if (hr >= 55 && hr <= 61) Label7.Text = "unggul";
 else if (hr >= 62 && hr <= 65) Label7.Text = "baik";
 else if (hr >= 66 && hr <= 69) Label7.Text = "Diatas rata-rata";
 else if (hr >= 70 && hr <= 73) Label7.Text = "rata-rata";
 else if (hr >= 74 && hr <= 81) Label7.Text = "dibawah rata-rata";
 else if (hr >= 82) Label7.Text = "poor";
 }
 else if(usia>=26 && usia<=35)
 {
 if (hr >= 49 && hr <= 54) Label7.Text = "atlet";
 else if (hr >= 55 && hr <= 61) Label7.Text = "unggul";
 else if (hr >= 62 && hr <= 65) Label7.Text = "baik";
 else if (hr >= 66 && hr <= 69) Label7.Text = "Diatas rata-rata";
 else if (hr >= 70 && hr <= 73) Label7.Text = "rata-rata";
 else if (hr >= 74 && hr <= 81) Label7.Text = "dibawah rata-rata";
 else if (hr >= 82) Label7.Text = "poor";
 }
 else if (usia >= 36 && usia <= 45)
 {
 if (hr >= 50 && hr <= 56) Label7.Text = "atlet";
 else if (hr >= 57 && hr <= 62) Label7.Text = "unggul";
 else if (hr >= 63 && hr <= 66) Label7.Text = "baik";
 else if (hr >= 67 && hr <= 70) Label7.Text = "Diatas rata-rata";
 else if (hr >= 71 && hr <= 75) Label7.Text = "rata-rata";
 else if (hr >= 76 && hr <= 82) Label7.Text = "dibawah rata-rata";
 else if (hr >= 83) Label7.Text = "poor";
 }
 else if (usia >= 46 && usia <= 55)
 {
 if (hr >= 50 && hr <= 56) Label7.Text = "atlet";
 else if (hr >= 58 && hr <= 63) Label7.Text = "unggul";
 else if (hr >= 64 && hr <= 67) Label7.Text = "baik";
 else if (hr >= 68 && hr <= 71) Label7.Text = "Diatas rata-rata";
 else if (hr >= 72 && hr <= 76) Label7.Text = "rata-rata";
 else if (hr >= 77 && hr <= 83) Label7.Text = "dibawah rata-rata";
 else if (hr >= 84) Label7.Text = "poor";
 }
 else if (usia >= 56 && usia <= 65)
 {
 if (hr >= 51 && hr <= 56) Label7.Text = "atlet";
 else if (hr >= 57 && hr <= 63) Label7.Text = "unggul";
 else if (hr >= 62 && hr <= 67) Label7.Text = "baik";
 else if (hr >= 68 && hr <= 71) Label7.Text = "Diatas rata-rata";
 else if (hr >= 72 && hr <= 76) Label7.Text = "rata-rata";
 else if (hr >= 76 && hr <= 83) Label7.Text = "dibawah rata-rata";
 else if (hr >= 82) Label7.Text = "poor";
 }
 else if (usia >= 66)
 {
 if (hr >= 50 && hr <= 56) Label7.Text = "atlet";
 else if (hr >= 56 && hr <= 61) Label7.Text = "unggul";
 else if (hr >= 62 && hr <= 65) Label7.Text = "baik";
 else if (hr >= 66 && hr <= 69) Label7.Text = "Diatas rata-rata";
 else if (hr >= 70 && hr <= 73) Label7.Text = "rata-rata";
 else if (hr >= 74 && hr <= 79) Label7.Text = "dibawah rata-rata";
 else if (hr >= 80) Label7.Text = "poor";
 }

}
 else if (jk == "p") 
 {
 if (usia > 18 && usia <= 25)
 {
 if (hr >= 54 && hr <= 54) Label7.Text = "atlet";
 else if (hr >= 61 && hr <= 65) Label7.Text = "unggul";
 else if (hr >= 66 && hr <= 69) Label7.Text = "baik";
 else if (hr >= 70 && hr <= 73) Label7.Text = "Diatas rata-rata";
 else if (hr >= 74 && hr <= 78) Label7.Text = "rata-rata";
 else if (hr >= 79 && hr <= 84) Label7.Text = "dibawah rata-rata";
 else if (hr >= 85) Label7.Text = "poor";
 }
 else if (usia >= 26 && usia <= 35)
 {
 if (hr >= 54 && hr <= 59) Label7.Text = "atlet";
 else if (hr >= 60 && hr <= 64) Label7.Text = "unggul";
 else if (hr >= 65 && hr <= 68) Label7.Text = "baik";
 else if (hr >= 69 && hr <= 72) Label7.Text = "Diatas rata-rata";
 else if (hr >= 73 && hr <= 76) Label7.Text = "rata-rata";
 else if (hr >= 77 && hr <= 82) Label7.Text = "dibawah rata-rata";
 else if (hr >= 83) Label7.Text = "poor";
 }
 else if (usia >= 36 && usia <= 45)
 {
 if (hr >= 54 && hr <= 59) Label7.Text = "atlet";
 else if (hr >= 60 && hr <= 64) Label7.Text = "unggul";
 else if (hr >= 65 && hr <= 69) Label7.Text = "baik";
 else if (hr >= 70 && hr <= 73) Label7.Text = "Diatas rata-rata";
 else if (hr >= 74 && hr <= 78) Label7.Text = "rata-rata";
 else if (hr >= 79 && hr <= 84) Label7.Text = "dibawah rata-rata";
 else if (hr >= 85) Label7.Text = "poor";
 }
 else if (usia >= 46 && usia <= 55)
 {
 if (hr >= 54 && hr <= 60) Label7.Text = "atlet";
 else if (hr >= 61 && hr <= 65) Label7.Text = "unggul";
 else if (hr >= 66 && hr <= 69) Label7.Text = "baik";
 else if (hr >= 70 && hr <= 73) Label7.Text = "Diatas rata-rata";
 else if (hr >= 74 && hr <= 77) Label7.Text = "rata-rata";
 else if (hr >= 78 && hr <= 83) Label7.Text = "dibawah rata-rata";
 else if (hr >= 84) Label7.Text = "poor";
 }
 else if (usia >= 56 && usia <= 65)
 {
 if (hr >= 54 && hr <= 59) Label7.Text = "atlet";
 else if (hr >= 60 && hr <= 64) Label7.Text = "unggul";
 else if (hr >= 65 && hr <= 68) Label7.Text = "baik";
 else if (hr >= 69 && hr <= 73) Label7.Text = "Diatas rata-rata";
 else if (hr >= 74 && hr <= 77) Label7.Text = "rata-rata";
 else if (hr >= 78 && hr <= 83) Label7.Text = "dibawah rata-rata";
 else if (hr >= 84) Label7.Text = "poor";
 }
 else if (usia >= 66)
 {
 if (hr >= 54 && hr <= 59) Label7.Text = "atlet";
 else if (hr >= 60 && hr <= 64) Label7.Text = "unggul";
 else if (hr >= 65 && hr <= 68) Label7.Text = "baik";
 else if (hr >= 69 && hr <= 72) Label7.Text = "Diatas rata-rata";
 else if (hr >= 73 && hr <= 76) Label7.Text = "rata-rata";
 else if (hr >= 77 && hr <= 84) Label7.Text = "dibawah rata-rata";
 else if (hr >= 85) Label7.Text = "poor";
 }

 }

 //algoritma berakhir
 }
 }
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s