diff --git a/Newtouch.HIS.EMR/Newtouch.EMR.Web/Areas/MedicalRecordManage/Controllers/MedicalRecordController.cs b/Newtouch.HIS.EMR/Newtouch.EMR.Web/Areas/MedicalRecordManage/Controllers/MedicalRecordController.cs index 0f00dcdb6a565d6ba6ba6b0c988be08962604988..ecc6c4a2276bd81f011a372987b2c2555a85a5fc 100644 --- a/Newtouch.HIS.EMR/Newtouch.EMR.Web/Areas/MedicalRecordManage/Controllers/MedicalRecordController.cs +++ b/Newtouch.HIS.EMR/Newtouch.EMR.Web/Areas/MedicalRecordManage/Controllers/MedicalRecordController.cs @@ -29,6 +29,7 @@ using System.Drawing; using System.IO; using System.Linq; using System.Reflection; +using System.Threading; using System.Web.Mvc; using System.Xml; @@ -525,17 +526,10 @@ namespace Newtouch.EMR.Web.Areas.MedicalRecordManage // 用户点击了“保存文档”按钮, // 则试图从WEB请求中加载文档然后保存 - int loop = 1; - while (loop < 20) //加载护理记录xml文档存在延迟情况 - { - try { - loaded = eng.LoadDocumentFromRequestFormData(); - } - catch (Exception er) { - loop++; - } - if (loaded) - break; + try { + loaded = eng.LoadDocumentFromRequestFormData(); + } + catch (Exception er) { } if (loaded) { @@ -711,8 +705,8 @@ namespace Newtouch.EMR.Web.Areas.MedicalRecordManage ViewBag.zyh = zyh; ViewBag.mzh = mzh; ViewBag.blxtmc_yj = blxtmc_yj; - ViewBag.userid = this.UserIdentity.UserId; - ViewBag.username = this.UserIdentity.UserName; + //ViewBag.userid = this.UserIdentity.UserId; + //ViewBag.username = this.UserIdentity.UserName;//不可再赋值用户 会导致护理文书保存失败 //string oldstr = "span style="color:black;font-size:9pt;background-color:white"; //string tip = "style=\"position:relative;left:4px;top:1px"; eng.Options.LogUserEditTrack = true; diff --git a/NewtouchHISRSAPrivateKey.txt b/NewtouchHISRSAPrivateKey.txt new file mode 100644 index 0000000000000000000000000000000000000000..37703c0b662adb995efa0fcf99931a2920afe330 --- /dev/null +++ b/NewtouchHISRSAPrivateKey.txt @@ -0,0 +1 @@ +4pMqmQX769acm3Cx2pff4BQV51mxVIbLTs9ZquC8l7ko+P2BGov88go8S9uwKXj7LYRlaSmBMnFSlnUHHP32sLgdCUzYHSDgxrGGB2V2s+ua7zJo8HRXJ1X/4cVsQM+I+anwi0v1M2Mfgk5EduL2SagOtEPfBf1hGvQcbgOPbmM=AQAB

5MCL5N3hUchxlXqSbr1R20FyW7smvmGwf4kYbNQiEvm6VIkv0gNkwuSjrvxXoF5n4D0qK0Pgf0MkKsQMkslKkw==

