|
@@ -230,17 +230,17 @@ namespace WpfTest1.SQLite
|
|
|
/// <summary>
|
|
|
/// getDeletedPatients:从Patient表中获取所有已被标记为删除的数据的id
|
|
|
/// </summary>
|
|
|
- public static List<string> getDeletedPatients()
|
|
|
+ public static List<int> getDeletedPatients()
|
|
|
{
|
|
|
string sql = "SELECT p_id FROM Patient WHERE p_delete_flag = 1";
|
|
|
SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
SQLiteParameter[] parameters = new SQLiteParameter[] { };
|
|
|
- List<string> result = new List<string>();
|
|
|
+ List<int> result = new List<int>();
|
|
|
using (SQLiteDataReader reader = db.ExecuteReader(sql, parameters))
|
|
|
{
|
|
|
while (reader.Read())
|
|
|
{
|
|
|
- string id = reader.IsDBNull(0) ? "" : reader.GetString(0);
|
|
|
+ int id = reader.IsDBNull(0) ? 0 : reader.GetInt32(0);
|
|
|
result.Add(id);
|
|
|
}
|
|
|
}
|
|
@@ -581,6 +581,20 @@ namespace WpfTest1.SQLite
|
|
|
return db.ExecuteNonQuery(sql, parameters);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 删除病例pid对应的所有记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="r_id">记录ID</param>
|
|
|
+ public static int deleteRecordByPid(int p_id)
|
|
|
+ {
|
|
|
+ string sql = "DELETE FROM Record WHERE p_id=@p_id";
|
|
|
+ SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
+ SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
+ new SQLiteParameter("@p_id",p_id)
|
|
|
+ };
|
|
|
+ return db.ExecuteNonQuery(sql, parameters);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
|
|
@@ -787,7 +801,7 @@ namespace WpfTest1.SQLite
|
|
|
}
|
|
|
}
|
|
|
//更新激活码信息
|
|
|
- public static void UpdateRegisterCode(string name, string pw, string code)
|
|
|
+ public static void UpdateOrganizationName(string name)
|
|
|
{
|
|
|
//Boolean a = false;
|
|
|
string sql = "UPDATE Config SET value=@name WHERE key='organization_name'";
|
|
@@ -796,115 +810,8 @@ namespace WpfTest1.SQLite
|
|
|
new SQLiteParameter("@name",name)
|
|
|
};
|
|
|
db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@pw WHERE key='organization_pw'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@pw",pw)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@code WHERE key='organization_active_code'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@code",code)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- }
|
|
|
- //更新血压单位显示hhmg或者kpa,如果为1则是hhmg
|
|
|
- public static void UpdateDocSetting(string value)
|
|
|
- {
|
|
|
- //Boolean a = false;
|
|
|
- string sql = "UPDATE Config SET value=@value WHERE key='bp_unit_mmhg'";
|
|
|
- SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
- SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@value",value)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- }
|
|
|
- //更新平滑参数
|
|
|
- public static void UpdateSmoothPara(int ori_pts, int ori_times, int dri_pts, int dri_times, int filter_when_saving)
|
|
|
- {
|
|
|
- //Boolean a = false;
|
|
|
- string sql = "UPDATE Config SET value=@ori_pts WHERE key='original_smooth_points'";
|
|
|
- SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
- SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@ori_pts",ori_pts)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@ori_times WHERE key='original_smooth_times'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@ori_times",ori_times)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@dri_pts WHERE key='derive_smooth_points'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@dri_pts",dri_pts)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@dri_times WHERE key='derive_smooth_times'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@dri_times",dri_times)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@filter_when_saving WHERE key='filter_when_saving'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@filter_when_saving",filter_when_saving)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- }
|
|
|
- //只更新特征值数列的平滑参数
|
|
|
- public static void UpdateEigenSmoothPara(int egi_pts, int egi_times)
|
|
|
- {
|
|
|
- //Boolean a = false;
|
|
|
- string sql = "UPDATE Config SET value=@egi_pts WHERE key='eigen_smooth_points'";
|
|
|
- SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
- SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@egi_pts",egi_pts)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@egi_times WHERE key='eigen_smooth_times'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@egi_times",egi_times)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- }
|
|
|
-
|
|
|
- //更新报告中report_figure_name
|
|
|
- public static void UpdateReportFigureName(string new_name)
|
|
|
- {
|
|
|
- string sql = "UPDATE Config SET value=@new_name WHERE key='report_figure_name'";
|
|
|
- SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
- SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@new_name",new_name)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- }
|
|
|
- //更新主公式等参数
|
|
|
- public static void UpdateGeneralExpression(string new_segment_name, string segement_threhold, string new_expression)
|
|
|
- {
|
|
|
- string sql = "UPDATE Config SET value=@new_segment_name WHERE key='segement_name'";
|
|
|
- SQLiteHelper db = new SQLiteHelper(dbPath);
|
|
|
- SQLiteParameter[] parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@new_segment_name",new_segment_name)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@segement_threhold WHERE key='segement_threhold'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@segement_threhold",segement_threhold)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
- sql = "UPDATE Config SET value=@new_expression WHERE key='general_expression'";
|
|
|
- db = new SQLiteHelper(dbPath);
|
|
|
- parameters = new SQLiteParameter[]{
|
|
|
- new SQLiteParameter("@new_expression",new_expression)
|
|
|
- };
|
|
|
- db.ExecuteNonQuery(sql, parameters);
|
|
|
}
|
|
|
+
|
|
|
|
|
|
#endregion
|
|
|
|