예제 #1
0
        /// <summary>
        /// 上传数据
        /// </summary>
        /// <param name="code">条码</param>
        /// <param name="codeType">条码的类型:0 卡号,1 住院号</param>
        /// <param name="dataStr">传入数据</param>
        /// <returns></returns>
        public string PostData(string dataStr, string username)
        {
            List <Dictionary <string, string> > dicList = GetClinicalInfoDgDicList(dataStr);
            string mes = "";

            //读取code和codeType
            if (dicList != null && dicList.Count > 0)
            {
                for (int i = 0; i < dicList.Count; i++)
                {
                    Model.QueryRecoder model = new Model.QueryRecoder();
                    model = DicToQueryRecoderModel(dicList[i]);//转化为MODEL
                    //获取值
                    string code     = dicList[i]["Code"];
                    string codeType = dicList[i]["CodeType"];
                    //string date = dicList[i]["LastQueryDate"];
                    //判断传入类型
                    if (model.QueryType == "NormalLisReport")
                    {
                        // BLL.Request.NormalLisReportRequest nrr = new Request.NormalLisReportRequest(model);
                        BLL.NormalLisReport nr = new NormalLisReport();
                        //nrr.CreatRequest(false);
                        string result = nr.GetData(model, false);
                        Model.DTO.JsonModel jsonModel_N = JsonConvert.DeserializeObject <Model.DTO.JsonModel>(result);
                        if (jsonModel_N.Statu == "ok")
                        {
                            string strdata = JsonConvert.SerializeObject(jsonModel_N.Data);
                            mes = mes + nr.PostData(code, codeType, strdata, username, true);//导入到临床检验数据
                        }
                        else
                        {
                            mes = mes + "," + jsonModel_N.Msg;
                        }
                    }
                    else if (model.QueryType == "PatientDiagnose")
                    {
                        BLL.Request.PatientDiagnoseResuest nrr = new Request.PatientDiagnoseResuest(model);
                        BLL.PatientDiagnose nr = new PatientDiagnose();
                        nrr.CreatRequest(false);
                        string result = nr.GetData(model, false);
                        Model.DTO.JsonModel jsonModel_N = JsonConvert.DeserializeObject <Model.DTO.JsonModel>(result);
                        if (jsonModel_N.Statu == "ok")
                        {
                            string strdata = JsonConvert.SerializeObject(jsonModel_N.Data);
                            mes = mes + nr.PostData(strdata, code, codeType, username, true);//导入到患者信息
                        }
                        else
                        {
                            mes = mes + "," + jsonModel_N.Msg;
                        }
                    }
                }
            }
            return(mes);
        }
예제 #2
0
파일: QueryRecoder.cs 프로젝트: aj-hc/SZY
 /// <summary>
 /// 上传数据
 /// </summary>
 /// <param name="code">条码</param>
 /// <param name="codeType">条码的类型:0 卡号,1 住院号</param>
 /// <param name="dataStr">传入数据</param>
 /// <returns></returns>
 public string PostData(string dataStr, string username)
 {
     List<Dictionary<string, string>> dicList = GetClinicalInfoDgDicList(dataStr);
     string mes = "";
     //读取code和codeType
     if (dicList != null && dicList.Count > 0)
     {
         for (int i = 0; i < dicList.Count; i++)
         {
             Model.QueryRecoder model = new Model.QueryRecoder();
             model = DicToQueryRecoderModel(dicList[i]);//转化为MODEL
             //获取值
             string code = dicList[i]["Code"];
             string codeType = dicList[i]["CodeType"];
             //string date = dicList[i]["LastQueryDate"];
             //判断传入类型
             if (model.QueryType == "NormalLisReport")
             {
                 // BLL.Request.NormalLisReportRequest nrr = new Request.NormalLisReportRequest(model);
                 BLL.NormalLisReport nr = new NormalLisReport();
                 //nrr.CreatRequest(false);
                 string result = nr.GetData(model, false);
                 Model.DTO.JsonModel jsonModel_N = JsonConvert.DeserializeObject<Model.DTO.JsonModel>(result);
                 if (jsonModel_N.Statu == "ok")
                 {
                     string strdata = JsonConvert.SerializeObject(jsonModel_N.Data);
                     mes = mes + nr.PostData(code, codeType, strdata, username, true);//导入到临床检验数据
                 }
                 else
                 {
                     mes = mes + "," + jsonModel_N.Msg;
                 }
             }
             else if (model.QueryType == "PatientDiagnose")
             {
                 BLL.Request.PatientDiagnoseResuest nrr = new Request.PatientDiagnoseResuest(model);
                 BLL.PatientDiagnose nr = new PatientDiagnose();
                 nrr.CreatRequest(false);
                 string result = nr.GetData(model, false);
                 Model.DTO.JsonModel jsonModel_N = JsonConvert.DeserializeObject<Model.DTO.JsonModel>(result);
                 if (jsonModel_N.Statu == "ok")
                 {
                     string strdata = JsonConvert.SerializeObject(jsonModel_N.Data);
                     mes = mes + nr.PostData(strdata, code, codeType, username, true);//导入到患者信息
                 }
                 else
                 {
                     mes = mes + "," + jsonModel_N.Msg;
                 }
             }
         }
     }
     return mes;
 }