| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 | 
							- using Newtonsoft.Json;
 
- using Newtonsoft.Json.Linq;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.ComponentModel;
 
- using System.Data;
 
- using System.Drawing;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using System.Windows.Forms;
 
- using PTMedicalInsurance.Common;
 
- using PTMedicalInsurance.Helper;
 
- using PTMedicalInsurance.Variables;
 
- using PTMedicalInsurance.Business;
 
- namespace PTMedicalInsurance.Forms
 
- {
 
-     public partial class OutpatientRegistration : Form
 
-     {
 
-         MIIrisServices mIS = new MIIrisServices();
 
-         public OutpatientRegistration()
 
-         {
 
-             InitializeComponent();
 
-             this.StartPosition = FormStartPosition.CenterParent;
 
-             /*
 
-                 string sqlCondition = " and Interface_ID = '" + Global.inf.InterfaceID + "'";
 
-                 string sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'insutype'" + sqlCondition;
 
-                 //SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
 
-                 string sqlStr2 = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type='insutype' and Interface_Dr = '7'and Hosp_Dr ='63'";
 
-                 SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr2);
 
-                 sqlStr = "select Code,SectionName AS Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Diagnose'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxDisease, sqlStr2);
 
-                 sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
 
-                 sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'MED_TYPE'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
 
-                 sqlStr = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Operation'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxOperation, sqlStr);
 
-             */
 
-             //获取通用目录
 
-             string sTYML = mIS.GetCommonInterface_Dr(Global.inf.interfaceDr.ToString(), "");
 
-             if (sTYML == "")
 
-                 Global.inf.interfaceDr_TY = Global.inf.interfaceDr;
 
-             else
 
-                 Global.inf.interfaceDr_TY = int.Parse(sTYML);
 
-             string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr_TY.ToString() + "'";
 
-             if (Global.pat.RYorCY == "2")
 
-             {
 
-                 //string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
 
-                 string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr  "
 
-                               + " WHERE B.Code='" + Global.pat.insuType + "' and A.InsuCode = 'insutype'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
 
-                 if (Global.pat.admType == 1)
 
-                 {
 
-                     sqlStr = " select A.Code, A.Name FROM HB_MedInsuDirectory A where A.Code='" + Global.pat.DiseasecCode + "' "
 
-                            + " and A.UseFlag='1' And A.HisType=6" + sqlCondition;
 
-                     SetDBLKCombox(ref dblkcbxDisease, sqlStr);
 
-                 }
 
-                 else
 
-                 {
 
-                     sqlStr = " select A.Code, A.Name FROM HB_MedInsuDirectory A where A.Code='" + Global.pat.DiseasecCode + "' "
 
-                        + " and A.UseFlag='1' And A.HisType=7" + sqlCondition;
 
-                     SetDBLKCombox(ref dblkcbxDisease, sqlStr);
 
-                 }
 
-                 sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr"
 
-                        + " WHERE B.Code='" + Global.pat.medType + "' and A.InsuCode = 'med_type'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
 
-                 sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B "
 
-                        + " ON A.ID = B.HBDictionary_Dr  WHERE A.InsuCode = 'psn_setlway'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
 
-             }
 
-             else
 
-             {
 
-                 //string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
 
-                 string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B "
 
-                               + " ON A.ID = B.HBDictionary_Dr  WHERE A.InsuCode = 'insutype'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
 
-                 if (Global.pat.admType == 1)
 
-                 {
 
-                     sqlStr = "select A.Code, A.Name FROM HB_MedInsuDirectory A where A.UseFlag='1' And A.HisType=6" + sqlCondition;
 
-                     SetDBLKCombox(ref dblkcbxDisease, sqlStr);
 
-                 }
 
-                 else
 
-                 {
 
-                     sqlStr = "select A.Code, A.Name FROM HB_MedInsuDirectory A where A.UseFlag='1' And A.HisType=7" + sqlCondition;
 
-                     SetDBLKCombox(ref dblkcbxDisease, sqlStr);
 
-                 }
 
-                 sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B "
 
-                        + " ON A.ID = B.HBDictionary_Dr  WHERE A.InsuCode = 'psn_setlway'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
 
-                 sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B "
 
-                        + " ON A.ID = B.HBDictionary_Dr  WHERE A.InsuCode = 'med_type'" + sqlCondition;
 
-                 SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
 
-             }
 
-             //sqlStr = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Directory where HisType=5" + sqlCondition;
 
-             //SetDBLKCombox(ref dblkcbxOperation, sqlStr);
 
-             //dgvDiagnose.DataSource = DtDiagnose;
 
-             ////DtDiagnose.AcceptChanges();
 
-             //dgvDiagnose.ReadOnly = true;
 
-             //MessageBox.Show(DtDiagnose.Rows.Count.ToString());
 
-             //MessageBox.Show(DtDiagnose.Rows[0]["diag_name"].ToString());
 
-             //DataGridViewColumn column = new PTControl.DataGridViewDBLKBColumn();
 
-             //(column as PTControl.DataGridViewDBLKBColumn).SDisplayField = "Code,Name,SearchCode";
 
-             //(column as PTControl.DataGridViewDBLKBColumn).SDisplayMember = "Name";
 
-             //(column as PTControl.DataGridViewDBLKBColumn).SKeyWords = "SearchCode";
 
-             //column.DataGridView.Width = 400;
 
-             //column.DataGridView.Columns[0].Name = "编码";
 
-             //column.DataGridView.Columns[1].Name = "名称";
 
-             //column.DataGridView.Columns[2].Name = "查找码";
 
-             //column.DataGridView.Columns[0].Width = 100;
 
-             //column.DataGridView.Columns[1].Width = 200;
 
-             //sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
 
-             //(column as PTControl.DataGridViewDBLKBColumn).DataSource = GetDBLKComboxTable(sqlStr);
 
-             //dgvDiagnose.Columns.Add(column);
 
-             //dgvDiagnose.Columns[10].Name = "测试";
 
-             //dgvDiagnose.Columns[10].DisplayIndex = 0;
 
-             //string diseaseTypeParam = string.Empty;
 
-             //string diseaseTypeRtn = iris.Invoke(diseaseTypeParam);
 
-             //dynamic diseaseTypeRtnRtnJson = JsonConvert.DeserializeObject(diseaseTypeRtn);
 
-             //dtDiseaseType = (DataTable)diseaseTypeRtnRtnJson.ToObject(typeof(DataTable));
 
-             //string insuranceTypeParam = string.Empty;
 
-             //string insuranceTypeRtn = iris.Invoke(insuranceTypeParam);
 
-             //dynamic insuranceTypeRtnRtnJson = JsonConvert.DeserializeObject(insuranceTypeRtn);
 
-             //dtInsuranceType = (DataTable)insuranceTypeRtnRtnJson.ToObject(typeof(DataTable));
 
-             rbg_AccUseFalg.SelectedIndex = 1;
 
-             personAccountUsedFlag = "1";
 
-         }
 
-         public Boolean b2001 = false;
 
-         private DataTable dtDisease;
 
-         private DataTable dtDiseaseType;
 
-         private DataTable dtInsuranceType;
 
-         private DataTable dtMedicalType;
 
-         private DataTable dtOperation;
 
-         private DataTable dtSettelmentType;
 
-         //险种
 
-         public string  insuType { get; set; }
 
-         public string insuTypeName { get; set; }
 
-         //医疗类别
 
-         public string med_type { get; set; }
 
-         public string med_type_name { get; set; }
 
-         //诊断
 
-         public string diseCodg { get; set; }
 
-         public string diseName{ get; set; }
 
-         //手术
 
-         public string oprn_oprt_code { get; set; }
 
-         public string oprn_oprt_name{ get; set; }
 
-         //病种
 
-         public string dise_type_code { get; set; }
 
-         public string dise_type_name { get; set; }
 
-         //结算方式
 
-         public string psn_setlway { get; set; }
 
-         public string psn_setlway_name { get; set; }
 
-         public DataTable DtDiagnose { get; set; }
 
-         public string personAccountUsedFlag = "0";
 
-         private DataTable GetDBLKComboxTable(string sqlStr)
 
-         {
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             dynamic joInparm = new JObject();
 
-             
 
-             dynamic joTmp = new JObject();
 
-             joTmp.sqlStr = sqlStr;
 
-             JArray jaParams = new JArray();
 
-             jaParams.Add(joTmp);
 
-             joInparm.Add("params", JArray.FromObject(jaParams));
 
-             joInparm.code = "09010014";
 
-             string inParam = joInparm.ToString();
 
-             JObject joRtn = invoker.invokeInsuService(inParam,"获取下拉框消息");
 
-             //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
 
-             DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
 
-             //dt.Columns[0].ColumnName = "编码";
 
-             //dt.Columns[1].ColumnName = "名称";
 
-             //dt.Columns[2].ColumnName = "拼音查找码";
 
-             return dt;
 
-         }
 
-         private void SetDBLKCombox(ref  PTControl.DBLookupCombox dblcbx, string sqlStr)
 
-         {
 
-             dblcbx.sDisplayField = "Code,Name,SearchCode";
 
-             dblcbx.sDisplayMember = "名称";
 
-             dblcbx.sKeyWords = "Code,SearchCode";
 
-             dblcbx.DataSource = GetDBLKComboxTable(sqlStr);
 
-             dblcbx.RowFilterVisible = true;
 
-             dblcbx.TextBox.Width = 400;
 
-             dblcbx.DataGridView.Width = 400;
 
-             dblcbx.DataGridView.Columns[0].Name = "编码";
 
-             dblcbx.DataGridView.Columns[1].Name = "名称";
 
-             dblcbx.DataGridView.Columns[2].Name = "查找码";
 
-             dblcbx.DataGridView.Columns[0].Width = 100;
 
-             dblcbx.DataGridView.Columns[1].Width = 200;
 
-         }
 
-         private void OutpatientRegistration_Load(object sender, EventArgs e)
 
-         {
 
-             dgvDiagnose.AutoGenerateColumns = false;
 
-             dgvDiagnose.DataSource = DtDiagnose;
 
-             //DtDiagnose.AcceptChanges();
 
-             dgvDiagnose.ReadOnly = true;
 
-         }
 
-         private void button1_Click(object sender, EventArgs e)
 
-         {
 
-             //DealFor2001("");
 
-             personAccountUsedFlag = rbg_AccUseFalg.SelectedIndex.ToString();
 
-             this.DialogResult = DialogResult.OK;
 
-         }
 
-         private void dblkcbxInsuranceType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;            
 
-             insuType = dataRow["Code"].ToString().Trim();
 
-             insuTypeName = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void dblkcbxMedicalType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;
 
-             med_type = dataRow["Code"].ToString().Trim();
 
-             med_type_name = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void dblkcbxDisease_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;
 
-             diseCodg = dataRow["Code"].ToString().Trim();
 
-             diseName = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void dblkcbxOperation_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;
 
-             oprn_oprt_code = dataRow["Code"].ToString().Trim();
 
-             oprn_oprt_name = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void dblkcbxSettelmentWay_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;
 
-             psn_setlway = dataRow["Code"].ToString().Trim();
 
-             psn_setlway_name = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void dblkcbxDiseaseType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
 
-         {
 
-             DataGridViewRow row = e.Value as DataGridViewRow;
 
-             DataRowView dataRow = row.DataBoundItem as DataRowView;
 
-             dise_type_code = dataRow["Code"].ToString().Trim();
 
-             dise_type_name = dataRow["Name"].ToString().Trim();
 
-         }
 
-         private void button2_Click(object sender, EventArgs e)
 
-         {
 
-             this.DialogResult = DialogResult.Cancel;
 
-         }
 
-         private void cbxAccountPay_ValueChanged(object sender, bool value)
 
-         {
 
-         }
 
-         public int DealFor2001(string funNO, out string OutMsg)
 
-         {
 
-             //人员待遇享受检查
 
-             string errMsg = "";
 
-             JObject joData2001 = new JObject();
 
-             joData2001.Add("psn_no", Global.pat.psn_no);
 
-             joData2001.Add("insutype", insuType);
 
-             joData2001.Add("fixmedins_code", Global.inf.hospitalNO);
 
-             joData2001.Add("med_type", med_type);
 
-             joData2001.Add("begntime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
 
-             joData2001.Add("endtime", "");
 
-             joData2001.Add("dise_codg", diseCodg);
 
-             joData2001.Add("dise_name", diseName);
 
-             joData2001.Add("oprn_oprt_code", "");
 
-             joData2001.Add("oprn_oprt_name", "");
 
-             joData2001.Add("matn_type", "");
 
-             joData2001.Add("birctrl_type", "");
 
-             JObject joInput = new JObject();
 
-             joInput.Add("data", joData2001);
 
-             InvokeHelper invoker = new InvokeHelper();
 
-             JObject joRtn2001 = invoker.invokeCenterService("2001", JsonHelper.setCenterInpar("2001", joInput));
 
-             if (JsonHelper.parseCenterRtnValue(joRtn2001, out errMsg) != 0)
 
-             {
 
-                 OutMsg = "人员待遇享受检查调用失败,中心返回错误信息:" + errMsg;
 
-                 return -1;
 
-             }
 
-             else
 
-             {
 
-                 OutMsg = "人员待遇享受检查调用成功:" + joRtn2001.ToString();
 
-                 return 0;
 
-             }
 
-         }
 
-         private void uiButton1_Click(object sender, EventArgs e)
 
-         {
 
-             string OutMsg = "";
 
-             DealFor2001("", out OutMsg);
 
-             MessageBox.Show(OutMsg);
 
-         }
 
-     }
 
- }
 
 
  |