Beispiel #1
0
 public long AddPatientBaseInfo(PatientInfo model)
 {
     StringBuilder stringBuilder = new StringBuilder();
     stringBuilder.Append("insert into PatientBaseInfo(");
     stringBuilder.Append("PatientAge,PatientName,PatientSex,BeHospitalizedDate,Bed,CourtyardState,LeaveHospitalDate,LeaveHospitalAgent,Diacrisis)");
     stringBuilder.Append(" values (");
     stringBuilder.Append("@PatientAge,@PatientName,@PatientSex,@BeHospitalizedDate,@Bed,@CourtyardState,@LeaveHospitalDate,@LeaveHospitalAgent,@Diacrisis)");
     stringBuilder.Append(";select LAST_INSERT_ROWID()");
     SQLiteParameter[] array = new SQLiteParameter[]
     {
         new SQLiteParameter("@PatientAge", DbType.Int16),
         new SQLiteParameter("@PatientName", DbType.String),
         new SQLiteParameter("@PatientSex", DbType.String),
         new SQLiteParameter("@BeHospitalizedDate", DbType.Date),
         new SQLiteParameter("@Bed", DbType.String),
         new SQLiteParameter("@CourtyardState", DbType.String),
         new SQLiteParameter("@LeaveHospitalDate", DbType.Date),
         new SQLiteParameter("@LeaveHospitalAgent", DbType.String),
         new SQLiteParameter("@Diacrisis", DbType.String)
     };
     array[0].Value = model.Age;
     array[1].Value = model.Name;
     array[2].Value = model.Sex;
     array[3].Value = model.BeHospitalizedDate;
     array[4].Value = model.Bed;
     array[5].Value = model.CourtyardState;
     array[6].Value = model.LeaveHospitalDate;
     array[7].Value = model.LeaveHospitalAgent;
     array[8].Value = model.Diacrisis;
     object single = DbHelperSQLite.GetSingle(stringBuilder.ToString(), array);
     return Convert.ToInt64(single);
 }
        public void SetUp()
        {
            var container = new WindsorContainer().Install(new CommonInstaller());
            mStudyInfoProvider = container.Resolve<IStudyInfoProvider>();
            var patientInfoProvider = container.Resolve<IPatientInfoProvider>();

            mPatient = patientInfoProvider.GetPatientByBirthNumberAsync("151018/0012").Result;
        }
        public void DicomType_IsPatient()
        {
            // Arrange 
            var patient = new PatientInfo();

            // Act + Assert
            Assert.That(patient.DicomType, Is.EqualTo(DicomInfoType.Patient));
        }
        public void PatientID_Setter_AfterGettingHashCode_ThrowsException()
        {
            // Arrange
            var patient = new PatientInfo
            {
                PatientID = new BirthNumber("9107256444")
            };

            // Act
            patient.GetHashCode();

            // Assert
            Assert.That(() => patient.PatientID = new BirthNumber("9107256444"), Throws.InvalidOperationException);
        }
        public void PatientName_Setter_AfterGettingHashCode_ThrowsException()
        {
            // Arrange
            var patient = new PatientInfo
            {
                PatientName = new PatientName("Doe^John")
            };

            // Act
            patient.GetHashCode();

            // Assert
            Assert.That(() => patient.PatientName = new PatientName("Doe^John"), Throws.InvalidOperationException);
        }
        public void Equals_WithItself_ReturnsTrue()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var patient = new PatientInfo
            {
                PatientID = birthNumber
            };

            // Act
            var result = patient.Equals(patient);

            // Assert
            Assert.That(result, Is.True);
        }
        public void GetIdentifierHashCode_ReturnsHashCodeOfPatientID()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var patient = new PatientInfo
            {
                PatientID = birthNumber
            };

            // Act
            int hashCode = patient.GetIdentifierHashCode();

            // Assert
            Assert.That(hashCode, Is.EqualTo(birthNumber.GetHashCode()));
        }
Beispiel #8
0
        public long AddPatientInfo(PatientInfo model)
        {
            model.Id = this.AddPatientBaseInfo(model);

            if (model.OcOperation != null)
            {
                foreach (OperationInfo current in model.OcOperation)
                {

                    current.PatientId = model.Id;
                    current.OperationId = this.AddOperationInfo(current);

                }
            }
            if (model.OcSclerteInfo != null)
            {
                foreach (SclerteInfo current2 in model.OcSclerteInfo)
                {
                    current2.PatientId = model.Id;
                    current2.ScleriteId = this.AddSclerteInfo(current2);
                }
            }
            return model.Id;
        }
Beispiel #9
0
 public Anthropometrics(PatientInfo patientInfo) : base("Anthropometrics", patientInfo, "General")
 {
 }
		private static Patient FindPatient(PatientInfo patientInfo, IPersistenceContext context)
		{
            IPatientEntityBroker patientFindBroker = context.GetBroker<IPatientEntityBroker>();
			PatientSelectCriteria criteria = new PatientSelectCriteria();

			if (!String.IsNullOrEmpty(patientInfo.PatientId))
				criteria.PatientId.EqualTo(patientInfo.PatientId);
			else
				criteria.PatientId.IsNull();

			if (!String.IsNullOrEmpty(patientInfo.Name))
                criteria.PatientsName.EqualTo(patientInfo.Name);
			else
				criteria.PatientsName.IsNull();

			return patientFindBroker.FindOne(criteria);
		}
		private void TransferStudy(ServerEntityKey studyKey, PatientInfo oldPatient, Patient newPatient)
		{
			Platform.Log(LogLevel.Info, "Transferring study from {0} [ID={1}] to {2} [ID={3}]",
			             oldPatient.Name, oldPatient.PatientId, newPatient.PatientsName, newPatient.PatientId);

            IAttachStudyToPatient attachStudyToPatientBroker = UpdateContext.GetBroker<IAttachStudyToPatient>();
			AttachStudyToPatientParamaters parms = new AttachStudyToPatientParamaters
			                                       	{
			                                       		StudyKey = studyKey,
			                                       		NewPatientKey = newPatient.GetKey()
			                                       	};
			attachStudyToPatientBroker.Execute(parms);            
		}
Beispiel #12
0
        /// <summary>
        /// 调用获取个人信息接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public static ResultClass GetPersonInfo(SiInterfaceDll sDll, string cardNo)
        {
            _cardNo = cardNo;

            string    sMome = "";
            bool      bRet  = false;
            string    sOut  = "";
            DataTable dt    = new DataTable();

            _sColumns.Clear();
            //ic卡
            _sColumns.Add("card_no");   //社保卡卡号
            _sColumns.Add("ic_no");
            _sColumns.Add("id_no");
            _sColumns.Add("personname");
            _sColumns.Add("sex");
            _sColumns.Add("birthday");
            _sColumns.Add("fromhosp");
            _sColumns.Add("fromhospdate");
            _sColumns.Add("fundtype");
            _sColumns.Add("isyt");
            _sColumns.Add("jclevel");
            _sColumns.Add("hospflag");
            //网络信息
            _sColumns.Add("persontype");
            _sColumns.Add("isinredlist");
            _sColumns.Add("isspecifiedhosp");
            _sColumns.Add("ischronichosp");
            _sColumns.Add("personcount");
            _sColumns.Add("chroniccode");
            dt = CreatDataTable(_sColumns);

            AddLog("调用获取个人信息接口");
            AddLog("输入参数:无");

            sDll.GetPersonInfo(out sOut, cardNo);

            AddLog("输出数据:");
            AddLog(sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);

            if (bRet)
            {
                DataRow dr          = dt.NewRow();
                XmlNode dataNode    = GetNodeFromPath(xmlDoc.DocumentElement, "output/ic");
                XmlNode dataNodeNet = GetNodeFromPath(xmlDoc.DocumentElement, "output/net");
                foreach (string s in _sColumns)
                {
                    XmlNodeList xNodeList = dataNode.SelectNodes(s);
                    if (xNodeList.Count > 0)
                    {
                        dr[s] = xNodeList[0].InnerText;
                    }
                    else
                    {
                        dr[s] = dataNodeNet.SelectNodes(s)[0].InnerText;
                    }
                }
                dt.Rows.Add(dr);
                AddLog("解析获取个人信息接口完成");
            }
            xmlDoc = null;

            List <PatientInfo> patientInfoList = new List <PatientInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                PatientInfo patientInfo = new PatientInfo();
                patientInfo.CardNo          = dr["card_no"].ToString();
                patientInfo.IcNo            = dr["ic_no"].ToString();
                patientInfo.IdNo            = dr["id_no"].ToString();
                patientInfo.PersonName      = dr["personname"].ToString();
                patientInfo.Sex             = dr["sex"].ToString();
                patientInfo.Birthday        = dr["birthday"].ToString();
                patientInfo.FromHosp        = dr["fromhosp"].ToString();
                patientInfo.FromHospDate    = dr["fromhospdate"].ToString();
                patientInfo.FundType        = dr["fundtype"].ToString();
                patientInfo.IsYT            = dr["isyt"].ToString();
                patientInfo.JcLevel         = dr["jclevel"].ToString();
                patientInfo.HospFlag        = dr["hospflag"].ToString();
                patientInfo.PersonType      = dr["persontype"].ToString();
                patientInfo.IsInredList     = dr["isinredlist"].ToString();
                patientInfo.IsSpecifiedHosp = dr["isspecifiedhosp"].ToString();
                patientInfo.IsChronicHosp   = dr["ischronichosp"].ToString();
                patientInfo.PersonCount     = dr["personcount"].ToString();
                patientInfo.ChronIcCode     = dr["chroniccode"].ToString();
                patientInfoList.Add(patientInfo);
            }

            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = patientInfoList;

            return(resultClassTemp);
        }
