Exemple #1
0
        public JsonResult CDSSdiagnosis()
        {
            string strResult = null;

            try{
                string    jsonStr = Request.Params["postjson"];
                VisitData obj     = JsonConvert.DeserializeObject <VisitData>(jsonStr);//jsonStr.FromJsonTo<VisitData>();
                //HeadachePlace h1=new HeadachePlace();
                //h1.Position = "左侧为主";
                //obj.PHeadacheOverview.HeadachePlace.Add(h1);//629演示
                HeadacheDiagnosis HDiagnosis = new HeadacheDiagnosis();
                strResult = HDiagnosis.GetDiagnosis(obj);
            }
            catch (Exception e)
            {
                return(this.Json(new { OK = false, Message = e.Message + "推理出错" }));
            }
            //strResult = "123";
            if (!strResult.Contains("必填项"))
            {
                if (strResult.Length < 20)
                {
                    strResult = "\n" + "                          " + strResult;
                }
                return(this.Json(new { OK = true, Message = strResult }));
            }
            else
            {
                return(this.Json(new { OK = false, Message = strResult }));
            }
        }
        public JsonResult CDSSdiagnosis()
        {
            string            completeResult = null;
            string            drugResult     = null;
            string            cdssResult     = null;
            string            strSecond      = null;
            string            vid            = null;
            string            PatID          = Request.Params["patId"];
            string            visitID        = Request.Params["visitId"];
            VisitData         obj            = new VisitData();
            HeadacheDiagnosis HDiagnosis     = new HeadacheDiagnosis();

            string jsonStr = Request.Params["postjson"];

            obj            = JsonConvert.DeserializeObject <VisitData>(jsonStr);//jsonStr.FromJsonTo<VisitData>();
            strSecond      = HDiagnosis.secondaryScreen(obj);
            completeResult = HDiagnosis.completeTest(obj);
            drugResult     = HDiagnosis.DrugInfor(obj);
            if (strSecond == "")    //排除继发性
            {
                if (!completeResult.Contains("必填项"))
                {
                    if (drugResult == "")
                    {
                        //if (completeResult.Length < 20)
                        //    completeResult = "\n" + "                          " + completeResult;
                        if (visitID != null)
                        {
                            bool updateResult = vr.UpdateRecord(PatID, visitID, obj);
                            vid = visitID;
                        }
                        else
                        {
                            bool res = vr.SaveRecord(PatID, obj);    //在点击下一步进行推理之前先判断数据完整性,再保存,最后推理(20140814),后面的保存按钮保存前面未存的辅助诊断结果和医嘱信息
                            vid = obj.visitrecord.Id.ToString();
                        }
                        try
                        {
                            cdssResult = HDiagnosis.GetDiagnosis(obj);
                            if (cdssResult.Length < 20)
                            {
                                cdssResult = "\n" + "                          " + cdssResult;
                            }
                        }
                        catch (Exception e)
                        {
                            return(this.Json(new { OK = false, Message = e.Message + "推理出错" }));
                        }
                        return(this.Json(new { OK = true, Message = cdssResult, VisitID = vid }));
                    }
                    else
                    {
                        return(this.Json(new { OK = false, Message = drugResult }));
                    }
                }
                else
                {
                    return(this.Json(new { OK = false, Message = completeResult }));
                }
            }
            else
            {
                if (visitID != null)
                {
                    bool updateResult = vr.UpdateRecord(PatID, visitID, obj);
                    vid = visitID;
                }
                else
                {
                    bool res = vr.SaveRecord(PatID, obj);
                    vid = obj.visitrecord.Id.ToString();
                }
                return(this.Json(new { OK = true, Message = strSecond, VisitID = vid }));
            }
        }