12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using Newtonsoft.Json.Linq;
- using PTMedicalInsurance.Common;
- using PTMedicalInsurance.Entity;
- using PTMedicalInsurance.Entity.Local;
- using PTMedicalInsurance.Forms;
- using PTMedicalInsurance.Helper;
- using PTMedicalInsurance.Variables;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PTMedicalInsurance.Business
- {
- class PatientService
- {
- protected HisMainBusiness hBus = new HisMainBusiness();
- protected InvokeHelper invoker = new InvokeHelper();
- /// <summary>
- /// 读卡
- /// </summary>
- /// <returns></returns>
- public int readCard(out string outParam)
- {
- Global.writeLog_debug($"Current Thread ID: {Thread.CurrentThread.ManagedThreadId}");
- Global.writeLog_debug($"Current Process ID: {Process.GetCurrentProcess().Id}");
- CallResult ret = new ReadCardProcess().Process(null);
- outParam = ret.Data?.ToString();
- return ret.Code;
- }
- /// <summary>
- /// 读卡并展示病人信息
- /// </summary>
- /// <param name="outParam"></param>
- /// <returns></returns>
- public int readPatientInfo(out string outParam)
- {
- string patInfo = "";
- //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
- if (readCard(out outParam) != 0)
- {
- return -1;
- }
- else
- {
- patInfo = outParam;
- hBus.convertPatientInfo(patInfo, out outParam);
- }
- #region 展示患者信息
- //患者信息赋值给全局变量
- string errMsg = "";
- if (hBus.setGlobalPatAfaterShowPatInfo(outParam, out errMsg) != 0)
- {
- outParam = JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
- return -1;
- }
- //在这里判断,建档的时候会直接拦截
- //校验HIS姓名与医保姓名是否一致
- if (!string.IsNullOrEmpty(Global.pat.admID))
- {
- if (hBus.checkName(Global.pat.name, out errMsg) != 0)
- {
- outParam = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
- return -1;
- }
- }
-
- #endregion
- return 0;
- }
- }
- }
|