Beispiel #13
0
 public void ConvetToISHME(string rawDataPath, PatientInfo patientInfo, string outputPath)
 {
     SetPatientInfo();
     WarpPackage();
 }
        public void GetHashCode_PatientsWithSameIDAndNameAreEqual()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient1 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            var patient2 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };

            // Act
            var hash1 = patient1.GetHashCode();
            var hash2 = patient2.GetHashCode();

            // Assert
            Assert.That(hash1, Is.EqualTo(hash2));
        }
        public void SerializeToJson_CorrectOutput(string patientName, string birthNumber, string expectedResult)
        {
            // Arrange
            var patient = new PatientInfo
            {
                PatientID = new BirthNumber(birthNumber),
                PatientName = new PatientName(patientName),
                AdditionalInstances = { new PatientInfo() }
            };

            // Act
            var result = JsonConvert.SerializeObject(patient);

            // Assert
            Assert.That(result, Is.EqualTo(expectedResult));
        }
Beispiel #16
0
        //把预约信息存进数据库
        public void SaveReservation(PatientInfo ptinfo)
        {
            Base sr = new Base();

            sr.Add(ptinfo.PatientName);
        }
Beispiel #17
0
        /// <summary>
        /// 卡查询
        /// </summary>
        /// <param name="brxm">病人姓名</param>
        /// <param name="sfzh">身份证号</param>
        /// <param name="brlx">病人类别 1-门诊  2-住院</param>
        /// <param name="list">返回的病人信息</param>
        /// <param name="msg">成功、错误或异常信息</param>
        /// <returns>0-成功  大于0-失败   小于0-异常</returns>
        public int DB_QueryCard(string brxm, string sfzh, string brlx, out ArrayList values, out string msg)
        {
            msg = "";


            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            int    ret     = -1;
            string findId1 = "";

            values = new ArrayList();

            try
            {
                bool _flag = false;

                findId1 = _builder.GetQueryCardSql(brxm, sfzh, brlx, out _flag, out msg);

                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, findId1);

                if (!_flag)
                {
                    ret = 10;
                    return(ret);
                }

                dr = DbHelperOra.ExecuteReader(findId1, connection);


                while (dr.Read())
                {
                    PatientInfo paintentInfo = new PatientInfo();

                    if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTXRMYY ||
                        WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSRAZYY ||
                        (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY && brlx == "1"))
                    {
                        paintentInfo.brid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                    }
                    else
                    {
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSYJXDSRMYY && brlx == "2")
                        {
                            paintentInfo.brid = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        }
                        else
                        {
                            paintentInfo.brid = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : "";
                        }
                    }

                    paintentInfo.bkhm = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                    paintentInfo.bklx = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                    paintentInfo.brxm = !dr.IsDBNull(3) ? dr.GetString(3) : "";
                    paintentInfo.sfzh = !dr.IsDBNull(4) ? dr.GetString(4) : "";
                    paintentInfo.lxdh = !dr.IsDBNull(5) ? dr.GetString(5) : "";
                    paintentInfo.jtdz = !dr.IsDBNull(6) ? dr.GetString(6) : "";
                    paintentInfo.jlsj = DateTime.MinValue;

                    //判断是否住院病人   否则没有下列信息
                    if (brlx.Equals("2"))
                    {
                        paintentInfo.jlsj = !dr.IsDBNull(7) ? dr.GetDateTime(7) : DateTime.MinValue;
                        paintentInfo.szbq = !dr.IsDBNull(8) ? dr.GetString(8) : "";
                        paintentInfo.szcw = !dr.IsDBNull(9) ? dr.GetString(9) : "";
                        if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY)
                        {
                            paintentInfo.zyh = !dr.IsDBNull(10) ? Convert.ToString(dr.GetInt64(10)) : "";
                        }
                        else
                        {
                            paintentInfo.zyh = !dr.IsDBNull(10) ? dr.GetString(10) : "";
                        }
                    }

                    values.Add(paintentInfo);
                }

                if (values.Count > 0)
                {
                    msg = "找到病人信息";
                    ret = 0;
                }
                else
                {
                    msg    = "医院端未找到,请核对信息后重试";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);
                msg    = GetExceptionInfo(ex);
                values = null;

                ret = -1;
                return(ret);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }
Beispiel #18
0
 public string AddNewPatient(PatientInfo newPatient)
 {
     Console.WriteLine("New Patient Details Recieved");
     _db.Add(newPatient);
     return(newPatient.MRN);
 }
Beispiel #19
0
 public bool UpdatePatient(PatientInfo updatedState)
 {
     return(false);
 }
Beispiel #20
0
 public StudyInfo()
 {
     Series  = new List <SeriesDetails>();
     Patient = new PatientInfo();
 }
Beispiel #21
0
 public PropofolCalories(string name, PatientInfo patientInfo) : base("Propofol", patientInfo, "CTI|Propofol")
 {
 }