/ZA6O+Zr051GOoln0rbH5ajgafTCjiTnCX26EdszJlzg/X+Wrf8UNQN+mRkhUSLwGi2n6W1oOdqPfmXxOkEe8Q==0V+Pa+bOQj3WALxU5TkxgB6yHlX5S0487y67hXjQy096BcAfXfkvM9d0Hkjnp2hhaXRycXFKPRFmPCJ/Y6cMMw==nM2kNYa5B5Qq6egvHE+MLqnQnbWO2vhXJ7doacJ0TzUArcNJGzCy/lW65FJ2GAbTFF1HiULvQVe3hSLlmnDLAQ==Gc7Taeplr9AigSzINQcoewI7VRIDL5cFNXefnZnarnYJcUd/wm+ag4PDimg786KCPhiXAIGAO2H7F+qJojdKhQ==T0p/UtQESJFvdvpmU4Bo6Ys96xu5ckJF7gukbqd9eH9k9lYJE1hAKhgo58c3DBx5koFN2BKdUyDTbTIBTkUWSjMp66wGNvfkJd4HXD/o5TjhW6y0x+tIErsBwjXYMX37nIaY5ocVJ+YTl/gyA863RUimHKa0FBNKn2BcHacGwCE=
\ No newline at end of file diff --git a/NewtouchHISRSAPublicKey.txt b/NewtouchHISRSAPublicKey.txt new file mode 100644 index 0000000000000000000000000000000000000000..5a643cd9c4e319a43fae6b80246766d6404af84e --- /dev/null +++ b/NewtouchHISRSAPublicKey.txt @@ -0,0 +1 @@ +4pMqmQX769acm3Cx2pff4BQV51mxVIbLTs9ZquC8l7ko+P2BGov88go8S9uwKXj7LYRlaSmBMnFSlnUHHP32sLgdCUzYHSDgxrGGB2V2s+ua7zJo8HRXJ1X/4cVsQM+I+anwi0v1M2Mfgk5EduL2SagOtEPfBf1hGvQcbgOPbmM=AQAB \ No newline at end of file diff --git a/SqlServer/Script/GetChange.ps1 b/SqlServer/Script/GetChange.ps1 index 3e891a4d4f0a7bcf1824e5896388e742cd3f53ca..bf6cd8c847cd4654a76d59e6e8ad520f1b973e6e 100644 --- a/SqlServer/Script/GetChange.ps1 +++ b/SqlServer/Script/GetChange.ps1 @@ -3,8 +3,8 @@ $ServerName = "127.0.0.1" # 本地 SQL Server 实例 $User = "sa" # $Password = "" # $OutputFolder = [System.IO.Path]::Combine($env:USERPROFILE, "Desktop", "SQLChange") # 输出目录路径-当前用户桌面的SQLChange文件夹 -$StartDate = "2024-10-20" # 起始日期 -$EndDate = "2024-11-29" # 结束日期 +$StartDate = "2024-11-30" # 起始日期 +$EndDate = "2024-12-03" # 结束日期 # 创建输出目录(如果不存在) $DateFolderName = "$($StartDate.Replace('-', ''))_$($EndDate.Replace('-', ''))" diff --git a/SqlServer/V1.8.1/20241130_20241203/20241130010109530_skd_syncxmfeefromcpoe_13.sql b/SqlServer/V1.8.1/20241130_20241203/20241130010109530_skd_syncxmfeefromcpoe_13.sql new file mode 100644 index 0000000000000000000000000000000000000000..7823f533865be8c19f47ac6e9a65bb4c06dc968e --- /dev/null +++ b/SqlServer/V1.8.1/20241130_20241203/20241130010109530_skd_syncxmfeefromcpoe_13.sql @@ -0,0 +1,189 @@ +USE [NewtouchHIS_Sett] +GO + +-- 事件类型: ALTER_PROCEDURE +-- 变更时间: 11/30/2024 01:01:09 + + + + + + + +/* +declare @newcount int +exec skd_syncxmfeefromcpoe '6d5752a7-234a-403e-aa1c-df8b45d3469f','2024-8-27 23:59:59', '03319', @newcount output +select @newcount +*/ +ALTER PROCEDURE [dbo].[skd_syncxmfeefromcpoe] +@orgId VARCHAR(50), +@lqrq datetime, --拉取日期(带时分秒) 会拉取 @lqrq - day1 至 @lqrq 24小时之内 的 记录 +@zyh varchar(20), --若仅同步个人 指定值。 +@newcount int output +AS +begin + set @newcount = 0 + declare @jfCount int = 0 --插入总记录数 + declare @zzfbz int --转自费标志 + select zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,sl,CreateTime,zxksdm,Id,CreatorCode,WardCode,OrganizeId,yzxh,@zzfbz zzfbz,yzxz + into #zy_xm + from [Newtouch_CIS]..zy_fymxk xmfymx with(nolock) + where 1=2 + + select zyh,id,zzfbz,OrganizeId,zt into #yztab from Newtouch_CIS..zy_cqyz where 1=2 + + if(@zyh<>'') + begin + select @lqrq=ryrq from zy_brjbxx with(nolock) where zyh=@zyh and organizeid=@orgId and zt=1 + + insert into #yztab + select zyh,Id,zzfbz,OrganizeId,zt from ( + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_cqyz + where zt='1' and zyh=@zyh and OrganizeId=@orgId and createtime >=@lqrq + union all + + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_lsyz + where zt='1' and zyh=@zyh and OrganizeId=@orgId and createtime >=@lqrq + ) yztable + + insert into #zy_xm + select a.zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,isnull(sl,0)sl,CreateTime,zxksdm, + a.Id,CreatorCode,WardCode,a.OrganizeId,yzxh,isnull(zzfbz,0) zzfbz,a.yzxz + from [Newtouch_CIS]..zy_fymxk a with(nolock) + left join #yztab yzxx on yzxx.id=a.yzxh and yzxx.zyh=a.zyh and yzxx.OrganizeId=a.OrganizeId and yzxx.zt='1' + where a.OrganizeId=@orgId and a.zyh=@zyh + and CreateTime>=@lqrq + and a.yzlb in('-1','1') + --and isnull(a.sl,0) > 0 + and a.zt=1 and isnull(a.isjf,1)<>'0' + and not exists(select 1 from zy_xmjfb b with(nolock) + where a.OrganizeId=b.OrganizeId and a.zyh=b.zyh and a.id=b.bdzxid) + and exists(select 1 from zy_brjbxx c with(nolock) where a.OrganizeId=c.OrganizeId and a.zyh=c.zyh and + c.zybz in (1,2,7) and c.zt=1) --病区中、出病区、转区状态 + end + else + begin + insert into #yztab + select zyh,Id,zzfbz,OrganizeId,zt from ( + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_cqyz + where zt='1' and OrganizeId=@orgId and createtime between DateAdd(day, -10, @lqrq) and @lqrq + union all + + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_lsyz + where zt='1' and OrganizeId=@orgId and createtime between DateAdd(day, -10, @lqrq) and @lqrq + ) yztable + + insert into #zy_xm + select a.zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,isnull(sl,0)sl,CreateTime,zxksdm, + a.Id,CreatorCode,WardCode,a.OrganizeId,yzxh,isnull(zzfbz,0) zzfbz,a.yzxz + from [Newtouch_CIS]..zy_fymxk a with(nolock) + left join #yztab yzxx on yzxx.id=a.yzxh and yzxx.zyh=a.zyh and yzxx.OrganizeId=a.OrganizeId and yzxx.zt='1' + where a.OrganizeId=@orgId --and a.zyh=@zyh + and a.createtime between DateAdd(day, -1, @lqrq) and @lqrq + and a.yzlb in('-1','1') + --and isnull(a.sl,0) > 0 + and a.zt=1 and isnull(a.isjf,1)<>'0' + and not exists(select 1 from zy_xmjfb b with(nolock) + where a.OrganizeId=b.OrganizeId and a.zyh=b.zyh and a.id=b.bdzxid) + and exists(select 1 from zy_brjbxx c with(nolock) where a.OrganizeId=c.OrganizeId and a.zyh=c.zyh and + c.zybz in (1,2,7) and c.zt=1) --病区中、出病区、转区状态 + + --检验计费准备 + select b.id + into #jyid + from Newtouch_Interface.dbo.lis_confirm_zy c with(nolock),[Newtouch_CIS].dbo.zy_lsyz b with(nolock) + where c.createtime>convert(date,getdate()) and c.qrzt=1 and c.sqdh>'' + and c.zyh=b.zyh and c.sqdh=b.yzh and c.organizeid=b.OrganizeId and b.zt='1' and b.yzlx=6 + and exists(select 1 from zy_brjbxx d with(nolock) where b.OrganizeId=d.OrganizeId and b.zyh=d.zyh and d.zt=1) + and not exists(select 1 from zy_xmjfb f with(nolock) + where b.OrganizeId=f.OrganizeId and b.zyh=f.zyh and b.id=f.yzwym) + + if(exists(select 1 from #jyid)) + begin + insert into #zy_xm + select a.zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,isnull(sl,0)sl,CreateTime,zxksdm, + a.Id,CreatorCode,WardCode,a.OrganizeId,yzxh,isnull(zzfbz,0) zzfbz,a.yzxz + from [Newtouch_CIS]..zy_fymxk a with(nolock) + left join #yztab yzxx on yzxx.id=a.yzxh and yzxx.zyh=a.zyh and yzxx.OrganizeId=a.OrganizeId and yzxx.zt='1' + where a.OrganizeId=@orgId --and a.zyh=@zyh + and yzxh in(select id from #jyid) + and a.yzlb in('-1','1') + --and isnull(a.sl,0) > 0 + and a.zt=1 and isnull(a.isjf,1)<>'0' + and not exists(select 1 from #zy_xm e where a.Id=e.Id ) + and not exists(select 1 from zy_xmjfb b with(nolock) + where a.OrganizeId=b.OrganizeId and a.zyh=b.zyh and a.id=b.bdzxid) + end + + drop table #jyid + end + + --2021-9-16 chl 检验单独计费 + select * into #sync_xm from #zy_xm where isnull(yzxz,0)<>1 + if(exists(select 1 from #zy_xm where yzxz=1)) + begin + insert into #sync_xm + select * + from #zy_xm a + where a.yzxz=1 + and exists(select 1 from Newtouch_CIS.dbo.zy_lsyz b with(nolock) + where a.yzxh=b.id --and b.yzlx<>6 + ) + + --print('lis已接收同步') + --insert into #sync_xm + --select * + --from #zy_xm a + --where a.yzxz=1 + --and exists(select 1 from [Newtouch_CIS].dbo.zy_lsyz b with(nolock) + -- where a.yzxh=b.id and b.yzlx=6 + -- and exists(select 1 + -- from Newtouch_Interface.dbo.lis_confirm_zy c with(nolock) + -- where b.OrganizeId=c.OrganizeId and b.zyh=c.zyh and b.yzh=c.sqdh + -- and c.createtime> b.createtime + -- and c.qrzt=1 and c.zt<>9 and c.sqdh>'' ) + -- ) --已接收 计费 + end + + + if(exists(select 1 from #sync_xm)) + begin + select @jfCount = count(1) from #sync_xm + + declare @startjfbId int = 0 --插入记录开始Id + SELECT @startjfbId = CurrentSerialNo FROM [NewtouchHIS_Sett].[dbo].[EntitySerialNo] where EntityName = 'zy_xmjfb' + --占用Id 得再加1 + if(@startjfbId > 0) + update EntitySerialNo set CurrentSerialNo = CurrentSerialNo + @jfCount + 1 where EntityName = 'zy_xmjfb' + else + insert into EntitySerialNo(EntityName,SerialNoMin,SerialNoMax,CurrentSerialNo) + values('zy_xmjfb', 1, 999999999, @jfCount + 1) + + --执行插入 + insert into zy_xmjfb(jfbbh, OrganizeId, zyh, tdrq, sfxm, dl, ys, ks, cw, dj, sl, jfdw + ,zfbl,zfxz,ssbz,ssry,ssrq,zxks,yzxz,yzzt,cxzyjfbbh,bdzxId,CreatorCode,CreateTime,bq,zt,ysmc,ksmc,yzwym,zzfbz) + select @startjfbId + ROW_NUMBER() over(order by xmfymx.CreateTime) as jfbbh, @orgId OrganizeId + , xmfymx.zyh, CONVERT(varchar(100), xmfymx.zxrq, 121) tdrq, xmdm sfxm, sfdl.dlCode dl + , isnull(xmfymx.ysgh, '') ys, isnull(xmfymx.DeptCode, '') ks, xmfymx.cwdm cw + , xmfymx.dj, xmfymx.sl, sfxm.dw jfdw + , sfxm.zfbl, sfxm.zfxz, 1 ssbz, '' ssry, xmfymx.CreateTime ssrq,xmfymx.zxksdm + , '2' yzxz, '1' yzzt, 0 cxzyjfbbh + , xmfymx.Id bdzxId, xmfymx.CreatorCode, getdate() CreateTime + , xmfymx.WardCode bq, '1' zt, '' ysmc, '' ksmc,yzxh,zzfbz + --同 + from #sync_xm xmfymx,[NewtouchHIS_Base]..V_S_xt_sfxm sfxm,[NewtouchHIS_Base]..V_S_xt_sfdl sfdl + where sfxm.sfxmCode = xmfymx.xmdm and sfxm.Organizeid = xmfymx.OrganizeId and sfxm.zt = '1' + and sfdl.dlCode = sfxm.sfdlCode and sfdl.Organizeid = xmfymx.OrganizeId and sfdl.zt = '1' + end + + select @newcount=@jfCount + drop table #zy_xm + drop table #sync_xm +end + + + + + + + diff --git a/SqlServer/V1.8.1/20241130_20241203/20241130010706220_skd_syncxmjfbcope_14.sql b/SqlServer/V1.8.1/20241130_20241203/20241130010706220_skd_syncxmjfbcope_14.sql new file mode 100644 index 0000000000000000000000000000000000000000..7d006c287e8698e00a741d21f3e468a4394648fa --- /dev/null +++ b/SqlServer/V1.8.1/20241130_20241203/20241130010706220_skd_syncxmjfbcope_14.sql @@ -0,0 +1,126 @@ +USE [NewtouchHIS_Sett] +GO + +-- 事件类型: ALTER_PROCEDURE +-- 变更时间: 11/30/2024 01:07:06 + + + + + + + +/* +declare @newcount int +exec skd_syncxmjfbcope '6d5752a7-234a-403e-aa1c-df8b45d3469f','2023-03-27 15:29:00', '03199' +select @newcount +select * from zy_xmjfb where zyh='03199' order by createtime desc +select * from [Newtouch_CIS]..zy_fymxk where zyh='03199' order by createtime desc +*/ +ALTER PROCEDURE [dbo].[skd_syncxmjfbcope] +@orgId VARCHAR(50), +@lqrq datetime, --拉取日期(带时分秒) 会拉取 @lqrq - day1 至 @lqrq 三十天之内 的 记录 +@zyh varchar(max) +AS +begin + declare @jfCount int = 0 --插入总记录数 + declare @zzfbz int --转自费标志 + select zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,sl,CreateTime,zxksdm,Id,CreatorCode,WardCode,OrganizeId,yzxh,@zzfbz zzfbz,yzxz + into #zy_xm + from [Newtouch_CIS]..zy_fymxk xmfymx with(nolock) + where 1=2 + + select zyh,id,zzfbz,OrganizeId,zt into #yztab from Newtouch_CIS..zy_cqyz where 1=2 + insert into #yztab + select zyh,Id,zzfbz,OrganizeId,zt from ( + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_cqyz + where zt='1' and OrganizeId=@orgId and createtime between DateAdd(day, -120, @lqrq) and @lqrq + and zyh in (select * from f_split(@zyh,',')) + union all + + select zyh,id,zzfbz,OrganizeId,zt from Newtouch_CIS..zy_lsyz + where zt='1' and OrganizeId=@orgId and createtime between DateAdd(day, -120, @lqrq) and @lqrq + and zyh in (select * from f_split(@zyh,',')) + ) yztable + + insert into #zy_xm + select a.zyh,zxrq,xmdm,ysgh,DeptCode,cwdm,dj,isnull(sl,0)sl,CreateTime,zxksdm, + a.Id,CreatorCode,WardCode,a.OrganizeId,yzxh,isnull(zzfbz,0) zzfbz,a.yzxz + from [Newtouch_CIS]..zy_fymxk a with(nolock) + left join #yztab yzxx on yzxx.id=a.yzxh and yzxx.zyh=a.zyh and yzxx.OrganizeId=a.OrganizeId and yzxx.zt='1' + where a.OrganizeId=@orgId --and a.zyh=@zyh + and a.createtime between DateAdd(day, -120, @lqrq) and @lqrq + and a.yzlb in('-1','1') + and a.zyh in (select * from f_split(@zyh,',')) + --and isnull(a.sl,0) > 0 + and a.zt=1 and isnull(a.isjf,1)<>'0' + and not exists(select 1 from zy_xmjfb b with(nolock) + where a.OrganizeId=b.OrganizeId and a.zyh=b.zyh and a.id=b.bdzxid) + and exists(select 1 from zy_brjbxx c with(nolock) where a.OrganizeId=c.OrganizeId and a.zyh=c.zyh and + c.zybz in (1,2,7) and c.zt=1) --病区中、出病区、转区状态 + --2021-9-16 chl 检验单独计费 + select * into #sync_xm from #zy_xm where isnull(yzxz,0)<>1 + if(exists(select 1 from #zy_xm where yzxz=1)) + begin + insert into #sync_xm + select * + from #zy_xm a + where a.yzxz=1 + and exists(select 1 from Newtouch_CIS.dbo.zy_lsyz b with(nolock) + where a.yzxh=b.id --and b.yzlx<>6 + ) + + --print('lis已接收同步') + --insert into #sync_xm + --select * + --from #zy_xm a + --where a.yzxz=1 + --and exists(select 1 from [Newtouch_CIS].dbo.zy_lsyz b with(nolock) + -- where a.yzxh=b.id --and b.yzlx=6 + -- and exists(select 1 + -- from Newtouch_Interface.dbo.lis_confirm_zy c with(nolock) + -- where b.OrganizeId=c.OrganizeId and b.zyh=c.zyh and b.yzh=c.sqdh + -- and c.createtime> b.createtime + -- and c.qrzt=1 and c.zt<>9 and c.sqdh>'' )) --已接收 计费 + end + + + if(exists(select 1 from #sync_xm)) + begin + select @jfCount = count(1) from #sync_xm + + declare @startjfbId int = 0 --插入记录开始Id + SELECT @startjfbId = CurrentSerialNo FROM [NewtouchHIS_Sett].[dbo].[EntitySerialNo] where EntityName = 'zy_xmjfb' + --占用Id 得再加1 + if(@startjfbId > 0) + update EntitySerialNo set CurrentSerialNo = CurrentSerialNo + @jfCount + 1 where EntityName = 'zy_xmjfb' + else + insert into EntitySerialNo(EntityName,SerialNoMin,SerialNoMax,CurrentSerialNo) + values('zy_xmjfb', 1, 999999999, @jfCount + 1) + + --执行插入 + insert into zy_xmjfb(jfbbh, OrganizeId, zyh, tdrq, sfxm, dl, ys, ks, cw, dj, sl, jfdw + ,zfbl,zfxz,ssbz,ssry,ssrq,zxks,yzxz,yzzt,cxzyjfbbh,bdzxId,CreatorCode,CreateTime,bq,zt,ysmc,ksmc,yzwym,zzfbz) + select @startjfbId + ROW_NUMBER() over(order by xmfymx.CreateTime) as jfbbh, @orgId OrganizeId + , xmfymx.zyh, CONVERT(varchar(100), xmfymx.zxrq, 121) tdrq, xmdm sfxm, sfdl.dlCode dl + , isnull(xmfymx.ysgh, '') ys, isnull(xmfymx.DeptCode, '') ks, xmfymx.cwdm cw + , xmfymx.dj, xmfymx.sl, sfxm.dw jfdw + , sfxm.zfbl, sfxm.zfxz, 1 ssbz, '' ssry, xmfymx.CreateTime ssrq,xmfymx.zxksdm + , '2' yzxz, '1' yzzt, 0 cxzyjfbbh + , xmfymx.Id bdzxId, xmfymx.CreatorCode, getdate() CreateTime + , xmfymx.WardCode bq, '1' zt, '' ysmc, '' ksmc,yzxh,zzfbz + --同 + from #sync_xm xmfymx,[NewtouchHIS_Base]..V_S_xt_sfxm sfxm,[NewtouchHIS_Base]..V_S_xt_sfdl sfdl + where sfxm.sfxmCode = xmfymx.xmdm and sfxm.Organizeid = xmfymx.OrganizeId and sfxm.zt = '1' + and sfdl.dlCode = sfxm.sfdlCode and sfdl.Organizeid = xmfymx.OrganizeId and sfdl.zt = '1' + end + drop table #zy_xm + drop table #sync_xm +end + + + + + + +