Example #1
0
        //保存
        private void btnSave_Click(object sender, EventArgs e)
        {
            string state = GetWardshipInterpStatus();

            if (state == @"未判读")
            {
                string udSql = "UPDATE Tb_Application set InterpretationStatus='已判读' WHERE applicationID='" + _applicationId + "'";
                if (ConfigHelper.DB_SIGN == 0)
                {
                    _sqHelper.SqliteUpdate(udSql);
                }
            }
            lblMsg.Text = @"提示:" + @"保存成功!";
        }
        /// <summary>
        /// 更新申请状态
        /// </summary>
        /// <param name="applicationId"></param>
        /// <param name="status"></param>
        private void UpdateApplicationStatus(string applicationId, string status)
        {
            var    so  = new SqliteOptions();
            string sql = string.Format("Update tb_Application set status='{1}' where ApplicationId='{0}'", applicationId, status);

            so.SqliteUpdate(sql);
        }
        /// <summary>
        /// 更新判读结果
        /// </summary>
        /// <param name="applicationId"></param>
        /// <param name="beginTime"></param>
        /// <param name="diagnosis"></param>
        private void UpdateApplicationDiagnosis(string applicationId, DateTime beginTime, string diagnosis)
        {
            var    so  = new SqliteOptions();
            string sql = string.Format("update tb_Application set InterpretationStatus='已判读' where ApplicationId='{0}'", applicationId);

            so.SqliteUpdate(sql);

            sql = string.Format("select * from Tb_Snapshot where ApplicationID='{0}'", applicationId);
            DataTable dso = so.ExcuteSqlite(sql);

            if (null != dso && dso.Rows.Count > 0)
            {
                sql = string.Format("update Tb_Snapshot set Diagnosis='{1}' where ApplicationID='{0}'", applicationId, diagnosis);
                so.SqliteUpdate(sql);
            }
            else
            {
                sql = string.Format(" insert into Tb_Snapshot(ID,ApplicationID,SnapshotTime,Diagnosis) Values('{0}','{1}','{2}','{3}')", Guid.NewGuid(), applicationId, beginTime.ToString("s"), diagnosis);
                so.SqliteAdd(sql);
            }
        }
Example #4
0
        public bool UpdateUserPassword(string newPassword)
        {
            string _sql = string.Format("update tb_doctor set DoctorPassword='******' where ID='{1}'", newPassword, ConfigHelper.LoginId);

            return(_sqlite.SqliteUpdate(_sql));
        }
Example #5
0
        /// <summary>
        /// 保存心电数据
        /// </summary>
        private void SaveEcgData()
        {
            _dCount++;
            var pm = new PermissionModel();

            for (int i = 1; i < pace_makingOptions.Pacing_signal_list.Count - 2; i++)
            {
                if (pace_makingOptions.Pacing_signal_list[i] == 1 && pace_makingOptions.Pacing_signal_list[i - 1] != 1)
                {
                    _paceCount++;
                }

                if (pace_makingOptions.Pacing_signal_list[i] == 1)
                {
                    _totPaceCount++;
                }
            }
            if (_paceCount > 0 && _totPaceCount > 0)
            {
                _isQiBo = "1";
            }
            _paceCount    = 0;
            _totPaceCount = 0;
            try
            {
                _ecgDataDicAfterFilter = serialPortOption.CreateInstance().EcgData_Dic_AfterFilter;
            }
            catch
            {
                _ecgDataDicAfterFilter = serialPortOption.CreateInstance().EcgData_Dic;
            }
            int ecgCount = (_ecgDataDicAfterFilter.Count > 0 ? _ecgDataDicAfterFilter[0].Count : 0);

            try
            {
                for (int leadIndex = 0; leadIndex < 12; leadIndex++)
                {
                    var leadEcgData = new List <float>();
                    for (int i = 0; i < ecgCount; i++)
                    {
                        if (serialPortOption.CreateInstance().EcgData_Dic_AfterFilter.Count > 0 && i < _ecgDataDicAfterFilter[leadIndex].Count)
                        {
                            leadEcgData.Add(_ecgDataDicAfterFilter[leadIndex][i]);
                        }
                    }
                    pm.Add(leadIndex, leadEcgData);
                }
            }
            catch (Exception ex)
            {
            }
            byte[] hospitalTel = pm.Compress(pm.Dict); string ednPathDir = Application.StartupPath + "\\ECG_DATA_NEW";
            if (!Directory.Exists(ednPathDir))
            {
                Directory.CreateDirectory(ednPathDir);
            }
            try
            {
                var fs = new FileStream(ednPathDir + "\\" + ConfigHelper.AppId + "_0", FileMode.CreateNew, FileAccess.Write);
                var bw = new BinaryWriter(fs, Encoding.UTF8);
                bw.Write(hospitalTel);
                bw.Close();
                //fs.Close();
            }
            catch (Exception ex)
            {
            }
            _filter = "低通:75Hz";

            var pLocs = new StringBuilder();

            for (int k = 0; k < serialPortOption.CreateInstance().PaceLocs.Count; k++)
            {
                serialPortOption.CreateInstance().PaceLocs[k] = serialPortOption.CreateInstance().PaceLocs[k] + serialPortOption.CreateInstance().PaceOffset;
                if (serialPortOption.CreateInstance().PaceLocs[k] < 2500)
                {
                    serialPortOption.CreateInstance().PaceLocs.RemoveAt(k);
                }
                else
                {
                    pLocs.Append(serialPortOption.CreateInstance().PaceLocs[k] - 2500).Append(",");
                }
            }
            string strdel       = "delete from data_packs where ApplicationID='" + ConfigHelper.AppId + "'";
            string strsql       = "insert into data_packs (ApplicationID,beginTime,dataSizePerLead,EcgFilter,isLead,LeadEndTime,paceLocs) values ('" + ConfigHelper.AppId + "','" + _beginCollectTime + "','" + Dataperlead + "','" + _filter + "','0','" + _endCollectTime + "','" + pLocs.ToString().TrimEnd(',') + "') ";
            string strsqlUpdate = "update tb_patientinfo set IsQiBo='" + _isQiBo + "' where PatientID='" + _patientId + "'";

            //执行SQL语句,将数据插入表中
            try
            {
                if (hospitalTel.Length > 0)
                {
                    _sqlite.SqliteDelete(strdel);
                    _sqlite.SqliteAdd(strsql);
                    _sqlite.SqliteUpdate(strsqlUpdate);
                }
                serialPortOption.CreateInstance().PaceLocs.Clear();
            }
            catch (Exception ex)
            {
            }
        }