Beispiel #22
0
 public async Task <ActionResult> CreatePatient(PatientInfo patientInfo)
 {
     _logger.LogDebug($"API - CreatePatient: Creating new patient for {patientInfo.FirstName} {patientInfo.LastName}");
     return(Ok(await _patientService.Create(patientInfo)));
 }
        public void PruebaPorHospital(Hospital hospital, Estadisticas data)
        {
            try
            {
                PrioridadCola pacienteSeleccionado = hospital.colaSospechosos.Peek();
                long          dpi     = pacienteSeleccionado.dpi;
                PatientInfo   patient = Storage.Instance.dataPacientes.Busqueda("dpi", dpi.ToString())[0];
                bool          prueba  = hospital.PruebaContagio(patient);

                if (prueba)
                {
                    Storage.Instance.datos.sospechososPositivo++;
                    Storage.Instance.datos.contagiadosIngresados++;
                    data.sospechososPositivo++;
                    data.contagiadosIngresados++;


                    if (hospital.contagiadosCamilla < 10)
                    {
                        hospital.contagiadosCamilla++;

                        //Encontrar primer camilla libre y sacar su código.
                        Cama camaDisponible = hospital.camillas.AllDataLikeList().Find((dato) =>
                        {
                            return((dato.Disponible) ? true : false);
                        });

                        //Llamar al hashTable del hospital Correspondiente....
                        //Hacer un search de la camilla con ese código y al objeto de retorno ingresarle el paciente.
                        hospital.camillas.Search(camaDisponible.Codigo).PacienteActual = pacienteSeleccionado;
                        hospital.camillas.Search(camaDisponible.Codigo).Disponible     = false;

                        hospital.CamillasDisponibles = hospital.CamasDisponibles();
                    }
                    else
                    {
                        hospital.colaContagiados.Insert(pacienteSeleccionado.prioridad, pacienteSeleccionado);

                        hospital.colaSospechosos.Delete();
                    }
                    Response.Write("<script>alert('El paciente que era sospechoso y seguía en la cola ha resultado positivo para el Covid - 19')</script>");

                    NodeAVL <PatientInfo> nodoPaciente = Storage.Instance.dataPacientes.SearchOneValue(dpi);
                    nodoPaciente.value.Estado = "No Recuperado";
                }
                else
                {
                    Storage.Instance.datos.sospechososNegativo++;
                    data.sospechososNegativo++;

                    Response.Write("<script>alert('La prueba ha salido negativa')</script>");
                    hospital.colaSospechosos.Delete();
                    //TODO: Revisar el string de este estado...
                    NodeAVL <PatientInfo> nodoPaciente = Storage.Instance.dataPacientes.SearchOneValue(dpi);
                    nodoPaciente.value.Estado = "Sospechoso Negativo";
                }
            }
            catch (Exception)
            {
                Response.Write("<script>alert('No se puede realizar la prueba, no hay sospechosos en la cola.')</script>");
            }
        }
 public StudyInfo()
 {
     Series = new List<SeriesDetails>();
     Patient = new PatientInfo();
 }
        public void Equals_WithDifferentType_ReturnsFalse()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            
            // Act
            var result = patient.Equals(new object());

            // Assert
            Assert.That(result, Is.False);
        }
Beispiel #26
0
        public bool EditPatientBaseInfo(PatientInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update PatientBaseInfo set ");
            strSql.Append("PatientAge=@PatientAge,");
            strSql.Append("PatientName=@PatientName,");
            strSql.Append("PatientSex=@PatientSex,");
            strSql.Append("BeHospitalizedDate=@BeHospitalizedDate,");
            strSql.Append("Bed=@Bed,");
            strSql.Append("CourtyardState=@CourtyardState,");
            strSql.Append("LeaveHospitalDate=@LeaveHospitalDate,");
            strSql.Append("LeaveHospitalAgent=@LeaveHospitalAgent,");
            strSql.Append("Diacrisis=@Diacrisis,");
            strSql.Append("Teach=@Teach");
            strSql.Append(" where PatientId=@PatientId");
            SQLiteParameter[] parameters = {
                    new SQLiteParameter("@PatientAge", DbType.Int32),
                    new SQLiteParameter("@PatientName", DbType.String),
                    new SQLiteParameter("@PatientSex", DbType.String),
                    new SQLiteParameter("@BeHospitalizedDate", DbType.Date),
                    new SQLiteParameter("@Bed", DbType.String),
                    new SQLiteParameter("@CourtyardState", DbType.String),
                    new SQLiteParameter("@LeaveHospitalDate", DbType.Date),
                    new SQLiteParameter("@LeaveHospitalAgent", DbType.String),
                    new SQLiteParameter("@Diacrisis", DbType.String),
                    new SQLiteParameter("@Teach", DbType.String),
                    new SQLiteParameter("@PatientId", DbType.Int64)};
            parameters[0].Value = model.Age;
            parameters[1].Value = model.Name;
            parameters[2].Value = model.Sex;
            parameters[3].Value = model.BeHospitalizedDate;
            parameters[4].Value = model.Bed;
            parameters[5].Value = model.CourtyardState;
            parameters[6].Value = model.LeaveHospitalDate;
            parameters[7].Value = model.LeaveHospitalAgent;
            parameters[8].Value = model.Diacrisis;
            parameters[9].Value = model.Teach;
            parameters[10].Value = model.Id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);
            return rows > 0;
        }
        public void GetHashCode_PatientsWithDifferencNameAndIDAreNotEqual()
        {
            // Arrange
            var patient1 = new PatientInfo
            {
                PatientID = new BirthNumber("9107256444"),
                PatientName = new PatientName("Doe^John")
            };
            var patient2 = new PatientInfo
            {
                PatientID = new BirthNumber("1510180012"),
                PatientName = new PatientName("Smith^Jack")
            };

            // Act
            var hash1 = patient1.GetHashCode();
            var hash2 = patient2.GetHashCode();

            // Assert
            Assert.That(hash1, Is.Not.EqualTo(hash2));
        }
