Пример #1
0
        public ActionResult Editrx(int PatientID, int RxDataID)
        {
            RxViewModel p = new RxViewModel();

            DataService.Patientportal.PatientPortalService cls = new DataService.Patientportal.PatientPortalService();

            try
            {
                CommonStatus cs = cls.GetRxData(RxDataID, base.GetLoggedinUserID());

                if (cs != null && cs.OpStatus)
                {
                    RxData input = (RxData)cs.OpPayload;

                    p.RxDataID      = input.RxData_ID;
                    p.rxDate        = input.RxDate;
                    p.rxDoctor      = input.RxDoctor;
                    p.Prescription1 = input.Prescription1;
                    p.Prescription2 = input.Prescription2;
                    p.Prescription3 = input.Prescription3;
                    p.Prescription4 = input.Prescription4;
                    p.Prescription5 = input.Prescription5;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                cls = null;
            }

            return(PartialView(p));
        }
Пример #2
0
        private void RxThreadHandler(object ev)
        {
            var stopEvent = (ManualResetEvent)ev;

            while (stopEvent.WaitOne())
            {
                if (_rxBuf.Count > 0)    //Если в буфере есть данные
                {
                    Pack pack;
                    if (UseSLIP)
                    {
                        pack = SlipParser(); // то прогоняем их через SLIP протокол
                    }
                    else
                    {
                        pack = new Pack(_rxBuf.GetRange(0, _threshold));
                        _rxBuf.RemoveRange(0, _threshold);
                    }

                    if (pack != null)
                    {
                        RxData.Enqueue(new Pack(pack.Data)); //Суем пакет в выходную очередь
                        if (RxEvent != null)
                        {
                            RxEvent.Invoke(this, null); //Дергаем Event
                        }
                    }
                }

                Thread.Sleep(20);
            }
        }
Пример #3
0
 /// <summary>
 /// Метод разрыва соединения и остановки потока вычитки
 /// </summary>
 public bool Disconnect()
 {
     if (_port.IsOpen)
     {
         _port.Close();
         Status = EPortStatus.Closed;
     }
     _rxManualResetEvent.Reset();
     RxData.Clear();
     _rxBuf.Clear();
     return(true);
 }
Пример #4
0
        public ActionResult EditRx(int PatientID, RxViewModel input)
        {
            string status  = string.Empty;
            string message = string.Empty;

            if (ModelState.IsValid)
            {
                DataService.Patientportal.PatientPortalService cls = new DataService.Patientportal.PatientPortalService();

                try
                {
                    RxData p = new RxData();
                    p.RxData_ID     = input.RxDataID;
                    p.RxDate        = input.rxDate;
                    p.RxDoctor      = input.rxDoctor;
                    p.Prescription1 = input.Prescription1;
                    p.Prescription2 = input.Prescription2;
                    p.Prescription3 = input.Prescription3;
                    p.Prescription4 = input.Prescription4;
                    p.Prescription5 = input.Prescription5;

                    CommonStatus cs = cls.AddUpdatePatientRxData(PatientID, p, base.GetLoggedinUserID());

                    if (cs != null && cs.OpStatus)
                    {
                        status = "OK"; message = "";
                    }
                    else
                    {
                        status = "ERROR"; message = cs.OpMessage;
                    }
                }
                catch (Exception ex)
                {
                    status  = "ERROR";
                    message = ex.Message;
                }
                finally
                {
                    cls = null;
                }
            }

            var jsonData = new
            {
                status  = status,
                message = message
            };


            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
 private void GetRxData()
 {
     RxData.Add(new TableDisplayModel {
         Property = "Dose Per Fraction", Value = $"{_plan.DosePerFraction}"
     });
     RxData.Add(new TableDisplayModel {
         Property = "Number of Fractions", Value = $"{_plan.NumberOfFractions}"
     });
     RxData.Add(new TableDisplayModel {
         Property = "Total Dose", Value = $"{_plan.TotalDose}"
     });
     RxData.Add(new TableDisplayModel {
         Property = "Treatment %", Value = $"{_plan.TreatmentPercentage * 100.0}"
     });
 }
Пример #6
0
        public CommonStatus GetAllPatientRxs(int patientID, int LoggedInuserID)
        {
            CommonStatus cs = new CommonStatus(false);

            try
            {
                using (PatientPortalEntities ent = new PatientPortalEntities())
                {
                    List <RxData> allPatientRxs = new List <RxData>();

                    var rxs = from prd in ent.TB_PatientRxData
                              join rd in ent.TB_RxData on prd.RxData_ID equals rd.RxData_ID
                              where (prd.Patient_ID == patientID)
                              select rd;

                    if (rxs != null && rxs.FirstOrDefault() != null)
                    {
                        foreach (TB_RxData r in rxs)
                        {
                            RxData d = new RxData();
                            d.RxData_ID     = r.RxData_ID;
                            d.RxDate        = r.RxDate;
                            d.RxDoctor      = r.RxDoctor;
                            d.Prescription1 = r.Prescription1;
                            d.Prescription2 = r.Prescription2;
                            d.Prescription3 = r.Prescription3;
                            d.Prescription4 = r.Prescription4;
                            d.Prescription5 = r.Prescription5;
                            d.CreateDate    = r.CreateDate;
                            d.UpdatedOn     = r.UpdateDate;

                            allPatientRxs.Add(d);
                        }

                        cs.Set(true, "", allPatientRxs);
                    }
                }
            }
            catch (Exception ex)
            {
                cs.Set(false, ex.Message, null);
            }

            return(cs);
        }
        public CommonStatus AddUpdatePatientRxData(int patientID, RxData rxData, int LoggedInuserID)
        {
            ProcessData  p  = new ProcessData();
            CommonStatus cs = new CommonStatus(false);

            try
            {
                cs = p.AddUpdatePatientRxData(patientID, rxData, LoggedInuserID);
            }
            catch (Exception ex)
            {
                cs.Set(false, ex.Message, null);
            }
            finally
            {
                p = null;
            }

            return(cs);
        }
Пример #8
0
        public CommonStatus GetRxData(int RxDataID, int LoggedInuserID)
        {
            CommonStatus cs = new CommonStatus(false);

            try
            {
                using (PatientPortalEntities ent = new PatientPortalEntities())
                {
                    var r = (from rd in ent.TB_RxData
                             where rd.RxData_ID == RxDataID
                             select rd).FirstOrDefault();

                    if (r != null)
                    {
                        RxData d = new RxData();
                        d.RxData_ID     = r.RxData_ID;
                        d.RxDate        = r.RxDate;
                        d.RxDoctor      = r.RxDoctor;
                        d.Prescription1 = r.Prescription1;
                        d.Prescription2 = r.Prescription2;
                        d.Prescription3 = r.Prescription3;
                        d.Prescription4 = r.Prescription4;
                        d.Prescription5 = r.Prescription5;
                        d.CreateDate    = r.CreateDate;
                        d.UpdatedOn     = r.UpdateDate;

                        cs.Set(true, "", d);
                    }
                }
            }
            catch (Exception ex)
            {
                cs.Set(false, ex.Message, null);
            }

            return(cs);
        }
Пример #9
0
        public CommonStatus GetPatients(string FirstName, string LastName, int LoggedInuserID)
        {
            CommonStatus cs = new CommonStatus(false);

            try
            {
                using (PatientPortalEntities ent = new PatientPortalEntities())
                {
                    List <Patient> patients = new List <Patient>();
                    RxData         rdata    = new RxData();

                    var pts = from p in ent.TB_Patient /*where (p.First_Name.Contains(FirstName) || p.Last_Name.Contains(LastName))*/ select p;
                    foreach (TB_Patient dbp in pts)
                    {
                        //Patient p = Mapper.Map<Patient>(dbp);
                        Patient p = new Patient();
                        p.Patient_ID  = dbp.Patient_ID;
                        p.First_Name  = dbp.First_Name;
                        p.Last_Name   = dbp.Last_Name;
                        p.DateOfBirth = dbp.DateOfBirth;
                        p.PhoneNumber = dbp.PhoneNumber;
                        p.DisplayDate = (dbp.UpdateDate != null && dbp.UpdateDate > dbp.CreateDate ? dbp.UpdateDate : dbp.CreateDate);

                        p.LastestRxData = new RxData();

                        //select all Rxs for patient
                        var rx = from prd in ent.TB_PatientRxData
                                 join rd in ent.TB_RxData on prd.RxData_ID equals rd.RxData_ID
                                 join pt in ent.TB_Patient on prd.Patient_ID equals pt.Patient_ID
                                 where (prd.Patient_ID == p.Patient_ID)
                                 //orderby rd.CreateDate descending, rd.UpdateDate descending
                                 select new
                        {
                            rxid   = rd.RxData_ID,
                            uddate = (rd.UpdateDate != null && rd.UpdateDate > rd.CreateDate ? rd.UpdateDate : rd.CreateDate)
                        };

                        if (rx != null && rx.FirstOrDefault() != null)
                        {
                            var latestRxId = (from lrid in rx orderby lrid.uddate descending select lrid.rxid).FirstOrDefault();

                            var latestRX = (from s in ent.TB_RxData where s.RxData_ID == latestRxId select s).FirstOrDefault();

                            RxData d = new RxData();
                            d.RxData_ID     = latestRxId;
                            d.RxDate        = latestRX.RxDate;
                            d.RxDoctor      = latestRX.RxDoctor;
                            d.Prescription1 = latestRX.Prescription1;
                            d.Prescription2 = latestRX.Prescription2;
                            d.Prescription3 = latestRX.Prescription3;
                            d.Prescription4 = latestRX.Prescription4;
                            d.Prescription5 = latestRX.Prescription5;

                            p.LastestRxData = d;

                            //p.LastestRxData = Mapper.Map<RxData>(rx.FirstOrDefault());
                        }
                        patients.Add(p);
                    }

                    cs.Set(true, "", patients);
                }
            }
            catch (Exception ex)
            {
                cs.Set(false, ex.Message, null);
            }

            return(cs);
        }
Пример #10
0
        public CommonStatus AddUpdatePatientRxData(int patientID, RxData rxData, int LoggedInuserID)
        {
            CommonStatus cs = new CommonStatus(false);

            try
            {
                using (PatientPortalEntities ent = new PatientPortalEntities())
                {
                    var username = (from u in ent.TB_PortalUser where u.PortalUser_ID == LoggedInuserID select u.UserName).FirstOrDefault();

                    if (rxData.RxData_ID == 0)
                    {
                        TB_RxData r = new TB_RxData();
                        r.RxDate        = rxData.RxDate;
                        r.RxDoctor      = rxData.RxDoctor;
                        r.Prescription1 = rxData.Prescription1;
                        r.Prescription2 = rxData.Prescription2;
                        r.Prescription3 = rxData.Prescription3;
                        r.Prescription4 = rxData.Prescription4;
                        r.Prescription5 = rxData.Prescription5;
                        r.CreateDate    = DateTime.Now;
                        r.CreatedBy     = username;

                        ent.TB_RxData.Add(r);
                        ent.SaveChanges();

                        TB_PatientRxData pr = new TB_PatientRxData();
                        pr.Patient_ID = patientID;
                        pr.RxData_ID  = r.RxData_ID;
                        pr.CreateDate = DateTime.Now;
                        pr.CreatedBy  = username;
                        ent.TB_PatientRxData.Add(pr);
                        ent.SaveChanges();
                    }
                    else
                    {
                        var r = (from p in ent.TB_RxData where p.RxData_ID == rxData.RxData_ID select p).FirstOrDefault();

                        if (r != null)
                        {
                            r.RxDate        = rxData.RxDate;
                            r.RxDoctor      = rxData.RxDoctor;
                            r.Prescription1 = rxData.Prescription1;
                            r.Prescription2 = rxData.Prescription2;
                            r.Prescription3 = rxData.Prescription3;
                            r.Prescription4 = rxData.Prescription4;
                            r.Prescription5 = rxData.Prescription5;
                            r.UpdateDate    = DateTime.Now;
                            r.UpdatedBy     = username;

                            ent.SaveChanges();
                        }
                    }

                    cs.Set(true, "", null);
                }
            }
            catch (Exception ex)
            {
                cs.Set(false, ex.Message, null);
            }

            return(cs);
        }
Пример #11
0
    private void subsPush()
    {
        manager.Socket.On("push", (socket, packet, args) => {
            if (args.Length == 0)
            {
                return;
            }

            var json = args[0] as Dictionary <string, object>;

            if (json == null)
            {
                return;
            }

            var e        = json.String("e");
            var rid      = json.String("roomid");
            var argsDict = json.Dict("args");

            // 换房间了,更新Room
            if (e == "look" && argsDict.Int("is_enter_look") == 1)
            {
                // 更新比赛、房间ID
                GameData.Shared.MatchID    = argsDict.Dict("options").String("matchid");
                GameData.Shared.Room.Value = rid;

                //传给应用环信需要
                if (!string.IsNullOrEmpty(GameData.Shared.MatchID))
                {
                    Commander.Shared.InitHx(rid);
                }
            }
            else if (!string.IsNullOrEmpty(rid) && rid != GameData.Shared.Room.Value)                 // 收到异常包,忽略
            {
                return;
            }

            if (argsDict.ContainsKey("cmds"))
            {
                var cmds = argsDict.Dict("cmds");
                GameData.MyCmd.SetCmd(cmds);
            }

            if (String.IsNullOrEmpty(e))
            {
                return;
            }

            var rxdata = new RxData(argsDict, e);

            if (e == "prompt")
            {
                GameData.MyCmd.SetCmd(rxdata.Data);
            }

            // 通过事件广播出去
            switch (e)
            {
            case "takeseat":
                RxSubjects.TakeSeat.OnNext(rxdata);
                break;

            case "takecoin":
                RxSubjects.TakeCoin.OnNext(rxdata);
                break;

            case "unseat":
                RxSubjects.UnSeat.OnNext(rxdata);
                break;

            case "ready":
                RxSubjects.Ready.OnNext(rxdata);
                break;

            case "takemore":
                RxSubjects.TakeMore.OnNext(rxdata);
                break;

            case "gamestart":
                RxSubjects.GameStart.OnNext(rxdata);
                break;

            case "seecard":
                RxSubjects.SeeCard.OnNext(rxdata);
                break;

            case "look":
                RxSubjects.Look.OnNext(rxdata);
                break;

            case "deal":
                RxSubjects.Deal.OnNext(rxdata);
                break;

            case  "moveturn":
                RxSubjects.MoveTurn.OnNext(rxdata);
                break;

            case  "fold":
                RxSubjects.Fold.OnNext(rxdata);
                break;

            case  "check":
                RxSubjects.Check.OnNext(rxdata);
                break;

            case  "raise":
                RxSubjects.Raise.OnNext(rxdata);
                break;

            case  "call":
                RxSubjects.Call.OnNext(rxdata);
                break;

            case  "all_in":
                RxSubjects.Raise.OnNext(rxdata);
                break;

            case "bye":
                RxSubjects.Bye.OnNext(rxdata);
                break;

            case "gameover":
                RxSubjects.GameOver.OnNext(rxdata);
                break;

            case "pausing":
                RxSubjects.Pausing.OnNext(rxdata);
                break;

            case "paused":
                RxSubjects.Paused.OnNext(rxdata);
                break;

            case "start":
                RxSubjects.Started.OnNext(rxdata);
                break;

            case "game_end":
                RxSubjects.GameEnd.OnNext(rxdata);
                break;

            case "un_audit":
                RxSubjects.Audit.OnNext(rxdata);
                break;

            case "unaudit_countdown":
                RxSubjects.UnAuditCD.OnNext(rxdata);
                break;

            case "pass":
                RxSubjects.Pass.OnNext(rxdata);
                break;

            case "un_pass":
                RxSubjects.UnPass.OnNext(rxdata);
                break;

            case "ending":
                RxSubjects.Ending.OnNext(rxdata);
                break;

            case "modify":
                RxSubjects.Modify.OnNext(rxdata);
                break;

            case "emoticon":
                RxSubjects.Emoticon.OnNext(rxdata);
                break;

            case "standup":
                RxSubjects.StandUp.OnNext(rxdata);
                break;

            case "kickout":
                RxSubjects.KickOut.OnNext(rxdata);
                break;

            case "showcard":
                RxSubjects.ShowCard.OnNext(rxdata);
                break;

            case "insurance":
                RxSubjects.Insurance.OnNext(rxdata);
                break;

            case "to_insurance":
                RxSubjects.ToInsurance.OnNext(rxdata);
                break;

            case "moretime":
                RxSubjects.Moretime.OnNext(rxdata);
                break;

            case "someone_seecard":
                RxSubjects.SomeOneSeeCard.OnNext(rxdata);
                break;

            case "expression":
                RxSubjects.Expression.OnNext(rxdata);
                break;

            case "gamer_state":
                RxSubjects.GamerState.OnNext(rxdata);
                break;

            case "notalking":
                RxSubjects.NoTalking.OnNext(rxdata);
                break;

            case "show_insurance":
                RxSubjects.ShowInsurance.OnNext(rxdata);
                break;

            case "rsync_insurance":
                RxSubjects.RsyncInsurance.OnNext(rxdata);
                break;

            case "award_27":
                RxSubjects.Award27.OnNext(rxdata);
                break;

            case "offscore":
                RxSubjects.OffScore.OnNext(rxdata);
                break;

            case "match_rank":
                RxSubjects.MatchRank.OnNext(rxdata);
                break;

            case "raise_blind":
                RxSubjects.RaiseBlind.OnNext(rxdata);
                break;

            case "match_look":
                RxSubjects.MatchLook.OnNext(rxdata);
                break;

            case "to_addon":
                RxSubjects.ToAddOn.OnNext(rxdata);
                break;

            case "to_rebuy":
                RxSubjects.ToRebuy.OnNext(rxdata);
                break;

            case "mtt_match":
                RxSubjects.MTTMatch.OnNext(rxdata);
                break;

            case "current_rank":
                RxSubjects.CurrentRank.OnNext(rxdata);
                break;

            case "half_break":
                RxSubjects.HalfBreak.OnNext(rxdata);
                break;

            default:
                break;
            }
        });
    }