Beispiel #28
0
        public void DataTransfer_Event(string strMethod, object sender)
        {
            switch (strMethod)
            {
            case "QueryMaxSampleNum":
                intMaxSampleNum = (int)sender;
                this.Invoke(new EventHandler(delegate
                {
                    txtSampleNum.Text       = (intMaxSampleNum + 1).ToString();
                    txtBoxDetectionNum.Text = "1";
                }));
                break;

            case "QueryProNameForApplyTask":
                List <string[]> lstProName = (List <string[]>)XmlUtility.Deserialize(typeof(List <string[]>), sender as string);
                projectPage1.LstAssayProInfos = lstProName;
                projectPage2.LstAssayProInfos = lstProName;
                projectPage3.LstAssayProInfos = lstProName;
                projectPage4.LstAssayProInfos = lstProName;
                this.BeginInvoke(new EventHandler(delegate { grpProject.SelectedTabPageIndex = 0; }));
                break;

            case "QueryCombProjectNameAllInfo":
                List <string> lstCombProName = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                proCombPage1.LstProjectGroups = lstCombProName;
                proCombPage2.LstAssayProInfos = lstCombProName;
                this.BeginInvoke(new EventHandler(delegate { grpCombProject.SelectedTabPageIndex = 0; }));
                break;

            case "QueryApplyTaskLsvt":
                lstSampleInfo = (List <SampleInfo>)XmlUtility.Deserialize(typeof(List <SampleInfo>), sender as string);
                //项目任务数据存储
                DataTable dt = new DataTable();
                dt.Columns.Add("样本编号");
                dt.Columns.Add("盘号");
                dt.Columns.Add("位置");
                dt.Columns.Add("样本状态");

                lstPanel.Clear();
                lstPosition.Clear();
                lstSamNum.Clear();
                dt.Rows.Clear();
                if (lstSampleInfo != null)
                {
                    foreach (SampleInfo s in lstSampleInfo)
                    {
                        string strState = string.Empty;
                        if (s.SampleState == 0)
                        {
                            strState = "待测";
                        }
                        else if (s.SampleState == 1)
                        {
                            strState = "检测中";
                        }
                        else if (s.SampleState == 2)
                        {
                            strState = "完成";
                        }
                        else if (s.SampleState == 3)
                        {
                            strState = "任务被终止";
                        }

                        dt.Rows.Add(new object[] { s.SampleNum.ToString(), s.PanelNum.ToString(), s.SamplePos.ToString(), strState });
                        lstPanel.Add(s.PanelNum);
                        lstPosition.Add(s.SamplePos);
                        lstSamNum.Add(s.SampleNum);
                        lstPanelPos.Add(s.PanelNum + "|" + s.SamplePos);
                    }
                }
                this.Invoke(new EventHandler(delegate
                {
                    lstvTask.DataSource = dt;
                    this.SamplePanelAndPosNum();
                    txtSampleNum.Text = lstSamNum.Count > 0 ? (lstSamNum.Max() + 1).ToString() : (1).ToString();
                    intMaxSampleNum   = System.Convert.ToInt32(txtSampleNum.Text) - 1;
                }));
                break;

            case "QuerySampleDiluteRatio":
                lstDilutionRatio = (List <float>)XmlUtility.Deserialize(typeof(List <float>), sender as string);
                break;

            case "QueryProjectAndCombProName":
                lstCombProInfo = (List <CombProjectInfo>)XmlUtility.Deserialize(typeof(List <CombProjectInfo>), sender as string);
                break;

            case "QueryTaskInfoBySampleNum":
                break;

            case "AddTask":
                string strAddTaskInfo = sender as string;
                if (strAddTaskInfo == "此样本任务已经存在,请重新录入!")
                {
                    MessageBox.Show("此样本任务已经存在,请重新录入!");
                }
                // 获取申请任务列表
                dic.Clear();
                dic.Add("QueryApplyTaskLsvt", new object[] { "" });
                ClientSendToServices(dic);
                lstDiluteInfos.Clear();
                break;

            case "QueryPatientInfoBySampleNum":
                PatientInfo patientInfo = XmlUtility.Deserialize(typeof(PatientInfo), sender as string) as PatientInfo;
                patientInfofrm.PatientInfoByNum = patientInfo;
                break;

            case "AddTaskForBatch":
                List <string> lstResult = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                batchInput.LstReceiveInfo = lstResult;
                break;

            case "QueryDepartmentInfo":
                patientInfofrm.LstApplyDepartment = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                break;

            case "QueryApplyDoctor":
                patientInfofrm.LstApplyDoctor = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                break;

            case "QueryCheckDoctor":
                patientInfofrm.LstCheckDoctor = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                break;

            case "QueryInspectDoctor":
                patientInfofrm.LstInspectDoctor = (List <string>)XmlUtility.Deserialize(typeof(List <string>), sender as string);
                break;

            case "QueryPatientInfos":
                patientInfofrm.LstPatientInfo = (List <PatientInfo>)XmlUtility.Deserialize(typeof(List <PatientInfo>), sender as string);
                break;

            case "UpdatePatientInfo":
                patientInfofrm.StrUpdateInfo = sender as string;
                break;

            case "QueryTaskInfoForSamplePanel":
                anologSamplePanel.TaskInfoForSamPanel = XmlUtility.Deserialize(typeof(TaskInfoForSamplePanelInfo), sender as string) as TaskInfoForSamplePanelInfo;
                break;

            case "QuerySamplePanelState":
                anologSamplePanel.LstSampleInfo = XmlUtility.Deserialize(typeof(List <SampleInfo>), sender as string) as List <SampleInfo>;
                break;

            default:
                break;
            }
        }
        public ActionResult Create(PatientInfoModel model)
        {
            ResultModel resultModel = new ResultModel();

            try
            {
                if (model.PatientInfoId == 0)
                {
                    //Creating New Treatment record
                    var TreatmentRecord = new TreatmentRecordMaster();

                    TreatmentRecord.AppointmentDateId = model.AppointmentDateId;
                    TreatmentRecord.TreatmentStatusId = (int)TreatmentStatus.Started;
                    TreatmentRecord.CreatedOn         = DateTime.UtcNow;
                    TreatmentRecord.Deleted           = false;
                    _treatmentRecordsServices.InsertTreatmentRecords(TreatmentRecord);
                    TreatmentRecord.TreatmentRecordNo = _treatmentRecordsServices.GetTreatmentRecordNo();
                    _treatmentRecordsServices.UpdateTreatmentRecords(TreatmentRecord);
                    //Bhawana(07/10/2019)
                    //Change appointment status from Created to Treatment Started
                    var appointmentdata = _appointmentServices.GetAppointmentDateById((int)model.AppointmentDateId);
                    appointmentdata.AppointmentStatusId = (int)AppointmentStatus.TreatmentStarted;
                    _appointmentServices.UpdateAppointmentDate(appointmentdata);

                    //Inser Patient Data if patient is new
                    var PatientMaster = new PatientMaster();
                    if (model.PatientMasterId == 0)
                    {
                        PatientMaster.PatientName = _encryptionService.EncryptText(model.PatientName);
                        PatientMaster.Deleted     = false;
                        PatientMaster.CreatedOn   = DateTime.UtcNow;
                        _treatmentRecordsServices.InsertPatientMaster(PatientMaster);
                    }
                    else
                    {
                        PatientMaster.Id          = (int)model.PatientMasterId;
                        PatientMaster.PatientName = _encryptionService.EncryptText(model.PatientName);
                        PatientMaster.Deleted     = false;
                        PatientMaster.LastUpdated = DateTime.UtcNow;
                        _treatmentRecordsServices.UpdatePatientMaster(PatientMaster);
                    }
                    //Inser PatientInfo Data in Database
                    var PatientInfo = new PatientInfo();
                    PatientInfo.Date                    = model.Date;
                    PatientInfo.MR                      = _encryptionService.EncryptText(model.MR);
                    PatientInfo.Deleted                 = false;
                    PatientInfo.CreatedOn               = DateTime.UtcNow;
                    PatientInfo.LastUpdated             = DateTime.UtcNow;
                    PatientInfo.PatientMasterId         = PatientMaster.Id;
                    PatientInfo.NurseMasterId           = (model.NurseMasterId != 0)? model.NurseMasterId:null;
                    PatientInfo.HospitalMasterId        = (model.HospitalMasterId != 0) ? model.HospitalMasterId:null;
                    PatientInfo.DiagnosisId             = model.DiagnosisId;
                    PatientInfo.ProcedureId             = model.ProcedureId;
                    PatientInfo.MarkComplete            = model.MarkComplete;
                    PatientInfo.TreatmentRecordMasterId = TreatmentRecord.Id;
                    _treatmentRecordsServices.InsertPatientInfo(PatientInfo);
                    //Bhawana(09/10/2019)
                    //Change treatment Record Status
                    _reportService.UpdateTreatmentStatusID((int)PatientInfo.TreatmentRecordMasterId);
                    //12/10/19 aakansha
                    //model response
                    model.PatientInfoId           = PatientInfo.Id;
                    model.PatientMasterId         = PatientInfo.PatientMasterId;
                    model.TreatmentRecordMasterId = PatientInfo.TreatmentRecordMasterId;
                    model.TreatmentRecordNo       = TreatmentRecord.TreatmentRecordNo;
                    resultModel.Message           = ValidationMessages.Success;
                    resultModel.Status            = 1;
                    resultModel.Response          = model;
                    return(Ok(resultModel));
                }
                else
                {
                    var patientInfoData = _treatmentRecordsServices.GetPatientInfoById(model.PatientInfoId);
                    if (patientInfoData != null)
                    {
                        patientInfoData.Date             = model.Date;
                        patientInfoData.LastUpdated      = DateTime.UtcNow;
                        patientInfoData.MR               = _encryptionService.EncryptText(model.MR);
                        patientInfoData.NurseMasterId    = model.NurseMasterId;
                        patientInfoData.HospitalMasterId = model.HospitalMasterId;
                        patientInfoData.DiagnosisId      = model.DiagnosisId;
                        patientInfoData.ProcedureId      = model.ProcedureId;
                        patientInfoData.MarkComplete     = model.MarkComplete;
                        _treatmentRecordsServices.UpdatePatientInfo(patientInfoData);
                        //Bhawana(09/10/2019)
                        //Change treatment Record Status
                        _reportService.UpdateTreatmentStatusID((int)patientInfoData.TreatmentRecordMasterId);
                    }
                    //12/10/19 aakansha
                    //model response
                    model.PatientInfoId           = patientInfoData.Id;
                    model.PatientMasterId         = patientInfoData.PatientMasterId;
                    model.TreatmentRecordMasterId = patientInfoData.TreatmentRecordMasterId;
                    var treatmentdata = _treatmentRecordsServices.GetTreatmentRecordsById((int)patientInfoData.TreatmentRecordMasterId);
                    model.TreatmentRecordNo = treatmentdata.TreatmentRecordNo;
                    resultModel.Message     = ValidationMessages.Success;
                    resultModel.Status      = 1;
                    resultModel.Response    = model;
                    return(Ok(resultModel));
                }
            }
            catch (Exception ex)
            {
                resultModel.Message  = ex.ToString();
                resultModel.Status   = 0;
                resultModel.Response = null;
                return(Ok(resultModel));
            }
        }
        public ActionResult Registro(FormCollection collection)
        {
            List <PatientInfo> comprobacionDPI = new List <PatientInfo>();

            comprobacionDPI = Storage.Instance.dataPacientes.Busqueda("dpi", (collection["DPI_Partida"]));

            if ((collection["DPI_Partida"].Length == 13))
            {
                if (comprobacionDPI == null || comprobacionDPI.Count == 0)
                {
                    if ((long.Parse(collection["DPI_Partida"].Substring(9)) <= 2231) && (long.Parse(collection["DPI_Partida"].Substring(9)) >= 0101))
                    {
                        PatientInfo   newPatient = new PatientInfo();
                        Hospital      hospitalCorrespondiente = new Hospital("Hospital");
                        PrioridadCola infoCola         = new PrioridadCola();
                        string        infoEstadisticas = "";

                        #region Informacion de registro de paciente
                        newPatient.Nombre         = collection["Nombre"];
                        newPatient.Apellido       = collection["Apellido"];
                        newPatient.DPI_Partida    = long.Parse(collection["DPI_Partida"]);
                        newPatient.Departamento   = collection["Departamento"];
                        newPatient.Municipio      = collection["Municipio"];
                        newPatient.Sintomas       = collection["Sintomas"];
                        newPatient.Contagio       = collection["Contagio"];
                        newPatient.Categoria      = collection["Categoria"];
                        newPatient.Caracteristica = collection["Caracteristica"];
                        newPatient.Estado         = newPatient.Categoria;
                        #endregion

                        #region Informacion de registro para cola
                        infoCola.nombre    = newPatient.Nombre;
                        infoCola.apellido  = newPatient.Apellido;
                        infoCola.dpi       = newPatient.DPI_Partida;
                        infoCola.prioridad = definirPrioridad(newPatient.Caracteristica);
                        #endregion

                        #region Definicion de hospital correspondiente
                        if ((collection["Departamento"] == "Guatemala") || (collection["Departamento"] == "BajaVerapaz") || (collection["Departamento"] == "Chimaltenango") || (collection["Departamento"] == "ElProgreso"))
                        {
                            hospitalCorrespondiente = Storage.Instance.hospitalCapital;
                            infoEstadisticas        = "Capital";
                        }
                        if ((collection["Departamento"] == "Quetzaltenango") || (collection["Departamento"] == "SanMarcos") || (collection["Departamento"] == "Retalhuleu") || (collection["Departamento"] == "Totonicapán") || (collection["Departamento"] == "Sololá"))
                        {
                            hospitalCorrespondiente = Storage.Instance.hospitalQuetzaltenango;
                            infoEstadisticas        = "Quetzaltenango";
                        }
                        if ((collection["Departamento"] == "Petén") || (collection["Departamento"] == "Quiché") || (collection["Departamento"] == "AltaVerapaz") || (collection["Departamento"] == "Izabal") || (collection["Departamento"] == "Huehuetenango"))
                        {
                            hospitalCorrespondiente = Storage.Instance.hospitalPeten;
                            infoEstadisticas        = "Petén";
                        }
                        if ((collection["Departamento"] == "Escuintla") || (collection["Departamento"] == "Suchitepequez") || (collection["Departamento"] == "Sacatepequez") || (collection["Departamento"] == "SantaRosa"))
                        {
                            hospitalCorrespondiente = Storage.Instance.hospitalEscuintla;
                            infoEstadisticas        = "Escuintla";
                        }
                        if ((collection["Departamento"] == "Jalapa") || (collection["Departamento"] == "Jutiapa") || (collection["Departamento"] == "Chiquimula") || (collection["Departamento"] == "Zacapa"))
                        {
                            hospitalCorrespondiente = Storage.Instance.hospitalOriente;
                            infoEstadisticas        = "Oriente";
                        }
                        #endregion

                        #region Envio a cola
                        if (newPatient.Categoria == "Contagiado")
                        {
                            Storage.Instance.datos.contagiadosIngresados++;
                            #region Agregar datos para estadisticas
                            if (infoEstadisticas == "Capital")
                            {
                                Storage.Instance.datosCapital.contagiadosIngresados++;
                            }
                            else if (infoEstadisticas == "Quetzaltenango")
                            {
                                Storage.Instance.datosQuetzaltenango.contagiadosIngresados++;
                            }
                            else if (infoEstadisticas == "Escuintla")
                            {
                                Storage.Instance.datosEscuintla.contagiadosIngresados++;
                            }
                            else if (infoEstadisticas == "Petén")
                            {
                                Storage.Instance.datosPeten.contagiadosIngresados++;
                            }
                            else if (infoEstadisticas == "Oriente")
                            {
                                Storage.Instance.datosOriente.contagiadosIngresados++;
                            }
                            #endregion

                            if (hospitalCorrespondiente.contagiadosCamilla < 10)
                            {
                                hospitalCorrespondiente.contagiadosCamilla++;

                                //Enviar datos del Paciente a camilla.

                                //Encontrar primer camilla libre y sacar su código.
                                Cama camaDisponible = hospitalCorrespondiente.camillas.AllDataLikeList().Find((dato) =>
                                {
                                    return((dato.Disponible) ? true : false);
                                });

                                //Llamar al hashTable del hospital Correspondiente....
                                //Hacer un search de la camilla con ese código y al objeto de retorno ingresarle el paciente.
                                hospitalCorrespondiente.camillas.Search(camaDisponible.Codigo).PacienteActual = infoCola;
                                hospitalCorrespondiente.camillas.Search(camaDisponible.Codigo).Disponible     = false;

                                hospitalCorrespondiente.CamillasDisponibles = hospitalCorrespondiente.CamasDisponibles();
                                hospitalCorrespondiente.CamillasOcupadas    = hospitalCorrespondiente.CamasOcupadas();
                            }
                            else
                            {
                                hospitalCorrespondiente.colaContagiados.Insert(infoCola.prioridad, infoCola);
                            }
                        }
                        else if (newPatient.Categoria == "Sospechoso")
                        {
                            Storage.Instance.datos.sospechososIngresados++;
                            #region Agregar datos para estadisticas
                            if (infoEstadisticas == "Capital")
                            {
                                Storage.Instance.datosCapital.sospechososIngresados++;
                            }
                            else if (infoEstadisticas == "Quetzaltenango")
                            {
                                Storage.Instance.datosQuetzaltenango.sospechososIngresados++;
                            }
                            else if (infoEstadisticas == "Escuintla")
                            {
                                Storage.Instance.datosEscuintla.sospechososIngresados++;
                            }
                            else if (infoEstadisticas == "Petén")
                            {
                                Storage.Instance.datosPeten.sospechososIngresados++;
                            }
                            else if (infoEstadisticas == "Oriente")
                            {
                                Storage.Instance.datosOriente.sospechososIngresados++;
                            }
                            #endregion
                            hospitalCorrespondiente.colaSospechosos.Insert(infoCola.prioridad, infoCola);
                        }
                        #endregion
                        Storage.Instance.dataPacientes.Insert(newPatient.Nombre, newPatient.Apellido, newPatient.DPI_Partida, newPatient);
                        return(View("Index"));
                    }
                    else
                    {
                        Response.Write("<script>alert('El dpi ingresado no corresponde a ningún departamento')</script>");
                        return(View("Registro"));
                    }
                }
                else
                {
                    Response.Write("<script>alert('El DPI ingresado ya está registrado en el sistema, intente ingresar otro paciente...')</script>");
                    return(View("Registro"));
                }
            }
            else
            {
                Response.Write("<script>alert('El DPI ingresado no es válido, inténtelo de nuevo')</script>");
                return(View("Registro"));
            }
        }
		private void UpdatePatientDemographics(ServerEntityKey patientEntityKey, PatientInfo patientInfo)
		{
			Platform.Log(LogLevel.Info, "Update patient record...");
			var patientUpdateBroker = UpdateContext.GetBroker<IPatientEntityBroker>();
			var columns = new PatientUpdateColumns();
			columns.IssuerOfPatientId = patientInfo.IssuerOfPatientId;
			columns.PatientId = patientInfo.PatientId;
			columns.PatientsName = patientInfo.PatientsName;
			if (atLeastOneFileUpdatedToUTF8) 
				columns.SpecificCharacterSet = UTF8;
			
			patientUpdateBroker.Update(patientEntityKey, columns);

		}
Beispiel #32
0
 /// <summary>
 /// Adds PatientInfo object to the database
 /// </summary>
 /// <param name="patient">New PatientInfo object</param>
 public void AddPatient(PatientInfo patient)
 {
     _data.AddPatient(patient);
 }
        public void Equals_PatientsWithSameIDAndNameAreEqual()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient1 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            var patient2 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };

            // Act
            var result = patient1.Equals(patient2);

            // Assert
            Assert.That(result, Is.True);
        }
		private Patient FindPatient(PatientInfo patientInfo, IPersistenceContext context)
		{
			var patientFindBroker = context.GetBroker<IPatientEntityBroker>();
			var criteria = new PatientSelectCriteria();
            criteria.ServerPartitionKey.EqualTo(_partition.Key);
			if (!String.IsNullOrEmpty(patientInfo.PatientId))
				criteria.PatientId.EqualTo(patientInfo.PatientId);
			else
				criteria.PatientId.IsNull();

			if (!String.IsNullOrEmpty(patientInfo.PatientsName))
				criteria.PatientsName.EqualTo(patientInfo.PatientsName);
			else
				criteria.PatientsName.IsNull();

			return patientFindBroker.FindOne(criteria);
		}
Beispiel #35
0
 public bool DeletePatientInfo(PatientInfo model)
 {
     StringBuilder stringBuilder = new StringBuilder();
     stringBuilder.AppendFormat("delete from PatientBaseInfo where PatientId={0};", model.Id);
     stringBuilder.AppendFormat("delete from OperationInfo   where PatientId={0};", model.Id);
     stringBuilder.AppendFormat("delete from SclerteInfo  where PatientId={0};", model.Id);
     foreach (SclerteInfo sclerte in model.OcSclerteInfo)
     {
         File.Delete(sclerte.SleritePicUrl);
     }
     return DbHelperSQLite.ExecuteSql(stringBuilder.ToString()) > 0;
 }
		private void Initialize()
		{
			_study = Study.Find(ServerExecutionContext.Current.ReadContext,_studyLocation.StudyInstanceUid, _partition);
			_curPatient = _study.LoadPatient(ServerExecutionContext.Current.ReadContext);
			_oldPatientInfo = new PatientInfo
				{
					PatientsName = _curPatient.PatientsName,
					PatientId = _curPatient.PatientId,
					IssuerOfPatientId = _curPatient.IssuerOfPatientId
				};

			_seriesInstanceUid = _file.DataSet[DicomTags.SeriesInstanceUid].ToString();
			var broker = ServerExecutionContext.Current.ReadContext.GetBroker<ISeriesEntityBroker>();
			var select = new SeriesSelectCriteria();
			select.SeriesInstanceUid.EqualTo(_seriesInstanceUid);
			select.ServerPartitionKey.EqualTo(_partition.Key);
			_curSeries = broker.FindOne(select);

			_newPatientInfo = new PatientInfo(_oldPatientInfo);
			_file.DataSet.LoadDicomFields(_newPatientInfo);

			_newPatient = FindPatient(_newPatientInfo, ServerExecutionContext.Current.ReadContext);
			_patientInfoIsNotChanged = _newPatientInfo.Equals(_oldPatientInfo);
		}
Beispiel #37
0
        public List<PatientInfo> QueryPatientBaseInfo(string where)
        {
            List<PatientInfo> list = new List<PatientInfo>();
            StringBuilder stringBuilder = new StringBuilder("select * from PatientBaseInfo where 1=1 ");
            if (!string.IsNullOrWhiteSpace(where))
            {
                stringBuilder.Append(where);
            }
            stringBuilder.Append(" order by BeHospitalizedDate");
            //stringBuilder.Append(" LIMIT 500");
            uint seq = 0;
            using (DbDataReader dbDataReader = DbHelperSQLite.ExecuteReader(stringBuilder.ToString()))
            {
                while (dbDataReader.Read())
                {
                    PatientInfo patientInfo = new PatientInfo { Seq = ++seq };
                    object obj = dbDataReader["PatientId"];
                    if (obj != DBNull.Value)
                    {
                        patientInfo.Id = Convert.ToInt64(obj);
                    }
                    patientInfo.Name = dbDataReader["PatientName"].ToString();
                    obj = dbDataReader["PatientAge"];
                    if (obj != DBNull.Value)
                    {
                        patientInfo.Age = Convert.ToUInt16(obj);
                    }
                    patientInfo.Sex = dbDataReader["PatientSex"].ToString();
                    obj = dbDataReader["BeHospitalizedDate"];
                    if (obj != null && obj != DBNull.Value)
                    {
                        patientInfo.BeHospitalizedDate = new DateTime?((DateTime)obj);
                    }
                    patientInfo.Bed = dbDataReader["Bed"].ToString();
                    patientInfo.CourtyardState = dbDataReader["CourtyardState"].ToString();
                    obj = dbDataReader["LeaveHospitalDate"];
                    if (obj != null && obj != DBNull.Value)
                    {
                        patientInfo.LeaveHospitalDate = new DateTime?((DateTime)obj);
                    }
                    patientInfo.LeaveHospitalAgent = dbDataReader["LeaveHospitalAgent"].ToString();
                    patientInfo.Diacrisis = dbDataReader["Diacrisis"].ToString();

                    patientInfo.Teach = dbDataReader["Teach"].ToString();
                    list.Add(patientInfo);
                }

            }
            return list;
        }
 private void LoadSearchResult(String HospitalId,String PatientName)
 {
     this.SearchResult.Clear();
     for (int i = 0; i < this.TablesName.Count; i++)
     {
         try
         {
             FileStream fs;
             fs = new FileStream(this.sPath + this.TablesName[i] + ".dat", FileMode.Open);
             BinaryReader br = new BinaryReader(fs);
             try
             {
                 int rowNum = 0;
                 while (true)
                 {
                     PatientInfo TempInfo = new PatientInfo();
                     TempInfo.id = br.ReadString();
                     TempInfo.Name = br.ReadString();
                     TempInfo.HospitalId = br.ReadString();
                     TempInfo.BookInDate = br.ReadString();
                     TempInfo.ReturnAmount = br.ReadString();
                     TempInfo.ReturnDate = br.ReadString();
                     TempInfo.Other = br.ReadString();
                     bool IsIn = false;
                     if (!HospitalId.Equals(""))
                     {
                         if (TempInfo.HospitalId.Equals(HospitalId))
                         {
                             IsIn = true;
                         }
                     }
                     if (!PatientName.Equals(""))
                     {
                         if(TempInfo.Name.Contains(PatientName))
                         {
                             IsIn = true;
                         }
                     }
                     if (IsIn)
                     {
                         TempInfo.fileName = this.TablesName[i];
                         TempInfo.RowNum = rowNum;
                         this.SearchResult.Add(TempInfo);
                     }
                     rowNum++;
                 }
             }
             catch (Exception)
             {
                 Console.WriteLine("读取文件到达末尾");
             }
             br.Close();
             fs.Close();
         }
         catch (FileNotFoundException)
         {
             continue;
         }
     }
 }
 private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
 {
     Graphics g = e.Graphics;
     //MessageBox.Show(Convert.ToString(e.MarginBounds.Width));
     Font HeadFont = new Font("宋体",24);
     Font TextFont = new Font("宋体", 10);
     SolidBrush myBrush = new SolidBrush(Color.Black);
     Pen myPen = new Pen(Color.Black);
     //标题
     //g.DrawString("病历档案", HeadFont, myBrush, e.MarginBounds.Left + 246, e.MarginBounds.Top + 21);
     //时间
     PatientInfo TempInfo;
     Image DesImage;
     if (NameListBox.SelectedIndex == -1)
     {
         TempInfo = new PatientInfo();
         TempInfo.BookInDate = "    年  月  日";
         TempInfo.HospitalId = "";
         TempInfo.id = "";
         TempInfo.Name = "";
         TempInfo.ReturnAmount = "";
         TempInfo.ReturnDate = "";
         DesImage = null;
     }
     else
     {
         TempInfo = this.SearchResult[NameListBox.SelectedIndex];
         DesImage = pictureBoxDocument.Image;
     }
     /*
     g.DrawString(TempInfo.BookInDate, TextFont, myBrush, e.MarginBounds.Left + 478, e.MarginBounds.Top + 47);
     //表格
     g.DrawLine(myPen, e.MarginBounds.Left + 23, e.MarginBounds.Top + 76, e.MarginBounds.Left + 604, e.MarginBounds.Top + 76);
     g.DrawLine(myPen, e.MarginBounds.Left + 23, e.MarginBounds.Top + 93, e.MarginBounds.Left + 604, e.MarginBounds.Top + 93);
     g.DrawLine(myPen, e.MarginBounds.Left + 23, e.MarginBounds.Top + 116, e.MarginBounds.Left + 604, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 23, e.MarginBounds.Top + 76, e.MarginBounds.Left + 23, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 60, e.MarginBounds.Top + 76, e.MarginBounds.Left + 60, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 168, e.MarginBounds.Top + 76, e.MarginBounds.Left + 168, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 275, e.MarginBounds.Top + 76, e.MarginBounds.Left + 275, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 385, e.MarginBounds.Top + 76, e.MarginBounds.Left + 385, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 497, e.MarginBounds.Top + 76, e.MarginBounds.Left + 497, e.MarginBounds.Top + 116);
     g.DrawLine(myPen, e.MarginBounds.Left + 604, e.MarginBounds.Top + 76, e.MarginBounds.Left + 604, e.MarginBounds.Top + 116);
     //绘制文字
     g.DrawString("编号",TextFont,myBrush, e.MarginBounds.Left + 64, e.MarginBounds.Top + 78);
     g.DrawString("姓名", TextFont, myBrush, e.MarginBounds.Left + 172, e.MarginBounds.Top + 78);
     g.DrawString("住院号", TextFont, myBrush, e.MarginBounds.Left + 279, e.MarginBounds.Top + 78);
     g.DrawString("返款日期", TextFont, myBrush, e.MarginBounds.Left + 389, e.MarginBounds.Top + 78);
     g.DrawString("押金", TextFont, myBrush, e.MarginBounds.Left + 501, e.MarginBounds.Top + 78);
     //绘制内容
     g.DrawString(TempInfo.id, TextFont, myBrush, e.MarginBounds.Left + 64, e.MarginBounds.Top + 95);
     g.DrawString(TempInfo.Name, TextFont, myBrush, e.MarginBounds.Left + 172, e.MarginBounds.Top + 95);
     g.DrawString(TempInfo.HospitalId, TextFont, myBrush, e.MarginBounds.Left + 279, e.MarginBounds.Top + 95);
     g.DrawString(TempInfo.ReturnDate, TextFont, myBrush, e.MarginBounds.Left + 389, e.MarginBounds.Top + 95);
     g.DrawString(TempInfo.ReturnAmount, TextFont, myBrush, e.MarginBounds.Left + 501, e.MarginBounds.Top + 95);
     */
     //绘制图片
     if (DesImage != null)
     {
         //g.DrawImage(pictureBoxDocument.Image, e.MarginBounds.Left + 23, e.MarginBounds.Top + 142, 581, 820);
         g.DrawImage(pictureBoxDocument.Image, e.PageBounds.Left, e.PageBounds.Top, e.PageBounds.Width, e.PageBounds.Height);
     }
     g.DrawRectangle(myPen, e.PageBounds.Left, e.PageBounds.Top, e.PageBounds.Width, e.PageBounds.Height);
     //g.DrawRectangle(myPen, e.MarginBounds.Left + 23, e.MarginBounds.Top + 142, 581, 820);
     e.HasMorePages = false;
 }
 public FrmEditOperation(PatientInfo pi)
     : this()
 {
     OperationValue.PatientId = pi.Id;
     Title = string.Format("{0}[{1}]的手术信息", OperationValue.PatientId == 0 ? "新增" : "修改/查看", pi.Name);
 }
		private void Initialize()
		{
			_backupDir = ProcessorContext.BackupDirectory;

				_oldStudyPath = _oldStudyLocation.GetStudyPath();
				_oldStudyInstanceUid = _oldStudyLocation.StudyInstanceUid;
				_oldStudyFolder = _oldStudyLocation.StudyFolder;
				_newStudyInstanceUid = _oldStudyInstanceUid;

			_study = _oldStudyLocation.LoadStudy(ServerExecutionContext.Current.ReadContext);
				_totalSopCount = _study.NumberOfStudyRelatedInstances;
			_curPatient = _study.LoadPatient(ServerExecutionContext.Current.ReadContext);
				_oldPatientInfo = new PatientInfo
				                  	{
				                  		Name = _curPatient.PatientsName,
				                  		PatientId = _curPatient.PatientId,
				                  		IssuerOfPatientId = _curPatient.IssuerOfPatientId
				                  	};

				_newPatientInfo = new PatientInfo(_oldPatientInfo);
				Debug.Assert(_newPatientInfo.Equals(_oldPatientInfo));

				foreach (BaseImageLevelUpdateCommand command in _commands)
				{
					ImageLevelUpdateEntry imageLevelUpdate = command.UpdateEntry;
					if (imageLevelUpdate == null)
						continue;

					if (imageLevelUpdate.TagPath.Tag.TagValue == DicomTags.StudyInstanceUid)
					{
						_newStudyInstanceUid = imageLevelUpdate.GetStringValue();
					}
					else if (imageLevelUpdate.TagPath.Tag.TagValue == DicomTags.PatientId)
					{
						_newPatientInfo.PatientId = imageLevelUpdate.GetStringValue();
					}
					else if (imageLevelUpdate.TagPath.Tag.TagValue == DicomTags.IssuerOfPatientId)
					{
						_newPatientInfo.IssuerOfPatientId = imageLevelUpdate.GetStringValue();
					}
					else if (imageLevelUpdate.TagPath.Tag.TagValue == DicomTags.PatientsName)
					{
						_newPatientInfo.Name = imageLevelUpdate.GetStringValue();
					}
				}

				Platform.CheckForNullReference(_newStudyInstanceUid, "_newStudyInstanceUid");

				NewStudyPath = Path.Combine(_oldStudyLocation.FilesystemPath, _partition.PartitionFolder);
				NewStudyPath = Path.Combine(NewStudyPath, _oldStudyFolder);
				NewStudyPath = Path.Combine(NewStudyPath, _newStudyInstanceUid);

			_newPatient = FindPatient(_newPatientInfo, ServerExecutionContext.Current.ReadContext);
				_patientInfoIsNotChanged = _newPatientInfo.Equals(_oldPatientInfo);

				Statistics.InstanceCount = _study.NumberOfStudyRelatedInstances;
				Statistics.StudySize = (ulong) _oldStudyLocation.LoadStudyXml().GetStudySize();

				// The study path will be changed. We will need to delete the original folder at the end.
				// May be too simple to test if two paths are the same. But let's assume it is good enough for 99% of the time.
				_deleteOriginalFolder = NewStudyPath != _oldStudyPath;
				_initialized = true;
			}
        public PatientDetails[] GetPatientDetails(Stream message)
        {
            try
            {
                PatientDetails objInput = JSonHelper.JsonDeserialize<PatientDetails>(new StreamReader(message).ReadToEnd());
                if (System.Configuration.ConfigurationManager.AppSettings[objInput.Pin] == null)
                {
                    PatientDetails patdet = new PatientDetails();
                    patdet.PatientId = 0;
                    patdet.FirstName = "";
                    patdet.LastName = "";
                    patdet.DOB = "";
                    patdet.Phone = "";
                    patdet.MessengerMessage = "Invalid PIN";
                    var colpatdets = new PatientDetails[1];
                    colpatdets[0] = patdet;
                    return colpatdets;
                }
                if (objInput.Pin != null && objInput.Pin.Length > 0)
                {
                    if (objInput.PhysicianId != null && objInput.PhysicianId.ToString().Length > 0)
                    {
                        IList<PatientInfo> objcol = new List<PatientInfo>();
                        PatientInfo obj = new PatientInfo();
                        Patient objbll = new Patient();

                        obj.Physician = objInput.PhysicianId;
                        if (objInput.FirstName != null)
                            obj.FirstName = objInput.FirstName;
                        if (objInput.LastName != null)
                            obj.Lastname = objInput.LastName;

                        obj.Pin = System.Configuration.ConfigurationManager.AppSettings[objInput.Pin].ToString();
                        if (objInput.DOB != null && objInput.DOB.Length > 0)
                        {
                            obj.DateOfBirth = Convert.ToDateTime(objInput.DOB);
                        }
                        else
                        {
                            obj.DateOfBirth = DateTime.MinValue;
                        }

                        objcol = objbll.SearchPatientsDetailsByCriteria(obj);
                        var colPatDetails = new PatientDetails[objcol.Count];
                        var autoPopUpdata = new List<string>(objcol.Count);
                        if (objcol.Count > 0)
                        {
                            for (var i = 0; i < objcol.Count; i++)
                            {
                                PatientDetails patdet = new PatientDetails();
                                PatientInfo patinfo = objcol[i];
                                patdet.PatientId = patinfo.PatientId;
                                patdet.FirstName = patinfo.FirstName;
                                patdet.LastName = patinfo.Lastname;
                                patdet.DOB = patinfo.DateOfBirth_String;
                                patdet.Phone = patinfo.PhoneNumber;
                                colPatDetails[i] = patdet;

                                //var elementAtOrDefault = objcol.ElementAtOrDefault(i);
                                //if (elementAtOrDefault != null)
                                //    autoPopUpdata.Add(string.Format("{0}-{1}-{2}-{3}-{4}", elementAtOrDefault.PatientId,
                                //                                    elementAtOrDefault.FirstName,
                                //                                    elementAtOrDefault.Lastname,
                                //                                    elementAtOrDefault.DateOfBirth,
                                //                                    elementAtOrDefault.PhoneNumber));
                            }
                        }
                        return colPatDetails;
                    }
                    else
                    {
                        PatientDetails patdet = new PatientDetails();
                        patdet.PatientId = 0;
                        patdet.FirstName = "";
                        patdet.LastName = "";
                        patdet.DOB = "";
                        patdet.Phone = "";
                        patdet.MessengerMessage = "Physician id is a required field";
                        var colpatdets = new PatientDetails[1];
                        colpatdets[0] = patdet;
                        return colpatdets;
                    }
                }
                else
                {
                    PatientDetails patdet = new PatientDetails();
                    patdet.PatientId = 0;
                    patdet.FirstName = "";
                    patdet.LastName = "";
                    patdet.DOB = "";
                    patdet.Phone = "";
                    patdet.MessengerMessage = "Pin is a required field";
                    var colpatdets = new PatientDetails[1];
                    colpatdets[0] = patdet;
                    return colpatdets;
                }
            }
            catch (Exception ex)
            {
                PatientDetails patdet = new PatientDetails();
                patdet.PatientId = 0;
                patdet.FirstName = "";
                patdet.LastName = "";
                patdet.DOB = "";
                patdet.Phone = "";
                patdet.MessengerMessage = ex.Message;
                var colpatdets = new PatientDetails[1];
                colpatdets[0] = patdet;
                return colpatdets;
            }
        }
		private Patient CreateNewPatient(PatientInfo patientInfo)
		{
			Platform.Log(LogLevel.Info, "Creating new patient {0}", patientInfo.PatientId);

			ICreatePatientForStudy createStudyBroker = UpdateContext.GetBroker<ICreatePatientForStudy>();
			CreatePatientForStudyParameters parms = new CreatePatientForStudyParameters
			                                        	{
			                                        		IssuerOfPatientId = patientInfo.IssuerOfPatientId,
			                                        		PatientId = patientInfo.PatientId,
			                                        		PatientsName = patientInfo.Name,
                                                            SpecificCharacterSet = _curPatient.SpecificCharacterSet, // this will be updated at the end if necessary
			                                        		StudyKey = _study.GetKey()
			                                        	};
			Patient newPatient = createStudyBroker.FindOne(parms);
			if (newPatient==null)
				throw new ApplicationException("Unable to create patient for the study");

			return newPatient;
		}
        public void Equals_PatientsWithDifferentIDAndNameAreNotEqual()
        {
            // Arrange
            var patient1 = new PatientInfo
            {
                PatientID = new BirthNumber("9107256444"),
                PatientName = new PatientName("Doe^John")
            };
            var patient2 = new PatientInfo
            {
                PatientID = new BirthNumber("1510180012"),
                PatientName = new PatientName("Smith^Jack")
            };

            // Act
            var result = patient1.Equals(patient2);

            // Assert
            Assert.That(result, Is.False);
        }
        public async void DownloadImages_ProperMethodsAreCalled()
        {
            // Arrange
            var mockProvider = new MockProvider();
            var studyInfoProvider = Substitute.For<IStudyInfoProvider>();
            var dataLoader = Substitute.For<IDicomDataLoader<StudyInfo>>();
            var whereCollection = Substitute.For<WhereCollection<StudyInfo>>(mockProvider.GetDicomMappingFake());
            var query = Substitute.For<DicomQuery<StudyInfo>>(mockProvider.GetGeneralizedInfoProviderFake(), dataLoader, whereCollection);
            
            dataLoader.LoadDataFromServerAsync(Arg.Any<IWhereCollection<StudyInfo>>()).Returns(c =>
                Task<IImmutableList<StudyInfo>>.Factory.StartNew(() => 
                    new List<StudyInfo>
                    {
                        new StudyInfo(),
                        new StudyInfo()
                    }.ToImmutableList()));
            
            studyInfoProvider.GetStudiesForPatient(Arg.Any<PatientInfo>()).Returns(query);
            var patientInfoProvider = new PatientInfoProvider(mockProvider.GetDicomQueryProviderForPatientsFake(), studyInfoProvider, mockProvider.GetBirthNumberParserFake());
            var patient = new PatientInfo();
                
            // Act
            await patientInfoProvider.DownloadImagesAsync(patient);

            // Assert
            Assert.That(() => studyInfoProvider.Received(1).GetStudiesForPatient(patient), Throws.Nothing);
            Assert.That(() => studyInfoProvider.Received(2).DownloadImagesAsync(Arg.Any<StudyInfo>(), Arg.Any<Func<InfoIdentifier, InfoIdentifier, Stream>>()), Throws.Nothing);
        }
Beispiel #46
0
        /// <summary>
        /// 添加患者下的申请单列表
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        private int AddApply(NeuObject dept)
        {
            DateTime begin = DateTime.MinValue, end = DateTime.MinValue;

            if (this.GetDateTime(ref begin, ref end) == -1)
            {
                return(-1);
            }
            //申请单列表
            ArrayList al = Environment.OperationManager.GetOpsAppList(dept, begin, end);

            foreach (TreeNode node in this.tvApply.Nodes[0].Nodes)
            {
                PatientInfo patient = node.Tag as PatientInfo;

                for (int i = al.Count - 1; i >= 0; i--)
                {
                    OperationAppllication apply = (OperationAppllication)al[i];
                    if (apply.PatientInfo.ID == patient.ID)
                    {
                        TreeNode child = new TreeNode();
                        if (apply.OperateKind == "2")
                        {
                            child.Text      = "【急】";
                            child.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            child.ForeColor = System.Drawing.Color.Black;
                        }

                        if (apply.OperationInfos.Count > 0)
                        {
                            child.Text = child.Text + (apply.OperationInfos[0] as OperationInfo).OperationItem.Name;
                        }
                        if (apply.ExecStatus == "3")
                        {
                            child.Text = child.Text + "『已安排』";
                        }
                        if (apply.ExecStatus == "4")
                        {
                            child.Text = child.Text + "『已登记』";
                        }
                        if (apply.ExecStatus == "5")
                        {
                            child.Text = child.Text + "『已取消登记』";
                        }
                        if (apply.IsValid == false)
                        {
                            child.Text = child.Text + "『已取消申请』";
                        }
                        if (child.Text == "")
                        {
                            child.Text = apply.PreDate.ToString();
                        }

                        child.Tag                = apply;
                        child.ImageIndex         = 2;
                        child.SelectedImageIndex = 2;
                        node.Nodes.Add(child);
                    }
                }
                node.Expand();
            }

            return(0);
        }