diff --git a/.gitignore b/.gitignore index c10c215e..20ee27fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Build results +# Build results [Dd]ebug/ [Rr]elease/ x64/ @@ -10,6 +10,14 @@ bld/ [Oo]bj/ [Ll]og/ +# 保留 log的配置文件 +!**/Log/LogCore.cs +!**/Log/LogProxy.cs +!**/Log/LogContent.cs +!**/Log/LogMain.cs +!**/Log/AppLogger.cs + + # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ @@ -19,12 +27,15 @@ bld/ # NuGet Packages *.nupkg # The packages folder can be ignored because of the .nuget directory -packages/ +/packages/ # Uncomment if necessary however generally it will be generated by a restore !packages/build/ # Uncomment if necessary however generally it will be generated by a restore !packages/repositories.config +# 为了方便将项目中使用的包也进行管理,保留所有子目录中的 packages 文件夹 +!*/packages/ + # Windows image file caches Thumbs.db ehthumbs.db @@ -97,8 +108,6 @@ StyleCopReport.xml *.appxsym *.appxrecipe -# Click-Once Directory -Publish/ # Packaging Directory AppPackages/ @@ -118,9 +127,8 @@ BundleArtifacts/ Package.StoreAssociation.xml # Visual Studio 2019 -.vscode/ -.vs/ -.vscode/ +**/.vscode/ +**/.vs/ *.user *.suo *.userosscache @@ -208,8 +216,22 @@ jspm_packages/ # 发布配置 *.pubxml -# 报表自生成文件 -JSViewer_MVC_Core/.svn +**/Properties/PublishProfiles/* + +# 但保留 FolderProfile.pubxml 和 PublishProfile.pubxml(编译脚本用) +!**/Properties/PublishProfiles/FolderProfile.pubxml +!**/Properties/PublishProfiles/PublishProfile.pubxml + +# 部署脚本的发布包的生成路径 +[Pp]ublish/ +# 但保留 EmrStatic 和 Report 目录 +![Pp]ublish/EmrStatic/ +![Pp]ublish//Report + +# 住院病例不上传 +Newtouch.HIS.EMR/Newtouch.EMR.Web/File/住院病历/ +# 运行日志不上传 +**/APPLog/* -**/Properties/PublishProfiles/* \ No newline at end of file +**/packages/ \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Application/Newtouch.HIS.Application.csproj b/Newtouch.HIS.Base/Newtouch.HIS.Application/Newtouch.HIS.Application.csproj index bf64c700..ffbc0278 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Application/Newtouch.HIS.Application.csproj +++ b/Newtouch.HIS.Base/Newtouch.HIS.Application/Newtouch.HIS.Application.csproj @@ -31,6 +31,9 @@ prompt 4 + + bin\9_190\ + ..\..\his-dll-common\hiscommondlls\EntityFramework.dll diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Configs/database.config b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Configs/database.config index 61b15906..83fea30a 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Configs/database.config +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Configs/database.config @@ -1,6 +1,6 @@  - + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Newtouch.HIS.Base.HOSP.API.csproj b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Newtouch.HIS.Base.HOSP.API.csproj index 96fe9e08..f11d5a00 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Newtouch.HIS.Base.HOSP.API.csproj +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Newtouch.HIS.Base.HOSP.API.csproj @@ -253,6 +253,9 @@ 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + bin\ + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/FolderProfile.pubxml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/FolderProfile.pubxml index 2199301c..bc104861 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/FolderProfile.pubxml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,14 +4,15 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - false + true false true Release Any CPU FileSystem - D:\发布地址\开源\BaseApi + ..\..\publish\BaseAPI FileSystem <_TargetId>Folder + \ No newline at end of file diff --git a/Newtouch.HIS.EMR/Newtouch.EMR.Web/Properties/PublishProfiles/FolderProfile1.pubxml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/PublishProfile.pubxml similarity index 91% rename from Newtouch.HIS.EMR/Newtouch.EMR.Web/Properties/PublishProfiles/FolderProfile1.pubxml rename to Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/PublishProfile.pubxml index 869cbaf9..bc104861 100644 --- a/Newtouch.HIS.EMR/Newtouch.EMR.Web/Properties/PublishProfiles/FolderProfile1.pubxml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.API/Properties/PublishProfiles/PublishProfile.pubxml @@ -10,7 +10,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - D:\发布地址\开源\emr + ..\..\publish\BaseAPI FileSystem <_TargetId>Folder diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.Request/Newtouch.HIS.Base.HOSP.Request.csproj b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.Request/Newtouch.HIS.Base.HOSP.Request.csproj index 4f24ba2c..5cb05427 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.Request/Newtouch.HIS.Base.HOSP.Request.csproj +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP.Request/Newtouch.HIS.Base.HOSP.Request.csproj @@ -30,6 +30,9 @@ prompt 4 + + bin\9_190\ + False diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/PharmacyDrugStorage/Views/SysMedicineStorageIOMode/Index.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/PharmacyDrugStorage/Views/SysMedicineStorageIOMode/Index.cshtml index c469ed39..9ea84017 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/PharmacyDrugStorage/Views/SysMedicineStorageIOMode/Index.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/PharmacyDrugStorage/Views/SysMedicineStorageIOMode/Index.cshtml @@ -1,4 +1,5 @@ -@{ +@using Newtouch.Common.Operator; +@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Settlement/Controllers/GzybBaseInfoController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Settlement/Controllers/GzybBaseInfoController.cs index 4a1b8a62..f39ea255 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Settlement/Controllers/GzybBaseInfoController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Settlement/Controllers/GzybBaseInfoController.cs @@ -69,6 +69,11 @@ public ActionResult SaveCodeConstrast(List data) } #region 医保目录相关 + /// + /// 获取目录下载最新版本号 + /// + /// + /// public ActionResult GetVer(string tbname) { switch (tbname) @@ -122,7 +127,13 @@ public ActionResult GetVer(string tbname) return Content(data.ToJson()); } - + /// + /// 获取下载数据 + /// + /// + /// + /// + /// public ActionResult CatalogueData(Pagination pagination, string tbname, string key) { pagination.sidx = "VER desc"; diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Controllers/CombinationController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Controllers/CombinationController.cs index 33ce5a38..1b641a71 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Controllers/CombinationController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Controllers/CombinationController.cs @@ -95,17 +95,17 @@ public ActionResult GetMldzxxlist(Pagination pagination, string keyword, string return Content(data.ToJson()); } /// - /// 根据系统药品信息查询医保对应药品信息 + /// 根据系统药品信息查询医保对应药品信息 /// /// /// /// /// /// - public ActionResult GetYpypxxlist( string ypmc, string py,string gjybdm,string pzwh) + public ActionResult GetYpypxxlist( string ypmc, string py,string gjybdm,string pzwh,string dataSource) { - var data = _sysMedicineDmnService.GetYpypxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh); + var data = _sysMedicineDmnService.GetYpypxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh,dataSource); return Content(data.ToJson()); } @@ -153,9 +153,9 @@ public ActionResult Getclxxlist(Pagination pagination, string keyword, string ty /// /// /// - public ActionResult GetYbclxxlist(string ypmc, string py, string gjybdm, string pzwh) + public ActionResult GetYbclxxlist(string ypmc, string py, string gjybdm, string pzwh,string dataSource) { - var data = _sysMedicineDmnService.GetYbclxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh); + var data = _sysMedicineDmnService.GetYbclxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh, dataSource); return Content(data.ToJson()); } @@ -174,7 +174,13 @@ public ActionResult SaveYpcl(G_yb_clxxVO ybxx, int? ypid) }; return Content(data.ToJson()); } - + /// + /// 获取项目信息集合 + /// + /// + /// + /// + /// public ActionResult Getxmxxlist(Pagination pagination, string keyword, string type) { pagination.sidx = "CreateTime desc"; @@ -197,9 +203,9 @@ public ActionResult Getxmxxlist(Pagination pagination, string keyword, string ty /// /// /// - public ActionResult GetYbxmxxlist(string ypmc, string py, string gjybdm, string pzwh) + public ActionResult GetYbxmxxlist(string ypmc, string py, string gjybdm, string pzwh,string dataSource) { - var data = _sysMedicineDmnService.GetYbxmxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh); + var data = _sysMedicineDmnService.GetYbxmxxlist(this.OrganizeId, ypmc, py, gjybdm, pzwh, dataSource); return Content(data.ToJson()); } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/Index.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/Index.cshtml index 4c8999fa..40476508 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/Index.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/Index.cshtml @@ -39,6 +39,15 @@
+
+ +
+
+ +
@@ -58,10 +67,10 @@
- +
- +
@* @@ -220,7 +229,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYpypxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: scqy, py:'' , pzwh: pzwh }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: scqy, py:'' , pzwh: pzwh ,dataSource: $("#DataSource").val()}, dataType: "json", success: function (ajaxresp) { @@ -246,7 +255,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYpypxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '' }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '' ,dataSource: $("#DataSource").val()}, dataType: "json", success: function (ajaxresp) { $('#gridJSMXList').newtouchLocalDataGrid(null, ajaxresp); @@ -303,7 +312,7 @@ function getpostData() { return { - keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val() + keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val(),dataSource: $("#DataSource").val() }; } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/materialIndex.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/materialIndex.cshtml index 96c3d7ec..c6b0a71c 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/materialIndex.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/materialIndex.cshtml @@ -39,6 +39,15 @@
+
+ +
+
+ +
@@ -58,10 +67,10 @@
- +
- +
@*
@@ -111,13 +120,13 @@ postData: getpostData(), colModel: [ { label: "主键", name: "sfxmId", hidden: true, key: true }, - { label: '耗材名称', name: 'sfxmmc', width: 200, align: 'center', sortable: false, frozen: true}, + { label: '耗材名称', name: 'ypmc', width: 200, align: 'center', sortable: false, frozen: true}, { label: "国家医保代码", name: "gjybdm", width: 180, align: 'center', sortable: false, frozen: true}, { label: "国家医保名称", name: "gjybmc", width: 200, align: 'center', sortable: false }, { label: '规格', name: 'gg', width: 110, align: 'center', sortable: false}, - { label: '批准文号', name: 'pzwh', width: 140, align: 'center', sortable: false }, + { label: '批准文号', name: 'ypzsm', width: 140, align: 'center', sortable: false }, //{ label: '剂型', name: 'jxmc', width: 60, align: 'center', sortable: false }, - { label: '生产厂商', name: 'sccj', width: 180, align: 'center', sortable: false }, + { label: '生产厂商', name: 'ycmc', width: 180, align: 'center', sortable: false }, { label: '自负性质', name: 'zfxz', width: 60, align: 'center', sortable: false, formatter: function (cellvalue, a, b) { switch (parseInt(b.zfxz)) { @@ -213,7 +222,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYbclxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: scqy, py: '', pzwh: pzwh }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: scqy, py: '', pzwh: pzwh,dataSource: $("#DataSource").val() }, dataType: "json", success: function (ajaxresp) { @@ -239,7 +248,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYbclxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '' }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '' ,dataSource: $("#DataSource").val()}, dataType: "json", success: function (ajaxresp) { $('#gridJSMXList').newtouchLocalDataGrid(null, ajaxresp); @@ -298,7 +307,7 @@ function getpostData() { return { - keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val() + keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val() ,dataSource: $("#DataSource").val() }; } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/projectIndex.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/projectIndex.cshtml index 612b7eb5..cac6fc8a 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/projectIndex.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Areas/Sys/Views/Combination/projectIndex.cshtml @@ -39,6 +39,15 @@
+
+ +
+
+ +
@@ -58,11 +67,13 @@
*@
- +
- +
+ +
@*
@@ -206,7 +217,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYbxmxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '' }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: '', py: '', pzwh: '',dataSource: $("#DataSource").val() }, dataType: "json", success: function (ajaxresp) { @@ -231,7 +242,7 @@ $.najax({ type: "POST", url: "@Url.Action("GetYbxmxxlist")", - data: { gjybdm: $("#txt_gjybdm").val(), ypmc: ypmc, py: yppy, pzwh: pzwh }, + data: { gjybdm: $("#txt_gjybdm").val(), ypmc: ypmc, py: yppy, pzwh: pzwh ,dataSource: $("#DataSource").val() }, dataType: "json", success: function (ajaxresp) { $('#gridJSMXList').newtouchLocalDataGrid(null, ajaxresp); @@ -288,7 +299,7 @@ function getpostData() { return { - keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val() + keyword: $("#txt_keyword").val(), type: $('input:radio:checked').val() ,dataSource: $("#DataSource").val() }; } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/database.config b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/database.config new file mode 100644 index 00000000..756fc553 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/database.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/system.config b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/system.config new file mode 100644 index 00000000..27298bf1 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/9_190/system.config @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/database.config b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/database.config index 95e28600..d6dad0fd 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/database.config +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/database.config @@ -1,8 +1,12 @@  - - - - - + + + + + + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/system.config b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/system.config index 69e89291..57454a3d 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/system.config +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Configs/system.config @@ -1,46 +1,53 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Content/js/catalogl.js b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Content/js/catalogl.js index 31dc0c02..47486a73 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Content/js/catalogl.js +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Content/js/catalogl.js @@ -119,6 +119,10 @@ { label: '诊断代码', name: 'DIAG_CODE', width: 80, align: 'left' }, { label: '诊断名称', name: 'DIAG_NAME', width: 100, align: 'left' }, { label: '使用标记', name: 'USED_STD', width: 40, align: 'left' }, + { label: '国标版诊断代码', name: 'NATSTD_DIAG_CODE', width: 80, align: 'left' }, + { label: '国标版诊断名称', name: 'NATSTD_DIAG_NAME', width: 100, align: 'left' }, + { label: '临床版诊断代码', name: 'CLNC_DIAG_CODE', width: 80, align: 'left' }, + { label: '临床版诊断名称', name: 'CLNC_DIAG_NAME', width: 100, align: 'left' }, { label: '版本号', name: 'VER', width: 60, align: 'left' }, { label: '版本名称', name: 'VER_NAME', width: 120, align: 'left' }, ]; diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/AntibioticTypeController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/AntibioticTypeController.cs index ec10b9a3..9beef5c0 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/AntibioticTypeController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/AntibioticTypeController.cs @@ -91,10 +91,14 @@ public ActionResult GetSelectJson(string parentId) { var data = _ISysMedicineAntibioticTypeRepo.GetListByParentId(OrganizeId, parentId); List list = new List(); - foreach (SysMedicineAntibioticTypeEntity item in data) + if (data!=null) { - list.Add(new { id = item.Id + "|" + item.qxjb, text = item.typeName });//将权限级别信息带入Id中 + foreach (SysMedicineAntibioticTypeEntity item in data) + { + list.Add(new { id = item.Id + "|" + item.qxjb, text = item.typeName });//将权限级别信息带入Id中 + } } + return Content(list.ToJson()); } } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineController.cs index a5da0ad6..06e096ff 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineController.cs @@ -111,12 +111,12 @@ public ActionResult submitForm(SysMedicineVO model, List p, string ypCod throw new FailedException("请选择组织机构"); } - if (!_sysOrganizeDmnService.IsMedicalOrganize(model.OrganizeId)) + if (!_sysOrganizeDmnService.IsMedicalOrganize(model.OrganizeId) && !model.OrganizeId.Equals("*")) { throw new FailedException("请选择医疗机构(医院或诊所)"); } _sysMedicineDmnService.SubmitMedicine(model, keyValue); - var t = _sysPharmacyDepartmentApp.SubmitEmpowermentPharmacyDepartment(keyValue, ypCode, OrganizeId, UserIdentity.UserCode, p); + var t = _sysPharmacyDepartmentApp.SubmitEmpowermentPharmacyDepartment(keyValue, ypCode, model.OrganizeId, UserIdentity.UserCode, p); var msg = string.IsNullOrWhiteSpace(t) ? "操作成功。" : ("保存药品信息成功,但授权药房药库失败," + t); return Success(msg); @@ -220,9 +220,9 @@ public ActionResult SubmitKssForm(SysMedicineAntibioticInfoEntity AntibioticInfo /// 获取所有药房药库 /// /// - public ActionResult GetAllYfbm() + public ActionResult GetAllYfbm(string organizeId) { - var result = _sysPharmacyDepartmentRepo.GetEffectiveList(OrganizeId, null); + var result = _sysPharmacyDepartmentRepo.GetEffectiveList(organizeId ?? OrganizeId, null); return Success("", result.ToJson()); } @@ -231,9 +231,9 @@ public ActionResult GetAllYfbm() /// /// /// - public ActionResult GetEmpowermentPharmacyDepartment(string ypId) + public ActionResult GetEmpowermentPharmacyDepartment(string ypId,string organizeId) { - var result = _sysPharmacyDepartmentApp.EmpowermentPharmacyDepartmentQuery(ypId, OrganizeId); + var result = _sysPharmacyDepartmentApp.EmpowermentPharmacyDepartmentQuery(ypId, organizeId ?? OrganizeId); return Content(result.ToJson()); } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineElectronicPrescriptionController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineElectronicPrescriptionController.cs new file mode 100644 index 00000000..6aa3c8fa --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/PharmacyDrugStorage/SysMedicineElectronicPrescriptionController.cs @@ -0,0 +1,49 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.IDomainServices.PharmacyDrugStorage; +using Newtouch.Tools; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace Newtouch.HIS.Base.HOSP.Controllers.PharmacyDrugStorage +{ + public class SysMedicineElectronicPrescriptionController : Controller + { + // GET: SysMedicineElectronicPrescription + private readonly ISysMedicineElectronicPrescriptionDmnService _sysMedicineElectronicPrescriptionDmnService; + + public SysMedicineElectronicPrescriptionController(ISysMedicineElectronicPrescriptionDmnService SysMedicineElectronicPrescriptionDmnService) + { + this._sysMedicineElectronicPrescriptionDmnService = SysMedicineElectronicPrescriptionDmnService; + } + + public ActionResult Index() + { + return View(); + } + /// + /// 电子处方目录 + /// + /// + /// + /// + /// + /// + /// + [HttpGet] + [HandlerAjaxOnly] + public ActionResult GetGridJson(Pagination pagination, string genname, string medListCodg,string listType,string zt) + { + var data = new + { + rows = _sysMedicineElectronicPrescriptionDmnService.GetPaginationList(pagination, genname, medListCodg,listType,zt), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/ChargeCategoryController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/ChargeCategoryController.cs index 9fa96f36..6cd8a01b 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/ChargeCategoryController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/ChargeCategoryController.cs @@ -7,6 +7,7 @@ using System.Linq; using Newtouch.Common; using System.Collections.Generic; +using Newtouch.HIS.Repository; namespace Newtouch.HIS.Base.HOSP.Controllers { @@ -17,12 +18,14 @@ public class ChargeCategoryController : ControllerBase { private readonly ISysChargeCategoryRepo _SysChargeCategoryRepo; private readonly ISysOrganizeDmnService _SysOrganizeDmnService; + private readonly ISysChargeCategoryBaseRepo _SysChargeCategoryBaseRepo; public ChargeCategoryController(ISysChargeCategoryRepo SysChargeCategoryRepo - , ISysOrganizeDmnService sysOrganizeDmnService) + , ISysOrganizeDmnService sysOrganizeDmnService , ISysChargeCategoryBaseRepo SysChargeCategoryBaseRepo) { this._SysChargeCategoryRepo = SysChargeCategoryRepo; this._SysOrganizeDmnService = sysOrganizeDmnService; + this._SysChargeCategoryBaseRepo = SysChargeCategoryBaseRepo; } //收费大类树形(医院) 下拉 数据源 @@ -31,29 +34,58 @@ public ChargeCategoryController(ISysChargeCategoryRepo SysChargeCategoryRepo public ActionResult GetTreeSelectJson(string organizeId, string treeidFieldName = "Code") { var data = _SysChargeCategoryRepo.GetValidList(organizeId); + var data1 = _SysChargeCategoryBaseRepo.GetValidList(organizeId); var treeList = new List(); - foreach (var item in data) + // 基础数据 + if (organizeId .Equals("*") ) { - if (treeidFieldName == "Code") + // 遍历 data1 + foreach (var item in data1) { TreeSelectModel treeModel = new TreeSelectModel(); - treeModel.id = item.dlCode; - treeModel.text = item.dlmc; - treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) - ? data.Where(p => p.dlId == item.ParentId).Select(p => p.dlCode).FirstOrDefault() - : null; + if (treeidFieldName == "Code") + { + treeModel.id = item.dlCode; + treeModel.text = item.dlmc; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) + ? data1.Where(p => p.dlId == item.ParentId).Select(p => p.dlCode).FirstOrDefault() + : null; + } + else + { + treeModel.id = item.dlId.ToString(); + treeModel.text = item.dlmc; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) ? item.ParentId.ToString() : null; + } treeList.Add(treeModel); } - else + } + else + { + // 遍历 data + foreach (var item in data) { TreeSelectModel treeModel = new TreeSelectModel(); - treeModel.id = item.dlId.ToString(); - treeModel.text = item.dlmc; - treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) ? item.ParentId.ToString() : null; + if (treeidFieldName == "Code") + { + treeModel.id = item.dlCode; + treeModel.text = item.dlmc; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) + ? data.Where(p => p.dlId == item.ParentId).Select(p => p.dlCode).FirstOrDefault() + : null; + } + else + { + treeModel.id = item.dlId.ToString(); + treeModel.text = item.dlmc; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) ? item.ParentId.ToString() : null; + } treeList.Add(treeModel); } } + return Content(treeList.TreeSelectJson(null)); + } /// @@ -63,25 +95,61 @@ public ActionResult GetTreeSelectJson(string organizeId, string treeidFieldName /// public ActionResult GetTreeGridJson(string organizeId, string keyword) { - var data = _SysChargeCategoryRepo.GetList(organizeId); - if (!string.IsNullOrEmpty(keyword)) + if (!organizeId.Equals("*")) { - data = data.ToList().TreeWhereForKeyInt(t => t.dlmc.Contains(keyword), keyValue : "dlId", parentId: "ParentId"); + //非基础数据 + var data = _SysChargeCategoryRepo.GetList(organizeId); + if (!string.IsNullOrEmpty(keyword)) + { + data = data.ToList().TreeWhereForKeyInt(t => t.dlmc.Contains(keyword), keyValue: "dlId", + parentId: "ParentId"); + } + + var treeList = new List(); + foreach (var item in data) + { + TreeGridModel treeModel = new TreeGridModel(); + treeModel.id = item.dlId.ToString(); + bool hasChildren = data.Count(t => t.ParentId == item.dlId) == 0 ? false : true; + treeModel.id = item.dlId.ToString(); + treeModel.isLeaf = hasChildren; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) + ? item.ParentId.ToString() + : null; + treeModel.expanded = hasChildren; + treeModel.entityJson = item.ToJson(); + treeList.Add(treeModel); + } + + return Content(treeList.TreeGridJson(null)); } - var treeList = new List(); - foreach (var item in data) + else { - TreeGridModel treeModel = new TreeGridModel(); - treeModel.id = item.dlId.ToString(); - bool hasChildren = data.Count(t => t.ParentId == item.dlId) == 0 ? false : true; - treeModel.id = item.dlId.ToString(); - treeModel.isLeaf = hasChildren; - treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) ? item.ParentId.ToString() : null; - treeModel.expanded = hasChildren; - treeModel.entityJson = item.ToJson(); - treeList.Add(treeModel); + var data = _SysChargeCategoryBaseRepo.GetList(organizeId); + if (!string.IsNullOrEmpty(keyword)) + { + data = data.ToList().TreeWhereForKeyInt(t => t.dlmc.Contains(keyword), keyValue: "dlId", + parentId: "ParentId"); + } + + var treeList = new List(); + foreach (var item in data) + { + TreeGridModel treeModel = new TreeGridModel(); + treeModel.id = item.dlId.ToString(); + bool hasChildren = data.Count(t => t.ParentId == item.dlId) == 0 ? false : true; + treeModel.id = item.dlId.ToString(); + treeModel.isLeaf = hasChildren; + treeModel.parentId = (item.ParentId.HasValue && item.ParentId.Value != 0) + ? item.ParentId.ToString() + : null; + treeModel.expanded = hasChildren; + treeModel.entityJson = item.ToJson(); + treeList.Add(treeModel); + } + + return Content(treeList.TreeGridJson(null)); } - return Content(treeList.TreeGridJson(null)); } /// @@ -89,10 +157,20 @@ public ActionResult GetTreeGridJson(string organizeId, string keyword) /// /// /// - public ActionResult GetFormJson(int keyValue) + public ActionResult GetFormJson(int keyValue, string orgId = null) { - var entity = _SysChargeCategoryRepo.GetForm(keyValue); - return Content(entity.ToJson()); + + if ("*".Equals(orgId)) + { + var entity = _SysChargeCategoryBaseRepo.GetForm(keyValue); + return Content(entity.ToJson()); + } + else + { + var entity = _SysChargeCategoryRepo.GetForm(keyValue); + return Content(entity.ToJson()); + + } } /// @@ -124,11 +202,19 @@ public ActionResult SubmitForm(SysChargeCategoryEntity entity, int? keyValue) { throw new FailedException("请选择组织机构"); } - else if (!_SysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId)) + else if (!_SysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId) && !"*".Equals(entity.OrganizeId) ) { throw new FailedException("请选择医疗机构(医院或诊所)"); } - _SysChargeCategoryRepo.SubmitForm(entity, keyValue); + + if ("*".Equals(entity.OrganizeId)) + { + _SysChargeCategoryBaseRepo.SubmitForm(entity.ToJson().ToObject(), keyValue); + } + else + { + _SysChargeCategoryRepo.SubmitForm(entity, keyValue); + } return Success("操作成功。"); } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysChargeItemController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysChargeItemController.cs index 6e3b02f1..3dc2328e 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysChargeItemController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysChargeItemController.cs @@ -16,14 +16,20 @@ public class SysChargeItemController : ControllerBase private readonly ISysChargeItemRepo _sysChargeItemRepo; private readonly ISysOrganizeDmnService _SysOrganizeDmnService; private readonly ISysChargeItemDmnService _sysChargeItemDmnService; + private readonly ISysChargeItemBaseRepo _sysChargeItemBaseRepo; public SysChargeItemController(ISysChargeItemRepo _sysChargeItemRepo , ISysOrganizeDmnService sysOrganizeDmnService - , ISysChargeItemDmnService sysChargeItemDmnService) + , ISysChargeItemDmnService sysChargeItemDmnService, + ISysChargeItemBaseRepo sysChargeItemBaseRepo + ) { this._sysChargeItemRepo = _sysChargeItemRepo; this._SysOrganizeDmnService = sysOrganizeDmnService; this._sysChargeItemDmnService = sysChargeItemDmnService; + this._sysChargeItemBaseRepo = sysChargeItemBaseRepo; + _sysChargeItemBaseRepo = sysChargeItemBaseRepo; + } public ActionResult YbbxblForm() @@ -39,7 +45,7 @@ public ActionResult GetGridJson(Pagination pagination, string organizeId, string { pagination.sidx = "CreateTime desc"; pagination.sord = "asc"; - if (!_SysOrganizeDmnService.IsMedicalOrganize(organizeId)) + if (!_SysOrganizeDmnService.IsMedicalOrganize(organizeId) && !"*".Equals(organizeId)) { return Content(new { @@ -49,15 +55,32 @@ public ActionResult GetGridJson(Pagination pagination, string organizeId, string records = 0, }.ToJson()); } - var list = _sysChargeItemDmnService.GetPagintionList(organizeId, pagination, sfdl, keyword); - var data = new + + if ("*".Equals(organizeId)) + { + var list = _sysChargeItemDmnService.GetPagintionList(organizeId, pagination, sfdl, keyword); + var data = new + { + rows = list, + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + + } + else { - rows = list, - total = pagination.total, - page = pagination.page, - records = pagination.records - }; - return Content(data.ToJson()); + var list = _sysChargeItemDmnService.GetPagintionList(organizeId, pagination, sfdl, keyword); + var data = new + { + rows = list, + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + } } /// @@ -83,15 +106,23 @@ public ActionResult SubmitForm(SysChargeItemEntity entity, int? keyValue) entity.tsbz = entity.tsbz == "true" ? "1" : "0"; entity.sfbz = entity.sfbz == "true" ? "1" : "0"; entity.zt = entity.zt == "true" ? "1" : "0"; - if (string.IsNullOrWhiteSpace(entity.OrganizeId)) + if (string.IsNullOrWhiteSpace(entity.OrganizeId) && !"*".Equals(entity.OrganizeId)) { throw new FailedException("请选择组织机构"); } - else if (!_SysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId)) + else if (!_SysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId)&& !"*".Equals(entity.OrganizeId)) { throw new FailedException("请选择医疗机构(医院或诊所)"); } - _sysChargeItemRepo.SubmitForm(entity, keyValue); + + if ("*".Equals(entity.OrganizeId)) + { + _sysChargeItemBaseRepo.SubmitForm(entity.ToJson().ToObject(), keyValue); + } + else + { + _sysChargeItemRepo.SubmitForm(entity, keyValue); + } return Success("操作成功。"); } @@ -131,13 +162,23 @@ public ActionResult YibaoUploadApi(int sfxmId, string flag) return Success("缺少医保代码!"); } } - + /// + /// 获取医保报销比例集合 + /// + /// + /// public ActionResult Getybbxbldata(string keyValue) { var list = _sysChargeItemDmnService.Getybbxbldata(keyValue, this.OrganizeId); return Content(list.ToJson()); } - + /// + /// 保存医保报销比例设置 + /// + /// + /// + /// + /// public ActionResult SaveYbblValue(List entity, string xmbm,string xmmc) { _sysChargeItemDmnService.SaveYbblValue(entity, xmbm, xmmc, this.OrganizeId,this.UserIdentity.rygh); diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysDiagnosisController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysDiagnosisController.cs index acb91b47..f582c6bf 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysDiagnosisController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Settlement/SysDiagnosisController.cs @@ -140,7 +140,7 @@ public ActionResult SubmitForm(SysDiagnosisEntity entity, int? keyValue) { throw new FailedException("请选择组织机构"); } - else if (!_sysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId)) + else if (!_sysOrganizeDmnService.IsMedicalOrganize(entity.OrganizeId)&& entity.OrganizeId!="*") { throw new FailedException("请选择医疗机构(医院或诊所)"); } diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/CommonLibraryController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/CommonLibraryController.cs new file mode 100644 index 00000000..6a3163d9 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/CommonLibraryController.cs @@ -0,0 +1,310 @@ +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using Newtouch.Core.Common; +using Newtouch.HIS.Application.Interface; +using Newtouch.HIS.Domain.Entity; +using Newtouch.HIS.Domain.IDomainServices; +using Newtouch.HIS.Domain.IDomainServices.SystemManage; +using Newtouch.HIS.Domain.IRepository; +using Newtouch.HIS.DomainServices.SystemManage; +using Newtouch.HIS.Repository; +using Newtouch.Tools; + +namespace Newtouch.HIS.Base.HOSP.Controllers +{ + public class CommonLibraryController : ControllerBase + { + + + private readonly ISysOrganizeDmnService _sysOrganizeDmnService; + private readonly ISysMedicineRepo _SysMedicineRepository; + private readonly ISysMedicinePropertyRepo _sysMedicinePropertyRepo; + private readonly ISysMedicineDmnService _sysMedicineDmnService; + private readonly ISysMedicalOrderFrequencyRepo _sysMedicalOrderFrequencyRepo; + private readonly ISysMedicineAntibioticInfoRepo _sysMedicineAntibioticInfoRepo; + private readonly ISysPharmacyDepartmentRepo _sysPharmacyDepartmentRepo; + private readonly ISysPharmacyDepartmentApp _sysPharmacyDepartmentApp; + private readonly ISysMedicineUsageRepo _sysMedicineUsageRepo; + private readonly ICommonLibraryDmnService _iCommonLibraryDmnService; + private readonly ISysMedicineBaseRepo _sysMedicineBaseRepo; + private readonly ISysMedicinePropertyBaseRepo _sysMedicinePropertyBaseRepo; + private readonly ISysChargeCategoryRepo _sysChargeCategoryRepo; + private readonly ISysChargeCategoryBaseRepo _sysChargeCategoryBaseRepo; + private readonly ISysChargeItemRepo _sysChargeItemRepo; + private readonly ISysChargeItemBaseRepo _sysChargeItemBaseRepo; + private readonly ISysMedicalOrderFrequencyRepo _sysMedicalOrderFrequencyApp; + private readonly ISysChargeCategoryTypeRelationRepo _sysChargeCategoryTypeRelationRepo; + + + + + public CommonLibraryController(ISysOrganizeDmnService sysOrganizeDmnService + , ISysMedicineRepo SysMedicineRepository, ISysMedicineDmnService sysMedicineDmnService + , ISysMedicalOrderFrequencyRepo SysMedicalOrderFrequencyRepo + , ISysMedicineAntibioticInfoRepo MedicineAntibioticInfoRepo, + ISysPharmacyDepartmentRepo sysPharmacyDepartmentRepo, + ISysPharmacyDepartmentApp sysPharmacyDepartmentApp, ICommonLibraryDmnService iCommonLibraryDmnService, + ISysMedicineBaseRepo SysMedicineBaseRepo, ISysMedicinePropertyBaseRepo SysMedicinePropertyBaseRepo,ISysChargeCategoryRepo SysChargeCategoryRepo + ,ISysChargeCategoryBaseRepo SysChargeCategoryBaseRepo, + ISysChargeItemRepo SysChargeItemRepo, + ISysChargeItemBaseRepo SysChargeItemBaseRepo, + ISysMedicalOrderFrequencyRepo sysMedicalOrderFrequencyApp, + ISysChargeCategoryTypeRelationRepo sysChargeCategoryTypeRelationRepo, + ISysMedicinePropertyRepo sysMedicinePropertyRepo + ) + { + _sysOrganizeDmnService = sysOrganizeDmnService; + _SysMedicineRepository = SysMedicineRepository; + _sysMedicineDmnService = sysMedicineDmnService; + _sysMedicalOrderFrequencyRepo = SysMedicalOrderFrequencyRepo; + _sysMedicineAntibioticInfoRepo = MedicineAntibioticInfoRepo; + _sysPharmacyDepartmentRepo = sysPharmacyDepartmentRepo; + _sysPharmacyDepartmentApp = sysPharmacyDepartmentApp; + _iCommonLibraryDmnService = iCommonLibraryDmnService; + _sysMedicineBaseRepo = SysMedicineBaseRepo; + _sysMedicinePropertyBaseRepo = SysMedicinePropertyBaseRepo; + _sysChargeCategoryRepo = SysChargeCategoryRepo; + _sysChargeCategoryBaseRepo = SysChargeCategoryBaseRepo; + _sysChargeItemRepo = SysChargeItemRepo; + _sysChargeItemBaseRepo = SysChargeItemBaseRepo; + _sysMedicalOrderFrequencyApp = sysMedicalOrderFrequencyApp; + _sysChargeCategoryTypeRelationRepo = sysChargeCategoryTypeRelationRepo; + _sysMedicinePropertyRepo = sysMedicinePropertyRepo; + } + + + + //grid json 数据源 + [HttpGet] + [HandlerAjaxOnly] + public ActionResult GetGridJson(Pagination pagination, string keyword, string organizeId,string zxyfl, string zt,string ypflCode,string ypgg ,string ycmc,string dlCode) + { + pagination.sidx = "CreateTime desc"; + pagination.sord = "asc"; + if (!string.IsNullOrEmpty(zxyfl)) + { + dlCode = zxyfl; + } + var data = new + { + rows = _iCommonLibraryDmnService.GetPaginationList(organizeId, pagination, zt, ypflCode, keyword,ypgg, ycmc, dlCode), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + } + + + + + + + + + // /** + // * 同步全部药品 + // */ + // [HttpGet] + // [HandlerAjaxOnly] + // public ActionResult SyncAllDrug(string organizeId) + // { + // //默认获取当前登录用户的机构 + // var userIdentityOrganizeId = UserIdentity.OrganizeId; + // var validListByOrg = _sysMedicineBaseRepo.GetValidListByOrg("*"); + // + // foreach (var item in validListByOrg) + // { + // //查看是否同步过 + // var sysMedicineEntity = _SysMedicineRepository.FindEntity(p => p.ypCode == item.ypCode && p.OrganizeId == userIdentityOrganizeId && p.ypmc == item.ypmc); + // if (sysMedicineEntity != null) + // { + // //同步过则跳过 + // continue; + // } + // _iCommonLibraryDmnService.SyncCommonDrug(item,userIdentityOrganizeId); + // } + // return Success("同步成功!"); + // } + + + + [HttpPost] + [HandlerAjaxOnly] + public ActionResult Sync(List idList,string organizeId,string Type) + { + //默认获取当前登录用户的机构 + // var userIdentityOrganizeId = UserIdentity.OrganizeId; + //药品 + foreach (var id in idList) + { + if ("yp".Equals(Type)) + { + //获取药品信息 + var s = _sysMedicineBaseRepo.FindEntity(p=>p.ypId == id); + var s1 = _sysMedicinePropertyBaseRepo.FindEntity(p => p.ypId == id); + //查看是否同步过 + var sysMedicineEntity = _SysMedicineRepository.FindEntity(p => p.ycmc == s.ycmc && p.OrganizeId == organizeId && p.ypmc == s.ypmc); + var sysMedicineEntityProperty = _sysMedicinePropertyRepo.FindEntity(p =>p.OrganizeId == organizeId && p.gjybdm == s1.gjybdm); + if (sysMedicineEntity == null && sysMedicineEntityProperty == null) + { + _iCommonLibraryDmnService.SyncCommonDrug(s,organizeId); + } + else + { + return Error("["+s.ypmc+"]已经同步过!请勿勾选"); + } + }else if ("sfdl".Equals(Type)) + { + var s = _sysChargeCategoryBaseRepo.FindEntity(p => p.dlId == id); + var sysChargeCategoryEntity = _sysChargeCategoryRepo.FindEntity(p => p.dlCode == s.dlCode && p.OrganizeId == organizeId && p.dlmc == s.dlmc); + if (sysChargeCategoryEntity == null) + { + _iCommonLibraryDmnService.SyncCommonSfdl(s,organizeId); + try + { + //同步该项目下的收费大类类型 + var sysChargeCategoryTypeRelationEntity = _sysChargeCategoryTypeRelationRepo.FindEntity(p => + p.dlCode == s.dlCode && p.OrganizeId == "*"); + sysChargeCategoryTypeRelationEntity.OrganizeId = organizeId; + sysChargeCategoryTypeRelationEntity.Id = Guid.NewGuid().ToString(); + _sysChargeCategoryTypeRelationRepo.Insert(sysChargeCategoryTypeRelationEntity); + } + catch (Exception e) + { + continue; + } + }else + { + return Error("["+s.dlmc+"]已经同步过!请勿勾选"); + } + //收费大类 + + }else if ("hc".Equals(Type)) + { + //暂用公用药品材料费 + //获取材料信息 + var s = _sysMedicineBaseRepo.FindEntity(p=>p.ypId == id); + //查看是否同步过 + var sysMedicineEntity = _SysMedicineRepository.FindEntity(p => p.ycmc == s.ycmc && p.OrganizeId == organizeId && p.ypmc == s.ypmc); + if (sysMedicineEntity == null) + { + _iCommonLibraryDmnService.SyncCommonDrug(s,organizeId); + } + else + { + return Error("["+s.ypmc+"]已经同步过!请勿勾选"); + } + + }else if ("sfxm".Equals(Type)) + { + //sfxm + var s = _sysChargeItemBaseRepo.FindEntity(p => p.sfxmId == id); + //查看是否同步过 + var sysChargeItem = _sysChargeItemRepo.FindEntity(p => p.sfxmmc == s.sfxmmc && p.OrganizeId == organizeId && p.sfdlCode == s.sfdlCode); + if (sysChargeItem == null) + { + _iCommonLibraryDmnService.SyncCommonSfxm(s,organizeId); + } + else + { + return Error("["+s.sfxmmc+"]已经同步过!请勿勾选"); + } + } + else if ("yzpc".Equals(Type)) + { + //yzpc + var s = _sysMedicalOrderFrequencyApp.FindEntity(p => p.yzpcId == id); + //查看是否同步过 + var sysChargeItem = _sysMedicalOrderFrequencyApp.FindEntity(p => p.yzpcCode == s.yzpcCode && p.OrganizeId == organizeId && p.yzpcmc == s.yzpcmc); + if (sysChargeItem == null) + { + s.OrganizeId = organizeId; + _sysMedicalOrderFrequencyApp.Insert(s); + } + else + { + return Error("["+s.yzpcmc+"]已经同步过!请勿勾选"); + } + } + + } + + return Success("同步成功!"); + } + /** + * 同步医保药品目录 + */ + [HttpGet] + [HandlerAjaxOnly] + public ActionResult SyncYbyp() + { + _iCommonLibraryDmnService.SyncYbyp(UserIdentity.OrganizeId); + + return Success("医保药品目录同步成功!"); + } + + + public ActionResult SysCommonMedicineAdd() + { + return View(); + } + + public ActionResult SysCommonStuffAdd() + { + return View(); + } + + public ActionResult ChargeItemForm() + { + return View(); + } + + public ActionResult SysCommonChargeCategoryForm() + { + return View(); + } + + public ActionResult SysMedicalOrderFrequencyForm() + { + return View(); + } + + + + + + public ActionResult GetPcSelectJson() + { + var data = new List(); + var entityList = _sysMedicalOrderFrequencyRepo.GetOrderFrequencyList(this.OrganizeId); + foreach (var item in entityList) + { + var obj = new + { + id = item.yzpcCode, + text = item.yzpcmc + }; + data.Add(obj); + } + return Content(data.ToJson()); + } + + + /// + /// 修改信息时,把信息带到新页面 + /// + /// + /// + [HttpGet] + [HandlerAjaxOnly] + public ActionResult GetFormJson(int keyValue) + { + var data = _iCommonLibraryDmnService.GetFormJson(keyValue); + return Content(data.ToJson()); + } + + + } +} \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/DepartmentController.cs b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/DepartmentController.cs index e3ba86a4..5943f1b9 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/DepartmentController.cs +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Controllers/Sys/DepartmentController.cs @@ -120,6 +120,14 @@ public ActionResult SubmitForm(SysDepartmentEntity entity, string keyValue) return Success("操作成功。"); } + [HttpPost] + [HandlerAjaxOnly] + public ActionResult UpdateYbUpload(int uploadYB, string id) + { + _sysDepartmentRepository.UpdateYbUpload(uploadYB, id); + return Success("操作成功。"); + } + #region 关联病区 public virtual ActionResult WardInfo() diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Newtouch.HIS.Base.HOSP.csproj b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Newtouch.HIS.Base.HOSP.csproj index be8480d7..04f93294 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Newtouch.HIS.Base.HOSP.csproj +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Newtouch.HIS.Base.HOSP.csproj @@ -271,6 +271,12 @@ Designer + + Designer + + + Designer + Dockerfile @@ -280,6 +286,11 @@ + + + + + @@ -435,6 +446,10 @@ + + + Web.config + Web.config @@ -477,6 +492,7 @@ + @@ -489,6 +505,7 @@ + @@ -567,6 +584,9 @@ 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + bin\ + @@ -578,7 +598,7 @@ True 55142 / - http://localhost:55144/ + http://localhost:21000/ False False diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/FolderProfile.pubxml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/FolderProfile.pubxml index 851971dd..93c02b6c 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/FolderProfile.pubxml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,14 +4,15 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - false - false - true + True + False + True Release Any CPU FileSystem - D:\发布地址\开源\Base + D:\Pulish\base FileSystem <_TargetId>Folder + \ No newline at end of file diff --git a/Newtouch.HIS.Static/Newtouch.HIS.Static/Properties/PublishProfiles/FolderProfile1.pubxml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/PublishProfile.pubxml similarity index 91% rename from Newtouch.HIS.Static/Newtouch.HIS.Static/Properties/PublishProfiles/FolderProfile1.pubxml rename to Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/PublishProfile.pubxml index 7f448e84..42e83103 100644 --- a/Newtouch.HIS.Static/Newtouch.HIS.Static/Properties/PublishProfiles/FolderProfile1.pubxml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Properties/PublishProfiles/PublishProfile.pubxml @@ -10,7 +10,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - D:\发布地址\开源\static + ..\..\publish\Base FileSystem <_TargetId>Folder diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/ChargeCategory/Form.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/ChargeCategory/Form.cshtml index ecafcf4a..46579f5a 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/ChargeCategory/Form.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/ChargeCategory/Form.cshtml @@ -6,7 +6,7 @@
diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeCategoryBase/Form.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeCategoryBase/Form.cshtml new file mode 100644 index 00000000..46579f5a --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeCategoryBase/Form.cshtml @@ -0,0 +1,205 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*组织机构: + +
*名称: + +
*编码: + +
*首拼: + +
*大类类别: + @Html.DropDownList("dllb", Newtouch.Infrastructure.EnumSfdlDllb.yp.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
上级大类: + +
所属分类: + @Html.DropDownList("fjCode", Newtouch.Infrastructure.EnumSffjdlCode.ypf.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
门诊报表大类: + +
门诊结算大类: + +
通用报表大类: + +
*门诊住院标志: + +
排序: + +
税率: + +
状态: +
+ +
+
+ + + + + + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeItemForm.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeItemForm.cshtml new file mode 100644 index 00000000..16860096 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/ChargeItemForm.cshtml @@ -0,0 +1,442 @@ +@{ + ViewBag.Title = "ChargeItemForm"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +
+
+ + + @* + *@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @* + *@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*组织机构: *@ + @* *@ + @* *名称: + + *编码: + +
*首拼: + + 手术等级: + +
+ *自负性质: + + @Html.DropDownList("zfxz", Newtouch.Infrastructure.EnumZFXZv2.ZF.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) + 自负比例: + + 计价策略: + @Html.DropDownList("jjcl", Newtouch.Infrastructure.EnumSfxmJjcl.Amount.ToDescSelectList(((int)Newtouch.Infrastructure.EnumSfxmJjcl.Amount)), "==请选择==", new { @class = "form-control required" }) +
*单价: + + *单位: + + 单位计量数: + +
*收费大类: + + 病案收费大类: + + 默认执行科室: + +
批准文号: + + 规格: + + 生产厂家: + +
*医保标志: +
+ + +
+
国家医保代码: + + 省医保代码: + + +
新农合医保代码: + + *门诊住院标志: + + 医保限价: + + 国家医保名称: + +
实施标志: +
+ + + +
+
特殊标志: +
+ + +
+
收费标志: +
+ +
+
申请类型: + + 物价代码: + + + 时长(分): + +
排序: + + 状态: +
+ +
+
+ 备注: + + +
+
+
+ + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/Index.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/Index.cshtml new file mode 100644 index 00000000..4365d47c --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/Index.cshtml @@ -0,0 +1,1038 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + +
+
+
+ @Html.Partial("_OrganizeIdDDLToolbarSearchView") +
+
+ 新建 +
+
+ 修改 +
+ + @*
+ 限用 +
*@ +
+ +
+ @*
*@ + @* 全部同步 *@ + @*
*@ +
+ 同步 +
+
+
+
+
+
+
+
+ @* 收费大类tab *@ +
+
+
+
+ 新建 +
+
+ 修改 +
+
+ +
+ @*
*@ + @* 全部同步 *@ + @*
*@ +
+ 同步 +
+
+
+
+
+
+
+ @* 耗材tab *@ +
+
+
+
+ 新建 +
+
+ 修改 +
+
+ +
+
+ 同步 +
+
+
+
+
+
+
+ +
+ @* 收费项目tab *@ +
+
+
+
+ 新建 +
+
+ 修改 +
+
+ +
+ +
+
+
+ 同步 +
+
+
+
+
+
+
+
+ @* 医嘱频次 *@ +
+
+
+
+ 新建 +
+
+ 修改 +
+
+ +
+
+ 同步 +
+
+
+
+
+
+
+
+ +
+ + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonChargeCategoryForm.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonChargeCategoryForm.cshtml new file mode 100644 index 00000000..ab0968fd --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonChargeCategoryForm.cshtml @@ -0,0 +1,206 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+ + +
+
+ + @* *@ + @* *@ + @* *@ + @* *@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*组织机构: *@ + @* *@ + @*
*名称: + +
*编码: + +
*首拼: + +
*大类类别: + @Html.DropDownList("dllb", Newtouch.Infrastructure.EnumSfdlDllb.yp.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
上级大类: + +
所属分类: + @Html.DropDownList("fjCode", Newtouch.Infrastructure.EnumSffjdlCode.ypf.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
门诊报表大类: + +
门诊结算大类: + +
通用报表大类: + +
*门诊住院标志: + +
排序: + +
税率: + +
状态: +
+ +
+
+
+
+
+
+ + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonMedicineAdd.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonMedicineAdd.cshtml new file mode 100644 index 00000000..8dccc5b7 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonMedicineAdd.cshtml @@ -0,0 +1,1381 @@ +@{ + ViewBag.Title = "SysCommonMedicineAdd"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +
+
+ +
+
+ + + @* *@ + @* *@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*@ + @* *组织机构: *@ + @* *@ + @* *@ + @* 药品分类: + + +
+ *药品名称: + + + + *首拼: + + + + *大类: + + +
+ 商品名: + + + + *编码: + + + + *药厂名称: + + +
批准文号: + + + *药品规格: + + + + *剂型: + + + +
*剂量单位: + + *剂量转换系数: + + +

1最小单位 = 剂量转换系数 * 剂量单位

+
默认剂量: + + 默认频次: + + 抗生素: +     + + +
*医保标志: +
+ + +
+
+ 国家医保代码: + + +
+ 国家医保名称: + + + 省医保代码: + + + 默认用法: + + + +
+ *自负性质: + + @*
+ + +
*@ + @Html.DropDownList("zfxz", Newtouch.Infrastructure.EnumZFXZv2.ZF.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
自付比例: + + 医保规格: + +
+ 备注: + + +
+
+ 单位转换

说明:1最小单位 = 剂量转换系数 * 剂量单位

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ *零售价: + + + + 批发价: + + + + *最小单位: + + +
*住院: + + + = + + x + + + + + x + + = + 1 + +
+ *门诊: + + + + = + + x + + + + + x + + = + 1 + +
+ *药库: + + + + = + + x + + + + + x + + = + 1 + +
+ 医保限价: + + + + 单次限量: + + + + 慢病限量: + + +
+
+
+ 药品属性 +
+ + + + + + + + + + + + + + + + + +
招标方式: + + 药品属性: + + *病区记账类型: + @Html.DropDownList("jzlx", Newtouch.Infrastructure.EnumBQJZQZ.Day.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
*基药标识: + @Html.DropDownList("jybz", Newtouch.Infrastructure.EnumJybz.Gjy.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) + 特殊药品标志: + + 选项: + + + +
+ @*
*@ + @* 同步药/库房 *@ + @*
*@ +
+
    +
    +
    +
    + + + + + + + + + + + + + + + + + + @**@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + *抗生素分类: + + + + +
    + *权限级别: + + +
    + 单次剂量: + + +  -  + +
    + 频次范围: + + +  -   + + (小时一次) +
    + DDD值: + + +      DDD单位:     + +
    剂量单位: +   (单位g) +
    + 效价: + +   (单位mg) +
    + 空瓶: + +     + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonStuffAdd.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonStuffAdd.cshtml new file mode 100644 index 00000000..bf750a8c --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysCommonStuffAdd.cshtml @@ -0,0 +1,1367 @@ +@{ + ViewBag.Title = "SysCommonStuffAdd"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + *材料名称: + + + + *首拼: + + + + *大类: + + +
    + 商品名: + + + + *编码: + + + + *厂商名称: + + +
    批准文号: + + + *药品规格: + + + + *剂型: + + + +
    *剂量单位: + + *剂量转换系数: + + +

    1最小单位 = 剂量转换系数 * 剂量单位

    +
    默认剂量: + + 默认频次: + + 抗生素: +     + + +
    *医保标志: +
    + + +
    +
    + 国家医保代码: + + +
    + 国家医保名称: + + + 省医保代码: + + + 默认用法: + + + +
    + *自负性质: + + @*
    + + +
    *@ + @Html.DropDownList("zfxz", Newtouch.Infrastructure.EnumZFXZv2.ZF.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
    自付比例: + + 医保规格: + +
    + 备注: + + +
    +
    + 单位转换

    说明:1最小单位 = 剂量转换系数 * 剂量单位

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + *零售价: + + + + 批发价: + + + + *最小单位: + + +
    *住院: + + + = + + x + + + + + x + + = + 1 + +
    + *门诊: + + + + = + + x + + + + + x + + = + 1 + +
    + *药库: + + + + = + + x + + + + + x + + = + 1 + +
    + 医保限价: + + + + 单次限量: + + + + 慢病限量: + + +
    +
    + @*
    + 药品属性 +
    *@ + + + @* + + + + + + + + + + + *@ + + + +
    招标方式: + + 药品属性: + + *病区记账类型: + @Html.DropDownList("jzlx", Newtouch.Infrastructure.EnumBQJZQZ.Day.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) +
    *基药标识: + @Html.DropDownList("jybz", Newtouch.Infrastructure.EnumJybz.Gjy.ToDescSelectList(), "==请选择==", new { @class = "form-control required" }) + 特殊药品标志: + + 选项: + + + +
    + @*
    *@ + @* 同步药/库房 *@ + @*
    *@ +
    +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + @**@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + *抗生素分类: + + + + +
      + *权限级别: + + +
      + 单次剂量: + + +  -  + +
      + 频次范围: + + +  -   + + (小时一次) +
      + DDD值: + + +      DDD单位:     + +
      剂量单位: +   (单位g) +
      + 效价: + +   (单位mg) +
      + 空瓶: + +     + +
      +
      +
      +
      +
      + + \ No newline at end of file diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysMedicalOrderFrequencyForm.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysMedicalOrderFrequencyForm.cshtml new file mode 100644 index 00000000..e89506d6 --- /dev/null +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/CommonLibrary/SysMedicalOrderFrequencyForm.cshtml @@ -0,0 +1,153 @@ +@using Newtouch.Common.Operator; +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
      +
      + +
      +
      + + @* *@ + @* *@ + @* *@ + @* *@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      *组织机构: *@ + @* *@ + @*
      *名称: + +
      *名称说明: + +
      *编码: + +
      *执行次数: + +
      *执行周期: + +
      *执行周期时间单位: + +
      周标志: + +
      *执行时间: + +
      有效: +
      + +
      +
      +
      +
      +
      +
      + + diff --git a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/Department/Index.cshtml b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/Department/Index.cshtml index 72e95faf..3f12d378 100644 --- a/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/Department/Index.cshtml +++ b/Newtouch.HIS.Base/Newtouch.HIS.Base.HOSP/Views/Department/Index.cshtml @@ -2,6 +2,8 @@ @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; + + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); }
      - +
      @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel { - ShowKeyList = new[] { 7, 8, 10 }, - F8Text = "全部发药", - F7Text = "发药", - F10Text = "打印处方", + ShowKeyList = new[] { 6, 7, 8, 9, 10 }, + F6Text = "发药", + F7Text = "全部发药", + F8Text = "雾化卡", + F9Text = "输液卡", + F10Text = "用法标签" }) @@ -114,9 +120,11 @@ \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/DrugRepercussion.cshtml b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/DrugRepercussion.cshtml index 60a6b525..a8d683b6 100644 --- a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/DrugRepercussion.cshtml +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/DrugRepercussion.cshtml @@ -3,12 +3,15 @@ Layout = "~/Views/Shared/_Index.cshtml"; var partReturnSwitch = (bool)ViewBag.partReturnSwitch ? "true" : "false"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
      @@ -65,13 +68,49 @@ $(function () { gridTYCF(); gridTYCFDetail(); + + // 药品追溯码扫码 + $gridCfDetail.on('keydown', '.scan-input', function (event) { + if (event.key === 'Enter') { + event.preventDefault(); + + const inputField = $(this); + const row = inputField.closest('tr'); + + // 是否拆零 + const sfcl = parseInt(row.find('.sfcl').val(), 10); + var maxEntries = 1; + if (sfcl === 1) { + maxEntries = 1 + } else { + maxEntries = parseInt(row.find('.quantity').text(), 10); + } + + const entries = inputField.val().split(',').filter(entry => entry.trim() !== '').length; + + if (inputField.val() && !inputField.val().endsWith(',')) { + inputField.val(removeDuplicates(inputField.val())); + } + + if (entries >= maxEntries) { + $.modalMsg("已达到该行的最大扫码条目数量!", "warning", 1500); + inputField.val(inputField.val().split(',').filter(entry => entry.trim() != "").slice(0, maxEntries).join(',') + ","); + } + } + }); }); + function removeDuplicates(str){ + const arr = str.split(',') + const uniqueArr = [...new Set(arr)] + return uniqueArr.join(',')+',' + } + //回车事件绑定 $(document).keyup(function (event) { - if (event.keyCode === 13) { - $("#btn_search").trigger("click"); - } +// if (event.keyCode === 13) { +// $("#btn_search").trigger("click"); +// } }); //获取数据 @@ -135,8 +174,20 @@ { label: '药品名称', name: 'ypmc', width: 110, align: 'left' }, { label: '可退', name: 'slstr', width: 40, align: 'left' }, @*{ label: '数量', name: 'sl', width: 50, align: 'center', editable:@partReturnSwitch,editwidth:'85%' },*@ - { label: '数量', name: 'sl', width: 50, align: 'center' }, + { label: '数量', name: 'sl', width: 50, align: 'center', classes: 'quantity' }, { label: '单位', name: 'dw', width: 50, align: "left" }, + { + label: '*追溯码', name: 'zsm', width: 80, align: 'center', + formatter: function (cellvalue, options) { + return ""; + } + }, + { + label: '*是否拆零', name: 'sfcl', width: 80, align: 'center', + formatter: function (cellvalue, options) { + return ""; + } + }, { label: '规格', name: 'gg', width: 50, align: 'center' }, { label: '批号', name: 'ph', width: 90, align: 'center' }, { label: '批次', name: 'pc', width: 100, align: 'left' }, @@ -218,6 +269,24 @@ EnableInlineEditBox(); //启用行内编辑框 return false; } + const rowid = rowIds[i] + //追溯码 + var zsm = $("#sel_zsm_" + rowid).val() + //是否拆零 + var sfclValue = Number($("#sel_sfcl_" + rowid).val()); + + // 验证追溯码数量。 是否拆零选是,只需要扫一个,否的话需要扫对应入库数量的码 + const zsmLength = $("#sel_zsm_" + rowid).val().split(',').filter(entry => entry.trim() !== '').length + var maxZsmLength = 1 + if (sfclValue === 1) { + maxZsmLength = 1 + } else { + maxZsmLength = parseInt(rowData.sl) + } + if (zsmLength != 0 && zsmLength != maxZsmLength) { + $.modalMsg("条目" + rowData.ypmc + "数量与追溯码数量不一致!", "warning", 1500); + return false; + } if (parseInt(rowData.sl) > 0) { tymx.push({ "ypCode": rowData.ypCode, @@ -226,7 +295,9 @@ "cfh": rowData.cfh, "ph": rowData.ph, "czh": rowData.czh, - "pc": rowData.pc + "pc": rowData.pc, + "zsm": zsm, + "sfcl": sfclValue, }); } } @@ -247,7 +318,7 @@ if ($("#autoprint").get(0).checked) { var cfh = $gridCfList.jqGrid('getRowData', id).cfh; var tydh = JSON.parse(res.data)[0]; - var uri = '@reportUrl' + "?tempCode=62" + "&systemCode=" + '@reportSystemCode' + "&hospitalCode=" + '@ViewBag.OrganizeId' + "&yfbmCode=" + '@ViewBag.yfbmCode' + "&cfh=" + cfh + "&tydh=" + tydh; + var uri = '@reportUrl' + "?tempCode=62&systemCode=PDS" + "&hospitalCode=" + '@ViewBag.OrganizeId' + "&yfbmCode=" + '@ViewBag.yfbmCode' + "&cfh=" + cfh + "&tydh=" + tydh; window.open(uri); //window.open("/Report/PrintReport?type=MZTY_Bill¶m=OrganizeId=@ViewBag.OrganizeId" + "|yfbmCode=@ViewBag.yfbmCode" + "|cfh=" + cfh + "|tydh=" + tydh); } diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/ElectronicPrescription.cshtml b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/ElectronicPrescription.cshtml new file mode 100644 index 00000000..29d9a725 --- /dev/null +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/ElectronicPrescription.cshtml @@ -0,0 +1,624 @@ + +@{ + ViewBag.Title = "电子处方审核"; + Layout = "~/Views/Shared/_Index.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); +} + + +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      + 处方信息 + +
      +
      +
        +
      • + 门诊号: + +
      • +
      • + 姓名: + +
      • +
      • + 性别: + +
      • +
      • + 年龄: + +
      • +
      • + 医生: + +
      • +
      • + 医生工号: + +
      • +
      • + 卡号: + +
      • +
      • + 总金额: + +
      • +
      • + 病人性质: + +
      • +
      • + 科室: + +
      • +
      • + 处方号: + +
      • +
      • + 西医诊断: + +
      • +
      • + 中医诊断: + +
      • +
      +
      +
      +
      +
      +
      +
      + + @**@ +
      + @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel + { + ShowKeyList = new[] { 6,8 }, + F6Text = "不通过", + F8Text = "审核" + }) +
      + + + \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/MzPrescriptionQuery.cshtml b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/MzPrescriptionQuery.cshtml index 15be9377..324d8599 100644 --- a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/MzPrescriptionQuery.cshtml +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/OutPatientPharmacy/MzPrescriptionQuery.cshtml @@ -3,7 +3,6 @@ ViewBag.Title = "MzPrescriptionQuery"; Layout = "~/Views/Shared/_Index.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
      @@ -147,8 +151,73 @@ }); StartInventory(); InitialPd(); + + $gridKCInfo.on('keydown', '.scan-input', function (event) { + if (event.key === 'Enter') { + event.preventDefault(); + + const inputField = $(this); + const row = inputField.closest('tr'); + + // 是否拆零 + const sfcl = parseInt(row.find('.sfcl').val(), 10); + var maxEntries = 1; + if (sfcl === 1) { + maxEntries = 1 + } else { + maxEntries = parseInt(row.find('.quantity').text(), 10); + } + + + const entries = inputField.val().split(',').filter(entry => entry.trim() !== '').length; + + if (inputField.val() && !inputField.val().endsWith(',')) { + inputField.val(removeDuplicates(inputField.val())); + } + + if (entries >= maxEntries) { + $.modalMsg("已达到该行的最大扫码条目数量!", "warning", 1000); + inputField.val(inputField.val().split(',').filter(entry => entry.trim() != "").slice(0, maxEntries).join(',') + ","); + } + } + }); + $gridKCInfoMinUnit.on('keydown', '.scan-input', function (event) { + if (event.key === 'Enter') { + event.preventDefault(); + + const inputField = $(this); + const row = inputField.closest('tr'); + + // 是否拆零 + const sfcl = parseInt(row.find('.sfcl').val(), 10); + var maxEntries = 1; + if (sfcl === 1) { + maxEntries = 1 + } else { + maxEntries = parseInt(row.find('.quantity').text(), 10); + } + + + const entries = inputField.val().split(',').filter(entry => entry.trim() !== '').length; + + if (inputField.val() && !inputField.val().endsWith(',')) { + inputField.val(removeDuplicates(inputField.val())); + } + + if (entries >= maxEntries) { + $.modalMsg("已达到该行的最大扫码条目数量!", "warning", 1000); + inputField.val(inputField.val().split(',').filter(entry => entry.trim() != "").slice(0, maxEntries).join(',') + ","); + } + } + }); }); + function removeDuplicates(str){ + const arr = str.split(',') + const uniqueArr = [...new Set(arr)] + return uniqueArr.join(',')+',' + } + //初始化盘点 function InitialPd() { gridKCInfo(); @@ -213,8 +282,27 @@ { label: '药品名称', name: 'ypmc', width: 120, align: 'left' }, { label: '规格', name: 'ypgg', width: 80, align: 'left' }, { label: '理论数', name: 'llsl', width: 80, align: 'left' }, - { label: '(实)部门数', name: 'deptSjsl', width: 70, align: 'center', editable: true, editwidth: "90%" }, + { label: '(实)部门数', name: 'deptSjsl', width: 70, align: 'center', editable: true, editwidth: "90%", classes: 'quantity' }, { label: '单位', name: 'deptdw', width: 40, align: 'left' }, + { + label: '*追溯码', name: 'zsm', width: 80, align: 'center', + formatter: function (cellvalue, options) { + if (!cellvalue) { + cellvalue = "" + } + return ""; + } + }, + { + label: '*是否拆零', name: 'sfcl', width: 80, align: 'center', + formatter: function (cellvalue, options) { + if (!cellvalue) { + cellvalue = 1 + } + let html = `` + return html + } + }, { label: '系数', name: 'zhyz', width: 40, align: 'left' }, { label: '批号', name: 'ph', width: 100, align: 'center' }, { label: '批次', name: 'pc', width: 100, align: 'left' }, @@ -262,8 +350,28 @@ { label: '药品名称', name: 'ypmc', width: 120, align: 'left' }, { label: '规格', name: 'ypgg', width: 80, align: 'left' }, { label: '理论数', name: 'llsl', width: 80, align: 'left' }, - { label: '(实)最小数', name: 'minSjsl', width: 70, align: 'center', editable: true, editwidth: "90%" }, + { label: '(实)最小数', name: 'minSjsl', width: 70, align: 'center', editable: true, editwidth: "90%", classes: 'quantity' }, { label: '单位', name: 'zxdw', width: 40, align: 'left' }, + { + label: '*追溯码', name: 'zsm', width: 80, align: 'center', + formatter: function (cellvalue, options) { + if (!cellvalue) { + cellvalue = "" + } + return ""; + } + }, + { + label: '*是否拆零', name: 'sfcl', width: 80, align: 'center', + formatter: function (cellvalue, options) { + if (!cellvalue) { + cellvalue = 1 + } + let html = ""; + console.log(html) + return html + } + }, { label: '系数', name: 'zhyz', width: 40, align: 'left' }, { label: '批号', name: 'ph', width: 100, align: 'center' }, { label: '批次', name: 'pc', width: 100, align: 'left' }, @@ -340,6 +448,7 @@ ObjArr_Load.push($gridKCInfo.jqGrid('getRowData', rowIds[i])); $gridKCInfo.jqGrid('editRow', rowIds[i], true, null, null, null, null, function (callbackRowId) { //true: when set to true we can use [Enter] key to save the row and [Esc] to cancel editing. }); + } $.loading(false); } @@ -390,13 +499,33 @@ var kcInfoJsonSave = $targetJqg.jqGrid('getRowData_AllLine'); var objArrSave = new Array(); $.each(kcInfoJsonSave, function () {//保存时将Grid的数据行放在新的数组中 + //追溯码 + var zsm = $("#sel_zsm_" + this.jqRowId).val(); + //是否拆零 + var sfcl = parseInt($("#sel_sfcl_" + this.jqRowId).val(), 10); + this.zsm = zsm + this.sfcl = sfcl objArrSave.push(this); }); var resultObjArr = new Array(); //与页面加载的数组进行比对,将修改过的数据行放在resultObjArr中,传给后台 for (var i = 0; i < objArrSave.length; i++) { if (objArrSave[i].deptSjsl !== ObjArr_Load[i].deptSjsl || objArrSave[i].minSjsl !== ObjArr_Load[i].minSjsl) { - resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz) }); + // 验证追溯码数量。 是否拆零选是,只需要扫一个,否的话需要扫对应入库数量的码 + const zsmLength = objArrSave[i].zsm.split(',').filter(entry => entry.trim() !== '').length + var maxZsmLength = 1 + if (objArrSave[i].sfcl === 1) { + maxZsmLength = 1 + } else { + maxZsmLength = CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz) + } + + if (zsmLength != 0 && zsmLength != maxZsmLength) { + $.modalMsg("条目" + objArrSave[i].ypmc + "数量与追溯码数量不一致!", "warning", 1500); + return false; + } + + resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz), zsm: objArrSave[i].zsm, sfcl: objArrSave[i].sfcl }); } } if (resultObjArr.length === 0) { @@ -453,13 +582,35 @@ var kcInfoJsonSave = $targetJqg.jqGrid('getRowData_AllLine'); var objArrSave = new Array(); $.each(kcInfoJsonSave, function () {//保存时将Grid的数据行放在新的数组中 + //追溯码 + var zsm = $("#sel_zsm_" + this.jqRowId).val(); + //是否拆零 + var sfcl = parseInt($("#sel_sfcl_" + this.jqRowId).val(), 10); + this.zsm = zsm + this.sfcl = sfcl objArrSave.push(this); }); var resultObjArr = new Array(); //与页面加载的数组进行比对,将修改过的数据行放在resultObjArr中,传给后台 for (var i = 0; i < objArrSave.length; i++) { if (objArrSave[i].deptSjsl !== ObjArr_Load[i].deptSjsl || objArrSave[i].minSjsl !== ObjArr_Load[i].minSjsl) { - resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz) }); + + // 验证追溯码数量。 是否拆零选是,只需要扫一个,否的话需要扫对应入库数量的码 + const zsmLength = objArrSave[i].zsm.split(',').filter(entry => entry.trim() !== '').length + var maxZsmLength = 1 + if (objArrSave[i].sfcl === 1) { + maxZsmLength = 1 + } else { + maxZsmLength = CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz) + } + + if (zsmLength != 0 && zsmLength != maxZsmLength) { + $.modalMsg("条目" + objArrSave[i].ypmc + "数量与追溯码数量不一致!", "warning", 1500); + return false; + } + + resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz), zsm: objArrSave[i].zsm, sfcl: objArrSave[i].sfcl }); + } } if (resultObjArr.length === 0) { diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/PharmacyDrugStorage/InventoryQueryV2.cshtml b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/PharmacyDrugStorage/InventoryQueryV2.cshtml index 2b4ea755..ac85b8f0 100644 --- a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/PharmacyDrugStorage/InventoryQueryV2.cshtml +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/PharmacyDrugStorage/InventoryQueryV2.cshtml @@ -3,7 +3,6 @@ ViewBag.Title = "盘点查询"; Layout = "~/Views/Shared/_Index.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
      @@ -79,10 +82,11 @@ @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel { - ShowKeyList = new[] { 10, 6, 9, }, + ShowKeyList = new[] { 10, 6, 9, 8 }, F10Text = "大类明细", F6Text = "剂型明细", - F9Text = "盘点明细" + F9Text = "盘点明细", + F8Text = "保存追溯码" }) \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/SysMedicine/YbbxblForm.cshtml b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/SysMedicine/YbbxblForm.cshtml index 3bb60201..b228ec60 100644 --- a/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/SysMedicine/YbbxblForm.cshtml +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Views/SysMedicine/YbbxblForm.cshtml @@ -126,7 +126,7 @@ //获取所有选中行数据 var data = $("#gridList").jqGrid('getRowData_AllLine', false); $.najax({ - url: "/SysMedicine/SaveYbblValue", + url: "/SysChargeItem/SaveYbblValue", dataType: "json", data: { entity: data, xmbm: xmdm, xmmc: xmmc }, type: "POST", @@ -148,7 +148,7 @@ { $.najax({ type: "POST", - url: "/SysMedicine/Getybbxbldata", + url: "/SysChargeItem/Getybbxbldata", data: { keyValue: xmdm }, dataType: "json", //async: false, diff --git a/Newtouch.HIS.CIS/Newtouch.CIS.API/Web.Debug.config b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Web.9_190.config similarity index 80% rename from Newtouch.HIS.CIS/Newtouch.CIS.API/Web.Debug.config rename to Newtouch.HIS.PDS/Newtouch.HIS.Web/Web.9_190.config index a26200b2..305dc039 100644 --- a/Newtouch.HIS.CIS/Newtouch.CIS.API/Web.Debug.config +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/Web.9_190.config @@ -1,6 +1,6 @@ - + + + + + -
      +
      -
      -
      +
      +
      - - + + - + - - - - - - - - + + + + + + + + @@ -38,66 +38,65 @@ --> - + - + - + - - - - - - - - - - + + + + + + + + + + - + - + - + - - + + - - + + - - + + - - + + - - + - + \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.HIS.Web/packages.config b/Newtouch.HIS.PDS/Newtouch.HIS.Web/packages.config index 0d1897c2..6e96ece7 100644 --- a/Newtouch.HIS.PDS/Newtouch.HIS.Web/packages.config +++ b/Newtouch.HIS.PDS/Newtouch.HIS.Web/packages.config @@ -11,7 +11,6 @@ - \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/CacheKey.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/CacheKey.cs index 3fab69c0..f08b7d8c 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/CacheKey.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/CacheKey.cs @@ -27,10 +27,5 @@ public class CacheKey /// public static string SysFailedCodeMessageMapListListSetKey = "set:SysFailedCodeMessageMapListList_{0}"; - /// - /// 用户登陆第三方授权token {0} 当前系统AppId {1} 机构代码 {2} 用户 - /// - public static string AccessToken = "${0}${1}:accesstoken_{2}"; - } } diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/EFDBBaseFuncHelper.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/EFDBBaseFuncHelper.cs index cf97f47d..92908ebb 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/EFDBBaseFuncHelper.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/EFDBBaseFuncHelper.cs @@ -1,10 +1,9 @@ -using Newtouch.Core.Common; -using Newtouch.Tools.DB; +using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.Core.Common; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Text.RegularExpressions; -using FrameworkBase.MultiOrg.Infrastructure; namespace Newtouch.Infrastructure { diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Enum/EnumDB.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Enum/EnumDB.cs index 6491a9b6..52e97651 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Enum/EnumDB.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Enum/EnumDB.cs @@ -109,12 +109,11 @@ public enum EnumDanJuLX /// [Description("基药出库")] // 根据出库方式统计单据信息 jiyaochuku = 13, - /// - /// 申请调拨 + /// 批量出库 /// - [Description("申请调拨")] // 单据号DBSQD111111111111 - shenqingdiaobo = 14, + [Description("批量出库")] // 根据出库方式统计单据信息 + piliangchuku = 14, } /// @@ -206,21 +205,21 @@ public enum EnumKCXS public enum EnumSLDDeliveryStatus { /// - /// 未入库 + /// 未发 /// - [Description("未入库")] + [Description("未发")] None = 0, /// - /// 部分入库 + /// 已发部分 /// - [Description("部分入库")] + [Description("已发部分")] Part, /// - /// 已入库 + /// 已全发 /// - [Description("已入库")] + [Description("已全发")] All, /// @@ -419,7 +418,7 @@ public enum EnumOperateType /// None /// None = 0, - + /// /// 发药 /// @@ -544,111 +543,50 @@ public enum EnumCGJLDW } /// - /// 申领单类型 + /// 装箱类型 /// - public enum EnumSldlx + public enum EnumZXLX { - - /// - /// 内部申领单 - /// - [Description("内部申领单")] - neibushenlingdan = 0, - - /// - /// 申请调拨单 - /// - [Description("申请调拨单")] - shenqingdiaobodan = 1, + [Description("多品规货品拼箱配送")] + yxdp = 1, + [Description("整箱为同一品规的货品")] + yxyp = 2, + [Description("同一次配送的同一品规货品分布在多箱内")] + ypdx = 3, } - + /// - /// 远程诊疗状态 + /// 药品类型 /// - public enum Emunzlzt + public enum EnumYPLX { - [Description("待确认")] - dqr = 1, - [Description("就诊中")] - jzz = 2, - [Description("已结束")] - yjs = 3, - [Description("已退回")] - yth = 4, - [Description("已撤销")] - ycx = 5, - [Description("已发药")] - yfy = 6, - } - - /// - /// 自负性质 v2 - /// 重庆再用 - /// - public enum EnumZFXZv2 - { - /// - /// 自费 - /// - [Description("自费")] - ZF = 1, - /// - /// 甲类 - /// - [Description("甲类")] - J = 4, - /// - /// 乙类 - /// - [Description("乙类")] - Y = 5, - /// - /// 丙类 - /// - [Description("丙类")] - B = 6, + [Description("生物制剂")] + swzj = 1, + [Description("中成药")] + zcy = 2, + [Description("中药饮片")] + zyyp = 3, + [Description("自制制剂")] + zzzj = 4, + [Description("免疫用疫苗")] + myyym = 5, + [Description("实验室检验化验用药品或试剂")] + sysjyhyyyphsj = 6, + [Description("医学检查用药品或试剂")] + yxjcyyphsj = 7, + [Description("化学药品")] + hxyp = 8, + [Description("其他")] + qt = 9, } - /// - /// 病区记账取整类型 + /// 包装单位性质 /// - public enum EnumBQJZQZ - { - /// - /// 每天取整 - /// - [Description("每天取整")] - Day = 1, - /// - /// 每次取整 - /// - [Description("每次取整")] - Times - } - - public enum EnumJybz + public enum EnumBZDWXZ { - [Description("国基药")] - Gjy = 1, - [Description("贵安增补基药")] - Gazbjy = 2, - [Description("非基药")] - Fjy = 3, - [Description("非前述几种")] - dbs = 4, + [Description("商品最小零售单位")] + spzxlsdw = 1, + [Description("大包装简包装")] + dbzjbz = 2, } - - - public enum EnumYpsx - { - [Description("麻醉药品")] - Mzyp = 9, - [Description("毒性药品")] - Dxyp = 4, - [Description("精一药品")] - Jyyp = 5, - [Description("精二药品")] - Jeyp = 6, - } - } diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/AppLogger.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/AppLogger.cs new file mode 100644 index 00000000..ce59a249 --- /dev/null +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/AppLogger.cs @@ -0,0 +1,28 @@ +using System; +using System.IO; + +namespace Newtouch.Infrastructure.Log +{ + /// + /// 日志组件 + /// + public class AppLogger + { + public static void Info(string message) + { + try + { + var root = "C:\\HISLog\\log_yibao\\PDS"; + var date = DateTime.Now.ToString("yyyyMMddHHmm"); + var dirPath = string.Format("{0}\\{1}", root, date.Substring(0, 8)); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + var filePath = string.Format("{0}\\{1}.txt", dirPath, date.Substring(8, 2)); + File.AppendAllText(filePath, string.Format("\r\n\r\n{0}.Info.{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), message)); + } + catch { } + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogCore.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogCore.cs new file mode 100644 index 00000000..dea5d928 --- /dev/null +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogCore.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using Newtouch.Core.Common.Utils; +using NLog.Client; +using NLog.Contact.DTO; + +namespace Newtouch.Infrastructure.Log +{ + /// + /// 日志组件 + /// + public class LogCore + { + private static readonly ILog Logger = LogProxy.GetLogger(string.IsNullOrWhiteSpace(ConfigurationHelper.GetAppConfigValue("ServiceName")) ? "Newtouch.PDS" : ConfigurationHelper.GetAppConfigValue("ServiceName")); + + private static string LogAddress = + string.IsNullOrEmpty(ConfigurationManager.AppSettings["settLogAddress"]) + ? "C:\\HISLog\\log_sett_web" + : ConfigurationManager.AppSettings["settLogAddress"]; + + public static void Info(string title, T message, Dictionary addInfo = null) + { + Logger.Info(title, message, tags: addInfo); + } + + internal static void Debug(string title, string message = "", Dictionary addInfo = null) + { + Logger.Debug(title, message, tags: addInfo); + } + + public static void Error(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + if (ex != null && string.IsNullOrWhiteSpace(message)) + { + message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; + } + Logger.Error(title, message, ex, addInfo); + } + + public static void Fatal(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + if (ex != null && string.IsNullOrWhiteSpace(message)) + { + message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; + } + Logger.Fatal(title, message, ex, addInfo); + } + + public static void Warn(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + Logger.Warn(title, message, ex, addInfo); + } + + public static void Moniter(string title, object message, MoniterDTO moniter, Dictionary addInfo = null) + { + Logger.Moniter(title, message, moniter, addInfo); + } + + /// + /// 写本地日志 + /// + /// + public static void WriteInfoWeb(string message) + { + try + { + var date = DateTime.Now.ToString("yyyyMMddHHmm"); + var dirPath = string.Format("{0}\\{1}", LogAddress, date.Substring(0, 8)); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + var filePath = string.Format("{0}\\{1}.txt", dirPath, date.Substring(8, 3)); + File.AppendAllText(filePath, string.Format("\r\n\r\n{0}.Info.{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), message)); + } + catch { } + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogProxy.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogProxy.cs new file mode 100644 index 00000000..9f79fb2e --- /dev/null +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Log/LogProxy.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Newtouch.Common.Operator; +using NLog.Client; +using NLog.Contact.DTO; + +namespace Newtouch.Infrastructure.Log +{ + /// + /// log proxy + /// + public class LogProxy : ILog + { + private static ILogV2 _log; + #region 单例 + + /// + /// 服务名称 + /// + private static string _serviceName = string.Empty; + + private static readonly LogProxy Instance = new LogProxy(); + + private LogProxy() { } + + public static LogProxy GetLogger(string serviceName) + { + try + { + _serviceName = serviceName; + _log = LogManageV2.GetLogger(_serviceName, OperatorProvider.GetCurrent() != null ? OperatorProvider.GetCurrent().OrganizeId : ""); + return Instance; + } + catch (Exception e) + { + Console.WriteLine(e); + _log = LogManageV2.GetLogger(_serviceName, ""); + return Instance; + } + } + + #endregion + + public void Debug(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Debug(title, message, exception, tags); + } + + public void Error(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Error(title, message, exception, tags); + } + + public void Fatal(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Fatal(title, message, exception, tags); + } + + public void Info(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Info(title, message, exception, tags); + } + + public void Warn(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Warn(title, message, exception, tags); + } + + public void Moniter(string title, object message, MoniterDTO moniter, Dictionary tags = null) + { + _log.Moniter(title, message, moniter, tags); + } + + public void ChangeRecord(string title, object message, Exception exception = null, Dictionary tags = null) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Newtouch.Infrastructure.csproj b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Newtouch.Infrastructure.csproj index b7f57943..4bbfc856 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/Newtouch.Infrastructure.csproj +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/Newtouch.Infrastructure.csproj @@ -30,6 +30,9 @@ prompt 4 + + bin\9_190\ + False @@ -37,41 +40,37 @@ False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll - - - False - ..\..\..\..\..\dll\Newtonsoft.Json.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll False - ..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll False - ..\..\his-dll-common\dlls\Newtouch.Core.Common.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Common.dll False - ..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll - ..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll + .\..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll False - ..\..\his-dll-common\hiscommondlls\Newtouch.Infrastructure.EF.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Infrastructure.EF.dll False - ..\..\his-dll-common\dlls\Newtouch.Tools.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll - ..\..\his-dll-common\dlls\NLog.Client.dll + .\..\..\his-dll-common\dlls\NLog.Client.dll False - ..\..\his-dll-common\dlls\NLog.Contact.dll + .\..\..\his-dll-common\dlls\NLog.Contact.dll @@ -86,7 +85,6 @@ - diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlDispensing.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlDispensing.cs index 94f14621..3d8fff00 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlDispensing.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlDispensing.cs @@ -568,13 +568,14 @@ END CATCH /// 门诊发药处方明细查询 /// public const string mz_fy_cfmx = @" -SELECT a.czh, a.Fph, a.cfh,convert(varchar(50),a.cfnm) cfnm, a.ypmc, a.gg, CONVERT(INT,a.zxdwsl/a.zhyz) sl, a.dw, a.dj, a.ycmc, a.je, ISNULL(a.jl,0) jl, a.jldw, a.yfmc, a.yszt, a.ysmc, a.sfsj,'' slStr +SELECT a.czh, a.Fph, a.cfh,convert(varchar(50),a.cfnm) cfnm,a.ypCode, a.ypmc, a.gg, CONVERT(INT,a.zxdwsl/a.zhyz) sl, a.dw, a.dj, a.ycmc, a.je, ISNULL(a.jl,0) jl, a.jldw, a.yfmc, a.yszt, a.ysmc, a.sfsj,a.gjybdm FROM ( - SELECT cf.Fph, cf.cfh,cf.cfnm, cfmx.ypmc, cfmx.gg, SUM(mxph.sl) zxdwsl, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc - ,cfmx.bz yszt, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz + SELECT cf.Fph, cf.cfh,cf.cfnm,cfmx.ypCode, cfmx.ypmc, cfmx.gg, SUM(mxph.sl) zxdwsl, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc + ,cfmx.bz yszt, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz,xtyp.gjybdm FROM dbo.mz_cf(NOLOCK) cf INNER JOIN dbo.mz_cfmx(NOLOCK) cfmx ON cfmx.cfh = cf.cfh AND cfmx.OrganizeId=cf.OrganizeId AND cfmx.zt='1' INNER JOIN dbo.mz_cfmxph(NOLOCK) mxph ON mxph.cfh=cfmx.cfh AND mxph.gjzt='0' AND mxph.yp=cfmx.ypCode AND mxph.OrganizeId=cfmx.OrganizeId AND mxph.fyyf=cf.lyyf AND mxph.zt='1' + INNER JOIN [NewtouchHIS_Base].dbo.xt_ypsx(NOLOCK) xtyp ON xtyp.ypcode = cfmx.ypcode AND cfmx.OrganizeId=xtyp.OrganizeId AND xtyp.zt='1' WHERE cf.OrganizeId=@OrganizeId AND cf.zt='1' AND cf.jsnm>0 @@ -583,17 +584,18 @@ AND cf.jsnm>0 AND ISNULL(cf.cfh,'')=ISNULL(@cfh,'') AND ISNULL(mxph.czh,'')=ISNULL(cfmx.czh,'') AND mxph.cfmxId=cfmx.Id - GROUP BY cf.Fph, cf.cfh,cf.cfnm, cfmx.ypmc, cfmx.gg, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc, cfmx.bz, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz + GROUP BY cf.Fph, cf.cfh,cf.cfnm, cfmx.ypCode, cfmx.ypmc, cfmx.gg, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc, cfmx.bz, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz,xtyp.gjybdm ) a "; public const string mz_fy_cfmx_new = @" -SELECT a.czh, a.Fph, a.cfh,convert(varchar(50),a.cfnm) cfnm, a.ypmc, a.gg, CONVERT(INT,a.zxdwsl/a.zhyz) sl, a.dw, a.dj, a.ycmc, a.je, ISNULL(a.jl,0) jl, a.jldw, a.yfmc, a.yszt, a.ysmc, a.sfsj +SELECT a.czh, a.Fph, a.cfh,convert(varchar(50),a.cfnm) cfnm,a.ypCode, a.ypmc, a.gg, CONVERT(INT,a.zxdwsl/a.zhyz) sl, a.dw, a.dj, a.ycmc, a.je, ISNULL(a.jl,0) jl, a.jldw, a.yfmc, a.yszt, a.ysmc, a.sfsj,a.gjybdm FROM ( - SELECT cf.Fph, cf.cfh,cf.cfnm, cfmx.ypmc, cfmx.gg, SUM(mxph.sl) zxdwsl, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc - ,cfmx.bz yszt, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz + SELECT cf.Fph, cf.cfh,cf.cfnm,cfmx.ypCode, cfmx.ypmc, cfmx.gg, SUM(mxph.sl) zxdwsl, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc + ,cfmx.bz yszt, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz,xtyp.gjybdm FROM dbo.mz_cf(NOLOCK) cf INNER JOIN dbo.mz_cfmx(NOLOCK) cfmx ON cfmx.cfh = cf.cfh AND cfmx.OrganizeId=cf.OrganizeId AND cfmx.zt='1' INNER JOIN dbo.mz_cfmxph(NOLOCK) mxph ON mxph.cfh=cfmx.cfh AND mxph.gjzt='0' AND mxph.yp=cfmx.ypCode AND mxph.OrganizeId=cfmx.OrganizeId AND mxph.fyyf=cf.lyyf AND mxph.zt='1' + INNER JOIN [NewtouchHIS_Base].dbo.xt_ypsx(NOLOCK) xtyp ON xtyp.ypcode = cfmx.ypcode AND cfmx.OrganizeId=xtyp.OrganizeId AND xtyp.zt='1' WHERE cf.OrganizeId=@OrganizeId AND cf.zt='1' AND cf.jsnm>0 @@ -601,7 +603,7 @@ AND cf.jsnm>0 AND cf.cfh in(select col from dbo.f_split(@cfh,',') where col>'') AND ISNULL(mxph.czh,'')=ISNULL(cfmx.czh,'') AND mxph.cfmxId=cfmx.Id - GROUP BY cf.Fph, cf.cfh,cf.cfnm, cfmx.ypmc, cfmx.gg, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc, cfmx.bz, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz + GROUP BY cf.Fph, cf.cfh,cf.cfnm, cfmx.ypCode, cfmx.ypmc, cfmx.gg, cfmx.dw, cfmx.dj, cfmx.ycmc, cfmx.je, cfmx.jl, cfmx.jldw, cfmx.yfmc, cfmx.bz, cf.ysmc, cf.sfsj, cfmx.czh, cfmx.zhyz,xtyp.gjybdm ) a "; @@ -621,7 +623,7 @@ IF EXISTS(SELECT 1 FROM tempdb..sysobjects WHERE id=OBJECT_ID(N'tempdb..#mxph') END SELECT cfmxphId Id, sl, pc, ph, yp, cfmxId INTO #mxph -FROM dbo.mz_cfmxph(NOLOCK) WHERE cfh=@cfh AND OrganizeId=@OrganizeId AND zt='1' AND fyyf=@yfbmCode AND gjzt='0' +FROM dbo.mz_cfmxph(NOLOCK) WHERE cfh=@cfh and yp=@ypdm AND OrganizeId=@OrganizeId AND zt='1' AND fyyf=@yfbmCode AND gjzt='0' SET NOCOUNT ON SET TRANSACTION ISOLATION LEVEL READ COMMITTED @@ -714,7 +716,7 @@ WHILE EXISTS(SELECT 1 FROM #kcData) AND @sysl>0 END END - INSERT INTO dbo.mz_cfypczjl(mzcfmxId, operateType ,ypCode ,cfh ,sl ,bz ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode) + INSERT INTO dbo.mz_cfypczjl(mzcfmxId, operateType ,ypCode ,cfh ,sl ,bz ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode,zsm,sfcl) VALUES ( @cfmxId , -- mzcfmxId - bigint '1' , -- operateType - char(1) @ypCode , -- ypCode - varchar(20) @@ -724,7 +726,9 @@ INSERT INTO dbo.mz_cfypczjl(mzcfmxId, operateType ,ypCode ,cfh ,sl ,bz ,CreateTi GETDATE() , -- CreateTime - datetime @userCode , -- CreatorCode - varchar(50) NULL , -- LastModifyTime - datetime - '' -- LastModifierCode - varchar(50) + '', -- LastModifierCode - varchar(50) + @zsm, + @sfcl ) DELETE FROM #mxph WHERE Id=@Id END @@ -963,5 +967,108 @@ SELECT @resultMsg resultMsg "; #endregion + + #region 门诊取消结算 库存解冻 + public const string mz_yp_cancelSett_kcjd = @" +IF EXISTS(SELECT 1 FROM tempdb..sysobjects WHERE id=OBJECT_ID(N'tempdb..#CancalSettData') AND type='U') +BEGIN + DROP TABLE #CancalSettData; --排药数据 +END + +BEGIN TRY +DECLARE @cfId BIGINT, @ph VARCHAR(50), @pc VARCHAR(50), @kcsl INT, @cfmxphId VARCHAR(50), @curKcId VARCHAR(50), @fybz CHAR(1), @jsnm BIGINT; + +SELECT @cfId=Id, @fybz=fybz, @jsnm=jsnm FROM dbo.mz_cf WHERE cfh=@cfh AND OrganizeId=@OrganizeId AND lyyf=@yfbmCode --AND zt='1' + +IF ISNULL(@cfId, 0)=0 +BEGIN + SELECT '未找到指定处方'; + RETURN ; +END + +SELECT * + INTO #CancalSettData +FROM dbo.mz_cfmxph +WHERE yp=@ypdm AND OrganizeId=@OrganizeId AND fyyf=@yfbmCode AND zt='1' AND gjzt='0' AND cfh=@cfh + +IF NOT EXISTS(SELECT 1 FROM #CancalSettData) +BEGIN + SELECT '未找到排药数或已取消'; + RETURN; +END + +if(exists(select 1 from [mz_cfypczjl] a with(nolock),#CancalSettData b where a.mzcfmxid=b.cfmxid)) +begin + SELECT '处方已发药,不能取消预定'; + RETURN ; +end + +DECLARE @bookCout INT; +DECLARE @sysl INT; + +SELECT @sysl=SUM(sl) FROM #CancalSettData + +DECLARE @errorMsg VARCHAR(500); +SET @errorMsg=''; + +BEGIN TRANSACTION + WHILE EXISTS(SELECT 1 FROM #CancalSettData) AND @sysl>0 + BEGIN + SELECT TOP 1 @cfmxphId=cfmxphId, @ph=ph, @pc=pc, @kcsl=sl FROM #CancalSettData ORDER BY yxq asc + SELECT TOP 1 @curKcId=ISNULL(kcId,'') + FROM dbo.xt_yp_kcxx WITH (XLOCK, ROWLOCK) + WHERE ypdm=@ypdm AND yfbmCode=@yfbmCode AND ph=@ph AND pc=@pc AND OrganizeId=@OrganizeId + IF @curKcId='' + BEGIN + DECLARE @ypmc VARCHAR(256); + SELECT @ypmc=ypmc FROM NewtouchHIS_Base.dbo.V_C_xt_yp WHERE ypCode=@ypdm AND OrganizeId=@OrganizeId AND zt='1' + SET @errorMsg+=CONCAT('处方【',@cfh,'】未找到冻结时所用批号为【',@ph,'】的药品【',@ypmc,'】。'); + BREAK; + END + print @kcsl; + print @sysl; + IF @kcsl>@sysl + BEGIN + SET @kcsl=@sysl; + SET @sysl=0; + END + ELSE + BEGIN + + SET @sysl=@sysl-@kcsl; + UPDATE dbo.mz_cfmxph SET gjzt='1', zt='0', LastModifyTime=GETDATE(), LastModifierCode=@CreatorCode WHERE cfmxphId=@cfmxphId + END + UPDATE dbo.xt_yp_kcxx SET djsl=djsl-@kcsl, LastModifyTime=GETDATE(), LastModifierCode=@CreatorCode WHERE kcId=@curKcId ; + DELETE FROM #CancalSettData WHERE cfmxphId=@cfmxphId + + update dbo.mz_cfmx set zt='0',LastModifyTime=getdate(),LastModiFierCode=@CreatorCode where cfh=@cfh and OrganizeId=@OrganizeId and ypCode=@ypdm and zt='1' + + if(not exists(select 1 from mz_cfmx a with(nolock),mz_cf b with(nolock) + where a.cfh=b.cfh and a.OrganizeId=b.OrganizeId and a.zt='1' and b.zt='1' and b.cfh=@cfh)) + begin + update dbo.mz_cf + set zt='0',LastModifyTime=getdate(),LastModiFierCode=@CreatorCode + where cfh=@cfh and OrganizeId=@OrganizeId and zt='1' + end + END +IF(@errorMsg='') + BEGIN + COMMIT TRANSACTION; + END + ELSE + BEGIN + ROLLBACK TRANSACTION; + END + SELECT @errorMsg; +END TRY +BEGIN CATCH +IF @@TRANCOUNT>0 +BEGIN + ROLLBACK TRANSACTION +END +SELECT ERROR_MESSAGE(); +END CATCH +"; + #endregion } } diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlOutpatient.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlOutpatient.cs index 0f99bb6a..a7755c16 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlOutpatient.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlOutpatient.cs @@ -372,7 +372,7 @@ IF ISNULL(@curKcId, '')<>'' UPDATE dbo.mz_cf SET fybz='3', LastModiFierCode=@userCode, LastModifyTime=GETDATE() WHERE cfh=@cfh AND zt='1' AND OrganizeId=@OrganizeId AND lyyf=@yfbmCode - INSERT INTO dbo.mz_tfmx( returnDrugBillNo, OrganizeId ,ypCode ,cfh ,ph ,pc ,sl ,Remark ,zt ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode) + INSERT INTO dbo.mz_tfmx( returnDrugBillNo, OrganizeId ,ypCode ,cfh ,ph ,pc ,sl ,Remark ,zt ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode,zsm,sfcl) VALUES ( @returnDrugBillNo, -- returnDrugBillNo - varchar(50) @OrganizeId , -- OrganizeId - varchar(50) @ypCode , -- ypCode - varchar(50) @@ -385,11 +385,13 @@ INSERT INTO dbo.mz_tfmx( returnDrugBillNo, OrganizeId ,ypCode ,cfh ,ph ,pc ,sl , GETDATE() , -- CreateTime - datetime @userCode , -- CreatorCode - varchar(50) NULL , -- LastModifyTime - datetime - '' -- LastModifierCode - varchar(50) + '', -- LastModifierCode - varchar(50) + @zsm, + @sfcl ) - INSERT INTO dbo.mz_cfypczjl( mzcfmxId ,operateType ,ypCode ,cfh ,sl ,bz ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode) - SELECT TOP 1 Id,'2', ypCode, cfh, @tysl, '', GETDATE(), @userCode, NULL, NULL + INSERT INTO dbo.mz_cfypczjl( mzcfmxId ,operateType ,ypCode ,cfh ,sl ,bz ,CreateTime ,CreatorCode ,LastModifyTime ,LastModifierCode,zsm,sfcl) + SELECT TOP 1 Id,'2', ypCode, cfh, @tysl, '', GETDATE(), @userCode, NULL, NULL ,@zsm,@sfcl FROM dbo.mz_cfmx(NOLOCK) WHERE cfh=@cfh AND ypCode=@ypCode AND zt='1' AND OrganizeId=@OrganizeId END diff --git a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlStock.cs b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlStock.cs index 4b574c07..c716c3dd 100644 --- a/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlStock.cs +++ b/Newtouch.HIS.PDS/Newtouch.Infrastructure/TSQL/TSqlStock.cs @@ -282,7 +282,7 @@ ROLLBACK TRANSACTION IF NOT EXISTS(SELECT 1 FROM dbo.xt_yp_kcxx WHERE ypdm=@ypdm AND ypdm=@ypdm AND pc=@pc AND ph=@ph AND OrganizeId=@Organizeid AND yfbmCode=@rkbm AND zt='1') BEGIN - SELECT '入库部门不存批次为【'+@pc+'】的药品【'+@ypmc+'】'; + SELECT '入库部门不存在批次为【'+@pc+'】的药品【'+@ypmc+'】'; ROLLBACK TRANSACTION; RETURN ; END diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/App.config b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/App.config index d0cf50f2..c3e54d70 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/App.config +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/App.config @@ -1,33 +1,33 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - + diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Configs/database.config b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Configs/database.config index df8ad5db..b4fc5c12 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Configs/database.config +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Configs/database.config @@ -1,14 +1,6 @@  - - - - - - - - diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Newtouch.Pds.Api.Tests.csproj b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Newtouch.Pds.Api.Tests.csproj index a0bde2b9..c70d451d 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Newtouch.Pds.Api.Tests.csproj +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API.Tests/Newtouch.Pds.Api.Tests.csproj @@ -35,32 +35,35 @@ prompt 4 + + bin\9_190\ + ..\packages\Autofac.4.0.0\lib\net451\Autofac.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.API.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.API.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Application.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Application.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.DmnService.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.DmnService.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Domain.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Domain.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Repository.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Repository.dll @@ -74,27 +77,27 @@ False - ..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll False - ..\..\his-dll-common\dlls\Newtouch.Core.Common.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Common.dll False - ..\..\his-dll-common\dlls\Newtouch.Core.NLogger.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.NLogger.dll False - ..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll False - ..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll + .\..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll False - ..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/Configs/database.config b/Newtouch.HIS.PDS/Newtouch.PDS.API/Configs/database.config index 92bd828f..9127a3b9 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API/Configs/database.config +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/Configs/database.config @@ -1,10 +1,10 @@  - - + + - + \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/Controllers/ResourcesOperateController.cs b/Newtouch.HIS.PDS/Newtouch.PDS.API/Controllers/ResourcesOperateController.cs index cedd28ef..59438242 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API/Controllers/ResourcesOperateController.cs +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/Controllers/ResourcesOperateController.cs @@ -94,42 +94,41 @@ public HttpResponseMessage OutpatientCancelAllBook(OutpatientCancelAllBookReques } /// - /// 门诊确认资源(Commit) + /// HIS门诊退费后 冻结库存返还 /// /// /// [HttpPost] - [Route("OutpatientCommit")] - public HttpResponseMessage OutpatientCommit(OutpatientCommitRequestDTO request) + [Route("OutpatientCancelDjYpReturn")] + public HttpResponseMessage OutpatientCancelDjYpReturn(OutpatientCancelAllBookRequestDTO request) { - Action ac = (req, resp) => + Action ac = (req, resp) => { - resp.data = _resourcesOperateApp.OutpatientCommit(request); + resp.data = _resourcesOperateApp.OutpatientCancelDjYpReturn(request); resp.code = ResponseResultCode.SUCCESS; }; var result = CommonExecute(ac, request); return CreateResponse(result); } + /// /// 门诊确认资源(Commit) /// /// /// [HttpPost] - [Route("OutpatientCommitApi")] - [IgnoreTokenDecrypt] - public HttpResponseMessage OutpatientCommitforAPI(OutpatientCommitRequestDTO request) + [Route("OutpatientCommit")] + public HttpResponseMessage OutpatientCommit(OutpatientCommitRequestDTO request) { Action ac = (req, resp) => { resp.data = _resourcesOperateApp.OutpatientCommit(request); resp.code = ResponseResultCode.SUCCESS; }; - request.Token = null; - request.TokenType = null; var result = CommonExecute(ac, request); return CreateResponse(result); } + /// /// (未发药前)部分退药 /// diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/Newtouch.Pds.Api.csproj b/Newtouch.HIS.PDS/Newtouch.PDS.API/Newtouch.Pds.Api.csproj index d198d419..5cae91a8 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API/Newtouch.Pds.Api.csproj +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/Newtouch.Pds.Api.csproj @@ -1,6 +1,5 @@  - @@ -28,8 +27,6 @@ - LaunchBrowser - http://{ServiceIPAddress} true @@ -57,83 +54,86 @@ ..\packages\Autofac.WebApi2.4.0.1\lib\net45\Autofac.Integration.WebApi.dll - ..\..\his-dll-common\hiscommondlls\EntityFramework.dll + .\..\..\his-dll-common\hiscommondlls\EntityFramework.dll - ..\..\his-dll-common\hiscommondlls\EntityFramework.SqlServer.dll + .\..\..\his-dll-common\hiscommondlls\EntityFramework.SqlServer.dll - - False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.API.dll + + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.API.dll + False - - False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Application.dll + + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Application.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.DmnService.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.DmnService.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Domain.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Domain.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Infrastructure.dll False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Repository.dll + .\..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Repository.dll ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.7\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - ..\..\his-dll-common\dlls\MsgPack.dll + + False + .\..\..\his-dll-common\dlls\MsgPack.dll ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll False - ..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Common.dll - ..\..\his-dll-common\dlls\Newtouch.Core.Common.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Common.dll - ..\..\his-dll-common\dlls\Newtouch.Core.NLogger.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.NLogger.dll - ..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll - ..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll + .\..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll - ..\..\his-dll-common\hiscommondlls\Newtouch.HIS.Web.Core.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.HIS.Web.Core.dll - ..\..\his-dll-common\webapicommondlls\Newtouch.Infrastructure.EF.dll + .\..\..\his-dll-common\webapicommondlls\Newtouch.Infrastructure.EF.dll False - ..\..\his-dll-common\dlls\Newtouch.Tools.dll + .\..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll False - ..\..\his-dll-common\dlls\NLog.Contact.dll + .\..\..\his-dll-common\dlls\NLog.Contact.dll - - ..\..\his-dll-common\dlls\StackExchange.Redis.dll + + False + .\..\..\his-dll-common\dlls\StackExchange.Redis.dll - - ..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.Core.dll + + False + .\..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.Core.dll - - ..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.MsgPack.dll + + False + .\..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.MsgPack.dll @@ -319,27 +319,6 @@ PreserveNewest - - Designer - Always - - - Always - - - Always - - - Designer - Always - - - Always - - - Designer - Always - Always @@ -347,12 +326,9 @@ Designer Always - - - Dockerfile - + @@ -422,6 +398,9 @@ 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + bin\ + @@ -436,7 +415,7 @@ True 55873 / - http://localhost:9004/ + http://localhost:51099/ False False @@ -452,10 +431,7 @@ - - - - + - true - false - true + FileSystem + FileSystem Release Any CPU - FileSystem - D:\发布地址\开源\pdsApi - FileSystem - <_TargetId>Folder + true + true + ..\..\publish\PDSAPI + true + true + true + false + DonotMerge \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/Properties/PublishProfiles/PublishProfile.pubxml b/Newtouch.HIS.PDS/Newtouch.PDS.API/Properties/PublishProfiles/PublishProfile.pubxml new file mode 100644 index 00000000..67e6880d --- /dev/null +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/Properties/PublishProfiles/PublishProfile.pubxml @@ -0,0 +1,18 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + ..\..\publish\PDSAPI + FileSystem + <_TargetId>Folder + + + \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/Web.config b/Newtouch.HIS.PDS/Newtouch.PDS.API/Web.config index 1014c5ef..aead91a1 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API/Web.config +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/Web.config @@ -1,11 +1,11 @@ - + - - + + - - + + - + - - - - + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + \ No newline at end of file diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.API/packages.config b/Newtouch.HIS.PDS/Newtouch.PDS.API/packages.config index f8e8de4a..4588148b 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.API/packages.config +++ b/Newtouch.HIS.PDS/Newtouch.PDS.API/packages.config @@ -32,7 +32,6 @@ - diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.Requset/Newtouch.PDS.Requset.csproj b/Newtouch.HIS.PDS/Newtouch.PDS.Requset/Newtouch.PDS.Requset.csproj index f27f1956..d8d95c30 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.Requset/Newtouch.PDS.Requset.csproj +++ b/Newtouch.HIS.PDS/Newtouch.PDS.Requset/Newtouch.PDS.Requset.csproj @@ -30,13 +30,16 @@ prompt 4 + + bin\9_190\ + - ..\..\his-dll-common\dlls\Newtouch.Core.Common.dll + .\..\..\his-dll-common\dlls\Newtouch.Core.Common.dll - ..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll + .\..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll diff --git a/Newtouch.HIS.PDS/Newtouch.PDS.Requset/ResourcesOperate/OutpatientBookRequestDTO.cs b/Newtouch.HIS.PDS/Newtouch.PDS.Requset/ResourcesOperate/OutpatientBookRequestDTO.cs index 5f16aa31..aa626b64 100644 --- a/Newtouch.HIS.PDS/Newtouch.PDS.Requset/ResourcesOperate/OutpatientBookRequestDTO.cs +++ b/Newtouch.HIS.PDS/Newtouch.PDS.Requset/ResourcesOperate/OutpatientBookRequestDTO.cs @@ -116,6 +116,10 @@ public class ItemDetail /// 姓名 /// public string xm { get; set; } + /// + /// 性别 + /// + public string xb { get; set; } /// /// 年龄 diff --git a/Newtouch.HIS.PDS/README.md b/Newtouch.HIS.PDS/README.md new file mode 100644 index 00000000..bd6542e0 --- /dev/null +++ b/Newtouch.HIS.PDS/README.md @@ -0,0 +1 @@ +## 药房药库管理模块 \ No newline at end of file diff --git a/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/FolderProfile.pubxml b/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/FolderProfile.pubxml index 8ad10701..e8d17d15 100644 --- a/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/FolderProfile.pubxml +++ b/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,13 +4,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - false + true false true Release Any CPU FileSystem - D:\发布地址\开源\HIS.BaseAPI + ..\..\publish\his.baseapi FileSystem <_TargetId>Folder diff --git a/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/PublishProfile.pubxml b/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/PublishProfile.pubxml new file mode 100644 index 00000000..61145803 --- /dev/null +++ b/Newtouch.HIS.SSO/HIS.BaseAPI/Properties/PublishProfiles/PublishProfile.pubxml @@ -0,0 +1,18 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + ..\..\publish\his.baseapi + FileSystem + <_TargetId>Folder + + + \ No newline at end of file diff --git a/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/FolderProfile.pubxml b/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/FolderProfile.pubxml index 70c179ef..d7560b93 100644 --- a/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/FolderProfile.pubxml +++ b/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,13 +4,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - false + true false true Release Any CPU FileSystem - D:\发布地址\开源\Union + ..\..\publish\Union FileSystem <_TargetId>Folder diff --git a/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/PublishProfile.pubxml b/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/PublishProfile.pubxml new file mode 100644 index 00000000..a6f5aee4 --- /dev/null +++ b/Newtouch.HIS.SSO/HIS.SSO/Properties/PublishProfiles/PublishProfile.pubxml @@ -0,0 +1,18 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + ..\..\publish\Union + FileSystem + <_TargetId>Folder + + + \ No newline at end of file diff --git a/Newtouch.HIS.SSO/HIS.SSO/Views/Login/Index.cshtml b/Newtouch.HIS.SSO/HIS.SSO/Views/Login/Index.cshtml index 670c3920..25fa536a 100644 --- a/Newtouch.HIS.SSO/HIS.SSO/Views/Login/Index.cshtml +++ b/Newtouch.HIS.SSO/HIS.SSO/Views/Login/Index.cshtml @@ -136,6 +136,7 @@ if (appId) { loginErrorKey = appId + "_" + loginErrorKey; } + document.cookie = appId + '_newtouch_loginuserkey_2016=; expires=Thu,01 Jan 2022 00:00:00 GMT;path=/' var login_error = top.$.cookie(loginErrorKey); if (login_error != null) { switch (login_error) { diff --git a/Newtouch.HIS.SSO/HIS.SSO/appsettings.json b/Newtouch.HIS.SSO/HIS.SSO/appsettings.json index 88d2641a..09e1a52b 100644 --- a/Newtouch.HIS.SSO/HIS.SSO/appsettings.json +++ b/Newtouch.HIS.SSO/HIS.SSO/appsettings.json @@ -7,7 +7,7 @@ }, "AllowedHosts": "*", "RedisConfig": { - "Connection": "61.172.179.6:32079,password=newtouch,syncTimeout=15000", + "Connection": "192.168.9.190:6379,password=newtouch,syncTimeout=15000", "Db": 0 }, "MessageCenter": { @@ -15,7 +15,7 @@ "GroupHub": "/grouphubs/msgcenter" }, "BusinessDB": { - "DefaultConn": "Data Source=61.172.179.6,30557;Initial Catalog={0};User ID=sa;Password=1qazxsw2#;", + "DefaultConn": "Data Source=192.168.9.183,1433;Initial Catalog={0};User ID=sa;Password=a1+b2*c3=d4;", "MainDB": "UnionDb", "MainDBFirstMode": true, //数据库初始化模式,true 默认当前上下文为MainDB,false 默认上下文为 EntityAttr标注 "EnabledMutiDB": true, //开启多库管理 @@ -74,8 +74,8 @@ //自定义扩展配置 AppSettings 默认查找目录 "AppConfigExt": { //菜单是否显示Description - "IS_ShowDescToMenuTitle": false, - + "IS_ShowDescToMenuTitle": false + }, "AccessConfig": { //"页面domain(嵌套其他域页面,并执行js" "要设置成同一域)" @@ -94,7 +94,7 @@ "AppId": "His.SSO", "AppName": "统一平台", "AppAPIHost": { - "SiteStaticHost": "http://61.172.179.73:41173/", + "SiteStaticHost": "http://61.172.179.73:41142/", "SiteBaseAPIHost": "http://192.168.122.159:7001/", "SiteBaseWebHost": "http://61.172.179.73:41133/", "SiteSettAPIHost": "http://192.168.122.159:7002/", @@ -105,18 +105,18 @@ "SiteYfykWebHost": "http://61.172.179.73:41136/", "SiteEmrWebHost": "http://61.172.179.73:41137/", "SiteMrmsWebHost": "http://61.172.179.73:41139/", - "SiteOrWebHost": "http://61.172.179.73:41138/", + "SiteOrWebHost": "http://61.172.179.73:8006/", "SiteHerpWebHost": "http://61.172.179.73:41141/", - "HisAppBaseAPIHost": "http://61.172.179.73:41144/", + "HisAppBaseAPIHost": "http://192.168.9.190:8017/", //任务调度系统 - "ScheduleJobHost": null, + "ScheduleJobHost": "http://61.172.179.73:8010/", //消息中心 - "SiteNoticeCenterHost": null, + "SiteNoticeCenterHost": "http://61.172.179.73:8011/", //接口中心 - "SiteApiManageHost": "http://61.172.179.73:41143/", + "SiteApiManageHost": "http://61.172.179.73:8016/", //鉴权中心 - "SiteAuthCenterHost": "http://61.172.179.73:41142/", - //外部站点 + "SiteAuthCenterHost": "http://61.172.179.73:8015/", + //外部站点 -- 废弃字段 "OuterMediaMeettingAPIHost": "https://61.172.179.30:17015/", //云诊所 "OuterClinicSystemAPIHost": "http://61.172.179.48:19020/" diff --git a/Newtouch.HIS.SSO/README.md b/Newtouch.HIS.SSO/README.md new file mode 100644 index 00000000..4b554f3e --- /dev/null +++ b/Newtouch.HIS.SSO/README.md @@ -0,0 +1,4 @@ +## 联合工作站以及基础API + +* [HIS.SSO](HIS.SSO) 联合工作站 +* [HIS.BaseAPI](HIS.BaseAPI) 基础API \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/HospitalizationManage/DischargeSettleApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/HospitalizationManage/DischargeSettleApp.cs index 5a125a02..c2d2c946 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/HospitalizationManage/DischargeSettleApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/HospitalizationManage/DischargeSettleApp.cs @@ -19,6 +19,7 @@ using Newtouch.Infrastructure; using Newtouch.Tools; using System; +using System.Collections.Generic; using System.Linq; namespace Newtouch.HIS.Application.Implementation.HospitalizationManage @@ -36,7 +37,7 @@ public class DischargeSettleApp : AppBase, IDischargeSettleApp private readonly IHospSettlementGAYBFeeRepo _hospSettlementGAYBFeeRepo; private readonly IHospSettlementGAXNHFeeRepo _hospSettlementGAXNHFeeRepo; private readonly IHospPatientBasicInfoRepo _hospPatientBasicInfoRepo; - private readonly ICqybSett05Repo _cqybSett05Repo; + private readonly ICqybSett05Repo _cqybSett05Repo; private readonly IBookkeepInHosDmnService _BookkeepInHosDmnService; private readonly IHospItemBillingRepo _hospItemBillingRepo; #region 出院结算 @@ -49,7 +50,7 @@ public class DischargeSettleApp : AppBase, IDischargeSettleApp /// /// /// - public InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) + public InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType,string jslx,string ver) { // 获取病人信息 var settpatInfo = GetInpatientSettlePatInfo(ref zyh, sfz, kh, cardType, jslx); @@ -63,7 +64,7 @@ public InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh { InpatientSettPatInfo = settpatInfo, //InpatientSettleItemBO = settleItemsBo - GroupFeeVOList = _dischargeSettleDmnService.GetHospGroupFeeVOList(zyh, this.OrganizeId, ver), + GroupFeeVOList = _dischargeSettleDmnService.GetHospGroupFeeVOList(zyh, this.OrganizeId,ver), }; return resultDto; } @@ -74,20 +75,20 @@ public InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh /// /// /// - public InpatientSettPatInfoVO GetInpatientSettlePatInfo(ref string zyh, string sfz = null, string kh = null, string cardType = null, string jslx = null, string orgId = null) + public InpatientSettPatInfoVO GetInpatientSettlePatInfo(ref string zyh, string sfz = null, string kh = null, string cardType = null,string jslx=null) { if (string.IsNullOrWhiteSpace(zyh)) { if (!string.IsNullOrWhiteSpace(kh) && !string.IsNullOrWhiteSpace(cardType)) { //根据卡号和卡类型 换取住院号 - zyh = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.kh == kh && p.CardType == cardType && p.zybz != ((int)EnumZYBZ.Wry).ToString()).OrderByDescending(p => p.CreateTime).Select(p => p.zyh).FirstOrDefault(); + zyh = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.kh == kh && p.CardType == cardType &&p.zt=="1" && p.OrganizeId==this.OrganizeId && p.zybz!=((int)EnumZYBZ.Wry).ToString()).OrderByDescending(p => p.CreateTime).Select(p => p.zyh).FirstOrDefault(); } else if (!string.IsNullOrWhiteSpace(sfz) && !string.IsNullOrWhiteSpace(cardType)) { //根据身份证和卡类型 换取住院号 var zjlx = ((int)EnumZJLX.sfz).ToString(); - zyh = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.zjlx == zjlx && p.zjh == sfz && p.CardType == cardType).OrderByDescending(p => p.CreateTime).Select(p => p.zyh).FirstOrDefault(); + zyh = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.zjlx == zjlx && p.zjh == sfz && p.CardType == cardType && p.zt=="1" && p.OrganizeId==this.OrganizeId && p.zybz!= ((int)EnumZYBZ.Wry).ToString()).OrderByDescending(p => p.CreateTime).Select(p => p.zyh).FirstOrDefault(); } } @@ -96,7 +97,7 @@ public InpatientSettPatInfoVO GetInpatientSettlePatInfo(ref string zyh, string s throw new FailedCodeException("HOSP_PATIENT_BASICINFO_IS_NOT_EXIST"); } - var settPatinfoList = _dischargeSettleDmnService.SelectInpatientSettPatInfo(zyh, this.OrganizeId ?? orgId); + var settPatinfoList = _dischargeSettleDmnService.SelectInpatientSettPatInfo(zyh, this.OrganizeId); if (settPatinfoList == null || settPatinfoList.Count == 0) { throw new FailedCodeException("HOSP_PATIENT_BASICINFO_IS_NOT_EXIST"); @@ -133,18 +134,18 @@ public InpatientSettPatInfoVO GetInpatientSettlePatInfo(ref string zyh, string s throw new FailedCodeException("HOSP_ERROR_PATIENT_DEPT_IS_NO_FOUND"); } //settpatinfo.zyts = Common.DateTimeHelper.GetInHospDays(settpatinfo.ryrq.Value, settpatinfo.cyrq.Value); - //zybz 是否可结算 病区中的患者 - var isSettContainsBQZ = _sysConfigRepo.GetBoolValueByCode("HOSP_Sett_Contains_BQZ", this.OrganizeId ?? orgId, false).Value; - var brzybzType = ((int)EnumZYBZ.Djz).ToString(); - if (isSettContainsBQZ) - { - brzybzType += "," + ((int)EnumZYBZ.Bqz).ToString(); - } - if (!brzybzType.Contains(settpatinfo.zybz) && (string.IsNullOrEmpty(jslx) || (!string.IsNullOrEmpty(jslx) && jslx != "mnjs"))) - { - throw new FailedException(((EnumZYBZ)(Convert.ToInt32(settpatinfo.zybz))).GetDescription() + "状态不能结算"); - } - + //zybz 是否可结算 病区中的患者 + var isSettContainsBQZ = _sysConfigRepo.GetBoolValueByCode("HOSP_Sett_Contains_BQZ", this.OrganizeId, false).Value; + var brzybzType = ((int)EnumZYBZ.Djz).ToString(); + if (isSettContainsBQZ) + { + brzybzType += "," + ((int)EnumZYBZ.Bqz).ToString(); + } + if (!brzybzType.Contains(settpatinfo.zybz) && (string.IsNullOrEmpty(jslx) || (!string.IsNullOrEmpty(jslx) && jslx != "mnjs"))) + { + throw new FailedException(((EnumZYBZ)(Convert.ToInt32(settpatinfo.zybz))).GetDescription() + "状态不能结算"); + } + return settpatinfo; } @@ -161,7 +162,7 @@ private InpatientSettleItemBO GetInpatientSettleItemsDetailList(string zyh, Date return null; } //zy_xmjfb - var treatmentItemsList = _dischargeSettleDmnService.SelectTreatmentItemList(zyh, this.OrganizeId, kssj, jssj); + var treatmentItemsList = _dischargeSettleDmnService.SelectTreatmentItemList(zyh, this.OrganizeId, kssj,jssj); //zy_ypjfb var drugList = _dischargeSettleDmnService.SelectDrugList(zyh, this.OrganizeId, kssj, jssj); //非治疗收费项目 @@ -175,30 +176,8 @@ private InpatientSettleItemBO GetInpatientSettleItemsDetailList(string zyh, Date }; return resultBo; } - - private InpatientSettleItemBO GetInpatientSettleItemsDetailList(string zyh, DateTime? kssj, DateTime? jssj, string orgId) - { - if (string.IsNullOrEmpty(zyh)) - { - return null; - } - //zy_xmjfb - var treatmentItemsList = _dischargeSettleDmnService.SelectTreatmentItemList(zyh, orgId, kssj, jssj); - //zy_ypjfb - var drugList = _dischargeSettleDmnService.SelectDrugList(zyh, orgId, kssj, jssj); - //非治疗收费项目 - //var non_treatmentItemsList = _dischargeSettleDmnService.SelectNonTreatmentItemList(zyh, this.OrganizeId); - - var resultBo = new InpatientSettleItemBO() - { - TreatmentItemList = treatmentItemsList, - DrugList = drugList - //Non_treatmentItemList = non_treatmentItemsList - }; - return resultBo; - } #region 医保数据传输 - public InpatientSettPatStatusDetailDto GetZyUploadDetail(string zyh, string jslx) + public InpatientSettPatStatusDetailDto GetZyUploadDetail(string zyh,string jslx) { //获取病人信息 var settpatInfo = GetInpatientSettlePatInfo(ref zyh, null, null, null, jslx); @@ -232,7 +211,7 @@ public InpatIentFeeSumVo GetInpatientSettleJe(string zyh, string sczt, DateTime? var FeeVo = _dischargeSettleDmnService.GetInpatSettFeeSum(zyh, this.OrganizeId, sczt, xmmc, kssj, jssj); var resultVo = new InpatIentFeeSumVo { - zje = FeeVo + zje =FeeVo }; return resultVo; } @@ -267,28 +246,7 @@ public void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSet var settleItemsBo = GetInpatientSettleItemsDetailList(zyh, dbDt, null); //保存到数据库 - _dischargeSettleDmnService.SaveSett(settpatInfo, settleItemsBo, expectedcyrq, this.OrganizeId, fph, feeRelated, ybfeeRelated, xnhfeeRelated, outTradeNo, jslx, out jsnm); - - } - public void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRelatedDTO feeRelated - , CQZyjs05Dto ybfeeRelated, S14OutResponseDTO xnhfeeRelated - , string outTradeNo, string jslx, string orgId, out int jsnm) - { - if (string.IsNullOrEmpty(zyh)) - { - throw new FailedCodeException("HOSP_ZYH_IS_EMPTY"); - } - - // 获取病人信息 - var settpatInfo = GetInpatientSettlePatInfo(ref zyh, null, null, null, null, orgId); - //获取最后一次结算 排除中途结算 - var dbDt = _BookkeepInHosDmnService.GetLastValidSettTime(zyh, orgId); - - // 获取计费明细(包括:项目和药品) - var settleItemsBo = GetInpatientSettleItemsDetailList(zyh, dbDt, null, orgId); - - //保存到数据库 - _dischargeSettleDmnService.SaveSett(settpatInfo, settleItemsBo, expectedcyrq, orgId, fph, feeRelated, ybfeeRelated, xnhfeeRelated, outTradeNo, jslx, out jsnm); + _dischargeSettleDmnService.SaveSett(settpatInfo, settleItemsBo, expectedcyrq, this.OrganizeId, fph, feeRelated, ybfeeRelated, xnhfeeRelated, outTradeNo, jslx,out jsnm); } #endregion @@ -310,18 +268,18 @@ public InpatientCancelSettPatStatusDetailDto GetCancelSettleStatusDetail(string var medicalInsurance = _sysConfigRepo.GetValueByCode("Inpatient_MedicalInsurance", this.OrganizeId); HospSettlementGAYBFeeEntity ybFee = null; HospSettlementGAXNHFeeEntity xnhFee = null; - CqybSett05Entity cqYbFee = null; - if (settpatInfo.brxz == "1" && settpatInfo.CardType == ((int)EnumCardType.YBJYK).ToString())//医保患者 - { + CqybSett05Entity cqYbFee = null; + if (settpatInfo.brxz=="1" && settpatInfo.CardType== ((int)EnumCardType.YBJYK).ToString())//医保患者 + { if (medicalInsurance == "guian") { ybFee = lastSett != null ? _hospSettlementGAYBFeeRepo.IQueryable().Where(p => p.jsnm == lastSett.jsnm).FirstOrDefault() : null; } - //if (medicalInsurance == "chongqing") - //{ - // cqYbFee = lastSett != null ? _cqybSett05Repo.IQueryable().Where(p => p.jsnm == lastSett.jsnm && p.zt=="1").FirstOrDefault() : null; - //} - } + //if (medicalInsurance == "chongqing") + //{ + // cqYbFee = lastSett != null ? _cqybSett05Repo.IQueryable().Where(p => p.jsnm == lastSett.jsnm && p.zt=="1").FirstOrDefault() : null; + //} + } if (settpatInfo.brxz == "8" && settpatInfo.CardType == ((int)EnumCardType.XNHJYK).ToString())//新农合患者 { if (medicalInsurance == "guian") @@ -334,9 +292,9 @@ public InpatientCancelSettPatStatusDetailDto GetCancelSettleStatusDetail(string InpatientSettPatInfo = settpatInfo, LastUnCancelledSett = lastSett, YbFee = ybFee, - XnhFee = xnhFee - //CqYbFee= cqYbFee - }; + XnhFee= xnhFee + //CqYbFee= cqYbFee + }; return resultDto; } @@ -448,7 +406,7 @@ public void DoCancel(string zyh, int expectedjsnm, string cancelReason, string c public void SavePartialSettle(string zyh, DateTime startTime, DateTime endTime, string fph, InpatientSettFeeRelatedDTO feeRelated , CQZyjs05Dto ybfeeRelated, string outTradeNo, string jslx, out int jsnm) { - jsnm = 0; + jsnm = 0; // 获取病人信息 var settpatInfo = GetPartialInpatientSettlePatInfo(ref zyh); @@ -465,21 +423,21 @@ public void SavePartialSettle(string zyh, DateTime startTime, DateTime endTime, throw new FailedException("过程中结算状态发生变更,请重试!"); } - _dischargeSettleDmnService.commitPartialSettle(zyh, this.OrganizeId, startTime, endTime, feeRelated, ybfeeRelated, jslx, ypxmlist, out jsnm); + _dischargeSettleDmnService.commitPartialSettle(zyh, this.OrganizeId, startTime, endTime, feeRelated, ybfeeRelated,jslx, ypxmlist, out jsnm); } - public InpatientSettPatStatusDetailDto GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) + public InpatientSettPatStatusDetailDto GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx,string ver) { // 获取病人信息 var settpatInfo = GetPartialInpatientSettlePatInfo(ref zyh, sfz, kh, cardType, jslx); // 获取计费明细(包括:项目和药品) //var settleItemsBo = GetInpatientSettleItemsDetailList(zyh); - settpatInfo.zyts = DateTimeHelper.GetInHospDays(settpatInfo.ryrq.Value, DateTime.Now); + settpatInfo.zyts = DateTimeHelper.GetInHospDays(settpatInfo.ryrq.Value, DateTime.Now); var resultDto = new InpatientSettPatStatusDetailDto() { InpatientSettPatInfo = settpatInfo, //InpatientSettleItemBO = settleItemsBo - GroupFeeVOList = _dischargeSettleDmnService.GetHospGroupFeeVOList(zyh, this.OrganizeId, ver), + GroupFeeVOList = _dischargeSettleDmnService.GetHospGroupFeeVOList(zyh, this.OrganizeId,ver), }; return resultDto; } @@ -547,8 +505,7 @@ public InpatientSettPatInfoVO GetPartialInpatientSettlePatInfo(ref string zyh, s /// 转出院结算 预处理 /// /// - public string PreCYsettle(string zyh) - { + public string PreCYsettle(string zyh) { //1.未停止的医嘱判断 _hospAccountingPlanDetailRepo.CheckAccountingPlanDetailStatus(zyh, this.OrganizeId); //2.在院状态判断 @@ -561,7 +518,7 @@ public string PreCYsettle(string zyh) startTime = new DateTime(1970, 01, 01); //未结算过的话 从入院开始算所有项目 } var jsItemList = _hospItemBillingRepo.GetItemFeeEntityListByTime(zyh, this.OrganizeId, startTime.Value, DateTime.Now); - if (jsItemList.Count() > 0) + if (jsItemList.Count()>0) { throw new FailedException("存在未结费用,不能出院"); } diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatChargeApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatChargeApp.cs index 9330b1f4..c68ce1a0 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatChargeApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatChargeApp.cs @@ -48,21 +48,23 @@ public class OutPatChargeApp : AppBase, IOutPatChargeApp private readonly ISysPatientBasicInfoRepo _sysPatiInfoRepo; //病人基本信息 private readonly IBookkeepInHosDmnService _hosTempRepo; //收费模版 private readonly IOutPatChargeDmnService _outChargeDmnService; - private readonly IPatientBasicInfoDmnService _patientBasicInfoDmnService; + private readonly IPatientBasicInfoDmnService _patientBasicInfoDmnService; private readonly IOutPatientSettleDmnService _outPatientSettleDmnService; + private readonly ISysCardRepo _sysCardRepo; + #region 门诊收费2018 private readonly IOutPatientUniversalDmnService _outPatientUniversalDmnService; private readonly IOutpatientPrescriptionRepo _outpatientPrescriptionRepo; #endregion - private readonly ICqybUploadInPres04Repo _cqybUploadInPres04Repo; - /// - /// 根据卡号或病历号获取病人信息 - /// - /// 卡号 - /// 病人性质 - /// - public OutPatChargeInfoVO GetOutPatChargeInfo(string kh, string brxz) + private readonly ICqybUploadInPres04Repo _cqybUploadInPres04Repo; + /// + /// 根据卡号或病历号获取病人信息 + /// + /// 卡号 + /// 病人性质 + /// + public OutPatChargeInfoVO GetOutPatChargeInfo(string kh, string brxz) { OutPatChargeInfoVO outchargeInfoVo; if (string.IsNullOrEmpty(kh)) @@ -954,14 +956,14 @@ public List GetOutPatBasicInfoInAcc(string IsBlh, string mzh) /// 证件号 /// 卡类型 /// - public OutpatAccInfoDto GetOutPatBasicInfoInRegister(string blh, string kh, string zjh, string cardType, string ly, string CardId) + public OutpatAccInfoDto GetOutPatBasicInfoInRegister(string blh, string kh, string zjh, string cardType,string ly,string CardId) { if (string.IsNullOrWhiteSpace(blh) && string.IsNullOrWhiteSpace(zjh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType))) { throw new FailedException("缺少查询参数:病历号或卡号"); } //获取挂号收费病人基本信息 - var outPatBasicInfoInAcc = _outChargeDmnService.GetChargePatInfoInRegister(kh, blh, zjh, OrganizeId, cardType, ly, CardId); + var outPatBasicInfoInAcc = _outChargeDmnService.GetChargePatInfoInRegister(kh, blh, zjh, OrganizeId, cardType,ly,CardId); if (outPatBasicInfoInAcc == null) { throw new FailedCodeException("OUTPAT_PATIENT_BASICINFO_IS_NOT_EXIST"); @@ -1093,14 +1095,14 @@ public bool submitOutpatCharge(BasicInfoDto2018 bacDto // if (extxmnmList != null && extxmnmList.Count > 0) { - + xmnmList = xmnmList.Union(extxmnmList).ToList(); } // if (cfnmList != null && cfnmList.Count() > 0) { cfnmList = cfnmList.ToList().Union(cfnmadd.ToList()).ToList(); - + } else { @@ -1123,11 +1125,6 @@ public bool submitOutpatCharge(BasicInfoDto2018 bacDto return true; } - public int submitOutpatGhCharge(string orgId,string fph, DateTime? sfrq, OutpatientSettFeeRelatedDTO feeRelated, IList ghxmnmList) - { - return _outPatientSettleDmnService.submitOutpatGhCharge(orgId, fph, sfrq, feeRelated, ghxmnmList); - } - /// /// 补计费提交 /// @@ -1554,17 +1551,17 @@ public guianMainAllOfMzjs GetGuiAnDetailsMzjsYbTfh(string jsnm, Dictionary tjsxmDict, out decimal ybzje, out decimal zfzje, out decimal tfzje) - { - var ybdata = _outChargeDmnService.GetCQYBTfListByJsnm(jsnm, mzh, this.OrganizeId); - var zfdata = _outChargeDmnService.GetCQZFTfListByJsnm(jsnm, mzh, this.OrganizeId); - List yblist = new List(); + } + } + + public UploadPrescriptionsInPut GetCQDetailsMzjsYbTfh(string mzh, string jsnm, + Dictionary tjsxmDict, out decimal ybzje, out decimal zfzje, out decimal tfzje) + { + var ybdata = _outChargeDmnService.GetCQYBTfListByJsnm(jsnm, mzh, this.OrganizeId); + var zfdata = _outChargeDmnService.GetCQZFTfListByJsnm(jsnm, mzh, this.OrganizeId); + List yblist = new List(); ybzje = Convert.ToDecimal(0.0000); - tfzje = Convert.ToDecimal(0.0000); - zfzje = Convert.ToDecimal(0.0000); - foreach (var item in ybdata) - { - - foreach (var itemtf in tjsxmDict) - { - if (itemtf.Key == item.cxmxlsh) - { - item.sl = Convert.ToDecimal(item.sl) - itemtf.Value;// - tfzje += (itemtf.Value * item.dj); - } - } - item.cxmxlsh = "";//存放jsmxnm,该字段可能恒为null,为了分页获取数据(明细上传个数限制) - item.jbr = this.UserIdentity.UserCode; + tfzje = Convert.ToDecimal(0.0000); + zfzje = Convert.ToDecimal(0.0000); + foreach (var item in ybdata) + { + + foreach (var itemtf in tjsxmDict) + { + if (itemtf.Key == item.cxmxlsh) + { + item.sl = Convert.ToDecimal(item.sl) - itemtf.Value;// + tfzje += (itemtf.Value * item.dj); + } + } + item.cxmxlsh = "";//存放jsmxnm,该字段可能恒为null,为了分页获取数据(明细上传个数限制) + item.jbr = this.UserIdentity.UserCode; if (!string.IsNullOrEmpty(item.sl.ToString()) && !string.IsNullOrEmpty(item.je.ToString()) && Convert.ToDecimal(item.sl) > 0 && Convert.ToDecimal(item.je) > 0) - { - item.je = Convert.ToDecimal(item.sl * item.dj); + { + item.je = Convert.ToDecimal(item.sl * item.dj); ybzje += Convert.ToDecimal(item.je); - yblist.Add(item); - } - } - - foreach (var item in zfdata) - { - foreach (var itemtf in tjsxmDict) - { - if (itemtf.Key == item.cxmxlsh) - { - item.sl = Convert.ToDecimal(item.sl) - itemtf.Value;// - tfzje += (itemtf.Value * item.dj); - } - } - if (!string.IsNullOrEmpty(item.sl.ToString()) && !string.IsNullOrEmpty(item.je.ToString()) && Convert.ToDecimal(item.sl) > 0 && Convert.ToDecimal(item.je) > 0) - { - item.je = Convert.ToDecimal(item.sl * item.dj); - zfzje += Convert.ToDecimal(item.je); - } - } - - - UploadPrescriptionsInPut ChongQingMainAllOfMzjsModel = new UploadPrescriptionsInPut() - { - zymzh = mzh, - cflist = yblist - }; - - return ChongQingMainAllOfMzjsModel; - } - - public void SaveCqybUploadInPres(List cflist, string zymzh, string jytype) - { - List entitylist = new List(); - if (cflist != null && cflist.Count > 0) - { - foreach (var item in cflist) - { - //if (entitylist.FindAll(p=>p.cfh==item.cfh && p.OrganizeId==this.OrganizeId).Count<1) - //{ - - CqybUploadInPres04Entity entity = new CqybUploadInPres04Entity(); - entity.OrganizeId = this.OrganizeId; - entity.zt = "1"; - entity.cfh = item.cfh; - entity.jytype = jytype; - entity.zymzh = zymzh; - entity.je = item.je; - entity.ysbm = item.ysbm; - entity.gjmldm = item.gjmldm; - entity.gjysbm = item.gjysbm; - entity.Create(); - entitylist.Add(entity); - //} - } - _cqybUploadInPres04Repo.SaveCqybUploadInPres(entitylist); - } + yblist.Add(item); + } + } + + foreach (var item in zfdata) + { + foreach (var itemtf in tjsxmDict) + { + if (itemtf.Key == item.cxmxlsh) + { + item.sl = Convert.ToDecimal(item.sl) - itemtf.Value;// + tfzje += (itemtf.Value * item.dj); + } + } + if (!string.IsNullOrEmpty(item.sl.ToString()) && !string.IsNullOrEmpty(item.je.ToString()) && Convert.ToDecimal(item.sl) > 0 && Convert.ToDecimal(item.je) > 0) + { + item.je = Convert.ToDecimal(item.sl * item.dj); + zfzje += Convert.ToDecimal(item.je); + } + } + + + UploadPrescriptionsInPut ChongQingMainAllOfMzjsModel = new UploadPrescriptionsInPut() + { + zymzh = mzh, + cflist = yblist + }; + + return ChongQingMainAllOfMzjsModel; + } + + public void SaveCqybUploadInPres(List cflist, string zymzh, string jytype) + { + List entitylist = new List(); + if (cflist != null && cflist.Count>0) + { + foreach (var item in cflist) + { + //if (entitylist.FindAll(p=>p.cfh==item.cfh && p.OrganizeId==this.OrganizeId).Count<1) + //{ + + CqybUploadInPres04Entity entity = new CqybUploadInPres04Entity(); + entity.OrganizeId = this.OrganizeId; + entity.zt = "1"; + entity.cfh = item.cfh; + entity.jytype = jytype; + entity.zymzh = zymzh; + entity.je = item.je; + entity.ysbm = item.ysbm; + entity.gjmldm = item.gjmldm; + entity.gjysbm = item.gjysbm; + entity.Create(); + entitylist.Add(entity); + //} + } + _cqybUploadInPres04Repo.SaveCqybUploadInPres(entitylist); + } } public void SaveCqybUploadInPres(string zymzh, string jytype, string cfh, string pch) { List entitylist = new List(); var cfhs = cfh.Split(','); - for (int i = 0; i < cfhs.Length; i++) + for (int i=0;i p.zymzh == zymzh && p.cfh == cfh && p.zt == "1" && p.OrganizeId == orgId); - if (entity != null) + if (entity!=null) { entity.zt = "0"; entity.Modify(); _cqybUploadInPres04Repo.Update(entity); } } - public void UpDateUploadPch(string zymzh, string cfh, string pch, string orgId) - { + public void UpDateUploadPch(string zymzh, string cfh, string pch, string orgId) { var entity = _cqybUploadInPres04Repo.FindEntity(p => p.zymzh == zymzh && p.cfh == cfh && p.pch == pch && p.zt == "1" && p.OrganizeId == orgId); if (entity != null) { @@ -1705,122 +1701,103 @@ public void UpDateUploadPch(string zymzh, string cfh, string pch, string orgId) /// /// 1门诊 2住院 /// - public List GetCqyb10Data(string zymzh, string type) - { - return _outPatientDmnService.GetCqyb10Data(zymzh, this.OrganizeId, type); - } + public List GetCqyb10Data(string zymzh,string type) + { + return _outPatientDmnService.GetCqyb10Data(zymzh, this.OrganizeId, type); + } - public List GetCqybMxCxData(string zymzh, string type, string ybver) - { - return _outPatientDmnService.GetCqybMxCxData(zymzh, this.OrganizeId, type, ybver); + public List GetCqybMxCxData(string zymzh, string type, string ybver) { + return _outPatientDmnService.GetCqybMxCxData(zymzh, this.OrganizeId, type,ybver); } public object ZFToYB_Step_1(string mzh) - { - if (string.IsNullOrWhiteSpace(mzh)) - { - throw new FailedException("缺少参数.门诊号"); - } - var orgId = this.OrganizeId; - var ghxx = _outPatRegRepo.IQueryable().Where(p => p.mzh == mzh && p.OrganizeId == orgId).FirstOrDefault(); - if (ghxx == null) - { - throw new FailedException("住院信息未找到"); - } - if (ghxx.zt == "0") - { - throw new FailedException("本次挂号已作废"); - } - if (!(ghxx.brxz == "0")) - { - throw new FailedException("当前非自费"); - } - - return new object(); - } - public object ZFToYB_Step_2(string zyh) - { - var orgId = this.OrganizeId; - //var hasNonYbFee = _hospFeeDmnService.CheckHasNonYbFee(zyh, orgId); - //if (hasNonYbFee) - //{ - // throw new FailedException("已产生非医保相关费用"); - //} - - return new object(); - } - - public object ZFToYB_Step_3(string mzh, string sbbh, string xm) - { - var orgId = this.OrganizeId; - var ghxx = _outPatRegRepo.IQueryable().Where(p => p.mzh == mzh && p.OrganizeId == orgId).FirstOrDefault(); - - int patid = ghxx.patid; + { + if (string.IsNullOrWhiteSpace(mzh)) + { + throw new FailedException("缺少参数.门诊号"); + } + var orgId = this.OrganizeId; + var ghxx = _outPatRegRepo.IQueryable().Where(p => p.mzh == mzh && p.OrganizeId == orgId).FirstOrDefault(); + if (ghxx == null) + { + throw new FailedException("住院信息未找到"); + } + if (ghxx.zt == "0") + { + throw new FailedException("本次挂号已作废"); + } + if (!(ghxx.brxz == "0")) + { + throw new FailedException("当前非自费"); + } + + return new object(); + } + public object ZFToYB_Step_2(string zyh) + { + var orgId = this.OrganizeId; + //var hasNonYbFee = _hospFeeDmnService.CheckHasNonYbFee(zyh, orgId); + //if (hasNonYbFee) + //{ + // throw new FailedException("已产生非医保相关费用"); + //} + + return new object(); + } + + public object ZFToYB_Step_3(string mzh, string sbbh, string xm) + { + var orgId = this.OrganizeId; + var ghxx = _outPatRegRepo.IQueryable().Where(p => p.mzh == mzh && p.OrganizeId == orgId).FirstOrDefault(); + + int patid = ghxx.patid; SysPatientBasicInfoEntity xtbrxx = null; - - //var xtbrxxList = _sysPatiInfoRepo.IQueryable().Where(p => p.sbbh == sbbh && p.brxz == "1" && p.OrganizeId == orgId && p.zt == "1").ToList(); - //if (xtbrxxList.Count == 1) - //{ - // //if (xtbrxxList[0].patid != ghxx.patid) - // //{ - // // throw new FailedException("该社保卡在系统里已绑定其他身份,不能再用来转该患者医保信息,请使用医保卡重新挂号就诊!社保编号:" + sbbh.ToString()); - // //} - // xtbrxx = xtbrxxList[0]; - //} - //else if (xtbrxxList.Count == 0) - //{ - // xtbrxx = _sysPatiInfoRepo.IQueryable().Where(p => p.patid == patid && p.OrganizeId == orgId && p.zt == "1").First(); - // if (!string.IsNullOrWhiteSpace(xtbrxx.sbbh) && xtbrxx.sbbh != sbbh) - // { - // throw new FailedException("该住院患者已绑定其他社保卡"); - // } - //} - //else - //{ - // throw new FailedException("数据异常,该社保卡在基础信息中存在多条,无法定位"); - //} - + SysCardEntity kxx = null; + var xtbrxxList = _sysCardRepo.IQueryable().Where(p => p.CardNo == sbbh && p.brxz != "0" && p.OrganizeId == orgId && p.zt == "1").ToList(); + if (xtbrxxList.Count == 1) + { + kxx = xtbrxxList[0]; + } + xtbrxx = _sysPatiInfoRepo.IQueryable().Where(p => p.patid == patid && p.OrganizeId == orgId && p.zt == "1").First(); if (xtbrxx.xm != xm) - { - throw new FailedException("异常,就诊姓名与医保卡姓名不一致,请先修改患者姓名"); - } + { + throw new FailedException("异常,就诊姓名与医保卡姓名不一致,请先修改患者姓名"); + } - //var ryzd1 = _hospMultiDiagnosisRepo.IQueryable().Where(p => p.zyh == zyh && p.zt == "1" && p.OrganizeId == orgId).OrderBy(p => p.zdpx).FirstOrDefault(); + //var ryzd1 = _hospMultiDiagnosisRepo.IQueryable().Where(p => p.zyh == zyh && p.zt == "1" && p.OrganizeId == orgId).OrderBy(p => p.zdpx).FirstOrDefault(); - //var ksmc = _sysDepartmentRepo.GetNameByCode(zybrxx.ks, orgId); + //var ksmc = _sysDepartmentRepo.GetNameByCode(zybrxx.ks, orgId); //国家编码 var ysInfo = _outPatientSettleDmnService.GetDepartmentDoctorIdC(orgId, ghxx.ks, ghxx.ys); return new - { - patid = xtbrxx.patid,//patid, + { + patid = xtbrxx.patid,//patid, ghxx = ghxx, - xtbrxx = xtbrxx, - yllb = ghxx.mjzbz, - rygjysbm = ysInfo + xtbrxx = xtbrxx, + yllb= ghxx.mjzbz, + rygjysbm= ysInfo }; - } + } - public object ZFToYB_Step_6(string mzh, int patid, ZYToYBDto patInfo) - { - var orgId = this.OrganizeId; + public object ZFToYB_Step_6(string mzh, int patid, ZYToYBDto patInfo) + { + var orgId = this.OrganizeId; - _patientBasicInfoDmnService.OutPatZFchangetoYB(orgId, mzh, patid, patInfo); + _patientBasicInfoDmnService.OutPatZFchangetoYB(orgId, mzh, patid, patInfo); - return new object(); - } + return new object(); + } - public object ZFToYB_Step_8(string mzh) - { - UpdatebrxzRequest par = new UpdatebrxzRequest { zyh = mzh, brxzCode = "1", brxzmc = "医保病人" }; - //同步数据至CPOE - SiteCISAPIHelper.UpdatebrxzInfo(par); - return new object(); - } + public object ZFToYB_Step_8(string mzh) + { + UpdatebrxzRequest par = new UpdatebrxzRequest {mzh=mzh, zyh = mzh, brxzCode = "1", brxzmc = "普通医保" }; + //同步数据至CPOE + SiteCISAPIHelper.UpdatebrxzInfo(par); + return new object(); + } #endregion - - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatienChargeQueryApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatienChargeQueryApp.cs index 3a7c9297..93bc47d7 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatienChargeQueryApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutPatienChargeQueryApp.cs @@ -21,6 +21,8 @@ using FrameworkBase.MultiOrg.Domain.Entity; using FrameworkBase.MultiOrg.Domain.IRepository; using Newtouch.Core.Common.Exceptions; +using Microsoft.Office.Interop.Excel; +using Newtouch.Infrastructure.Model; namespace Newtouch.HIS.Application.Implementation { @@ -56,7 +58,7 @@ public OutPatientRegChargeDetailDto GetRecordsByJsnm(string jsnm) { var chargeDetailsList = _outPatienChargeQueryDmnService.GetRecordsByJsnm(jsnm); - var mzsfcxdlPzStr = _sysConfigRepo.GetValueByCode(Constants.xtmzpz.MZSFCX_DL, OperatorProvider.GetCurrent().OrganizeId); + var mzsfcxdlPzStr = _sysConfigRepo.GetValueByCode(Infrastructure.Constants.xtmzpz.MZSFCX_DL, OperatorProvider.GetCurrent().OrganizeId); var arrDl = mzsfcxdlPzStr.TrimEnd(',').Split(','); var sysDlList = _sysChargeMajorClassRepo.GetLazyList(OperatorProvider.GetCurrent().OrganizeId).Where(p => arrDl.Contains(p.dlCode)).ToList(); @@ -647,7 +649,7 @@ public void PrintMxBill(SettleDetailVO detail, List leftDt, List< string fpPath = string.Format(@"{0}\17楼明细清单模板.grf", Infrastructure.Constants.ReportTemplateDirUrl); - var subReportDict = new Dictionary(); + var subReportDict = new Dictionary(); if (leftDt != null) { subReportDict.Add("leftSubReport", leftDt.ToDataTable()); @@ -717,7 +719,7 @@ public void ExecPrintInvoice(int jsnm, int ghnm, bool isGh, Enumdyfs dyfs) detailSubReportList.Add(detailItem); } - var subReportDict = new Dictionary(); + var subReportDict = new Dictionary(); if (itemSubReportList != null) { subReportDict.Add("ItemSubReport", itemSubReportList.ToDataTable()); @@ -757,6 +759,8 @@ public void ExecPrintInvoice(int jsnm, int ghnm, bool isGh, Enumdyfs dyfs) } + + #endregion #region 补打 @@ -798,7 +802,7 @@ public void SupplementPrint(string jsnm, bool isGh) detailSubReportList.Add(detailItem); } - var subReportDict = new Dictionary(); + var subReportDict = new Dictionary(); if (itemSubReportList != null) { subReportDict.Add("ItemSubReport", itemSubReportList.ToDataTable()); @@ -882,7 +886,7 @@ public void RePrint(string jsnm, string pageFph, bool isGh) detailSubReportList.Add(detailItem); } - var subReportDict = new Dictionary(); + var subReportDict = new Dictionary(); if (itemSubReportList != null) { subReportDict.Add("ItemSubReport", itemSubReportList.ToDataTable()); @@ -1172,7 +1176,7 @@ public PrintInvoiceInfoVO GetPrintInvoiceInfo(int jsnm, int ghnm, bool isGh, Enu //判断是否专家挂号 bool isZjgh = false; bool isContains = false; - var pzmz = _sysConfigRepo.GetByCode(Constants.xtmzpz.GHLX_ZJGH, OperatorProvider.GetCurrent().OrganizeId); + var pzmz = _sysConfigRepo.GetByCode(Infrastructure.Constants.xtmzpz.GHLX_ZJGH, OperatorProvider.GetCurrent().OrganizeId); if (pzmz == null) { throw new FailedCodeException("OUTPAT_CONFIGURATIONS_THERE_IS_NO_GHLX_ZJGH_CONFIGURATION_IN_THE_OUTPATIENT_SETTING"); @@ -1431,6 +1435,8 @@ private PrintInvoiceRegisterVO ReportRegisterInitialize(PrintInvoiceInfoVO info) } #endregion + + } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutpatientRegApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutpatientRegApp.cs index 064da842..0f40931f 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutpatientRegApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/OutpatientManage/OutpatientRegApp.cs @@ -4,6 +4,8 @@ using Newtouch.HIS.Application.Interface; using Newtouch.HIS.Domain.DTO; using Newtouch.HIS.Domain.DTO.OutputDto.OutpatientManage; +using Newtouch.HIS.Domain.DTO.InputDto; +using Newtouch.HIS.Application.Implementation.OutpatientManage.MzBespeakRegisterProcess; using Newtouch.HIS.Domain.ValueObjects; using Newtouch.Infrastructure; using System; @@ -12,8 +14,6 @@ using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IRepository; -using Newtouch.HIS.Sett.Request.Patient; -using Newtouch.Tools; namespace Newtouch.HIS.Application.Implementation { @@ -89,7 +89,7 @@ public void Save(int patid, string kh, string ghly, string mjzbz, , string fph, DateTime? sfrq, bool isCkf, bool isGbf, int ghpbId , OutpatientSettFeeRelatedDTO feeRelated, string brxz , string ybjsh, string mzyyghId, ref short? qzjzxh, ref string qzmzh - , string jzyy,string jzid, string jzlx, string bzbm, string bzmc, out object newJszbInfo) + , string jzyy,string jzid, string jzlx, string bzbm, string bzmc,string isjm, out object newJszbInfo) { if ((qzjzxh ?? 0) <= 0 || string.IsNullOrWhiteSpace(qzmzh)) { @@ -99,24 +99,7 @@ public void Save(int patid, string kh, string ghly, string mjzbz, } //保存 _outPatientSettleDmnService.Save(this.OrganizeId, patid, kh, ghly, mjzbz, - ks, ys, ksmc, ysmc, ghxm, zlxm, fph, sfrq, isCkf, isGbf, (int)qzjzxh.Value, ghpbId, feeRelated, brxz, ybjsh, qzmzh, jzyy,jzid,jzlx,bzbm,bzmc, mzyyghId, out newJszbInfo); - } - - - public void UnSettSave(int patid, string kh, string ghly, string mjzbz, - string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm, bool isCkf, bool isGbf, int ghpbId, string brxz - , string ybjsh, ref short? qzjzxh, ref string qzmzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, out object newJszbInfo) - { - if (( qzjzxh ?? 0) <= 0 || string.IsNullOrWhiteSpace( qzmzh)) - { - var mzhjzxh = _outPatientSettleDmnService.GetMzhJzxh( patid, ghpbId.ToString(), ks, ys, this.OrganizeId, this.UserIdentity.UserCode); - qzjzxh = mzhjzxh.Item1; - qzmzh = mzhjzxh.Item2; - } - //保存 - _outPatientSettleDmnService.UnSettSave(this.OrganizeId, patid, kh, ghly, mjzbz, - ks, ys, ksmc, ysmc, ghxm, zlxm, isCkf, isGbf, (int) qzjzxh.Value, ghpbId, brxz, ybjsh, qzmzh, jzyy, jzid, jzlx, bzbm, bzmc, null, out newJszbInfo); + ks, ys, ksmc, ysmc, ghxm, zlxm, fph, sfrq, isCkf, isGbf, (int)qzjzxh.Value, ghpbId, feeRelated, brxz, ybjsh, qzmzh, jzyy,jzid,jzlx,bzbm,bzmc, mzyyghId, isjm, out newJszbInfo); } /// @@ -167,5 +150,31 @@ public void CheckBrxz(string kh, string updateBrxz) } } + + + /// + /// 预约挂号 + /// + /// + /// + /// + /// + /// 门诊挂号类型 1:普通门诊 2:急诊 3:专家门诊 + /// + /// + public string BespeakRegister(int? zjlx, string zjh, string blh, string ksCode, int mzlx, string ysgh) + { + var param = new BespeakRegisterParamDTO + { + blh = blh, + ksCode = ksCode, + mzlx = mzlx, + ysgh = ysgh, + zjh = zjh, + zjlx = zjlx + }; + var result = new MzBespeakRegisterProcess(param).Process(); + return result.ResultMsg; + } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientAccountManageApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientAccountManageApp.cs index b98099e3..dbb56677 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientAccountManageApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientAccountManageApp.cs @@ -251,7 +251,8 @@ private void AccPayDeposit(DeposDto dto, out InpatientAccountRevenueAndExpenseEn payEntity.memo = dto.memo; payEntity.zt = "1"; payEntity.OrganizeId = OrganizeId; - ////获取凭证号 + payEntity.outTradeNo = dto.outTradeNo; + ////获取凭证号s ////判断静态参数配置 payEntity.pzh = GetFinRepSJPZH(); payEntity.Create(true); diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientApp.cs index 1fce4f4a..03e5060e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/InpatientApp.cs @@ -156,6 +156,11 @@ public object ZFToYB_Step_8(string zyh1) return new object(); } + public object UpqdScData(string kssj, string jssj) + { + return _patientBasicInfoDmnService.GetUpqdScData(kssj, jssj); + } + #endregion @@ -232,10 +237,10 @@ public object YBToZF_Step_3(string zyh, string sbbh, string xm) public object CqYBToZF_Step_3(string zyh) { var orgId = this.OrganizeId; - var zybrxx = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.zyh == zyh && p.OrganizeId == orgId).FirstOrDefault(); + var zybrxx = _hospPatientBasicInfoRepo.IQueryable().Where(p => p.zyh == zyh && p.OrganizeId == orgId && p.zt=="1").FirstOrDefault(); var medicalReg = _cqybMedicalReg02Repo.IQueryable().Where(p => p.zymzh == zyh && p.OrganizeId == orgId && p.zt=="1").FirstOrDefault(); var xtbrxx = _sysPatientBasicInfoRepo.IQueryable().Where(p=>p.patid== zybrxx.patid&&p.OrganizeId==orgId&&p.zt=="1").FirstOrDefault(); - var card = _SysCardRepository.IQueryable().Where(p => p.patid == zybrxx.patid && p.OrganizeId == orgId).FirstOrDefault(); + var card = _SysCardRepository.IQueryable().Where(p => p.patid == zybrxx.patid && p.OrganizeId == orgId &&p.CardType!="1" && p.zt=="1").FirstOrDefault(); return new { zybrxx = zybrxx, diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/SysPatBasicInfoApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/SysPatBasicInfoApp.cs index b42a8f11..20e2a948 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/SysPatBasicInfoApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PatientManage/SysPatBasicInfoApp.cs @@ -48,6 +48,7 @@ public object GetBRXZList(string orgId) var list = _SysPatiNatureRepo.IQueryable().Where(p => p.zt == "1" && p.OrganizeId == orgId).Select(p => new { brxz = p.brxz, + brxzlb=p.brxzlb, brxzbh = p.brxzbh, brxzmc = p.brxzmc, py = p.py diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PayApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PayApp.cs index 65e376dd..eb1dad0b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PayApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Implementation/PayApp.cs @@ -1,6 +1,7 @@ using FrameworkBase.MultiOrg.Application; using Newtouch.Common; using Newtouch.HIS.Application.Interface; +using Newtouch.HIS.Domain; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IRepository; using Newtouch.Infrastructure; @@ -59,33 +60,77 @@ public int TradeRefund(string outTradeNo, decimal refundAmount, string refundRea var refundedSum = _orderRefundInfoRepo.GetRefundedSumByOutTradeNo(outTradeNo); if (refundedSum + refundAmount <= payEntity.Amount) { - //3、退 - PayResultModel payresult = TradeHelper.TradeRefund(refundEntity.OutTradeNo, refundEntity.TradeNo, refundAmount.ToString("0.00"), refundReason, payEntity.PayType, "", refundEntity.OutRequestNo); - - if (payresult.code == ResponseResultCode.SUCCESS) + //13聚合支付退费 + if (payEntity.PayType == 13) { - DateTime refundDate; - if (DateTime.TryParse(payresult.GmtTime, out refundDate)) + //N|BH1234567890133|20240402|0.01 + string orderid = string.Format("N|{0}|{1}|{2}", payEntity.OutTradeNo, payEntity.TradeNo.Substring(0, 8), payEntity.Amount); + var auth_codedata = new + { + refundreason = refundReason, + terminal = this.UserIdentity.UserCode, + hospitalid = "隆安县城厢卫生院", + orderid = orderid, + sign = "" + }; + string datajson = Newtonsoft.Json.JsonConvert.SerializeObject(auth_codedata); + + CommmHelper commm = new CommmHelper(); + string nxresult = commm.NxPost(Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("NxPay") + "system/refund-refundfee", datajson); + if (nxresult != null) { - refundEntity.RefundDate = refundDate; + var nxpaymodel = Newtonsoft.Json.JsonConvert.DeserializeObject(nxresult); + if (nxpaymodel.Result == "0") + { + refundEntity.RefundDate = DateTime.Now; + refundEntity.RefundStatus = (int)EnumRefundStatus.Success; + return refundEntity.RefundStatus; + } + else + { + refundEntity.Memo = errorMsg = "失败," + nxpaymodel.Message; + refundEntity.RefundStatus = (int)EnumRefundStatus.Failed; + return refundEntity.RefundStatus; + } + } + else + { + refundEntity.Memo = errorMsg = "退款原路退回进度未知,请人工核查"; + refundEntity.RefundStatus = (int)EnumRefundStatus.UnKnown; + return refundEntity.RefundStatus; } - refundEntity.RefundStatus = (int)EnumRefundStatus.Success; - return refundEntity.RefundStatus; } else { - if ("UNKNOWN".Equals(payresult.sub_code, StringComparison.OrdinalIgnoreCase)) + //3、退 + PayResultModel payresult = TradeHelper.TradeRefund(refundEntity.OutTradeNo, refundEntity.TradeNo, refundAmount.ToString("0.00"), refundReason, payEntity.PayType, "", refundEntity.OutRequestNo); + + if (payresult.code == ResponseResultCode.SUCCESS) { - refundEntity.Memo = errorMsg = "退款原路退回进度未知,请人工核查"; - refundEntity.RefundStatus = (int)EnumRefundStatus.UnKnown; + DateTime refundDate; + if (DateTime.TryParse(payresult.GmtTime, out refundDate)) + { + refundEntity.RefundDate = refundDate; + } + + refundEntity.RefundStatus = (int)EnumRefundStatus.Success; return refundEntity.RefundStatus; } else { - refundEntity.Memo = errorMsg = "失败," + payresult.msg + "," + payresult.sub_msg; - refundEntity.RefundStatus = (int)EnumRefundStatus.Failed; - return refundEntity.RefundStatus; + if ("UNKNOWN".Equals(payresult.sub_code, StringComparison.OrdinalIgnoreCase)) + { + refundEntity.Memo = errorMsg = "退款原路退回进度未知,请人工核查"; + refundEntity.RefundStatus = (int)EnumRefundStatus.UnKnown; + return refundEntity.RefundStatus; + } + else + { + refundEntity.Memo = errorMsg = "失败," + payresult.msg + "," + payresult.sub_msg; + refundEntity.RefundStatus = (int)EnumRefundStatus.Failed; + return refundEntity.RefundStatus; + } } } } @@ -122,7 +167,7 @@ public int TradeRefund(string outTradeNo, decimal refundAmount, string refundRea } else { - if (refundEntity.RefundStatus == (int) EnumRefundStatus.Success) + if (refundEntity.RefundStatus == (int)EnumRefundStatus.Success) { var ety = _orderRefundInfoRepo.FindEntity(p => p.OutRequestNo == outRequestNo); diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Interface/HospitalizationManage/IDischargeSettleApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Interface/HospitalizationManage/IDischargeSettleApp.cs index 93f0c8eb..f0881da7 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Interface/HospitalizationManage/IDischargeSettleApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Interface/HospitalizationManage/IDischargeSettleApp.cs @@ -16,9 +16,6 @@ namespace Newtouch.HIS.Application.Interface.HospitalizationManage /// public interface IDischargeSettleApp { - #region 患者信息 - InpatientSettPatInfoVO GetInpatientSettlePatInfo(ref string zyh, string sfz = null, string kh = null, string cardType = null, string jslx = null, string orgId = null); - #endregion #region 出院结算 @@ -30,7 +27,7 @@ public interface IDischargeSettleApp /// /// /// - InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver); + InpatientSettPatStatusDetailDto GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx,string ver); /// /// 保存结算 @@ -43,24 +40,8 @@ public interface IDischargeSettleApp void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRelatedDTO feeRelated , CQZyjs05Dto ybfeeRelated, S14OutResponseDTO xnhfeeRelated , string outTradeNo, string jslx, out int jsnm); - /// - /// 结算-接口版 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRelatedDTO feeRelated - , CQZyjs05Dto ybfeeRelated, S14OutResponseDTO xnhfeeRelated - , string outTradeNo, string jslx, string orgId, out int jsnm); - InpatientSettPatStatusDetailDto GetZyUploadDetail(string zyh, string jslx); + InpatientSettPatStatusDetailDto GetZyUploadDetail(string zyh,string jslx); InpatIentFeeSumVo GetInpatientSettleJe(string zyh, string sczt, DateTime? kssj, DateTime jssj, string xmmc); #endregion @@ -74,7 +55,7 @@ void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRel /// /// 取消出院结算 /// - void DoCancel(string zyh, int expectedjsnm, string cancelReason, string cancelyblsh, out string outTradeNo, out decimal refundAmount); + void DoCancel(string zyh, int expectedjsnm, string cancelReason,string cancelyblsh, out string outTradeNo, out decimal refundAmount); #endregion @@ -89,13 +70,13 @@ void SaveSett(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRel void SavePartialSettle(string zyh, DateTime startTime, DateTime endTime, string fph, InpatientSettFeeRelatedDTO feeRelated , CQZyjs05Dto ybfeeRelated, string outTradeNo, string jslx, out int jsnm); - InpatientSettPatStatusDetailDto GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver); + InpatientSettPatStatusDetailDto GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx,string ver); /// /// 转出院结算 预处理 /// /// - string PreCYsettle(string zyh); + string PreCYsettle(string zyh); #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatChargeApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatChargeApp.cs index cf4b69be..00bf392c 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatChargeApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatChargeApp.cs @@ -12,7 +12,6 @@ using Newtouch.HIS.Domain.ValueObjects; using Newtouch.HIS.Proxy.guian.DTO.S25; using Newtouch.Core.Common; -using System; namespace Newtouch.HIS.Application.Interface { @@ -163,16 +162,7 @@ bool submitOutpatCharge(BasicInfoDto2018 bacDto /// bool submitOutpatAdditional(string orgId, BasicInfoDto2018 bacDto, OutServiceInfoDto2018 accDto); - /// - /// 项目未收费,单独收费 - /// - /// - /// - /// - /// - /// - /// - int submitOutpatGhCharge(string orgId, string fph, DateTime? sfrq, OutpatientSettFeeRelatedDTO feeRelated, IList ghxmnmList); + /// /// 整合前台的收费数据成后台的理想状态 /// diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatienChargeQueryApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatienChargeQueryApp.cs index 854e25ee..01de2330 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatienChargeQueryApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutPatienChargeQueryApp.cs @@ -5,6 +5,7 @@ using System; using Newtouch.HIS.Domain.DTO.OutputDto.OutpatientManage; using Newtouch.Core.Common; +using Newtouch.Infrastructure.Model; namespace Newtouch.HIS.Application.Interface { @@ -35,7 +36,7 @@ public interface IOutPatienChargeQueryApp void CheckPintInfo(string jsnm); - void PrintInvoice(string jsnm, bool isGH); + void PrintInvoice(string jsnm, bool isGH); void RePrint(string jsnm, string pageFph, bool isGH); diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutpatientRegApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutpatientRegApp.cs index eb4b78e3..2b718856 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutpatientRegApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Interface/OutpatientManage/IOutpatientRegApp.cs @@ -1,7 +1,6 @@ using Newtouch.HIS.Domain.DTO; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.ValueObjects; -using Newtouch.HIS.Sett.Request.Patient; using System; using System.Collections.Generic; @@ -56,43 +55,22 @@ void Save(int patid, string kh, string ghly, string mjzbz, , string fph, DateTime? sfrq, bool isCkf, bool isGbf, int ghpbId , OutpatientSettFeeRelatedDTO feeRelated, string brxz , string ybjsh, string mzyyghId, ref short? qzjzxh, ref string qzmzh - , string jzyy,string jzid, string jzlx, string bzbm, string bzmc, out object newJszbInfo); - - /// - /// 不收费挂号 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - void UnSettSave(int patid, string kh, string ghly, string mjzbz, - string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm, bool isCkf, bool isGbf, int ghpbId, string brxz - , string ybjsh, ref short? qzjzxh, ref string qzmzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, out object newJszbInfo); + , string jzyy,string jzid, string jzlx, string bzbm, string bzmc,string isjm, out object newJszbInfo); long Book(OutpatientRegistEntity gh, decimal ssk, string fph, bool isCkf, bool isGbf, string updateBrxz); void CheckBrxz(string kh, string updateBrxz); + /// + /// 预约挂号 + /// + /// + /// + /// + /// + /// + /// + /// + string BespeakRegister(int? zjlx, string zjh, string blh, string ksCode, int mzlx, string ysgh); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Interface/PatientManage/IInpatientApp.cs b/Newtouch.HIS.Sett/Newtouch.Application/Interface/PatientManage/IInpatientApp.cs index ee990727..cc2d1a86 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Interface/PatientManage/IInpatientApp.cs +++ b/Newtouch.HIS.Sett/Newtouch.Application/Interface/PatientManage/IInpatientApp.cs @@ -29,6 +29,8 @@ public interface IInpatientApp object ZFToYB_Step_8(string zyh); + object UpqdScData(string kssj, string jssj); + #endregion #region YBToZF steps diff --git a/Newtouch.HIS.Sett/Newtouch.Application/Newtouch.HIS.Application.csproj b/Newtouch.HIS.Sett/Newtouch.Application/Newtouch.HIS.Application.csproj index 9d9e7c44..b773bdf1 100644 --- a/Newtouch.HIS.Sett/Newtouch.Application/Newtouch.HIS.Application.csproj +++ b/Newtouch.HIS.Sett/Newtouch.Application/Newtouch.HIS.Application.csproj @@ -9,7 +9,7 @@ Properties Newtouch.HIS.Application Newtouch.HIS.Application - v4.6 + v4.6.2 512 @@ -76,7 +76,7 @@ ..\..\his-dll-common\dlls\newtouch.mq.Client.dll - ..\..\his-dll-common\dlls\Newtouch.PDS.Requset.dll + ..\..\..\NewTouch\his-dll-common\dlls\Newtouch.PDS.Requset.dll ..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/App.config b/Newtouch.HIS.Sett/Newtouch.Domain/App.config index d7200e34..54332e35 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/App.config +++ b/Newtouch.HIS.Sett/Newtouch.Domain/App.config @@ -10,4 +10,4 @@ - + diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/BusinessObjects/FeeItemsGroupedBO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/BusinessObjects/FeeItemsGroupedBO.cs index c04c7982..83958b20 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/BusinessObjects/FeeItemsGroupedBO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/BusinessObjects/FeeItemsGroupedBO.cs @@ -11,13 +11,9 @@ namespace Newtouch.HIS.Domain.BusinessObjects public class FeeItemsGroupedBO { /// - /// 处方类型 对应枚举 EnumPrescriptionType + /// 处方类型 对应枚举 EnumPrescriptionType /// public int? cflx { get; set; } - /// - /// 处方类型细分 EnumCflx - /// - public int? cflxxf { get; set; } /// /// 处方类型名称 diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DBContext.Infrastructure/DefaultDbContextTBRegister.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DBContext.Infrastructure/DefaultDbContextTBRegister.cs index 3ce7932b..8defe073 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DBContext.Infrastructure/DefaultDbContextTBRegister.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DBContext.Infrastructure/DefaultDbContextTBRegister.cs @@ -191,10 +191,6 @@ public static void Registe(DbModelBuilder modelBuilder) modelBuilder.Entity().RegisterTable().HasKey(p => p.Id); //排班 modelBuilder.Entity().RegisterTable().HasKey(p => p.ScheduId); - //订单 - modelBuilder.Entity().RegisterTable().HasKey(p => p.Id); - modelBuilder.Entity().RegisterTable().HasKey(p => p.Id); - modelBuilder.Entity().RegisterTable().HasKey(p => p.Id); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/DeposDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/DeposDto.cs index de0ad305..440cbb16 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/DeposDto.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/DeposDto.cs @@ -58,6 +58,9 @@ public class DeposDto public int patid { get; set; } public string zyh { get; set; } public string memo { get; set; } - + /// + /// 订单号 + /// + public string outTradeNo { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/InpatientSettFeeRelatedDTO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/InpatientSettFeeRelatedDTO.cs index 285cd2ca..0805e54b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/InpatientSettFeeRelatedDTO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/InpatientSettFeeRelatedDTO.cs @@ -75,4 +75,5 @@ public class InpatientSettFeeRelatedDTO public decimal? xjwc { get; set; } #endregion } + } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccBasicInfoDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccBasicInfoDto.cs index 667710c2..198534dc 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccBasicInfoDto.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccBasicInfoDto.cs @@ -31,7 +31,6 @@ public class BasicInfoDto2018 public string mzh { get; set; } public int ghnm { get; set; } public string ys { get; set; } - public string kh { get; set; } public DateTime? sfrq { get; set; } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccInfoDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccInfoDto.cs index 55ea3099..ebc0f8f4 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccInfoDto.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatAccInfoDto.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using Newtouch.HIS.Domain.BusinessObjects; using Newtouch.HIS.Domain.ValueObjects; -using Newtouch.Infrastructure; namespace Newtouch.HIS.Domain.DTO.InputDto { @@ -11,7 +10,6 @@ public class OutpatAccInfoDto public int patid { get; set; } public string xm { get; set; } public string xb { get; set; } - public string Gender { get; set; } public string blh { get; set; } public DateTime? csny { get; set; } public string zjlx { get; set; } @@ -34,24 +32,7 @@ public class OutpatAccInfoDto public string CardTypeName { get; set; } public string mzh { get; set; } public int? ghnm { get; set; } - - private DateTime? _ghsj; - public DateTime? ghsj - { - set - { - if (value == null) - { - _ghsj = null; - } - if ((DateTime)value <= Constants.MinDate) - { - _ghsj = null; - } - _ghsj = value; - } - get => _ghsj; - } + public DateTime? ghsj { get; set; } public string brly { get; set; } public string ghrq { get; set; } @@ -146,20 +127,16 @@ public DateTime? ghsj /// /// public string ksmc { get; set; } - /// - /// 参保类别 - /// - public string cblb { get; set; } + /// + /// 参保类别 + /// + public string cblb { get; set; } public string zyh { get; set; } public string mjzbz { get; set; } - public string mzlx { get; set; } public string CardId { get; set; } public string dz { get; set; } public string zybz { get; set; } - /// - /// 挂号总金额 - /// - public decimal ghzje { get; set; } + public string brxzlb { get; set; } } @@ -307,11 +284,6 @@ public IList ysList public string zfxz { get; set; } public decimal? zfbl { get; set; } public string xnhgrbm { get; set; } - - /// - /// - /// - public string grbh {get;set;} } /// @@ -323,12 +295,12 @@ public class OutpatOptimAccInfoDto /// 就诊记录 /// public OutpatAccInfoDto OutpatAccInfoDto { get; set; } - + /// /// 就诊记录集合 /// public List OutpatAccListDto { get; set; } - + /// /// /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientAccounting/OptimaAccLeftDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientAccounting/OptimaAccLeftDto.cs index fb51dd2f..588102d7 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientAccounting/OptimaAccLeftDto.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientAccounting/OptimaAccLeftDto.cs @@ -40,7 +40,6 @@ public class ChargeRightDto public string sfdlCode { get; set; } public string sfdlmc { get; set; } public string dlmc { get; set; } - public string ztmc { get; set; } public int sl { get; set; } public string dw { get; set; } public decimal dj { get; set; } @@ -75,14 +74,12 @@ public class ChargeRightDto /// 科室编码 /// public string ks { get; set; } - public string ksmc { get; set; } /// /// 医生编码 /// public string ys { get; set; } - /// /// 医生姓名 /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientSettFeeRelatedDTO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientSettFeeRelatedDTO.cs index 7dd328c5..3643b9b5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientSettFeeRelatedDTO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/InputDto/OutpatientSettFeeRelatedDTO.cs @@ -72,6 +72,7 @@ public class OutpatientSettFeeRelatedDTO /// 电子凭证码 /// public string ecToken { get; set; } + public List patZflist { get; set; } public decimal? xjwc { get; set; } } @@ -86,6 +87,7 @@ public class PatZfList /// public string zffsmc { get; set; } } + /// /// 门诊结算医保相关费用 /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/DRGUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/DRGUploadDto.cs new file mode 100644 index 00000000..56b95da8 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/DRGUploadDto.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.DRGManage +{ + public class DRGUploadDto + { + public string scqk { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string zyh { get; set; } + public string xm { get; set; } + public string sfzh { get; set; } + public string mdtrt_id { get; set; } + public string setl_id { get; set; } + public DateTime? ryrq { get; set; } + public DateTime? cyrq { get; set; } + public DateTime? basyrq { get; set; } + public DateTime? jsrq { get; set; } + public string ksmc { get; set; } + public string ysmc { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/YPUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/YPUploadDto.cs new file mode 100644 index 00000000..b5948ea3 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/YPUploadDto.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.DRGManage +{ + public class YPUploadDto + { + public string mlbm_id { get; set; } + public string scqk { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string ypmc { get; set; } + public string pch { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/sqszUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/sqszUploadDto.cs new file mode 100644 index 00000000..80594e4e --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/DRGManage/sqszUploadDto.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.DRGManage +{ + public class sqszUploadDto + { + public string zyh { get; set; } + public string xm { get; set; } + public string yzh { get; set; } + public string zdmc { get; set; } + public string xmmc { get; set; } + public string sl { get; set; } + public string ks { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string yzlx { get; set; } + + } + + public class mxlist + { + public string xmmc { get; set; } + public string kdrq { get; set; } + public string kdys { get; set; } + public string kdks { get; set; } + public string xmywmc { get; set; } + public string wjz { get; set; } + public string xmdw { get; set; } + public string ckz { get; set; } + public string jyjg { get; set; } + public string lcyx { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/HospitalizationManage/InPatientInfoDTO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/HospitalizationManage/InPatientInfoDTO.cs index 66f30801..1a61c6cd 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/HospitalizationManage/InPatientInfoDTO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/HospitalizationManage/InPatientInfoDTO.cs @@ -77,6 +77,7 @@ public class InPatientInfoDTO /// /// public string bqmc { get; set; } + public string cwmc { get; set; } /// /// @@ -181,6 +182,20 @@ public class InPatientInfoDTO public string contPerRelValue { get; set; } public string ryfs { get; set; } + /// + /// 是否已上传 + /// + public string issc { get; set; } + public string doctor { get; set; } + public string inHosDays { get; set; } + public string zzdmc2 { get; set; } + public string zzdmc3 { get; set; } + public string cyzd { get; set; } + public string zy { get; set; } + public string xzz { get; set; } + public string cyfs { get; set; } + public string jzDoctor { get; set; } + public string pkbz { get; set; } } @@ -212,6 +227,23 @@ public class InPatientInfoVO : InPatientInfoDTO /// 卡性质:0 自费 1:医保 /// public string brxzlb { get; set; } + /// + /// 医保结算流水号 + /// + public string setl_id { get; set; } + /// + /// 人员编号 + /// + public string psn_no { get; set; } + public string mdtrt_id { get; set; } + } + + public class InSettlementInfoVO : InPatientInfoVO + { + public string sczt { get; set; } + public string tjzt { get; set; } + public string setl_id { get; set; } + public string psn_no { get; set; } } public class patFeeVo diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGUploadDto.cs new file mode 100644 index 00000000..bfbaa431 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGUploadDto.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.JGManage +{ + public class JGUploadDto + { + public string scqk { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string zyh { get; set; } + public string xm { get; set; } + public string sfzh { get; set; } + public string mdtrt_id { get; set; } + public string setl_id { get; set; } + public DateTime? ryrq { get; set; } + public DateTime? cyrq { get; set; } + public DateTime? basyrq { get; set; } + public DateTime? jsrq { get; set; } + public string ksmc { get; set; } + public string ysmc { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGsqszUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGsqszUploadDto.cs new file mode 100644 index 00000000..43bb36a7 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/JGsqszUploadDto.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.JGManage +{ + public class JGsqszUploadDto + { + public string zyh { get; set; } + public string xm { get; set; } + public string yzh { get; set; } + public string zdmc { get; set; } + public string xmmc { get; set; } + public string sl { get; set; } + public string ks { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string yzlx { get; set; } + + } + + public class JGmxlist + { + public string xmmc { get; set; } + public string kdrq { get; set; } + public string kdys { get; set; } + public string kdks { get; set; } + public string xmywmc { get; set; } + public string wjz { get; set; } + public string xmdw { get; set; } + public string ckz { get; set; } + public string jyjg { get; set; } + public string lcyx { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/YPUploadDto.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/YPUploadDto.cs new file mode 100644 index 00000000..a8ea5461 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/JGManage/YPUploadDto.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.DTO.OutputDto.JGManage +{ + public class JGYPUploadDto + { + public string mlbm_id { get; set; } + public string scqk { get; set; } + public DateTime? scrq { get; set; } + public string errorMsg { get; set; } + public string ypmc { get; set; } + public string pch { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/OutpatientManage/OutPatientRegistrationInfoDTO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/OutpatientManage/OutPatientRegistrationInfoDTO.cs index 3562b807..ea67b71e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/OutpatientManage/OutPatientRegistrationInfoDTO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/DTO/OutputDto/OutpatientManage/OutPatientRegistrationInfoDTO.cs @@ -189,6 +189,6 @@ public class OutPatientRegistrationInfoDTO /// 挂号来源标签 2020-3-4 新增 /// public string ghlybz { get; set; } - public short queno { get; set; } + //public short? queno { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/DeanInquiryManage/DrugTrackingEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/DeanInquiryManage/DrugTrackingEntity.cs index a79f717b..26ae2238 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/DeanInquiryManage/DrugTrackingEntity.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/DeanInquiryManage/DrugTrackingEntity.cs @@ -38,8 +38,8 @@ public class DoctorBillingRanking public string Name { get; set; } [DecimalPrecision(11, 4)] public decimal zje { get; set; } - public int sl { get; set; } - + [DecimalPrecision(11, 4)] + public decimal sl { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/MzghbookEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/MzghbookEntity.cs index e89fe5cc..fb388881 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/MzghbookEntity.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/MzghbookEntity.cs @@ -206,9 +206,5 @@ public class MzghbookEntity : IEntity /// 当日挂号状态确认 /// public string drghstatu { get; set; } - /// - /// 排班描述(冗余) - /// - public string Title { get; set; } } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/OrderManage/QRBarPayOutput.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/OrderManage/QRBarPayOutput.cs new file mode 100644 index 00000000..2d7d65f4 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/OrderManage/QRBarPayOutput.cs @@ -0,0 +1,80 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain +{ + public class QRBarPayOutput + { + /// + /// 结果 + /// + public string Result { get; set; } + + /// + /// 消息 + /// + public string Message { get; set; } + + /// + /// 返回值 + /// + public string ReturnValue { get; set; } + + /// + /// 外部订单号 + /// + public string outTradeNo { get; set; } + + /// + /// 订单号 + /// + public string tradeNo { get; set; } + + /// + /// 买家ID + /// + public string OpenId { get; set; } + + /// + /// 支付金额 + /// + public string TotalAmount { get; set; } + /// + /// 支付金额 + /// + public string PaymentAmount { get; set; } + + /// + /// 订单状态 + /// + public string TradeStatus { get; set; } + + /// + /// 交易成功,交易失败 + /// + public bool TradeSuccess { get; set; } + } + + public class RefundFeeOut + { + /// + /// 结果 + /// + public string Result { get; set; } + + /// + /// 消息 + /// + public string Message { get; set; } + + /// + /// 返回值 + /// + public string ReturnValue { get; set; } + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/G_yb_daysrg_trt_list_bEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/G_yb_daysrg_trt_list_bEntity.cs new file mode 100644 index 00000000..708a7603 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/G_yb_daysrg_trt_list_bEntity.cs @@ -0,0 +1,125 @@ +using FrameworkBase.MultiOrg.Domain.Entity; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.Entity.PatientManage +{ + /// + /// 医保日间手术治疗目录表 + /// + [Table("G_yb_daysrg_trt_list_b")] + public class G_yb_daysrg_trt_list_bEntity : IEntity + { + /// + /// 日间手术治疗目录ID + /// + [Key] + public string DAYSRG_TRT_LIST_ID { get; set; } + /// + /// 日间手术病种目录代码 + /// + public string DAYSRG_DISE_LIST_CODE { get; set; } + /// + /// 日间手术病种名称 + /// + public string DAYSRG_DISE_NAME { get; set; } + /// + /// 有效标志 + /// + public string VALI_FLAG { get; set; } + /// + /// 数据唯一记录号 + /// + public string RID { get; set; } + + /// + /// 数据创建时间 + /// + public DateTime CRTE_TIME { get; set; } + /// + /// 数据更新时间 + /// + public DateTime UPDT_TIME { get; set; } + /// + /// 创建人ID + /// + public string CRTER_ID { get; set; } + /// + /// 创建人姓名 + /// + public string CRTER_NAME { get; set; } + /// + /// 创建机构编号 + /// + public string CRTE_OPTINS_NO { get; set; } + /// + /// 经办人ID + /// + public string OPTER_ID { get; set; } + /// + /// 经办人姓名 + /// + public string OPTER_NAME { get; set; } + /// + /// 经办时间 + /// + public DateTime OPT_TIME { get; set; } + /// + /// 经办机构编号 + /// + public string OPTINS_NO { get; set; } + /// + /// 版本号 + /// + public string VER { get; set; } + /// + /// 病种内涵 + /// + public string DISE_CONT { get; set; } + /// + /// 备注 + /// + public string MEMO { get; set; } + /// + /// 版本名称 + /// + public string VER_NAME { get; set; } + /// + /// 诊疗指南页码 + /// + public string TRT_GUIDE_PAGEN { get; set; } + /// + /// 诊疗指南电子档案 + /// + public string TRT_GUIDE_ELECACS { get; set; } + /// + /// 限定手术操作代码 + /// + public string QUA_OPRN_OPRT_CODE { get; set; } + /// + /// 限定手术操作名称 + /// + public string QUA_OPRN_OPRT_NAME { get; set; } + /// + /// 下发标志 + /// + public string ISU_FLAG { get; set; } + /// + /// 传输数据ID + /// + public string TRAM_DATA_ID { get; set; } + /// + /// 生效时间 + /// + public DateTime? EFFT_TIME { get; set; } + /// + /// 失效时间 + /// + public DateTime? INVD_TIME { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/HospPatientBasicInfoEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/HospPatientBasicInfoEntity.cs index 2979eb67..b72a4bb1 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/HospPatientBasicInfoEntity.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/HospPatientBasicInfoEntity.cs @@ -410,5 +410,6 @@ public class HospPatientBasicInfoEntity : IEntity public string tes { get; set; } public string zcbz { get; set; } public DateTime? syrq { get; set; } + // public string BedNo { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/InpatientAccountRevenueAndExpenseEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/InpatientAccountRevenueAndExpenseEntity.cs index 1f4107b6..02c0238b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/InpatientAccountRevenueAndExpenseEntity.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/PatientManage/InpatientAccountRevenueAndExpenseEntity.cs @@ -85,5 +85,9 @@ public class InpatientAccountRevenueAndExpenseEntity : IEntity + /// 订单号 + /// + public string outTradeNo { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/SystemManage/FinancialInvoiceEntity.cs b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/SystemManage/FinancialInvoiceEntity.cs index 7d0ec7d1..1a8cd8ab 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Entity/SystemManage/FinancialInvoiceEntity.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Entity/SystemManage/FinancialInvoiceEntity.cs @@ -12,13 +12,13 @@ namespace Newtouch.HIS.Domain.Entity public class FinancialInvoiceEntity : IEntity { /// - /// 发票单号 + /// /// [Key] public string fpdm { get; set; } /// - /// 首字母 + /// /// public string szm { get; set; } @@ -28,35 +28,35 @@ public class FinancialInvoiceEntity : IEntity public string OrganizeId { get; set; } /// - /// 起始发票号 + /// /// public long qsfph { get; set; } /// - /// 结束发票号 + /// /// public long jsfph { get; set; } /// - /// 当前发票号 + /// /// public long dqfph { get; set; } /// - /// 领用日期 + /// 领用人员 /// public DateTime lyrq { get; set; } /// - /// 领用人员 + /// /// public string lyry { get; set; } /// - /// 0:停用; 1:启用 + /// 0:无效; 1:有效 /// public string zt { get; set; } - + /// /// /// @@ -78,14 +78,9 @@ public class FinancialInvoiceEntity : IEntity public string LastModifierCode { get; set; } /// - /// 排序 + /// /// public int? px { get; set; } - /// - /// 0:有效;1;作废 - /// - public int? is_del { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/API/IBookingRegisterDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/API/IBookingRegisterDmnService.cs index 8634ff81..6565c4d4 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/API/IBookingRegisterDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/API/IBookingRegisterDmnService.cs @@ -11,7 +11,7 @@ namespace Newtouch.HIS.Domain.IDomainServices.API { public interface IBookingRegisterDmnService { - IList GetCardInfo(CardInfoReq req); + IList GetCardInfo(CardInfoReq req); /// /// 获取科室信息 @@ -46,17 +46,11 @@ public interface IBookingRegisterDmnService /// MzAppointmentResp OutAppointment(MzAppointmentReq dto); /// - /// 预约签到/预约挂号 + /// 签到 /// /// /// - RegSettResp BookOutpatRegSett(RegSettReq dto); - /// - /// 普通挂号(自费) - /// - /// - /// - RegSettResp OutpatRegSett(RegSettReq req); + RegSettResp OutpatRegSett(RegSettReq dto); /// /// 预约号查询预约信息 /// @@ -86,7 +80,7 @@ public interface IBookingRegisterDmnService /// /// /// - PatCardInfoResp SysPatInfoSet(RegisterReq req); + CardInfoResp SysPatInfoSet(RegisterReq req); /// /// 取消结算 /// @@ -128,7 +122,7 @@ public interface IBookingRegisterDmnService /// /// /// - void OutSett(SettReq req, int jsnm, string orgId); + void OutSett(SettReq req, int jsnm,string orgId); /// /// 对账信息 /// @@ -140,32 +134,5 @@ public interface IBookingRegisterDmnService List GetOrderAmount(string mzh, string orgId); BasicInfoDto2018 getPatInfo(string mzh, string orgId); List getCfnmList(string mzh, string orgId); - /// - /// 获取挂号列表 - /// - /// - /// - /// - /// - /// - /// - IList GetPatRegList(string orgId, string appId, bool todayonly, string kh, string mzh, int[] ghzt = null); - /// - /// 获取待支付账单 - /// - /// - /// - /// - /// - IList PresUnpayQuery(string mzh, string appId, string orgId); - /// - /// 处方明细 - /// - /// - /// - /// - /// - /// - IList PresDetailQuery(string mzh, string cfnms, string appId, string orgId); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGTradUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGTradUploadDmnService.cs new file mode 100644 index 00000000..79f75e58 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGTradUploadDmnService.cs @@ -0,0 +1,19 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.IDomainServices.DRGManage +{ + public interface IDRGTradUploadDmnService + { + List GetList(string orgId, string kssj, string jssj, string scqk, string zyh,string tradiNumber); + int DRGUpload(string orgId, List list,string tradiNumber); + List GetListYp(string orgId, string kssj, string jssj, string scqk, string tradiNumber); + List GetListsqsz(string orgId, string kssj, string jssj, string scqk, string zyh, string tradiNumber); + List Getmxlist(string orgid, string zyh, string type); + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGUploadDmnService.cs new file mode 100644 index 00000000..a7d5a036 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DRGManage/IDRGUploadDmnService.cs @@ -0,0 +1,16 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.IDomainServices.DRGManage +{ + public interface IDRGUploadDmnService + { + List GetList(Pagination pagination, string orgId, string kssj, string jssj,string scqk,string zyh); + int DRGUpload(string orgId,List list); + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DaySettleManage/IDaySettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DaySettleManage/IDaySettleDmnService.cs index a14ca701..9eac1ff6 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DaySettleManage/IDaySettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/DaySettleManage/IDaySettleDmnService.cs @@ -63,7 +63,9 @@ public interface IDaySettleDmnService /// 开始日期 /// 结束日期 /// - IList GetQsdzzs(string organizeId, string ksrq, string jsrq); + IList GetQsdzzs(string organizeId, string ksrq, string jsrq, string qslx, string xz); + + int inserqssq(System.Xml.XmlDocument ybqssq, string orgid); /// /// 获取清算明细(上半部分) @@ -116,5 +118,14 @@ public interface IDaySettleDmnService IList lsdzList(string orgid, string ksrq, string jsrq); IList Newdzfysj(string orgid, string rq); - } + /// + /// 获取本地对账明细数据 + /// + /// + /// + /// + /// + IList GetHistoryCheckList(string orgid, string ksrq, string jsrq); + + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IDischargeSettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IDischargeSettleDmnService.cs index ad6e63a7..f8598a0b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IDischargeSettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IDischargeSettleDmnService.cs @@ -70,14 +70,6 @@ void SaveSett(InpatientSettPatInfoVO settpatInfo, InpatientSettleItemBO settleIt , CQZyjs05Dto ybfeeRelated, S14OutResponseDTO xnhfeeRelated , string outTradeNo,string jslx, out int jsnm); - /// - /// 获取按大类分组费用明细 - /// - /// - /// - /// - /// - IList GetHospGroupFeeDetailVOList(string zyh, string orgId, string sfdl); /// /// 获取按大类分组费用 /// @@ -86,7 +78,7 @@ void SaveSett(InpatientSettPatInfoVO settpatInfo, InpatientSettleItemBO settleIt /// IList GetHospGroupFeeVOList(string zyh, string orgId, string ver); /// - /// 获取按大类分组费用-明细费用分页 + /// 获取按大类分组费用-明细费用 /// /// /// @@ -226,5 +218,6 @@ UploadPrescriptionsInPut GetCQUploadFeeDetails(Pagination pagination, string mzh string ValialPartialUploadData(string zyh, string orgId, DateTime jssj); InpatIentFeeInfo GetCQAlreadyUploadFeeDetailsV2(string zyh, string orgId, DateTime jssj); #endregion + int CountLisIncompletezy(string orgId, string zyh); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IHospSettDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IHospSettDmnService.cs index 4bb8040d..f1dde4ff 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IHospSettDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/HospitalizationManage/IHospSettDmnService.cs @@ -2,7 +2,6 @@ using Newtouch.HIS.Domain.ValueObjects; using System; using System.Collections.Generic; -using System.Threading.Tasks; namespace Newtouch.HIS.Domain.IDomainServices { @@ -41,20 +40,21 @@ public interface IHospSettDmnService IList GetPaginationSettlementList(Pagination pagination, string organizeId, string keyword, string fph, DateTime? jsksrq, DateTime? jsjsrq); /// - /// + /// 待上传的自费结算病人信息 /// + /// /// - /// + /// + /// /// - IList SettlementDetailsQuery(string organizeId, int jsnm); - + IList GetPaginationZFSettlementList(Pagination pagination, string organizeId, string keyword, DateTime? jsksrq, DateTime? jsjsrq); /// - /// 病人分类收费汇总 + /// /// /// - /// + /// /// - Task> SettlementDetailsQueryAsync(string organizeId, string zyh); + IList SettlementDetailsQuery(string organizeId, int jsnm); /// /// @@ -72,17 +72,6 @@ public interface IHospSettDmnService /// /// IList SettlementDetailsItemsQuery(Pagination pagination, string zyh, string orgId, string sfdl, string jsnms, string mc); - #endregion - - /// - /// 计费项目明细 - /// - /// - /// - /// - /// - /// - /// - Task> HospItemFeeDetailQueryAsync(string organizeId, string zyh, DateTime sfrq, string dlCode = "", List dlCodes = null); + #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGTradUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGTradUploadDmnService.cs new file mode 100644 index 00000000..127372ad --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGTradUploadDmnService.cs @@ -0,0 +1,20 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtouch.HIS.Domain.DTO.OutputDto.JGManage; + +namespace Newtouch.HIS.Domain.IDomainServices.JGManage +{ + public interface IJGTradUploadDmnService + { + List GetList(string orgId, string kssj, string jssj, string scqk, string zyh,string tradiNumber); + int JGUpload(string orgId, List list,string tradiNumber); + List GetListYp(string orgId, string kssj, string jssj, string scqk, string tradiNumber); + List GetListsqsz(string orgId, string kssj, string jssj, string scqk, string zyh, string tradiNumber); + List Getmxlist(string orgid, string zyh, string type); + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGUploadDmnService.cs new file mode 100644 index 00000000..d0b775ab --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/JGManage/IJGUploadDmnService.cs @@ -0,0 +1,16 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.JGManage; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.IDomainServices.JGManage +{ + public interface IJGUploadDmnService + { + List GetList(Pagination pagination, string orgId, string kssj, string jssj,string scqk,string zyh); + int JGUpload(string orgId,List list); + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutBookDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutBookDmnService.cs index 1b99df7d..c1e1df4d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutBookDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutBookDmnService.cs @@ -1,10 +1,11 @@ using Newtouch.Core.Common; using System; using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; using Newtouch.HIS.Domain.Entity.OutpatientManage; -using Newtouch.HIS.Sett.Request.Booking.Response; -using Newtouch.HIS.Sett.Request.Booking.Request; namespace Newtouch.HIS.Domain.IDomainServices.OutpatientManage { @@ -15,7 +16,7 @@ public interface IOutBookDmnService void SaveDatapb(List pbList, string orgId); void SaveDatatzcz(Decimal ScheduId, string czzt, string orgId,string tzyy); string getStaffName(string gh); - OutBookVO getArrangeInfo(int ghpbId); + OutBookVO getArrangeInfo(int ghpbId,string orgId); OutBookDateVO getDateInfo(string organizeId, int ghpbId); IList getDateTimeInfo(string organizeId, int ghpbId,string timeslot); int UpdateArrange(OutBookArrangeVO entity, int ghpbId, string orgId, string User, DateTime Time); @@ -45,8 +46,7 @@ public interface IOutBookDmnService string PatBookGh(string cardNo, int ScheduId, string brxz, string Doctor, DateTime OutDate, string orgId); - MzAppointmentResp PatBookGh(MzAppointmentReq req); + int CancalBook(string BookId); - int CancalBook(MzAppointmentRecordReq req); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatChargeDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatChargeDmnService.cs index 5b76e84e..f9589b87 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatChargeDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatChargeDmnService.cs @@ -301,17 +301,8 @@ void PatsettDBInOptima(SettInAccOutpatDataVo outaddvo, /// /// IList GetAllUnSettedListListByMzh(string mzh, string orgId); - IList GetUnSettGhfByMzh(string mzh, string orgId); IList GetNewAllUnSettedListByMzh(string mzh, string cfnms, string orgId); /// - /// 获取待结账明细 对外接口版 - /// - /// - /// - /// - /// - IList GetNewAllUnSettedList(string mzh, string cfnms, string orgId); - /// /// 退费时再上传明细获取 /// /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientChargeQueryDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientChargeQueryDmnService.cs index 1a7d2d28..23f9ba6e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientChargeQueryDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientChargeQueryDmnService.cs @@ -24,7 +24,7 @@ public interface IOutPatientChargeQueryDmnService /// /// /// - IList SelectRegChargeQuery(Pagination pagination,string kh, string fph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd); + IList SelectRegChargeQuery(Pagination pagination, string kh, string fph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd); /// /// 查询收费项目 @@ -37,8 +37,17 @@ public interface IOutPatientChargeQueryDmnService /// /// /// - IList RegChargeQuery(Pagination pagination, string kh, string fph,string jsfph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd,string zxlsh); + IList RegChargeQuery(Pagination pagination, string kh, string fph, string jsfph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd, string zxlsh); + /// + /// 待上传的门诊自费病人结算信息 + /// + /// + /// + /// + /// + /// + IList ZFRegChargeQuery(Pagination pagination, string xm, DateTime? createTimestart, DateTime? createTimeEnd); /// /// 获取结算支付方式 /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientDmnService.cs index f96416e8..b745bf1a 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientDmnService.cs @@ -79,6 +79,14 @@ List GetIsMzghBookSchedule(Pagination pagination,string mzxl /// /// List GetOutpatientRegistScheduleList(string orgId, string keyword = null, int? ghpbId = null); + /// + /// 自助机获取挂号排班 + /// + /// + /// + /// + /// + List GetZzjRegScheduleList(DateTime pbrq, string orgId); #region 门诊记账 /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientSettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientSettleDmnService.cs index f74ba35a..bb0ddfce 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientSettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IOutPatientSettleDmnService.cs @@ -2,7 +2,6 @@ using Newtouch.HIS.Domain.DTO; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.ValueObjects; -using Newtouch.HIS.Domain.ValueObjects.DaySettleManage; using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; using System; using System.Collections.Generic; @@ -82,55 +81,7 @@ void Save(string orgId, int patid, string kh, string ghly, string mjzbz, , int ghpbId , OutpatientSettFeeRelatedDTO feeRelated, string brxz , string ybjsh, string mzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId, out object newJszbInfo); - - /// - /// 项目生成单独结算(未收费项目处理) - /// - /// - /// - /// - /// - /// - /// - int submitOutpatGhCharge(string orgId, string fph, DateTime? sfrq, OutpatientSettFeeRelatedDTO feeRelated, IList ghxmnmList); - /// - /// 不结算挂号接口 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - void UnSettSave(string orgId, int patid, string kh, string ghly, string mjzbz, - string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm, bool isCkf, bool isGbf - , int jzxh - , int ghpbId, string brxz - , string ybjsh, string mzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId, out object newJszbInfo); + , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId,string isjm, out object newJszbInfo); /// /// @@ -192,28 +143,14 @@ string GetRegMzh(int patid, string ghpbId, string ks, string OrganizeId, string /// /// /// - Tuple GetCQMzhJzxh(int patid, string ghpbId, string ks, string ys, string OrganizeId, string UserCode, string mjzbz, string QueueNo, string OutDate); - CqybGjbmInfoVo GetDepartmentDoctorIdC(string orgId, string ks, string ys); + Tuple GetCQMzhJzxh(int patid, string ghpbId, string ks, string ys, string OrganizeId, string UserCode,string mjzbz,string QueueNo,string OutDate); + CqybGjbmInfoVo GetDepartmentDoctorIdC(string orgId, string ks,string ys); List GetRegListJson(Inparameter inparameter, string orgid); - - List GetDailyFeeListByCreateCode(string orgId, string czr, DateTime kssj, DateTime jssj, string isJZ, string qsfph, string jsfph); - - List GetDailyFeeListOfDoneByCreateCode(string orgId, string czr, DateTime ksjzsj, DateTime jsjzsj); - - List GetDailyFeeList(string czr, string orgId); - /// - /// 获取当天可以撤销的交账数据 - /// - void CancelDailyFee(string Id); - - - /// - /// 转诊 + /// 获取医保就诊登记所需信息 /// /// - /// - /// - void submitReferralForm(int patid, string ks, string ys, string OrganizeId, string UserCode, int ghnm, string mzh, string zzyy, string ghpbId); + /// + CqybGjbmInfoVo GetYbjzdjVo(string mzh,string orgId); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IRefundDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IRefundDmnService.cs index 331771fd..f8db3957 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IRefundDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/OutpatientManage/IRefundDmnService.cs @@ -78,7 +78,7 @@ public interface IRefundDmnService /// /// /// - List GetBasicInfoSearchListInRegister(Pagination pagination, string blh, string xm, string orgId,string zjh); + List GetBasicInfoSearchListInRegister(Pagination pagination, string blh, string xm, string orgId,string zjh, string zjlx); /// /// 病人门诊登记,浮层查询病人信息 diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientCenter/IPatientCenterDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientCenter/IPatientCenterDmnService.cs index 8e8abad2..a0c9ba48 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientCenter/IPatientCenterDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientCenter/IPatientCenterDmnService.cs @@ -1,4 +1,5 @@ using Newtouch.Core.Common; +using Newtouch.Core.Common; using Newtouch.HIS.Domain.ReportTemplateVO; using Newtouch.HIS.Domain.ValueObjects; using Newtouch.HIS.Domain.ValueObjects.PatientManage; @@ -14,8 +15,7 @@ public interface IPatientCenterDmnService { #region 患者信息 HosPatientVo PatBrxzInfo(string patid, string orgId); - List InHosPatientBasic(string zyh, string zjh, int? zybz, string orgId, string kh = ""); - PatientCenterVO PatientBasic(string zyh, string mzh, string keyword, string blh, string orgId, string ywlx, string kh = "", string zjh = ""); + PatientCenterVO PatientBasic(string zyh, string mzh, string keyword, string blh, string orgId, string ywlx); IList InHospitalHistory(string patid, string zyh, string orgId); HosPatientVo InHospitalDoctorInfo(string zyh, string orgId, ref HosPatientVo patvo); IList InHospitalSett(string zyh, string jsxz, string orgId); @@ -66,45 +66,5 @@ public interface IPatientCenterDmnService PatientSettleHisVO InHospitalSettbyJsnm(string jsnm,string settid,string orgId); PatientSettleHisVO MedInsurSettbyId(string settId); #endregion - - #region 门诊 - /// - /// 查询挂号记录 - /// - /// - /// - /// - /// - /// - /// - /// - IList GetPatRegList(string orgId, string appId, bool todayonly, string kh, string mzh, int[] ghzt = null); - #endregion - - #region 报告 - /// - /// 报告列表 - /// - /// - /// - /// - /// - /// - /// - /// - /// - List OutPatReportList(string kh, string mzh, string sqdzt, int cflx, string appId, string orgId); - List InHosPatReportList(string kh, string zyh, string sqdzt, int cflx, string appId, string orgId); - /// - /// 检验报表详情 - /// - /// - /// - /// - /// - /// - /// - PatLisReportDetail PatLisReportDetail(string sqdh, string xmdm, string ywlx, string appId, string orgId); - #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientManage/IPatientBasicInfoDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientManage/IPatientBasicInfoDmnService.cs index d5e34933..5ead5a04 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientManage/IPatientBasicInfoDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/PatientManage/IPatientBasicInfoDmnService.cs @@ -122,7 +122,6 @@ List OutPatientRegistrationQuery( , string mjzbz = null , string jiuzhenbz = null , string keyword = null - , string zzhz = null , Pagination pagination = null); /// @@ -218,6 +217,7 @@ bool InpatientZFchangetoXNH(string orgId, string zyh, HosPatZFToXNHVO cardInfo, /// void InpatientYBchangetoZF(string orgId, string zyh, int patid); + string GetUpqdScData(string kssj, string jssj); #region 新农合 SysHosBasicInfoVO GetZfToXnhPatInfo(string zyh, string orgId); @@ -239,11 +239,20 @@ bool InpatientZFchangetoXNH(string orgId, string zyh, HosPatZFToXNHVO cardInfo, #region 重庆医保 Input_Bbrxx GetCQjzdjInfo(string zyh, string orgId); - void InPatZFchangetoYB(string orgId, string zyh, int patid, ZYToYBDto patInfo, CqybMedicalReg02Entity ryblInfo); + + void InPatZFchangetoYB(string orgId, string zyh, int patid, ZYToYBDto patInfo, CqybMedicalReg02Entity ryblInfo); void OutPatZFchangetoYB(string orgId, string mzh, int patid, ZYToYBDto patInfo); void UpdateCqybOut02(string zyh,string orgId); #endregion + #region 重庆医保 + Input_Bbrxx GetQHDjzdjInfo(string zyh, string orgId); + + string GetQHDTFDate(string zyh, string orgId); + + string GetQHDSzshData(string zyh, string orgId); + #endregion + #region 医保业务 /// /// 是否首次就诊 @@ -301,5 +310,19 @@ bool InpatientZFchangetoXNH(string orgId, string zyh, HosPatZFToXNHVO cardInfo, bool updateZybrxxkExpandZhye(string zyh, string organizeId, decimal? zhye); List GetksZzdList(string orgid); + + /// + /// 基金结算清单上传查询 + /// + /// + /// + /// + /// + /// + /// + /// + /// + IList GetSettlementList(string orgId, string sczt, string tjzt, string keyword = null, Pagination pagination = null, DateTime? cykssj = null, DateTime? cyjssj = null); + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/ReportManage/IReportCommonDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/ReportManage/IReportCommonDmnService.cs index a9e09e74..30dc63da 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/ReportManage/IReportCommonDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/ReportManage/IReportCommonDmnService.cs @@ -1,4 +1,5 @@ -using Newtouch.HIS.Domain.Entity; +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.ValueObjects; using Newtouch.HIS.Domain.ValueObjects.ReportManage; using System; @@ -44,6 +45,12 @@ void SubmitMonthReportData(string orgId, string curOprCode, int year, int month, YBSBMX_DCdbfVO yBSBMX_DCdbfs(string types, string ksrq, string jsrq, string orgid); - - } + IList Getsfxm(Pagination pagination, string xzstr,string py,string sfdl,string orgId); + IList GetJyjlData(Pagination pagination, string ksrq, string jsrq, string orgId); + IList GetJyjlDatatotxt(string ksrq, string jsrq, string orgId); + IList GetMjzdbghData(Pagination pagination, string ksrq, string jsrq, string orgId); + IList GetYbMjzdbghtxt(string ksrq, string jsrq, string orgId); + IList GetMjzjcsfData(Pagination pagination, string ksrq, string jsrq, string orgId); + IList GetMjzjcsfDatatxt(string ksrq, string jsrq, string orgId); + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/SystemManage/ISysFinancialDmnService.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/SystemManage/ISysFinancialDmnService.cs index d9cf2221..73e236b5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/SystemManage/ISysFinancialDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IDomainServices/SystemManage/ISysFinancialDmnService.cs @@ -2,7 +2,6 @@ using Newtouch.HIS.Domain.ValueObjects.SystemManage; using Newtouch.Core.Common; using Newtouch.HIS.Domain.Entity; -using System; namespace Newtouch.HIS.Domain.IDomainServices { @@ -14,18 +13,8 @@ public interface ISysFinancialDmnService /// /// /// - IList GetFinancialInvoiceList(string keyValue, string OrganizeId, string zt = "1"); + IList GetFinancialInvoiceList(string keyValue, string OrganizeId); - IList GetCwfpList(string keyValue, string lyry, string OrganizeId); - - /// - /// 查询发票详情 - /// - /// - /// - /// - /// - /// - IList InvoiceQueryList(DateTime kssj, DateTime jssj, string orgId, string creatorCode); + IList GetCwfpList(string keyValue, string OrganizeId); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/HospitalizationManage/IHospDrugBillingRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/HospitalizationManage/IHospDrugBillingRepo.cs index f7385a19..db7ba5a8 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/HospitalizationManage/IHospDrugBillingRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/HospitalizationManage/IHospDrugBillingRepo.cs @@ -19,5 +19,6 @@ public interface IHospDrugBillingRepo : IRepositoryBase void ExecPartialSettleFeeDetail(string zyh,string jsnm,string czlx); void Updatezy_brxxexpand(string OrganizeId, string zyh); + void Updatezyaddfee(string OrganizeId, decimal sl, string yfbm, string ypdm); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookRepo.cs index d0e1f001..cc68967d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookRepo.cs @@ -10,8 +10,8 @@ namespace Newtouch.HIS.Domain.IRepository.OutpatientManage public interface IOutBookRepo { int UpdateForm(int keyValue,string orgId,string ks, string gh,string CreateCode, DateTime CreateTime); - IList getStaffByKs(string ks); - int updateZt(string ks, string CreateCode, DateTime CreateTime); + IList getStaffByKs(string ks,string orgId); + int updateZt(string ks, string CreateCode, DateTime CreateTime,string orgId); int SubmitForm(string orgId, string ks, string gh, string CreateCode, DateTime CreateTime); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookScheduleRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookScheduleRepo.cs index 0888e3f0..80f93360 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookScheduleRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutBookScheduleRepo.cs @@ -3,27 +3,16 @@ using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; using System; using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Domain.IRepository.OutpatientManage { public interface IOutBookScheduleRepo : IRepositoryBase { IList GetPagintionList(Pagination pagination, string orgId, DateTime time); - IList GetPagintionListTime(string orgId, string kssj, string jssj, string ys, string czztcx, string ScheduId, string ks, string lx, string isbook); - /// - /// 排班分页 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - IList GetPagintionListTime(Pagination pagination, string orgId, string kssj, string jssj, string ys, string czztcx, string ScheduId, string ks, string lx, string isbook, out Pagination paging); + IList GetPagintionListTime(string orgId,string kssj,string jssj,string ys,string czztcx, string ScheduId, string ks, string lx); int ExecSchedule(); /// /// 项目组合排班 diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutpatientRegistRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutpatientRegistRepo.cs index 2dd9471f..410167a8 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutpatientRegistRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/OutpatientManage/IOutpatientRegistRepo.cs @@ -1,6 +1,5 @@  using System.Collections.Generic; -using Newtouch.HIS.Domain.DTO.InputDto; using Newtouch.HIS.Domain.Entity; namespace Newtouch.HIS.Domain.IRepository @@ -20,13 +19,6 @@ public interface IOutpatientRegistRepo : IRepositoryBase /// /// OutpatientRegistEntity SelectData(string mzh, string orgId); - /// - /// 根据门诊号获取患者信息 - /// - /// - /// - /// - OutpatAccInfoDto GetBasicInfoPatInfoInRegister(string mzh, string orgId); List SelectOutPatientRegList(List ghnmList, string orgId); @@ -61,6 +53,7 @@ public interface IOutpatientRegistRepo : IRepositoryBase /// /// bool AllowRegh(string blh, string orgId); + int UpdatePatPhone(string patid, string phone, string userCode, string organizeId); /// /// 取消挂号 /// @@ -92,6 +85,23 @@ public interface IOutpatientRegistRepo : IRepositoryBase /// /// void updatePatBrxzInfo(string orgId, string mzh, string brxz); + /// + /// 门诊挂号不进行医保登记 收费时进行登记跟新自费卡为医保卡 + /// + /// + /// + /// + /// + /// + void UpdateChargeMzghInfo(string orgId, string mzh, string kh,string cardtype, string brxz,string zjh,string status); + /// + /// 更新挂号医保就诊id流水号 + /// + /// + /// + /// + /// + void updateYbghjzId(string orgId, string mzh, string jzId, string jzpzlx); /// /// 记录补偿序号 @@ -102,6 +112,5 @@ public interface IOutpatientRegistRepo : IRepositoryBase /// /// int RecordOutpId(string mzh, string outpId, string userCode, string organizeId); - int UpdatePatPhone(string patid, string phone, string userCode, string organizeId); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/PatientManage/IG_yb_daysrg_trt_list_bRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/PatientManage/IG_yb_daysrg_trt_list_bRepo.cs new file mode 100644 index 00000000..3032a268 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/PatientManage/IG_yb_daysrg_trt_list_bRepo.cs @@ -0,0 +1,120 @@ +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.Entity.PatientManage; +using Newtouch.HIS.Domain.ReportTemplateVO; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.IRepository.PatientManage +{ + public interface IG_yb_daysrg_trt_list_bRepo : IRepositoryBase + { + /// + /// 医保日间手术治疗目录表 + /// + /// + /// + /// + IList G_yb_daysrg_trt_list_b(string tbname); + /// + /// 诊断目录表 + /// + /// + /// + /// + IList G_yb_diag_list_b(string tbname); + /// + /// 医保按病种结算目录表 + /// + /// + /// + /// + IList G_yb_dise_setl_list_b(string tbname); + /// + /// 耗材信息表 + /// + /// + /// + /// + IList G_yb_mcs_info_b(string tbname); + /// + /// 手术操作分类和代码表 + /// + /// + /// + /// + IList G_yb_oprn_std_b(string tbname); + /// + /// 医保门慢门特病种目录表 + /// + /// + /// + /// + IList G_yb_opsp_dise_list_b(string tbname); + /// + /// 自制剂信息表 + /// + /// + /// + /// + IList G_yb_selfprep_info_b(string tbname); + /// + /// 中医诊断表 + /// + /// + /// + /// + IList G_yb_tcm_diag_b(string tbname); + /// + /// 中草药信息表 + /// + /// + /// + /// + IList G_yb_tcmherb_info_b(string tbname); + /// + /// 中医证候分类表 + /// + /// + /// + /// + IList G_yb_tcmsymp_type_b(string tbname); + /// + /// 肿瘤形态学表 + /// + /// + /// + /// + IList G_yb_tmor_mpy_b(string tbname); + /// + /// 医疗服务项目表 + /// + /// + /// + /// + IList G_yb_trt_serv_b(string tbname); + /// + /// 西药中成药信息表 + /// + /// + /// + /// + IList G_yb_wm_tcmpat_info_b(Pagination pagination, string tbname); + + /// + /// 目录查询公共方法 + /// + /// + /// + /// + IList Get_G_yb_mluCommon_Info(Pagination pagination, string mlbh,string key); + + string Header(string tbname); + + void DataListSQl(string tbname, string path); + List DataListSQl_V2(string tbname, string path); + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/IFinancialInvoiceRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/IFinancialInvoiceRepo.cs index d2ac5a70..43badf61 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/IFinancialInvoiceRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/IFinancialInvoiceRepo.cs @@ -40,7 +40,7 @@ public interface IFinancialInvoiceRepo : IRepositoryBase /// /// /// - FinancialInvoiceEntity GetFinancialInvoiceEntity(string fpdm, string orgId); + FinancialInvoiceEntity GetFinancialInvoiceEntity(string fpdm,string orgId); /// /// 保存 @@ -56,12 +56,6 @@ public interface IFinancialInvoiceRepo : IRepositoryBase /// void DeleteForm(string fpdm, string orgId); - /// - /// 验证数据合法性 - /// - /// - /// - /// void VlidateRepeat(FinancialInvoiceEntity entity, string orgId, string Id); - } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/ITreatmentportfolioRepo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/ITreatmentportfolioRepo.cs index 438e5fea..f2a45131 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/ITreatmentportfolioRepo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/IRepository/SystemManage/ITreatmentportfolioRepo.cs @@ -16,47 +16,49 @@ public interface ITreatmentportfolioRepo : IRepositoryBase /// - //void Insert( string OrganizeId,string zhmc, string zhcode, string ord, string zlxm, string zlxmmc, string price, string zlxmpy, string zhje); void ADDInsert(TreatmentportfolioEntity entity, string keyValue); - /// - /// 加载数据 + /// 删除收费项目组合 /// - /// - //IList Listselect(); - - //IList Keyword(string keyword); - - //IList Loginview(); - - - - IList selectid(TreatmentportfolioEntity entity, string keyValue); - - - - void Updatexg(TreatmentportfolioEntity entity, string keyValue); - - - void deleteid(string keyValue); - - void deletemc(string keyValue,string zhcodemc); + /// + void deleteid(string keyValue, string orgId); + /// + /// 删除收费组合中明细 + /// + /// + /// + void deletemc(string keyValue, string zhcodemc, string orgId); + /// + /// 保存收费项目组合 + /// + /// void ADDrowdata(TreatmentportfolioEntity entity); - - IList TJchaxun(string zhcodetj,string sfxmmc123); - - IList Codecx(TreatmentportfolioEntity entity, string zhcode); - - - - string sfdlcx(string sfxmmc123); - - - IList Loginview(Pagination pagination); - IList Keyword(Pagination pagination,string keyword); + /// + /// 是否已存在收费项目组合 + /// + /// + /// + /// + /// + IList TJchaxun(string zhcodetj, string sfxmmc123, string orgId); + /// + /// 获取修改收费项目组合 + /// + /// + /// + /// + IList Codecx(string orgId, string zhcode); + /// + /// 查询收费项目组合 + /// + /// + /// + /// + /// + IList Keyword(Pagination pagination, string keyword, string orgId); } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/Newtouch.HIS.Domain.csproj b/Newtouch.HIS.Sett/Newtouch.Domain/Newtouch.HIS.Domain.csproj index 563d4111..cc157c66 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/Newtouch.HIS.Domain.csproj +++ b/Newtouch.HIS.Sett/Newtouch.Domain/Newtouch.HIS.Domain.csproj @@ -9,7 +9,7 @@ Properties Newtouch.HIS.Domain Newtouch.HIS.Domain - v4.6 + v4.6.2 512 @@ -71,7 +71,6 @@ - @@ -94,7 +93,6 @@ - @@ -113,6 +111,9 @@ + + + @@ -121,6 +122,9 @@ + + + @@ -175,11 +179,9 @@ - - - + @@ -191,7 +193,6 @@ - @@ -205,6 +206,7 @@ + @@ -231,13 +233,15 @@ + + - - + + @@ -282,11 +286,6 @@ - - - - - @@ -295,6 +294,8 @@ + + @@ -303,6 +304,7 @@ + @@ -335,7 +337,21 @@ + + + + + + + + + + + + + + @@ -420,10 +436,6 @@ - - - - @@ -434,13 +446,8 @@ - - - - - - + @@ -472,17 +479,10 @@ - - - - - - - @@ -571,7 +571,6 @@ - @@ -579,6 +578,9 @@ + + + diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_daysrg_trt_list_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_daysrg_trt_list_bVO.cs new file mode 100644 index 00000000..14f9f029 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_daysrg_trt_list_bVO.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 医保日间手术治疗目录表 + /// + public class G_yb_daysrg_trt_list_bVO + { + /// + /// 日间手术治疗目录ID + /// + public string DAYSRG_TRT_LIST_ID { get; set; } + /// + /// 日间手术病种目录代码 + /// + public string DAYSRG_DISE_LIST_CODE { get; set; } + /// + /// 日间手术病种名称 + /// + public string DAYSRG_DISE_NAME { get; set; } + /// + /// 有效标志 + /// + public string VALI_FLAG { get; set; } + /// + /// 数据唯一记录号 + /// + public string RID { get; set; } + + /// + /// 数据创建时间 + /// + public DateTime CRTE_TIME { get; set; } + /// + /// 数据更新时间 + /// + public DateTime UPDT_TIME { get; set; } + ///// + ///// 创建人ID + ///// + //public string CRTER_ID { get; set; } + ///// + ///// 创建人姓名 + ///// + //public string CRTER_NAME { get; set; } + ///// + ///// 创建机构编号 + ///// + //public string CRTE_OPTINS_NO { get; set; } + ///// + ///// 经办人ID + ///// + //public string OPTER_ID { get; set; } + ///// + ///// 经办人姓名 + ///// + //public string OPTER_NAME { get; set; } + ///// + ///// 经办时间 + ///// + //public DateTime OPT_TIME { get; set; } + ///// + ///// 经办机构编号 + ///// + //public string OPTINS_NO { get; set; } + /// + /// 版本号 + /// + public string VER { get; set; } + /// + /// 病种内涵 + /// + public string DISE_CONT { get; set; } + /// + /// 备注 + /// + public string MEMO { get; set; } + /// + /// 版本名称 + /// + public string VER_NAME { get; set; } + /// + /// 诊疗指南页码 + /// + public string TRT_GUIDE_PAGEN { get; set; } + /// + /// 诊疗指南电子档案 + /// + public string TRT_GUIDE_ELECACS { get; set; } + /// + /// 限定手术操作代码 + /// + public string QUA_OPRN_OPRT_CODE { get; set; } + /// + /// 限定手术操作名称 + /// + public string QUA_OPRN_OPRT_NAME { get; set; } + ///// + ///// 下发标志 + ///// + //public string ISU_FLAG { get; set; } + ///// + ///// 传输数据ID + ///// + //public string TRAM_DATA_ID { get; set; } + ///// + ///// 生效时间 + ///// + //public DateTime? EFFT_TIME { get; set; } + ///// + ///// 失效时间 + ///// + //public DateTime? INVD_TIME { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_diag_list_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_diag_list_bVO.cs new file mode 100644 index 00000000..22aabf74 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_diag_list_bVO.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 诊断目录表 + /// + public class G_yb_diag_list_bVO + { + // 诊断目录ID + public string DIAG_LIST_ID { get; set; } + + // 章 + public string CPR { get; set; } + // 章代码范围 + public string CPR_CODE_SCP { get; set; } + // 章名称 + public string CPR_NAME { get; set; } + // 节代码范围 + public string SEC_CODE_SCP { get; set; } + // 节名称 + public string SEC_NAME { get; set; } + // 类目代码 + public string CGY_CODE { get; set; } + // 类目名称 + public string CGY_NAME { get; set; } + // 亚目代码 + public string SOR_CODE { get; set; } + // 亚目名称 + public string SOR_NAME { get; set; } + // 诊断代码 + public string DIAG_CODE { get; set; } + // 诊断名称 + public string DIAG_NAME { get; set; } + // 使用标记 + public string USED_STD { get; set; } + // 国标版诊断代码 + public string NATSTD_DIAG_CODE { get; set; } + // 国标版诊断名称 + public string NATSTD_DIAG_NAME { get; set; } + // 临床版诊断代码 + public string CLNC_DIAG_CODE { get; set; } + // 临床版诊断名称 + public string CLNC_DIAG_NAME { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_dise_setl_list_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_dise_setl_list_bVO.cs new file mode 100644 index 00000000..767a2d72 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_dise_setl_list_bVO.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 医保按病种结算目录表 + /// + public class G_yb_dise_setl_list_bVO + { + // 病种结算目录ID + public string DISE_SETL_LIST_ID { get; set; } + // 按病种结算病种目录代码 + public string BYDISE_SETL_LIST_CODE { get; set; } + // 按病种结算病种名称 + public string BYDISE_SETL_DISE_NAME { get; set; } + // 限定手术操作代码 + public string QUA_OPRN_OPRT_CODE { get; set; } + // 限定手术操作名称 + public string QUA_OPRN_OPRT_NAME { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 病种内涵 + public string DISE_CONT { get; set; } + // 备注 + public string MEMO { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 诊疗指南页码 + public string TRT_GUIDE_PAGEN { get; set; } + // 诊疗指南电子档案 + public string TRT_GUIDE_ELECACS { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_mcs_info_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_mcs_info_bVO.cs new file mode 100644 index 00000000..761ff83f --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_mcs_info_bVO.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 耗材信息表 + /// + public class G_yb_mcs_info_bVO + { + // 医疗目录编码 + public string MED_LIST_CODG { get; set; } + // 耗材名称 + public string MCS_NAME { get; set; } + // 医疗器械唯一标识码 + public string UDI { get; set; } + // 医保通用名代码 + public string HI_GENNAME_CODE { get; set; } + // 医保通用名 + public string HI_GENNAME { get; set; } + // 产品型号 + public string PROD_MOL { get; set; } + // 规格代码 + public string SPEC_CODE { get; set; } + // 规格 + public string SPEC { get; set; } + // 耗材分类 + public string MCS_TYPE { get; set; } + // 规格型号 + public string SPEC_MOL { get; set; } + // 材质代码 + public string MATL_CODE { get; set; } + // 耗材材质 + public string MCS_MATL { get; set; } + // 包装规格 + public string PACSPEC { get; set; } + // 包装数量 + public string PAC_CNT { get; set; } + // 产品包装材质 + public string PROD_PACMATL { get; set; } + // 包装单位 + public string PACUNT { get; set; } + // 产品转换比 + public string PROD_CONVRAT { get; set; } + // 最小使用单位 + public string MIN_USEUNT { get; set; } + // 生产地类别 + public string PRODPLAC_TYPE { get; set; } + // 生产地类别名称 + public string PRODPLAC_TYPE_NAME { get; set; } + // 产品标准 + public string PRODSTRD { get; set; } + // 产品有效期 + public string PRODEXPY { get; set; } + // 性能结构与组成 + public string PERF_STRU_COMP { get; set; } + // 适用范围 + public string APB_SCP { get; set; } + // 产品使用方法 + public string PROD_ISTR { get; set; } + // 产品图片编号 + public string PROD_IMG_NO { get; set; } + // 产品质量标准 + public string PROD_QLT_STD { get; set; } + // 说明书 + public string MANL { get; set; } + // 其他证明材料 + public string OTH_CERT_MATL { get; set; } + // 专机专用标志 + public string SPED_FLAG { get; set; } + // 专机名称 + public string SPED_NAME { get; set; } + // 组套名称 + public string COMB_NAME { get; set; } + // 机套标志 + public string CASE_FLAG { get; set; } + // 限制使用标志 + public string LMT_USED_FLAG { get; set; } + // 医保限用范围 + public string HI_LMT_SCP { get; set; } + // 最小销售单位 + public string MIN_SALUNT { get; set; } + // 高值耗材标志 + public string HIGHVAL_MCS_FLAG { get; set; } + // 医用材料分类代码 + public string MATL_TYPE_CODE { get; set; } + // 植入材料和人体器官标志 + public string IMPT_MATL_HMORGN_FLAG { get; set; } + // 灭菌标志 + public string STLZ_FLAG { get; set; } + // 灭菌标志名称 + public string STLZ_FLAG_NAME { get; set; } + // 植入或介入类标志 + public string IMPT_ITVT_CLSS_FLAG { get; set; } + // 植入或介入类名称 + public string IMPT_ITVT_CLSS_NAME { get; set; } + // 一次性使用标志 + public string DSPO_USED_FLAG { get; set; } + // 一次性使用标志名称 + public string DSPO_USED_FLAG_NAME { get; set; } + // 注册备案人名称 + public string REGER_NAME { get; set; } + // 开始日期 + public DateTime? BEGNDATE { get; set; } + // 结束日期 + public DateTime? ENDDATE { get; set; } + // 医疗器械管理类别 + public string MED_EQU_MGT_TYPE { get; set; } + // 医疗器械管理类别名称 + public string MED_EQU_MGT_TYPE_NAME { get; set; } + // 注册备案号 + public string REG_FIL_NO { get; set; } + // 注册备案产品名称 + public string REG_FIL_PROD_NAME { get; set; } + // 结构及组成 + public string STRU_COMP { get; set; } + // 其他内容 + public string OTH_CONT { get; set; } + // 批准日期 + public DateTime? APRV_DATE { get; set; } + // 注册备案人住所 + public string REGER_ADDR { get; set; } + // 注册证有效期开始时间 + public DateTime? REGCERT_EXPY_BEGNTIME { get; set; } + // 注册证有效期结束时间 + public DateTime? REGCERT_EXPY_ENDTIME { get; set; } + // 生产企业代码 + public string PRODENTP_CODE { get; set; } + // 生产企业名称 + public string PRODENTP_NAME { get; set; } + // 生产地址 + public string MANU_ADDR { get; set; } + // 代理人企业 + public string AGNT_ENTP { get; set; } + // 代理人企业地址 + public string AGNT_ENTP_ADDR { get; set; } + // 生产国或地区 + public string MANU_NAT_REGN { get; set; } + // 售后服务机构 + public string AFTSAL_SERINS { get; set; } + // 注册或备案证电子档案 + public string REG_FIL_ELEC_FILE { get; set; } + // 产品影像 + public string PROD_IMG { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_oprn_std_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_oprn_std_bVO.cs new file mode 100644 index 00000000..98c15284 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_oprn_std_bVO.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 手术操作分类和代码表 + /// + public class G_yb_oprn_std_bVO + { + // 手术标准目录ID + public string OPRN_STD_LIST_ID { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 章 + public string CPR { get; set; } + // 章代码范围 + public string CPR_CODE_SCP { get; set; } + // 章名称 + public string CPR_NAME { get; set; } + // 类目代码 + public string CGY_CODE { get; set; } + // 类目名称 + public string CGY_NAME { get; set; } + // 亚目代码 + public string SOR_CODE { get; set; } + // 亚目名称 + public string SOR_NAME { get; set; } + // 细目代码 + public string DTLS_CODE { get; set; } + // 细目名称 + public string DTLS_NAME { get; set; } + // 手术操作代码 + public string OPRN_OPRT_CODE { get; set; } + // 手术操作名称 + public string OPRN_OPRT_NAME { get; set; } + // 使用标记 + public string USED_STD { get; set; } + // 团标版手术操作代码 + public string RTL_OPRN_OPRT_CODE { get; set; } + // 团标版手术操作名称 + public string RTL_OPRN_OPRT_NAME { get; set; } + // 临床版手术操作代码 + public string CLNC_OPRN_OPRT_CODE { get; set; } + // 临床版手术操作名称 + public string CLNC_OPRN_OPRT_NAME { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_opsp_dise_list_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_opsp_dise_list_bVO.cs new file mode 100644 index 00000000..27bada51 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_opsp_dise_list_bVO.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 医保门慢门特病种目录表 + /// + public class G_yb_opsp_dise_list_bVO + { + // 门慢门特病种目录代码 + public string OPSP_DISE_CODE { get; set; } + // 门慢门特病种大类名称 + public string OPSP_DISE_MAJCLS_NAME { get; set; } + // 门慢门特病种细分类名称 + public string OPSP_DISE_SUBD_CLSS_NAME { get; set; } + // 医保区划 + public string ADMDVS { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime? OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 病种内涵 + public string DISE_CONT { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 诊疗指南页码 + public string TRT_GUIDE_PAGEN { get; set; } + // 诊疗指南电子档案 + public string TRT_GUIDE_ELECACS { get; set; } + // 门慢门特病种名称 + public string OPSP_DISE_NAME { get; set; } + // 门慢门特病种大类代码 + public string OPSP_DISE_MAJCLS_CODE { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_selfprep_info_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_selfprep_info_bVO.cs new file mode 100644 index 00000000..ffee73c3 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_selfprep_info_bVO.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 自制剂信息表 + /// + public class G_yb_selfprep_info_bVO + { + // 医疗目录编码 + public string MED_LIST_CODG { get; set; } + // 药品商品名 + public string DRUG_PRODNAME { get; set; } + // 别名 + public string ALIS { get; set; } + // 英文名称 + public string ENG_NAME { get; set; } + // 剂型 + public string DOSFORM { get; set; } + // 剂型名称 + public string DOSFORM_NAME { get; set; } + // 注册剂型 + public string REG_DOSFORM { get; set; } + // 成分 + public string ING { get; set; } + // 功能主治 + public string EFCC_ATD { get; set; } + // 性状 + public string CHRT { get; set; } + // 药品规格 + public string DRUG_SPEC { get; set; } + // 药品规格代码 + public string DRUG_SPEC_CODE { get; set; } + // 注册规格 + public string REG_SPEC { get; set; } + // 注册规格代码 + public string REG_SPEC_CODE { get; set; } + // 给药途径 + public string RUTE { get; set; } + // 贮藏 + public string STOG { get; set; } + // 使用频次 + public string USED_FRQU { get; set; } + // 每次用量 + public string EACH_DOS { get; set; } + // 药品类别 + public string DRUG_TYPE { get; set; } + // 药品类别名称 + public string DRUG_TYPE_NAME { get; set; } + // 非处方药标志 + public string OTC_FLAG { get; set; } + // 非处方药标志名称 + public string OTC_FLAG_NAME { get; set; } + // 包装材质 + public string PACMATL { get; set; } + // 包装材质名称 + public string PACMATL_NAME { get; set; } + // 包装规格 + public string PACSPEC { get; set; } + // 说明书 + public string MANL { get; set; } + // 包装数量 + public string PAC_CNT { get; set; } + // 最小使用单位 + public string MIN_USEUNT { get; set; } + // 最小销售单位 + public string MIN_SALUNT { get; set; } + // 最小计量单位 + public string MIN_UNT { get; set; } + // 最小包装数量 + public int? MIN_PAC_CNT { get; set; } + // 最小包装单位 + public string MIN_PACUNT { get; set; } + // 最小制剂单位 + public string MIN_PREPUNT { get; set; } + // 最小制剂单位名称 + public string MIN_PREPUNT_NAME { get; set; } + // 药品有效期 + public string DRUG_EXPY { get; set; } + // 最小计价单位 + public string MIN_PRCUNT { get; set; } + // 不良反应 + public string DEFS { get; set; } + // 注意事项 + public string MNAN { get; set; } + // 禁忌 + public string TABO { get; set; } + // 生产企业代码 + public string PRODENTP_CODE { get; set; } + // 生产企业名称 + public string PRODENTP_NAME { get; set; } + // 生产企业地址 + public string PRODENTP_ADDR { get; set; } + // 特殊限价药品标志 + public string SP_LMTPRIC_DRUG_FLAG { get; set; } + // 批准文号 + public string APRVNO { get; set; } + // 批准文号开始日期 + public DateTime? APRVNO_BEGNDATE { get; set; } + // 批准文号结束日期 + public DateTime? APRVNO_ENDDATE { get; set; } + // 药品注册证编号 + public string DRUG_REGNO { get; set; } + // 药品注册证号开始日期 + public DateTime? DRUG_REGCERT_BEGNDATE { get; set; } + // 药品注册证号结束日期 + public DateTime? DRUG_REGCERT_ENDDATE { get; set; } + // 转换比 + public int? CONVRAT { get; set; } + // 限制使用范围 + public string LMT_USESCP { get; set; } + // 最小包装单位名称 + public string MINPACUNT_NAME { get; set; } + // 注册名称 + public string REG_NAME { get; set; } + // 分包装厂家 + public string SUBPCK_FCTY { get; set; } + // 市场状态 + public string MKT_STAS { get; set; } + // 药品注册批件电子档案 + public string DRUG_REG_APPVLETR_ELECACS { get; set; } + // 药品补充申请批件电子档案 + public string SPLM_APPY_APPVLETR_FILE { get; set; } + // 国家医保药品目录编号 + public string NAT_HI_DRUGLIST_NO { get; set; } + // 国家医保药品目录备注 + public string NAT_HI_DRUGLIST_MEMO { get; set; } + // 增值税调整药品标志 + public string ADVALTAX_ADJM_DRUG_FLAG { get; set; } + // 增值税调整药品名称 + public string ADVALTAX_ADJM_DRUG_NAME { get; set; } + // 上市药品目录集药品 + public string LSTD_DRUGLIST_DRUG { get; set; } + // 卫健委药品编码 + public string NHC_DRUG_CODG { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 开始时间 + public DateTime? BEGNTIME { get; set; } + // 结束时间 + public DateTime? ENDTIME { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 自制剂许可证号 + public string SELFPREP_PMTNO { get; set; } + // 儿童用药 + public string CHLD_MEDC { get; set; } + // 老年患者用药 + public string ELD_PATN_MEDC { get; set; } + // 医疗机构联系人姓名 + public string MEDINS_CONER_NAME { get; set; } + // 医疗机构联系人电话 + public string MEDINS_CONER_TEL { get; set; } + // 自制剂许可证电子档案 + public string SELFPREP_PMTNO_ELECACS { get; set; } + //// 所在地区 + //public string REGN { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + //// 医院制剂申请人单位名称 + //public string HOSP_PREP_APPYER_EMP_NAME { get; set; } + //// 医院制剂申请人单位地址 + //public string HOSP_PREP_APPYER_EMP_ADDR { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcm_diag_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcm_diag_bVO.cs new file mode 100644 index 00000000..07987090 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcm_diag_bVO.cs @@ -0,0 +1,69 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 中医诊断表 + /// + public class G_yb_tcm_diag_bVO + { + // 中医诊断ID + public string TCM_DIAG_ID { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 科别类目代码 + public string CATY_CGY_CODE { get; set; } + // 科别类目名称 + public string CATY_CGY_NAME { get; set; } + // 专科系统分类目代码 + public string SPCY_SYS_TAXA_CODE { get; set; } + // 专科系统分类目名称 + public string SPCY_SYS_TAXA_NAME { get; set; } + // 病种类型代码 + public string DISE_TYPE_CODE { get; set; } + // 病种类型名称 + public string DISE_TYPE_NAME { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmherb_info_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmherb_info_bVO.cs new file mode 100644 index 00000000..53e6b8fb --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmherb_info_bVO.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 中草药信息表 + /// + public class G_yb_tcmherb_info_bVO + { + // 医疗目录编码 + public string MED_LIST_CODG { get; set; } + // 中草药名称 + public string TCMHERB_NAME { get; set; } + // 单复方标志 + public string CPND_FLAG { get; set; } + // 质量等级 + public string QLT_REG { get; set; } + // 中草药年份 + public string TCMHERB_YEAR { get; set; } + // 药用部位 + public string MED_PART { get; set; } + // 安全计量 + public string SAFE_MTR { get; set; } + // 常规用法 + public string CNVL_USED { get; set; } + // 性味 + public string NATFLA { get; set; } + // 归经 + public string MERTPM { get; set; } + // 品种 + public string CAT { get; set; } + // 开始日期 + public DateTime? BEGNDATE { get; set; } + // 结束日期 + public DateTime? ENDDATE { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime? OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 药材名称 + public string MLMS_NAME { get; set; } + // 功能主治 + public string EFCC_ATD { get; set; } + // 炮制方法 + public string PSDG_MTD { get; set; } + // 功效分类 + public string ECY_TYPE { get; set; } + // 药材种来源 + public string MLMS_CAT_SOUC { get; set; } + // 国家医保支付政策 + public string NAT_HI_PAY_POL { get; set; } + // 省级医保支付政策 + public string PROV_HI_PAY_POL { get; set; } + // 标准名称 + public string STD_NAME { get; set; } + // 标准页码 + public string STD_PAGEN { get; set; } + // 标准电子档案 + public string STD_ELECACS { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmsymp_type_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmsymp_type_bVO.cs new file mode 100644 index 00000000..2150281a --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tcmsymp_type_bVO.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 中医证候分类表 + /// + public class G_yb_tcmsymp_type_bVO + { + // 中医证候ID + public string TCMSYMP_ID { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 证候类目代码 + public string SDS_CGY_CODE { get; set; } + // 证候类目名称 + public string SDS_CGY_NAME { get; set; } + // 证候属性代码 + public string SDS_ATTR_CODE { get; set; } + // 证候属性 + public string SDS_ATTR { get; set; } + // 证候分类代码 + public string SDS_TYPE_CODE { get; set; } + // 证候分类名称 + public string SDS_TYPE_NAME { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tmor_mpy_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tmor_mpy_bVO.cs new file mode 100644 index 00000000..886f4789 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_tmor_mpy_bVO.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 肿瘤形态学表 + /// + public class G_yb_tmor_mpy_bVO + { + // 肿瘤形态学ID + public string TMOR_MPY_ID { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 肿瘤/细胞类型代码 + public string TMOR_CELL_TYPE_CODE { get; set; } + // 肿瘤/细胞类型 + public string TMOR_CELL_TYPE { get; set; } + // 形态学分类代码 + public string MPY_TYPE_CODE { get; set; } + // 形态学分类 + public string MPY_TYPE { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_trt_serv_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_trt_serv_bVO.cs new file mode 100644 index 00000000..a0619bd9 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_trt_serv_bVO.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 医疗服务项目表 + /// + public class G_yb_trt_serv_bVO + { + // 医疗目录编码 + public string MED_LIST_CODG { get; set; } + // 计价单位 + public string PRCUNT { get; set; } + // 计价单位名称 + public string PRCUNT_NAME { get; set; } + + // 诊疗项目说明 + public string TRT_ITEM_DSCR { get; set; } + // 诊疗除外内容 + public string TRT_EXCT_CONT { get; set; } + // 诊疗项目内涵 + public string TRT_ITEM_CONT { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 备注 + public string MEMO { get; set; } + // 服务项目类别 + public string SERVITEM_TYPE { get; set; } + // 医疗服务项目名称 + public string SERVITEM_NAME { get; set; } + // 项目说明 + public string ITEM_DSCR { get; set; } + // 开始日期 + public DateTime? BEGNDATE { get; set; } + // 结束日期 + public DateTime? ENDDATE { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_wm_tcmpat_info_bVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_wm_tcmpat_info_bVO.cs new file mode 100644 index 00000000..490a5098 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/G_yb_wm_tcmpat_info_bVO.cs @@ -0,0 +1,369 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 西药中成药信息表 + /// + public class G_yb_wm_tcmpat_info_bVO + { + // 医疗目录编码 + public string MED_LIST_CODG { get; set; } + // 药品商品名 + public string DRUG_PRODNAME { get; set; } + // 通用名编码 + public string GENNAME_CODG { get; set; } + // 药品通用名 + public string DRUG_GENNAME { get; set; } + // 化学名称 + public string CHEMNAME { get; set; } + // 别名 + public string ALIS { get; set; } + // 英文名称 + public string ENG_NAME { get; set; } + // 注册名称 + public string REG_NAME { get; set; } + // 药品本位码 + public string DRUGSTDCODE { get; set; } + // 药品剂型 + public string DRUG_DOSFORM { get; set; } + // 药品剂型名称 + public string DRUG_DOSFORM_NAME { get; set; } + // 药品类别 + public string DRUG_TYPE { get; set; } + // 药品类别名称 + public string DRUG_TYPE_NAME { get; set; } + // 药品规格 + public string DRUG_SPEC { get; set; } + // 药品规格代码 + public string DRUG_SPEC_CODE { get; set; } + // 注册剂型 + public string REG_DOSFORM { get; set; } + // 注册规格 + public string REG_SPEC { get; set; } + // 注册规格代码 + public string REG_SPEC_CODE { get; set; } + // 每次用量 + public string EACH_DOS { get; set; } + // 使用频次 + public string USED_FRQU { get; set; } + // 酸根盐基 + public string ACDBAS { get; set; } + // 国家药品编号 + public string NAT_DRUG_NO { get; set; } + // 使用方法 + public string USED_MTD { get; set; } + // 中成药标志 + public string TCMPAT_FLAG { get; set; } + // 生产地类别 + public string PRODPLAC_TYPE { get; set; } + // 生产地类别名称 + public string PRODPLAC_TYPE_NAME { get; set; } + // 计价单位类型 + public string PRCUNT_TYPE { get; set; } + // 非处方药标志 + public string OTC_FLAG { get; set; } + // 非处方药标志名称 + public string OTC_FLAG_NAME { get; set; } + // 包装材质 + public string PACMATL { get; set; } + // 包装材质名称 + public string PACMATL_NAME { get; set; } + // 包装规格 + public string PACSPEC { get; set; } + // 包装数量 + public string PAC_CNT { get; set; } + // 功能主治 + public string EFCC_ATD { get; set; } + // 给药途径 + public string RUTE { get; set; } + // 说明书 + public string MANL { get; set; } + // 开始日期 + public string BEGNDATE { get; set; } + // 结束日期 + public string ENDDATE { get; set; } + // 最小使用单位 + public string MIN_USEUNT { get; set; } + // 最小销售单位 + public string MIN_SALUNT { get; set; } + // 最小计量单位 + public string MIN_UNT { get; set; } + // 最小包装数量 + public int? MIN_PAC_CNT { get; set; } + // 最小包装单位 + public string MIN_PACUNT { get; set; } + // 最小制剂单位 + public string MIN_PREPUNT { get; set; } + // 最小包装单位名称 + public string MINPACUNT_NAME { get; set; } + // 最小制剂单位名称 + public string MIN_PREPUNT_NAME { get; set; } + // 转换比 + public int? CONVRAT { get; set; } + // 药品有效期 + public string DRUG_EXPY { get; set; } + // 最小计价单位 + public string MIN_PRCUNT { get; set; } + // 五笔助记码 + public string WUBI { get; set; } + // 拼音助记码 + public string PINYIN { get; set; } + // 分包装厂家 + public string SUBPCK_FCTY { get; set; } + // 生产企业代码 + public string PRODENTP_CODE { get; set; } + // 生产企业名称 + public string PRODENTP_NAME { get; set; } + // 特殊限价药品标志 + public string SP_LMTPRIC_DRUG_FLAG { get; set; } + // 特殊药品标志 + public string SP_DRUG_FLAG { get; set; } + // 限制使用范围 + public string LMT_USESCP { get; set; } + // 限制使用标志 + public string LMT_USED_FLAG { get; set; } + // 药品注册证编号 + public string DRUG_REGNO { get; set; } + // 药品注册证号开始日期 + public DateTime? DRUG_REGCERT_BEGNDATE { get; set; } + // 药品注册证号结束日期 + public DateTime? DRUG_REGCERT_ENDDATE { get; set; } + // 批准文号 + public string APRVNO { get; set; } + // 批准文号开始日期 + public DateTime? APRVNO_BEGNDATE { get; set; } + // 批准文号结束日期 + public DateTime? APRVNO_ENDDATE { get; set; } + // 市场状态 + public string MKT_STAS { get; set; } + // 市场状态名称 + public string MKT_STAS_NAME { get; set; } + // 药品注册批件电子档案 + public string DRUG_REG_APPVLETR_ELECACS { get; set; } + // 药品补充申请批件电子档案 + public string SPLM_APPY_APPVLETR_FILE { get; set; } + // 国家医保药品目录备注 + public string NAT_HI_DRUGLIST_MEMO { get; set; } + // 基本药物标志名称 + public string BAS_MEDN_FLAG_NAME { get; set; } + // 基本药物标志 + public string BAS_MEDN_FLAG { get; set; } + // 增值税调整药品标志 + public string ADVALTAX_ADJM_DRUG_FLAG { get; set; } + // 增值税调整药品名称 + public string ADVALTAX_ADJM_DRUG_NAME { get; set; } + // 上市药品目录集药品 + public string LSTD_DRUGLIST_DRUG { get; set; } + // 医保谈判药品标志 + public string HI_NEGO_DRUG_FLAG { get; set; } + // 医保谈判药品名称 + public string HI_NEGO_DRUG_NAME { get; set; } + // 卫健委药品编码 + public string NHC_DRUG_CODG { get; set; } + // 备注 + public string MEMO { get; set; } + // 有效标志 + public string VALI_FLAG { get; set; } + // 数据唯一记录号 + public string RID { get; set; } + // 数据创建时间 + public DateTime? CRTE_TIME { get; set; } + // 数据更新时间 + public DateTime? UPDT_TIME { get; set; } + //// 创建人ID + //public string CRTER_ID { get; set; } + //// 创建人姓名 + //public string CRTER_NAME { get; set; } + //// 创建机构编号 + //public string CRTE_OPTINS_NO { get; set; } + //// 经办人ID + //public string OPTER_ID { get; set; } + //// 经办人姓名 + //public string OPTER_NAME { get; set; } + //// 经办时间 + //public DateTime? OPT_TIME { get; set; } + //// 经办机构编号 + //public string OPTINS_NO { get; set; } + // 版本号 + public string VER { get; set; } + // 版本名称 + public string VER_NAME { get; set; } + // 儿童用药 + public string CHLD_MEDC { get; set; } + // 公司名称 + public string CO_NAME { get; set; } + // 仿制药一致性评价药品 + public string CONSEVAL_DRUG { get; set; } + // 经销企业 + public string DSTR { get; set; } + // 经销企业联系人 + public string DSTR_CONER { get; set; } + // 经销企业授权书电子档案 + public string DSTR_AUTH_FILE_ELECACS { get; set; } + // 国家医保药品目录剂型 + public string NAT_HI_DRUGLIST_DOSFORM { get; set; } + // 国家医保药品目录甲乙类标识 + public string NAT_HI_DRUGLIST_CHRGITM_LV { get; set; } + //// 上市许可证持有人 + //public string LSTD_LIC_HOLDER { get; set; } + //// 下发标志 + //public string ISU_FLAG { get; set; } + //// 传输数据ID + //public string TRAM_DATA_ID { get; set; } + //// 生效时间 + //public DateTime? EFFT_TIME { get; set; } + //// 失效时间 + //public DateTime? INVD_TIME { get; set; } + + } + public class G_yb_mluCommon_Info: G_yb_wm_tcmpat_info_bVO + { + #region 1301 + public string TCMHERB_NAME { get; set; } + public string MED_PART { get; set; } + public string CNVL_USED { get; set; } + public string NATFLA { get; set; } + public string CAT { get; set; } + public string MLMS_NAME { get; set; } + public string PSDG_MTD { get; set; } + public string ECY_TYPE { get; set; } + public string MLMS_CAT_SOUC { get; set; } + #endregion + + #region 1302 + public string DOSFORM { get; set; } + public string BEGNTIME { get; set; } + public string ENDTIME { get; set; } + #endregion + + #region 1305 + public string PRCUNT { get; set; } + public string PRCUNT_NAME { get; set; } + public string TRT_ITEM_DSCR { get; set; } + public string TRT_EXCT_CONT { get; set; } + public string SERVITEM_TYPE { get; set; } + public string SERVITEM_NAME { get; set; } + #endregion + + #region 1306 + public string HI_GENNAME { get; set; } + public string SPEC { get; set; } + public string MCS_MATL { get; set; } + #endregion + + #region 1307 + public string DIAG_LIST_ID { get; set; } + public string CPR { get; set; } + public string CPR_CODE_SCP { get; set; } + public string CPR_NAME { get; set; } + public string SEC_CODE_SCP { get; set; } + public string SEC_NAME { get; set; } + public string CGY_CODE { get; set; } + public string CGY_NAME { get; set; } + public string SOR_CODE { get; set; } + public string SOR_NAME { get; set; } + public string DIAG_CODE { get; set; } + public string DIAG_NAME { get; set; } + public string USED_STD { get; set; } + #endregion + + #region 1308 + public string OPRN_STD_LIST_ID { get; set; } + public string OPRN_OPRT_CODE { get; set; } + public string OPRN_OPRT_NAME { get; set; } + public string DTLS_CODE { get; set; } + public string DTLS_NAME { get; set; } + #endregion + + #region 1309 + public string OPSP_DISE_CODE { get; set; } + public string OPSP_DISE_MAJCLS_NAME { get; set; } + public string OPSP_DISE_SUBD_CLSS_NAME { get; set; } + public string ADMDVS { get; set; } + public string OPSP_DISE_NAME { get; set; } + public string OPSP_DISE_MAJCLS_CODE { get; set; } + #endregion + + #region 1310 + public string DISE_SETL_LIST_ID { get; set; } + public string BYDISE_SETL_LIST_CODE { get; set; } + public string BYDISE_SETL_DISE_NAME { get; set; } + public string QUA_OPRN_OPRT_CODE { get; set; } + public string QUA_OPRN_OPRT_NAME { get; set; } + + #endregion + #region 1311 + public string DAYSRG_TRT_LIST_ID { get; set; } + public string DAYSRG_DISE_LIST_CODE { get; set; } + + public string DAYSRG_DISE_NAME { get; set; } + #endregion + + #region 1313 + public string TMOR_MPY_ID { get; set; } + public string TMOR_CELL_TYPE_CODE { get; set; } + + public string TMOR_CELL_TYPE { get; set; } + public string MPY_TYPE_CODE { get; set; } + public string MPY_TYPE { get; set; } + #endregion + + #region 1314 + public string TCM_DIAG_ID { get; set; } + public string CATY_CGY_CODE { get; set; } + public string CATY_CGY_NAME { get; set; } + public string SPCY_SYS_TAXA_CODE { get; set; } + public string SPCY_SYS_TAXA_NAME { get; set; } + public string DISE_TYPE_CODE { get; set; } + public string DISE_TYPE_NAME { get; set; } + #endregion + + #region 1315 + public string TCMSYMP_ID { get; set; } + public string SDS_CGY_CODE { get; set; } + public string SDS_CGY_NAME { get; set; } + public string SDS_ATTR_CODE { get; set; } + public string SDS_ATTR { get; set; } + public string SDS_TYPE_CODE { get; set; } + public string SDS_TYPE_NAME { get; set; } + #endregion + + #region 1320 + public string ZYPFKL_CODE { get; set; } + public string ZYPFKL_NAME { get; set; } + public string DDYC { get; set; } + public string GG { get; set; } + public string ZYPFKLZXBZ { get; set; } + public string BLFYJCXX { get; set; } + public string ZYYP_CODE { get; set; } + public string ZYYP_NAME { get; set; } + public string YC_NAME { get; set; } + public string GXFL { get; set; } + public string GNZZ { get; set; } + public string CGYF { get; set; } + public string SJGXSJ { get; set; } + public string CJJG_CODE { get; set; } + public string YBQH { get; set; } + + #endregion + + + #region 1321 + public string YLML_CODE { get; set; } + public string YLFWXM_NAME { get; set; } + public string YLFWXMSC { get; set; } + public string JGGC { get; set; } + public string JJDW { get; set; } + public string JJSM { get; set; } + public string ZLXMSM { get; set; } + public string FYLXKJ { get; set; } + public string EFFECTIVE_TIME { get; set; } + public string EXPIRATION_TIME { get; set; } + #endregion + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/MedinsDaySetlResult.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/MedinsDaySetlResult.cs new file mode 100644 index 00000000..88ae0035 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ReportTemplateVO/MedinsDaySetlResult.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ReportTemplateVO +{ + /// + /// 医疗服务项目表 + /// + public class MedinsDaySetlResult + { + // 人员编号 + public string psn_no { get; set; } + // 医药机构结算ID + public string medinsSetlId { get; set; } + // 医疗费总额 + public string medfee_sumamt { get; set; } + // 基金支付总额 + public string fund_pay_sumamt { get; set; } + // 个人账户支出 + public string acct_pay { get; set; } + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/API/SysVSStaffVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/API/SysVSStaffVO.cs index cf79bc7e..f66ee65f 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/API/SysVSStaffVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/API/SysVSStaffVO.cs @@ -41,40 +41,4 @@ public class SysVSStaffVO /// public string dutyName { get; set; } } - - public class SysDoctorVO - { - /// - /// - /// - public string organizeId { get; set; } - /// - /// - /// - public string ks { get; set; } - /// - /// - /// - public string ksmc { get; set; } - /// - /// - /// - public string ysxm { get; set; } - /// - /// - /// - public string xb { get; set; } - /// - /// 医生工号 - /// - public string ysgh { get; set; } - /// - /// - /// - public string DutyId { get; set; } - /// - /// - /// - public string dutyName { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/DaySettleManage/YBdzsqList.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/DaySettleManage/YBdzsqList.cs index 0931f297..a0a6fd21 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/DaySettleManage/YBdzsqList.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/DaySettleManage/YBdzsqList.cs @@ -115,6 +115,15 @@ public class Qsmx /// public decimal jjzfje { get; set; } + /// + /// 个人账户支付 + /// + public decimal acct_pay { get; set; } + /// + /// 个人支付现金 + /// + public decimal psn_cash_pay { get; set; } + /// /// 共济支付金额 /// @@ -209,6 +218,56 @@ public class Qsmx_1 public DateTime jsrq { get; set; } } + /// + /// 对账成功保存 + /// + public class ybqssq + { + public string qslb { get; set; } + public string xz { get; set; } + public string sfyd { get; set; } + public string ksrq { get; set; } + public string jsrq { get; set; } + public decimal zfy { get; set; } + public decimal jjzfje { get; set; } + public decimal grzh { get; set; } + public decimal ybrkfyze { get; set; } + public decimal xjzfze { get; set; } + public int qsrc { get; set; } + public string qsny { get; set; } + public decimal czzgtcjj { get; set; }/*城镇职工基本医疗保险统筹基金*/ + public int czzgtcjjrc { get; set; }/*城镇职工基本医疗保险统筹基金人次*/ + public decimal czzgzhjj { get; set; }/*城镇职工基本医疗保险个人账户基金*/ + public int czzgzhjjrc { get; set; }/*城镇职工基本医疗保险个人账户基金*/ + public decimal gywbzjj { get; set; }/*公务员医疗补助基金*/ + public int gywbzjjrc { get; set; }/*公务员医疗补助基金*/ + public decimal deylbzjj { get; set; }/*大额医疗费用补助基金*/ + public int deylbzjjrc { get; set; }/*大额医疗费用补助基金*/ + public decimal lxrybzjj { get; set; }/*离休人员医疗保障基金*/ + public int lxrybzjjrc { get; set; }/*离休人员医疗保障基金*/ + public decimal cjbzjj { get; set; }/*一至六级残疾军人医疗补助基金*/ + public int cjbzjjrc { get; set; }/*一至六级残疾军人医疗补助基金*/ + public decimal qybzyljj { get; set; }/*企业补充医疗保险基金*/ + public int qybzyljjrc { get; set; }/*企业补充医疗保险基金*/ + public decimal cxjmjbyljj { get; set; }/*城乡居民基本医疗保险基金*/ + public int cxjmjbyljjrc { get; set; }/*城乡居民基本医疗保险基金*/ + public decimal cxjmdbyljj { get; set; }/*城乡居民大病医疗保险基金*/ + public int cxjmdbyljjrc { get; set; }/*城乡居民大病医疗保险基金*/ + public decimal yljzjj { get; set; }/*医疗救助基金*/ + public int yljzjjrc { get; set; }/*医疗救助基金人次*/ + public decimal yfjj { get; set; }/*优抚基金*/ + public int yfjjrc { get; set; }/*优抚基金人次*/ + public decimal syjj { get; set; }/*生育基金*/ + public int syjjrc { get; set; }/*生育基金人次*/ + public decimal qtjj { get; set; }/*其他基金*/ + public int qtjjrc { get; set; }/*其他基金人次*/ + public decimal eyjj { get; set; }/*二乙基金*/ + public int eyjjrc { get; set; }/*二乙基金人次*/ + public string create_user { get; set; } + public int sqzt { get; set; } + + } + /// /// 清算申请 /// @@ -549,4 +608,25 @@ public class RdrNewList /// public decimal totalfybjsfw { get; set; } } + + public class HistoryCheckVO + { + public string lsh {get;set;} + public string cardid { get; set; } + public DateTime jysj { get; set; } + public string lx { get; set; } + public decimal dn { get; set; } + public decimal ln { get; set; } + public decimal xj { get; set; } + public decimal tc { get; set; } + public int df { get; set; } + public decimal flzf { get; set; } + public decimal grzf { get; set; } + public string xm { get; set; } + public string mzbh { get; set; } + public string hm { get; set; } + public string zd { get; set; } + public string bz { get; set; } + + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospFeeChargeCategoryGroupVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospFeeChargeCategoryGroupVO.cs index 2a59b31f..e62f7c7a 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospFeeChargeCategoryGroupVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospFeeChargeCategoryGroupVO.cs @@ -37,9 +37,6 @@ public class HospFeeChargeCategoryGroupDetailVO : HospFeeChargeCategoryGroupVO public string zfxz { get; set; } public string gg { get; set; } public string zzfbz { get; set; } - public string zzfbzcode { get; set; } - public string zfxzcode { get; set; } - } /// /// 费用上传 diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospSettlementInfoVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospSettlementInfoVO.cs index 6ffa9096..8de6ef04 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospSettlementInfoVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/HospSettlementInfoVO.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Newtouch.HIS.Domain.ValueObjects { @@ -32,6 +28,9 @@ public class HospSettlementInfoVO public string lyfs { get; set; } public string cyzd { get; set; } public string jtdz { get; set; } + public string zxlsh { get; set; } + + public string sfyb { get; set; } } /// @@ -44,11 +43,6 @@ public class HospSettlementClassificationFeeVO public decimal je { get; set; } - /// - /// 收费日期(yyyy-MM-dd) - /// - public string sfrq { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientHosPatAccPayVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientHosPatAccPayVO.cs index 1c7e5a74..f9feb6d7 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientHosPatAccPayVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientHosPatAccPayVO.cs @@ -45,52 +45,56 @@ public class InpatientHosPatAccPayVO public string xjzffs { get; set; } } + /// + /// 账户收支记录 + /// + public class InpatientPatAccPayVO + { + public string Id { get; set; } /// - /// 账户收支记录 + /// 收支金额 xt_brzhszjl /// - public class InpatientPatAccPayVO - { - public string Id { get; set; } - /// - /// 收支金额 xt_brzhszjl - /// - public decimal szje { get; set; } - /// - /// 账户余额 - /// - public decimal zhye { get; set; } - /// - /// 凭证号 - /// - public string pzh { get; set; } - /// - /// 收支人员 - /// - public string Creator { get; set; } + public decimal szje { get; set; } + /// + /// 账户余额 + /// + public decimal zhye { get; set; } + /// + /// 凭证号 + /// + public string pzh { get; set; } + /// + /// 收支人员 + /// + public string Creator { get; set; } - /// - /// 收支日期-即创建日期 - /// - public DateTime CreateTime { get; set; } - /// - /// 收支性质 - /// - public int szxz { get; set; } + /// + /// 收支日期-即创建日期 + /// + public DateTime CreateTime { get; set; } + /// + /// 收支性质 + /// + public int szxz { get; set; } - public string szxzmc { get; set; } + public string szxzmc { get; set; } - /// - /// 支付方式 xt_xjzffs - /// - public string xjzffsmc { get; set; } + /// + /// 支付方式 xt_xjzffs + /// + public string xjzffsmc { get; set; } - /// - /// 支付方式 - /// - public string xjzffs { get; set; } - /// - /// 备注 - /// - public string memo { get; set; } - } + /// + /// 支付方式 + /// + public string xjzffs { get; set; } + /// + /// 备注 + /// + public string memo { get; set; } + /// + /// 订单号 + /// + public string outTradeNo { get; set; } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientSettPatInfoVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientSettPatInfoVO.cs index 1cfbad5e..818daa24 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientSettPatInfoVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/InpatientSettPatInfoVO.cs @@ -40,6 +40,7 @@ public class InpatientSettPatInfoVO /// /// public string ybjylx { get; set; } + public string brxzlb { get; set; } /// /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/TreatmentItemFeeDetailVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/TreatmentItemFeeDetailVO.cs index 7190b217..18748f51 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/TreatmentItemFeeDetailVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/HospitalizationManage/TreatmentItemFeeDetailVO.cs @@ -104,5 +104,10 @@ public class TreatmentItemFeeDetailVO public string sfmbmc { get; set; } public string jfbbhs { get; set; } + /// + /// 医嘱名称 + /// + public string yzmc { get; set; } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/MedicalRecord/MedicalRecordDeptVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/MedicalRecord/MedicalRecordDeptVO.cs index 8e83b182..72db1ade 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/MedicalRecord/MedicalRecordDeptVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/MedicalRecord/MedicalRecordDeptVO.cs @@ -10,7 +10,6 @@ public class MedicalRecordDeptVO { public string version { get; set; } public List medicalList { get; set; } - public string[] medicalArr { get; set; } } public class medicalList { public string Index { get; set; } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/CqybGjbmInfoVo.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/CqybGjbmInfoVo.cs index 104207b9..28833b07 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/CqybGjbmInfoVo.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/CqybGjbmInfoVo.cs @@ -14,5 +14,7 @@ public class CqybGjbmInfoVo public string gh { get; set; } public string name { get; set; } public string ksmc { get; set; } + public string ks { get; set; } + public string jzid { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegChargeMVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegChargeMVO.cs index d914142d..5a013215 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegChargeMVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegChargeMVO.cs @@ -7,7 +7,7 @@ namespace Newtouch.HIS.Domain.ValueObjects /// /// 门诊挂号收费查询 /// - public class OutPatientRegChargeMVO: OutpatientSettYbFeeRelatedDTO + public class OutPatientRegChargeMVO : OutpatientSettYbFeeRelatedDTO { #region 挂号收费查询的主记录 @@ -116,6 +116,7 @@ public class OutPatientRegChargeMVO: OutpatientSettYbFeeRelatedDTO public string zdmc { get; set; } public decimal? jsjz { get; set; } public string zxlsh { get; set; } + public string sfyb { get; set; } } /// diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegInfoVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegInfoVO.cs index 79cf1161..d618457b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegInfoVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/OutPatientRegInfoVO.cs @@ -1,5 +1,4 @@ -using System; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Newtouch.HIS.Domain.Entity; namespace Newtouch.HIS.Domain.ValueObjects @@ -57,55 +56,4 @@ public class OutPatientRegVO /// public string xnhgrbm { get; set; } } - - public class OutPatientRegBaseVO - { - - /// - /// 门诊号 - /// - public string Mzh { get; set; } - public string CardNo { get; set; } - - /// - /// 0 -窗口 1-预约 - /// - public string Ghly { get; set; } - - /// - /// 1:门诊 2:急诊 专家 mjzbz - /// - public string RegType { get; set; } - - /// - /// - /// - public string Dept { get; set; } - - /// - /// - /// - public string Doctor { get; set; } - public string DeptName { get; set; } - public string DoctorName { get; set; } - public string Ghxzmc { get; set; } - public string Ghxz { get; set; } - /// - /// 按科室、挂号类型产生的排队号 from mz_jzxh - /// - public Int16? QueueNo { get; set; } - /// - /// 0 待结 1 已结 2 已退 --2006-06-17 启用,作为便于识别结算情况的冗余字段 --2006.06.13 ??时不用此字?? 好像可以通过结算内码=0判断未结,>0判断已结,撤销结算内码>0判断已退?暂时不用此字段 - /// - public string RegStatus { get; set; } - /// - /// 就诊标志(就诊状态) 枚举EnumOutpatientJzbz - /// - public string Jzbz { get; set; } - - /// - /// 挂号时间 - /// - public DateTime RegDate { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/RegScheduleVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/RegScheduleVO.cs index 4c349fd8..13330e5b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/RegScheduleVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/OutpatientManage/RegScheduleVO.cs @@ -5,7 +5,7 @@ namespace Newtouch.HIS.Domain.ValueObjects { [NotMapped] - public class RegScheduleVO : OutpatientRegistScheduleEntity + public class RegScheduleVO: OutpatientRegistScheduleEntity { /// /// 收费项目名称 @@ -53,17 +53,7 @@ public class RegScheduleVO : OutpatientRegistScheduleEntity /// public string zlxmmc { get; set; } - /// - /// 收费项目单击 - /// - public decimal sfxmdj { get; set; } - - /// - /// 诊疗项目单击 - /// - public decimal zlxmdj { get; set; } - } - + } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/PatientManage/PatientCenterVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/PatientManage/PatientCenterVO.cs index b4a215f2..ea9d6983 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/PatientManage/PatientCenterVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/PatientManage/PatientCenterVO.cs @@ -85,7 +85,7 @@ public class OutpatientVO /// 门诊号 /// public string mzh { get; set; } - + public int patid { get; set; } public string brxz { get; set; } public int? ghnm { get; set; } @@ -159,9 +159,4 @@ public class OutpatientVO public string yllb { get; set; } public string bzbm { get; set; } } - - - public class PatOperation { - - } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetDlMc.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetDlMc.cs index e3fb999d..4ca9ea24 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetDlMc.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetDlMc.cs @@ -12,4 +12,11 @@ public class GetDlMc public string dlmc { get; set; } } + public class getsfxm { + public string sfxmcode { get; set; } + + public string sfxmmc { get; set; } + public string dw { get; set; } + public decimal dj { get; set; } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetJyllk.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetJyllk.cs new file mode 100644 index 00000000..6f0b86b5 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/GetJyllk.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ValueObjects.ReportManage +{ + public class GetJyllk + { + public string lsh { get; set; } + public string jgdm { get; set; } + public string kh { get; set; } + public string zhbz { get; set; } + public string brlx { get; set; } + public string jzcs { get; set; } + public string jysj { get; set; } + public string jslx { get; set; } + public string jyzfy { get; set; } + public string dnzhzf { get; set; } + public string lnzhzf { get; set; } + public string zfdxj { get; set; } + public string qfdxj { get; set; } + public string qfdzh { get; set; } + public string tcdxj { get; set; } + public string tcdzh { get; set; } + public string tczj { get; set; } + public string fjdxj { get; set; } + public string fjdzh { get; set; } + public string fjzf { get; set; } + public string ybfwze { get; set; } + public string fybfwzf { get; set; } + public string yblx { get; set; } + public string fphm { get; set; } + public string tfbz { get; set; } + public string ksrq { get; set; } + public string jfbz { get; set; } + public string jfje { get; set; } + + + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientRegistrationVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientRegistrationVO.cs new file mode 100644 index 00000000..139cf786 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientRegistrationVO.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ValueObjects.ReportManage +{ + public class OutpatientRegistrationVO + { + public string lsh { get; set; } + public string kh { get; set; } + public string ksbm { get; set; } + public string ksmc { get; set; } + public string ghf { get; set; } + public string zlf { get; set; } + public string jyzfy { get; set; } + public string ybfwze { get; set; } + public string fybfwze { get; set; } + public string jysj { get; set; } + public string yblx { get; set; } + public string jslx { get; set; } + public string tfbz { get; set; } + public int jzlsh { get; set; } + + + + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientSickBedAtHomeVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientSickBedAtHomeVO.cs new file mode 100644 index 00000000..848b4363 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/ReportManage/OutpatientSickBedAtHomeVO.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Domain.ValueObjects.ReportManage +{ + public class OutpatientSickBedAtHomeVO + { + public string yblsh { get; set; } + public string kh { get; set; } + public string ksbm { get; set; } + public string ksmc { get; set; } + public string ysgh { get; set; } + public string ysxm { get; set; } + public string cfbh { get; set; } + public string fylb { get; set; } + public string xmmc { get; set; } + public string xmdw { get; set; } + public string xmdj { get; set; } + public string xmsl { get; set; } + public string xmje { get; set; } + public string jyje { get; set; } + public string ybfwje { get; set; } + public string bxbz { get; set; } + public string jysj { get; set; } + public string yblx { get; set; } + public string jslx { get; set; } + public string tfbz { get; set; } + public string lsh { get; set; } + public string xflsh { get; set; } + public string yptym { get; set; } + public string zczh { get; set; } + public string mxxmgg { get; set; } + + + + + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/FinanceReceiptVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/FinanceReceiptVO.cs index f442eb1c..f54c6c80 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/FinanceReceiptVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/FinanceReceiptVO.cs @@ -69,7 +69,7 @@ public class FinanceReceiptVO public int? px { get; set; } /// - /// 0:停用; 1:启用 + /// /// public string zt { get; set; } } @@ -82,64 +82,9 @@ public class FinanceInvoiceVO public long dqfph { get; set; } public long qsfph { get; set; } public long jsfph { get; set; } - - /// - /// 0:停用; 1:启用 - /// public string zt { get; set; } public DateTime CreateTime { get; set; } public string CreatorCode { get; set; } public string ry { get; set; } - - /// - /// 是否作废 - /// - public int? is_del { get; set; } - } - - /// - /// 发票详情 - /// - public class InvoiceDetailVO - { - /// - /// 就诊类型 门诊 | 住院 - /// - public string jzlx { get; set; } - - /// - /// 就诊号 - /// - public string jzh { get; set; } - - /// - /// 发票号 - /// - public string fph { get; set; } - - /// - /// 患者姓名 - /// - public string xm { get; set; } - - /// - /// 卡号 - /// - public string kh { get; set; } - - /// - /// 科室名称 - /// - public string ks { get; set; } - - /// - /// 总金额 - /// - public decimal zje { get; set; } - - /// - /// 收费日期 - /// - public DateTime sfrq { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/SysHosBasicInfoVO.cs b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/SysHosBasicInfoVO.cs index ac161589..b076ef1a 100644 --- a/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/SysHosBasicInfoVO.cs +++ b/Newtouch.HIS.Sett/Newtouch.Domain/ValueObjects/SystemManage/SysHosBasicInfoVO.cs @@ -455,5 +455,6 @@ public class SysHosBasicInfoVO /// 账户标志 /// public string accountattr { get; set; } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingDmnService.cs index 66afd9ba..aeea797e 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingDmnService.cs @@ -19,7 +19,7 @@ namespace Newtouch.HIS.DomainServices.API { - public class BookingDmnService : DmnServiceBase, IBookingDmnService + public class BookingDmnService: DmnServiceBase, IBookingDmnService { public BookingDmnService(IDefaultDatabaseFactory databaseFactory) : base(databaseFactory) @@ -44,16 +44,13 @@ public BookingDmnService(IDefaultDatabaseFactory databaseFactory) /// /// /// - public IList GetDepartmentInfo(string orgId, string ks, string ksmc) + public IList GetDepartmentInfo(string orgId,string ks,string ksmc) { List para = new List(); para.Add(new SqlParameter("@orgId", orgId)); - string sql = @"select OrganizeId,Name as ksmc,Code as ks,mzzybz -from [NewtouchHIS_Base].[dbo].[V_S_Sys_Department] -where zt='1' and organizeId=@orgId -and mzzybz in(" + (int)Enummzzybz.mz + "," + (int)Enummzzybz.ty + ")"; + string sql = @"select OrganizeId,Name as ksmc,Code as ks,mzzybz from [NewtouchHIS_Base].[dbo].[V_S_Sys_Department] where 1=1 and zt='1' and organizeId=@orgId"; if (!string.IsNullOrEmpty(ks)) @@ -65,8 +62,7 @@ from [NewtouchHIS_Base].[dbo].[V_S_Sys_Department] { sql += " and name=@name "; para.Add(new SqlParameter("@name", ksmc)); - } - return this.FindList(sql, para.ToArray()); + }return this.FindList(sql, para.ToArray()); } @@ -79,10 +75,10 @@ from [NewtouchHIS_Base].[dbo].[V_S_Sys_Department] /// public IList GetStaffInfo(string orgId, string gh, string staffName) { - List para = new List(); - para.Add(new SqlParameter("@orgId", orgId)); + List para = new List(); + para.Add(new SqlParameter("@orgId", orgId)); - string sql = @" select staff.organizeId,departmentCode,department.Name as departmentName,staff.Name as staffName,Gender,gh,DutyId ,duty.Name as dutyName + string sql = @" select staff.organizeId,departmentCode,department.Name as departmentName,staff.Name as staffName,Gender,gh,DutyId ,duty.Name as dutyName from [NewtouchHIS_Base].[dbo].[Sys_Staff] staff left join [NewtouchHIS_Base].[dbo].[Sys_Department] department on department.code=staff.departmentCode @@ -91,18 +87,18 @@ left join [NewtouchHIS_Base].[dbo].[Sys_StaffDuty] staffduty on left join [NewtouchHIS_Base].[dbo].[Sys_Duty] duty on duty.id=staffduty.dutyId where 1=1 and staff.zt='1' and staff.organizeId=@orgId"; - - if (!string.IsNullOrEmpty(gh)) - { - sql += " and gh=@gh "; - para.Add(new SqlParameter("@gh", gh)); - } - if (!string.IsNullOrEmpty(staffName)) - { - sql += " and staff.Name=@staffName "; - para.Add(new SqlParameter("@staffName", staffName)); - } - return this.FindList(sql, para.ToArray()); + + if (!string.IsNullOrEmpty(gh)) + { + sql += " and gh=@gh "; + para.Add(new SqlParameter("@gh", gh)); + } + if (!string.IsNullOrEmpty(staffName)) + { + sql += " and staff.Name=@staffName "; + para.Add(new SqlParameter("@staffName", staffName)); + } + return this.FindList(sql, para.ToArray()); } /// @@ -113,20 +109,20 @@ left join [NewtouchHIS_Base].[dbo].[Sys_Duty] duty on /// /// /// - public IList GetPatInfo(string orgId, string kh, string zjh, string xm) + public IList GetPatInfo(string orgId,string kh, string zjh, string xm) { - + List para = new List(); para.Add(new SqlParameter("@orgId", orgId)); - string sql = @"select a.organizeId,a.patid, c.brxzmc brxz, blh,a.xm,xb,csny, zjh,dh,mz,zy,b.cardno kh,b.cardtypename klx + string sql = @"select a.organizeId,a.patid, c.brxzmc brxz, blh,a.xm,xb,csny, zjh,dh,dz,mz,zy,b.cardno kh,b.cardtypename klx from xt_brjbxx a with(nolock) left join xt_card b with(nolock) on a.organizeID=b.organizeid and a.patid=b.patid and b.zt='1' -left join dbo.xt_brxz c with(nolock) on b.organizeID=c.organizeid and b.brxz=c.brxz and c.zt='1' +left join dbo.xt_brxz c with(nolock) on a.organizeID=c.organizeid and a.brxz=c.brxz and c.zt='1' where a.zt='1' and a.organizeId=@orgId "; - if (!string.IsNullOrEmpty(kh)) + if(!string.IsNullOrEmpty(kh)) { sql += " and b.cardno=@kh "; para.Add(new SqlParameter("@kh", kh)); @@ -141,7 +137,7 @@ left join dbo.xt_brxz c with(nolock) on b.organizeID=c.organizeid and b.brxz=c.b sql += " and a.xm=@xm "; para.Add(new SqlParameter("@xm", xm)); } - sql += " group by a.organizeId,a.patid, c.brxzmc, blh,xm,xb,csny, zjh,dh,mz,zy,b.cardno,b.cardtypename "; + sql += " group by a.organizeId,a.patid, c.brxzmc, blh,xm,xb,csny, zjh,dh,dz,mz,zy,b.cardno,b.cardtypename "; return this.FindList(sql, para.ToArray()); } @@ -157,7 +153,7 @@ from [NewtouchHIS_Base].[dbo].[V_C_Sys_ItemsDetail] with(nolock) sql += " and catecode=@code "; } - return FindList(sql, new SqlParameter[] { new SqlParameter("@code", cateCode ?? "") }); + return FindList(sql, new SqlParameter[] {new SqlParameter("@code", cateCode ?? "")}); } @@ -206,7 +202,7 @@ left join [NewtouchHIS_Base].[dbo].[V_S_xt_ypjx] ypjx /// /// /// - public IList GetMedicalInfo(string orgId, int sfxmId, string sfxmCode, string sfxmmc) + public IList GetMedicalInfo(string orgId, int sfxmId, string sfxmCode,string sfxmmc) { List para = new List(); @@ -216,9 +212,8 @@ public IList GetMedicalInfo(string orgId, int sfxmId, string sfxmC left join [NewtouchHIS_Base].[dbo].[V_S_xt_sfdl] sfdl on sfxm.sfdlCode=sfdl.dlCode and sfdl.organizeId=@orgId where 1=1 and sfxm.zt='1' and sfxm.organizeId=@orgId"; - - if (sfxmId != 0) - { + + if (sfxmId != 0) { sql += " and sfxmId=@sfxmId "; para.Add(new SqlParameter("@sfxmId", sfxmId)); @@ -246,14 +241,14 @@ left join [NewtouchHIS_Base].[dbo].[V_S_xt_sfdl] sfdl /// /// /// - public IList GetDiseaseInfo(string orgId, string zdCode, string zdmc, string icd10) + public IList GetDiseaseInfo(string orgId, string zdCode, string zdmc,string icd10) { List para = new List(); para.Add(new SqlParameter("@orgId", orgId)); string sql = @" select zdCode,zdmc,icd10 from [NewtouchHIS_Base].[dbo].[V_S_xt_zd] where 1=1 "; - + if (!string.IsNullOrEmpty(zdCode)) { sql += " and zdCode=@zdCode "; @@ -285,7 +280,7 @@ public IList GetDiseaseInfo(string orgId, string zdCode, string zd /// /// /// - public IList GetMzpbSchedule(string orgId, string OutDate, string czks, string ysgh, string RegType, string ghpbid, string ScheduId, string FromOutDate = null, int pblx = 1) + public IList GetMzpbSchedule(string orgId,string OutDate,string czks, string ysgh,string RegType,string ghpbid,string ScheduId,string FromOutDate = null,int pblx=1) { string sql = @"select convert(varchar(20),ScheduId) ScheduId,a.[OrganizeId],convert(varchar(10),[OutDate],120)[OutDate],[ysgh], [ysxm],[czks],[czksmc],[RegType],[Title],[Period],[PeriodDesc],[TotalNum] @@ -295,11 +290,11 @@ from mz_ghpb_schedule a with(nolock) left join [NewtouchHIS_Base].dbo.[V_S_xt_sfxm] d with(nolock) on a.organizeid =d.organizeid and d.zt='1' and a.ghlx=d.sfxmcode left join [NewtouchHIS_Base].dbo.[V_S_xt_sfxm] e with(nolock) on a.organizeid =e.organizeid and d.zt='1' and a.zlxm=d.sfxmcode where a.[OrganizeId]=@orgId and a.zt='1' and OutDate>=@limitdate and IsBook='1' and IsCancel='0' "; - List para = new List(); - para.Add(new SqlParameter("@orgId", orgId)); + List para=new List(); + para.Add(new SqlParameter("@orgId",orgId)); para.Add(new SqlParameter("@limitdate", DateTime.Now.ToString("yyyy-MM-dd"))); - if (pblx == (int)EnumMzpblx.yy) + if (pblx == (int) EnumMzpblx.yy) { sql += " and IsBook=1 "; } @@ -391,8 +386,7 @@ left join [NewtouchHIS_Sett].[dbo].[mz_gh] e /// /// - public IList GetRecipeDrugInfo(string orgId, string cfmxId, string cfnm) - { + public IList GetRecipeDrugInfo(string orgId,string cfmxId,string cfnm) { List para = new List(); para.Add(new SqlParameter("@orgId", orgId)); @@ -429,8 +423,14 @@ left join [NewtouchHIS_Base].[dbo].[V_S_xt_ypjx] c /// /// /// - public IList OutbookRecord(string orgId, string kh, string xm, string lxdh, string BookId, int? yyzt, string ksrq, string jsrq, string ks, string ysgh, string appId) + public IList OutbookRecord(string orgId,string kh,string xm,string lxdh,string BookId,int? yyzt,string ksrq,string jsrq,string ks,string ysgh,string appId) { +// string sql = @"SELECT [OrganizeId],[BookId],[yyzt],[ScheduId],[ghxz],[patid],[xm],[xb],[lxdh],[kh],[ks],[ys],[OutDate] +//,[RegType],[Period],[PeriodStart],[PeriodEnd],[QueueNo],[RegFee],[PayFee],[PayLsh],[PayTime] +//,[CancelReason],[CancelTime],[mzh],[ghrq],[AppId],yynr +//from [mz_gh_book] a with(nolock) +//where a.zt='1' and a.OrganizeId=@orgId "; + string sql = @"SELECT a.[OrganizeId],[BookId], (case [yyzt] when 1 then (case when datediff(dd,getdate(),a.outdate)>=0 then '已预约' else '已作废' end) when 2 then '已挂号' when 3 then '预约取消' when 4 then '已作废' end)yyzt, @@ -450,10 +450,10 @@ left join [NewtouchHIS_Base].[dbo].[V_C_Sys_ItemsDetail] e with(nolock) on a.[Re para.Add(new SqlParameter("@orgId", orgId)); sql += " and a.OutDate>=@ksrq and a.OutDate<@jsrq "; - if (!string.IsNullOrWhiteSpace(ksrq) && !string.IsNullOrWhiteSpace(jsrq)) + if (!string.IsNullOrWhiteSpace(ksrq)&& !string.IsNullOrWhiteSpace(jsrq)) { var jstime = Convert.ToDateTime(jsrq).AddDays(1).ToString("yyyy-MM-dd"); - + para.Add(new SqlParameter("@ksrq", ksrq)); para.Add(new SqlParameter("@jsrq", jstime)); } @@ -482,7 +482,7 @@ left join [NewtouchHIS_Base].[dbo].[V_C_Sys_ItemsDetail] e with(nolock) on a.[Re sql += " and a.BookId=@BookId "; para.Add(new SqlParameter("@BookId", BookId)); } - if (yyzt != null) + if (yyzt!=null) { sql += " and a.yyzt=@yyzt "; para.Add(new SqlParameter("@yyzt", yyzt)); @@ -499,7 +499,7 @@ left join [NewtouchHIS_Base].[dbo].[V_C_Sys_ItemsDetail] e with(nolock) on a.[Re } sql += @" -order by a.outdate desc "; +order by a.outdate desc " ; return FindList(sql, para.ToArray()); } @@ -545,7 +545,7 @@ public decimal OutbookingApply(BookingRequestDto req, SysPatInfoVO patvo, MzpbSc { //获取剩余号源 var syhy = GetScheduleDetail(req.OrgId, pbvo.ScheduId).FirstOrDefault(); - if (syhy != null) + if (syhy!=null) { if (syhy.BookNum == 0) { @@ -561,11 +561,11 @@ public decimal OutbookingApply(BookingRequestDto req, SysPatInfoVO patvo, MzpbSc //申请预约 if (req != null && patvo != null && pbvo != null) { - var queno = _OutPatientDmnService.GetJzxh(req.ScheduId, pbvo.czks, pbvo.ysgh, "", req.AppId, req.OrgId); + var queno= _OutPatientDmnService.GetJzxh(req.scheduId, pbvo.czks, pbvo.ysgh, "", req.AppId, req.OrgId); var bookId = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_gh_book"); MzghbookEntity yyety = new MzghbookEntity(); yyety.BookId = bookId; - yyety.ScheduId = Convert.ToDecimal(req.ScheduId); + yyety.ScheduId = Convert.ToDecimal(req.scheduId); yyety.kh = req.kh; yyety.AppId = req.AppId; yyety.OutDate = Convert.ToDateTime(pbvo.OutDate); @@ -583,9 +583,9 @@ public decimal OutbookingApply(BookingRequestDto req, SysPatInfoVO patvo, MzpbSc yyety.xm = patvo.xm; yyety.xb = patvo.xb; yyety.yynr = pbvo.Title; - + yyety.OrganizeId = req.OrgId; - yyety.yyzt = ((int)EnumMzyyzt.book).ToString(); + yyety.yyzt = ((int) EnumMzyyzt.book).ToString(); yyety.Create(); @@ -609,17 +609,17 @@ public decimal OutbookingApply(BookingRequestDto req, SysPatInfoVO patvo, MzpbSc /// /// /// - public APIOutputDto OutpatRegApply(string bookId, string kh, string orgId, string payFee, string payLsh, string user) + public APIOutputDto OutpatRegApply(string bookId, string kh,string orgId, string payFee, string payLsh, string user) { - APIOutputDto res = new APIOutputDto(); - SysPatInfoVO patvo = new SysPatInfoVO(); - MzghbookEntity bookRecord = new MzghbookEntity(); + APIOutputDto res =new APIOutputDto(); + SysPatInfoVO patvo=new SysPatInfoVO(); + MzghbookEntity bookRecord=new MzghbookEntity(); int patid = -1; if (!string.IsNullOrWhiteSpace(bookId)) { - string yyzt = ((int)EnumMzyyzt.book).ToString(); - DateTime datevalid = DateTime.Now.Date; + string yyzt = ((int) EnumMzyyzt.book).ToString(); + DateTime datevalid=DateTime.Now.Date; bookRecord = _MzghbookRepo.FindEntity(p => p.BookId.ToString() == bookId && p.yyzt == yyzt && p.zt == "1" && p.OrganizeId == orgId && p.OutDate >= datevalid); @@ -648,33 +648,33 @@ public APIOutputDto OutpatRegApply(string bookId, string kh, string orgId, strin if (!string.IsNullOrWhiteSpace(kh)) { patvo = GetPatInfo(orgId, kh, null, null).FirstOrDefault(); - if (patvo != null) + if (patvo!=null) { if (patid == -1) { patid = patvo.patid; } - else if (patid != patvo.patid) + else if(patid!=patvo.patid) { res.code = 0; res.msg = "预约信息与卡信息不符,请重试。"; } } - else + else { res.code = 0; res.msg = "卡信息异常,请联系管理员。"; } } - if (string.IsNullOrWhiteSpace(res.msg) && patvo != null && bookRecord != null) + if (string.IsNullOrWhiteSpace(res.msg) && patvo!=null && bookRecord!=null) { //获取门诊号 string mzh = _OutPatientSettleDmnService.GetRegMzh(patid, bookRecord.ScheduId.ToString(), bookRecord.ks, orgId, null, bookRecord.QueueNo, bookRecord.OutDate.ToString("yyyy-MM-dd")); var scheduety = GetMzpbSchedule(orgId, null, null, null, null, null, bookRecord.ScheduId.ToString()).FirstOrDefault(); - if (!string.IsNullOrWhiteSpace(mzh) && scheduety != null) + if (!string.IsNullOrWhiteSpace(mzh) && scheduety!=null) { try { @@ -687,31 +687,31 @@ public APIOutputDto OutpatRegApply(string bookId, string kh, string orgId, strin feeRelated.xjzfys = bookRecord.RegFee; var scheduId = Convert.ToInt32(scheduety.ScheduId); string ghly = "1"; - SysCashPaymentModelEntity zffsEty = new SysCashPaymentModelEntity(); + SysCashPaymentModelEntity zffsEty=new SysCashPaymentModelEntity(); if (bookRecord.AppId == EnumMzghly.WeChat.ToString()) { zffsEty = _sysForCashPayRepository.FindEntity(p => p.xjzffsmc.Contains("微信") && p.zt == "1"); - ghly = ((int)EnumMzghly.WeChat).ToString(); + ghly = ((int) EnumMzghly.WeChat).ToString(); } else if (bookRecord.AppId == EnumMzghly.Alipay.ToString()) { zffsEty = _sysForCashPayRepository.FindEntity(p => p.xjzffsmc.Contains("支付宝") && p.zt == "1"); - ghly = ((int)EnumMzghly.Alipay).ToString(); + ghly = ((int) EnumMzghly.Alipay).ToString(); } feeRelated.zffs1 = zffsEty == null ? "" : zffsEty.xjzffs; feeRelated.zfje1 = zffsEty == null ? null : bookRecord.RegFee; _OutPatientSettleDmnService.Save(orgId, patid, kh, ghly, scheduety.RegType, scheduety.czks, "", scheduety.czksmc, "", scheduety.ghlx, scheduety.zlxm, null, null, false, - false, bookRecord.QueueNo, scheduId, feeRelated, bookRecord.ghxz, null, mzh, "0", null, null, null, null, null, + false, bookRecord.QueueNo, scheduId, feeRelated, bookRecord.ghxz, null, mzh, "0", null,null,null,null,null,null, out regobj); var regEty = _outpatientRegRepo.FindEntity(p => p.mzh == mzh && p.zt == "1" && p.OrganizeId == orgId); if (regEty != null) - { + { regEty.ghrq = bookRecord.OutDate; _outpatientRegRepo.Update(regEty); @@ -719,8 +719,8 @@ public APIOutputDto OutpatRegApply(string bookId, string kh, string orgId, strin bookRecord.PayLsh = payLsh; bookRecord.LastModifyTime = DateTime.Now; bookRecord.LastModifierCode = user; - bookRecord.yyzt = ((int)EnumMzyyzt.reg).ToString(); - bookRecord.ghrq = bookRecord.OutDate; + bookRecord.yyzt= ((int)EnumMzyyzt.reg).ToString(); + bookRecord.ghrq= bookRecord.OutDate; bookRecord.mzh = mzh; _MzghbookRepo.Update(bookRecord); @@ -751,12 +751,12 @@ public APIOutputDto OutpatRegApply(string bookId, string kh, string orgId, strin } } - + return res; } - public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh, string kh, string appId) + public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh,string kh,string appId) { APIOutputDto res = new APIOutputDto(); object newJszbInfo; @@ -768,17 +768,17 @@ public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh, strin var regEty = _outpatientRegRepo.FindEntity(p => p.mzh == mzh && p.zt == "1" && p.OrganizeId == orgId && p.CreatorCode == user && - p.ghly != ((int)EnumMzghly.His).ToString()); + p.ghly != ((int) EnumMzghly.His).ToString()); if (regEty != null) { var isTody = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); //待就诊 且已结 - if (regEty.jzbz == ((int)EnumOutpatientJzbz.Djz).ToString() && regEty.ghzt == "1" && + if (regEty.jzbz == ((int) EnumOutpatientJzbz.Djz).ToString() && regEty.ghzt == "1" && regEty.ghrq == isTody) { var jsEty = _outpatientSettlementRepo.FindEntity(p => p.OrganizeId == orgId && p.ghnm == regEty.ghnm && - p.jslx == ((int)EnumJslx.GH).ToString() && p.jszt == (int)Constants.jsztEnum.YJ && + p.jslx == ((int) EnumJslx.GH).ToString() && p.jszt == (int) Constants.jsztEnum.YJ && p.tbz != 1); if (jsEty != null) { @@ -801,7 +801,7 @@ public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh, strin } //预约挂号只能当前平台退号 - var yyzt = ((int)EnumMzyyzt.reg).ToString(); + var yyzt = ((int) EnumMzyyzt.reg).ToString(); var bookRecord = _MzghbookRepo.FindEntity(p => p.OrganizeId == orgId && p.mzh == mzh && p.zt == "1" && p.yyzt == yyzt); if (bookRecord != null) @@ -814,12 +814,12 @@ public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh, strin null, null, null, null); var newjsEty = _outpatientSettlementRepo.FindEntity(p => p.OrganizeId == orgId && p.ghnm == regEty.ghnm && - p.jslx == ((int)EnumJslx.GH).ToString() && - p.jszt == (int)Constants.jsztEnum.YT && + p.jslx == ((int) EnumJslx.GH).ToString() && + p.jszt == (int) Constants.jsztEnum.YT && p.tbz == 1); if (newjsEty != null) { - bookRecord.yyzt = ((int)EnumMzyyzt.regcancel).ToString(); + bookRecord.yyzt = ((int) EnumMzyyzt.regcancel).ToString(); bookRecord.LastModifyTime = DateTime.Now; bookRecord.LastModifierCode = user; _MzghbookRepo.Update(bookRecord); @@ -903,7 +903,7 @@ public APIOutputDto OutPatRegCancel(string orgId, string user, string mzh, strin return res; } - public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, string ks, string user, string AppId, string ghlybz) + public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, string ks,string user,string AppId, string ghlybz) { APIOutputDto res = new APIOutputDto(); SysPatInfoVO patvo = new SysPatInfoVO(); @@ -927,7 +927,7 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, string dtnow = DateTime.Now.ToString("yyyy-MM-dd"); var con = ConfigurationHelper.GetAppConfigValue("RegLimit"); - if (con == "1") + if (con=="1") { var reginfo = RegPermitCheck(patvo.blh, orgId, ks, dtnow); if (reginfo == false) @@ -941,8 +941,8 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, { string mzh = ""; int jzxh = 0; - - if (string.IsNullOrWhiteSpace(ghxz)) + + if(string.IsNullOrWhiteSpace(ghxz)) { ghxz = ((int)EnumGhxz.PTGH).ToString(); } @@ -953,8 +953,8 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, { //获取门诊号 就诊序号 var mjz = ((int)EnumOutPatientType.generalOutpat).ToString(); - var ghready = _OutPatientSettleDmnService.GetCQMzhJzxh(patvo.patid, scheduety.ScheduId, ks, null, orgId, user, mjz, null, ghrq); - if (ghready != null) + var ghready = _OutPatientSettleDmnService.GetCQMzhJzxh(patvo.patid,scheduety.ScheduId,ks,null,orgId, user, mjz,null,ghrq); + if(ghready!=null) { jzxh = ghready.Item1; mzh = ghready.Item2; @@ -1004,7 +1004,7 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, _OutPatientSettleDmnService.Save(orgId, patid, kh, ghly, scheduety.RegType, scheduety.czks, "", scheduety.czksmc, "", null, null, null, null, false, - false, jzxh, scheduId, feeRelated, ghxz, null, mzh, "0", null, null, null, null, null, + false, jzxh, scheduId, feeRelated, ghxz, null, mzh, "0",null, null,null,null,null, null, out regobj); var regEty = @@ -1016,7 +1016,7 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, regEty.ghlybz = ghly; _outpatientRegRepo.Update(regEty); } - + res.data = regobj; res.code = 1; res.msg = "挂号成功。"; @@ -1047,7 +1047,7 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, res.code = 0; res.msg = "该科室当日无相关排班。"; } - + } @@ -1056,21 +1056,21 @@ public APIOutputDto OutpatReg(string kh, string orgId, string ghrq, string ghxz, } - public bool RegPermitCheck(string blh, string orgId, string ks, string ghrq) + public bool RegPermitCheck(string blh,string orgId,string ks,string ghrq) { string sql = @" select mzh from mz_gh with(nolock) where organizeid=@orgId and blh=@blh and ks=@ks and convert(date,ghrq)=convert(date,@ghrq) and ghzt=0 "; - var list = this.FindList(sql, new SqlParameter[] { + var list= this.FindList(sql, new SqlParameter[] { new SqlParameter("@orgId",orgId), new SqlParameter("@blh",blh), new SqlParameter("@ks",ks), new SqlParameter("@ghrq",ghrq), }); - if (list != null && list.Count > 0) + if(list!=null && list.Count>0) { return false; } @@ -1118,7 +1118,7 @@ left join xt_brxz brxz --未退 and ISNULL(js.tbz, 0)=0 "; - if (!string.IsNullOrWhiteSpace(kh)) + if(!string.IsNullOrWhiteSpace(kh)) { sql += " and gh.kh=@kh "; } @@ -1127,13 +1127,13 @@ left join xt_brxz brxz sql += " and gh.mzh=@mzh "; } - var list = this.FindList(sql, new SqlParameter[] { + var list= this.FindList(sql, new SqlParameter[] { new SqlParameter("@orgId",orgId), new SqlParameter("@kh",kh), new SqlParameter("@mzh",mzh), }); - if (list != null && list.Count > 0) + if(list!=null && list.Count>0) { foreach (var item in list) { @@ -1141,13 +1141,13 @@ left join xt_brxz brxz dto.MainRecords = new List(); dto.DetailRecords = new List(); dto.MainRecords.Add(item); - var delist = OutpatChargeDetail(orgId, item.jsnm.ToString()); - if (delist != null && delist.Count > 0) + var delist= OutpatChargeDetail(orgId,item.jsnm.ToString()); + if(delist!=null && delist.Count>0) { - foreach (var s in delist) + foreach(var s in delist) { dto.DetailRecords.Add(s); - } + } } dtoList.Add(dto); @@ -1159,7 +1159,7 @@ left join xt_brxz brxz } - public IList OutpatChargeDetail(string orgId, string jsnm) + public IList OutpatChargeDetail(string orgId,string jsnm) { string sql = @"exec spSelectRecordsDetailByJsnm @jsnm=@jsnm,@OrganizeId=@OrganizeId "; return this.FindList(sql, new SqlParameter[] { @@ -1167,9 +1167,5 @@ public IList OutpatChargeDetail(string orgId, stri new SqlParameter("@OrganizeId",orgId) }); } - - - - } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingReginsterDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingReginsterDmnService.cs index 9435f5ad..6b116903 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingReginsterDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/API/BookingReginsterDmnService.cs @@ -5,12 +5,15 @@ using Newtouch.Core.Common.Utils; using Newtouch.HIS.Domain.DTO; using Newtouch.HIS.Domain.DTO.InputDto; +using Newtouch.HIS.Domain.DTO.OutputDto; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IDomainServices.API; using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.IRepository.OutpatientManage; using Newtouch.HIS.Domain.ValueObjects; +using Newtouch.HIS.Domain.ValueObjects.API; +using Newtouch.HIS.Proxy.guian.DTO.S25; using Newtouch.HIS.Sett.Request; using Newtouch.HIS.Sett.Request.Booking.Request; using Newtouch.HIS.Sett.Request.Booking.Response; @@ -48,16 +51,16 @@ public BookingReginsterDmnService(IDefaultDatabaseFactory databaseFactory) private readonly IPatientBasicInfoDmnService _PatientBasicInfoDmnService; private readonly IOutBookScheduleRepo _OutBookScheduleRepo; private readonly IOutpatientRegistRepo _ioutpatientRegistRepo; - private readonly IOutPatChargeDmnService _outChargeDmnService; + //private readonly IOutPatChargeApp _outPatChargeApp; /// /// 获取卡信息 /// /// /// - public IList GetCardInfo(CardInfoReq req) + public IList GetCardInfo(CardInfoReq req) { - string sql = @"select a.patid,blh,a.xm,xb,csny csrq,b.CardNo kh ,b.CardType klx, -b.CardTypeName klxmc,b.brxz, b.brxz,c.brxzmc, zjh + string sql = @"select a.patid PatientNumber,blh,a.xm PatientName,xb Gender,csny Brithday,b.CardNo ,b.CardType, +b.CardTypeName,b.brxz, b.brxz PatType,c.brxzmc PatTypeName, Zjh from xt_brjbxx a with(nolock) left join xt_card b with(nolock) on a.organizeID=b.organizeid and a.patid=b.patid and b.zt='1' left join dbo.xt_brxz c with(nolock) on b.organizeID=c.organizeid and b.brxz=c.brxz and c.zt='1' @@ -85,10 +88,10 @@ left join dbo.xt_brxz c with(nolock) on b.organizeID=c.organizeid and b.brxz=c.b sql += " and b.brxz=@brxz "; para.Add(new SqlParameter("@brxz", req.PatType)); } - return this.FindList(sql, para.ToArray()); + return this.FindList(sql, para.ToArray()); } /// - /// 获取预约出诊科室信息(弃用) + /// 获取预约出诊科室信息 /// /// /// @@ -112,8 +115,7 @@ public IList GetDepartmentInfo(DepartmentDTO dto) { sql += " and name=@name "; para.Add(new SqlParameter("@name", dto.DeptName)); - } - return this.FindList(sql, para.ToArray()); + }return this.FindList(sql, para.ToArray()); } /// @@ -132,19 +134,19 @@ left join [NewtouchHIS_Base].dbo.[V_S_xt_sfxm] d with(nolock) on a.organizeid =d left join [dbo].[mz_gh_zlxmzh] e with(nolock) on a.organizeid =e.organizeid and e.zt='1' and a.zlxm=e.zhcode where a.[OrganizeId]=@orgId and a.zt='1' and a.OutDate>=convert(varchar(10),GETDATE(),121) and a.OutDate<=convert(varchar(10), DATEADD(DAY,@pbday,GETDATE()),121) and IsBook='1' and IsCancel='0' "; - List para = new List(); + List para=new List(); para.Add(new SqlParameter("@orgId", ConfigurationManager.AppSettings[dto.HospitalID])); if (string.IsNullOrWhiteSpace(dto.SchedulingDay.ToString())) { - dto.SchedulingDay = Convert.ToInt32(ConfigurationHelper.GetAppConfigValue("mzpbday")); + dto.SchedulingDay =Convert.ToInt32(ConfigurationHelper.GetAppConfigValue("mzpbday")); } para.Add(new SqlParameter("@pbday", dto.SchedulingDay)); if (!string.IsNullOrWhiteSpace(dto.Dept)) { sql += " and czks=@czks"; - para.Add(new SqlParameter("@czks", dto.Dept)); + para.Add(new SqlParameter("@czks",dto.Dept)); } if (!string.IsNullOrWhiteSpace(dto.RegType)) { @@ -230,22 +232,17 @@ public IList GetMzpbDetail(MzKsPbDto dto) { string sql = @"select cast(a.ScheduId as int) ScheduId,a.[OutDate], -[czks] OutDept,[czksmc] OutDeptName,a.[RegType],a.[Title],[ysgh] Doctor,[ysxm] DoctorName,Weekdd,a.[Period],[PeriodDesc],a.[PeriodStart],a.[PeriodEnd] +[czks] OutDept,[czksmc] OutDeptName,a.[RegType],[Title],[ysgh] Doctor,[ysxm] DoctorName,Weekdd,a.[Period],[PeriodDesc],a.[PeriodStart],a.[PeriodEnd] ,convert(decimal(10,2),a.[RegFee]) [RegFee],isnull(d.dj,0.00) GhFee,sum(isnull(e.price,0.00)) ZLFee, -[ghlx],a.[zlxm],d.sfxmmc ghxmName,'诊疗费' zlxmName,[TotalNum],a.TotalNum-count(b.bookid) BookNum,a.IsBook +[ghlx],a.[zlxm],d.sfxmmc ghxmName,'诊疗费' zlxmName,[TotalNum],a.TotalNum-count(b.bookid) BookNum from mz_ghpb_schedule a with(nolock) left join mz_gh_book b with(nolock) on a.organizeid=b.organizeid and a.scheduid=b.scheduid and b.zt=1 and b.yyzt<>'3' left join [NewtouchHIS_Base].dbo.[V_S_xt_sfxm] d with(nolock) on a.organizeid =d.organizeid and d.zt='1' and a.ghlx=d.sfxmcode left join [dbo].[mz_gh_zlxmzh] e with(nolock) on a.organizeid =e.organizeid and e.zt='1' and a.zlxm=e.zhcode -where a.[OrganizeId]=@orgId and a.zt='1' and IsCancel='0' "; +where a.[OrganizeId]=@orgId and a.zt='1' and IsBook='1' and IsCancel='0' "; List para = new List(); para.Add(new SqlParameter("@orgId", ConfigurationManager.AppSettings[dto.HospitalID])); - if (!string.IsNullOrWhiteSpace(dto.ScheduId.ToString())) - { - sql += " and a.ScheduId=@ScheduId"; - para.Add(new SqlParameter("@ScheduId", dto.ScheduId.ToString())); - } if (!string.IsNullOrWhiteSpace(dto.RegType)) { sql += " and a.OutDate=convert(varchar(10),@OutDate,121) "; @@ -276,10 +273,14 @@ left join [dbo].[mz_gh_zlxmzh] e with(nolock) on a.organizeid =e.organizeid and sql += " and a.RegType=@RegType"; para.Add(new SqlParameter("@RegType", dto.RegType)); } - + if (!string.IsNullOrWhiteSpace(dto.ScheduId.ToString())) + { + sql += " and a.ScheduId=@ScheduId"; + para.Add(new SqlParameter("@ScheduId", dto.ScheduId.ToString())); + } sql += @" group by a.ScheduId,a.OutDate, -[czks],[czksmc],a.[RegType],a.[Title],[ysgh],[ysxm],weekdd,a.[Period],[PeriodDesc],a.[PeriodStart],a.[PeriodEnd],a.[RegFee], -[ghlx],a.[zlxm],d.sfxmmc,TotalNum,d.dj,e.price,a.IsBook +[czks],[czksmc],a.[RegType],[Title],[ysgh],[ysxm],weekdd,a.[Period],[PeriodDesc],a.[PeriodStart],a.[PeriodEnd],a.[RegFee], +[ghlx],a.[zlxm],d.sfxmmc,TotalNum,d.dj,e.price order by a.OutDate "; return FindList(sql, para.ToArray()); } @@ -330,57 +331,51 @@ left join dbo.xt_brxz c with(nolock) on b.organizeID=c.organizeid and b.brxz=c.b public MzAppointmentResp OutAppointment(MzAppointmentReq dto) { string message = ""; + if (dto.IsBooking == "N" && Convert.ToDateTime(dto.OutDate).Date != DateTime.Now.Date) + { + throw new FailedException("非预约挂号只能选择当天!"); + } + if (Convert.ToDateTime(dto.OutDate).Date < DateTime.Now.Date) + { + throw new FailedException("预约日期需要为今天之后的日期!"); + } MzKsPbDto pbxx = new MzKsPbDto(); pbxx.ScheduId = dto.ScheduId; pbxx.HospitalID = dto.HospitalID; var pbEntity = GetMzpbDetail(pbxx).FirstOrDefault(); - if (pbEntity == null) { - message = "排班信息不可约或已取消,请重新选择!"; + message = dto.IsBooking == "N" ? "该排班不支持当日挂号!" : "该排班不可预约!"; throw new FailedException(message); } - if (pbEntity.BookNum == 0) + if (pbEntity.BookNum==0) { throw new FailedException("该排班已无号源!"); } - if (Convert.ToDateTime(pbEntity.OutDate).Date < DateTime.Now.Date) - { - throw new FailedException("排班已过期,请重新选择!"); - } var brxxEntiey = GetPatInfo(dto.HospitalID, dto.CardNo, null, null).FirstOrDefault(); if (brxxEntiey == null) { throw new FailedException("该卡号在His中未登记!"); } - DateTime pbOutdate = pbEntity.OutDate;// Convert.ToDateTime(dto.OutDate); + DateTime pbOutdate = Convert.ToDateTime(dto.OutDate); dto.HospitalID = ConfigurationManager.AppSettings[dto.HospitalID]; - var yyEntity = _MzghbookRepo.FindEntity(p => p.OrganizeId == dto.HospitalID && p.kh == dto.CardNo && - p.ScheduId == dto.ScheduId && p.zt == "1" && p.yyzt != ((int)EnumMzyyzt.cancel).ToString()); + var yyEntity = _MzghbookRepo.FindEntity(p => p.OrganizeId == dto.HospitalID && p.kh == dto.CardNo && + p.yyzt != ((int)EnumMzyyzt.cancel).ToString() && + p.yyzt != ((int)EnumMzyyzt.bookreg).ToString() && + p.ScheduId == dto.ScheduId && p.zt == "1" && p.OutDate == pbOutdate); if (yyEntity != null) { - switch (Convert.ToInt32(yyEntity.yyzt)) - { - case (int)EnumMzyyzt.book: - case (int)EnumMzyyzt.reg: - message = "该卡号已预约过该排班,请勿重复预约!"; - break; - case (int)EnumMzyyzt.cancel: - break; - } - if (!string.IsNullOrWhiteSpace(message)) - { - throw new FailedException(message); - } + message = dto.IsBooking == "N" ? "该卡号已预约过该排班,请取消后在进行当日挂号或用预约号挂号!" : "该卡号已预约过该排班,请勿重复预约!"; + throw new FailedException(message); } var kepbEntity = _MzghbookRepo.FindEntity(p => p.OrganizeId == dto.HospitalID && p.yyzt != ((int)EnumMzyyzt.cancel).ToString() && - p.yyzt != ((int)EnumMzyyzt.reg).ToString() && - p.zt == "1" && p.kh == dto.CardNo && p.RegType == pbEntity.RegType && p.ks == pbEntity.OutDept && p.OutDate == pbOutdate); + p.yyzt != ((int)EnumMzyyzt.bookreg).ToString() && + p.zt == "1" && p.kh == dto.CardNo && p.ks == pbEntity.OutDept && p.OutDate == pbOutdate); if (kepbEntity != null) { - message = "同一科室相同门诊(门诊类型)当天不可重复预约!"; + message = dto.IsBooking == "N" ? "该卡号已预约过该科室,请取消后在进行当日挂号或用预约号挂号!" : "同一科室当天不可重复预约!"; throw new FailedException(message); } var queno = _OutPatientDmnService.GetJzxh(dto.ScheduId.ToString(), pbEntity.OutDept, pbEntity.Doctor, "", dto.AppID, dto.HospitalID); @@ -390,7 +385,7 @@ public MzAppointmentResp OutAppointment(MzAppointmentReq dto) yyety.ScheduId = Convert.ToDecimal(dto.ScheduId); yyety.kh = dto.CardNo; yyety.AppId = dto.AppID; - yyety.OutDate = pbOutdate; + yyety.OutDate = Convert.ToDateTime(dto.OutDate); yyety.patid = brxxEntiey.patid; yyety.Period = Convert.ToInt32(pbEntity.Period); yyety.PeriodStart = pbEntity.PeriodStart; @@ -404,26 +399,13 @@ public MzAppointmentResp OutAppointment(MzAppointmentReq dto) yyety.ys = pbEntity.Doctor; yyety.xm = brxxEntiey.xm; yyety.xb = brxxEntiey.xb; + yyety.yynr = pbEntity.Title; yyety.OrganizeId = dto.HospitalID; yyety.CreatorCode = dto.AppID; - yyety.yyzt = dto.IsBooking == "N" ? ((int)EnumMzyyzt.bookreg).ToString() : ((int)EnumMzyyzt.book).ToString(); + yyety.yyzt =dto.IsBooking== "N" ? ((int)EnumMzyyzt.bookreg).ToString(): ((int)EnumMzyyzt.book).ToString(); + - string Desc = ""; - if (!string.IsNullOrWhiteSpace(pbEntity.DoctorName)) - { - switch (Convert.ToInt32(pbEntity.RegType)) - { - case (int)EnumOutPatientType.expertOutpat: - Desc = $"[{pbEntity.DoctorName}]专家"; - break; - default: - Desc = $"[{pbEntity.DoctorName}]医生"; - break; - } - } - yyety.yynr = $"{pbEntity.OutDeptName} {Desc} {pbEntity.PeriodDesc}"; - yyety.Title = pbEntity.Title; yyety.Create(); _MzghbookRepo.Insert(yyety); var regEty = _OutBookScheduleRepo.FindEntity(p => p.ScheduId == dto.ScheduId && p.zt == "1"); @@ -432,94 +414,74 @@ public MzAppointmentResp OutAppointment(MzAppointmentReq dto) regEty.YYNum += 1; _OutBookScheduleRepo.Update(regEty); } - else - { - message = "未找到当前的预约数据!"; + else { + message = dto.IsBooking == "N" ? "未找到当日挂号排班信息!" : "未找到当前的预约数据!"; throw new FailedException(message); } return new MzAppointmentResp() { BookID = bookId.ToString(), - QueueNo = queno + QueueNo=queno }; } /// - /// 预约挂号结算 + /// (挂号结算) /// /// /// - public RegSettResp BookOutpatRegSett(RegSettReq req) + public RegSettResp OutpatRegSett(RegSettReq req) { + MzghbookEntity bookRecord = new MzghbookEntity(); string message = ""; int patid = -1; int qzjzxh = -1; string orgId = ConfigurationManager.AppSettings[req.HospitalID]; - DateTime today = DateTime.Now.Date; - if (string.IsNullOrWhiteSpace(req.BookID.ToString())) - { - throw new FailedException("BookID不可为空"); - } - MzghbookEntity bookRecord = _MzghbookRepo.FindEntity(p => - p.BookId == req.BookID && p.yyzt == ((int)EnumMzyyzt.book).ToString() && p.zt == "1" && p.OrganizeId == orgId && - p.OutDate >= today); - if (bookRecord != null) + if (!string.IsNullOrWhiteSpace(req.BookID.ToString())) { - patid = Convert.ToInt32(bookRecord.patid); - qzjzxh = bookRecord.QueueNo; - if (req.CardNo != bookRecord.kh) + string yyzt = req.IsBooking=="N" ? ((int)EnumMzyyzt.bookreg).ToString():((int)EnumMzyyzt.book).ToString(); + DateTime datevalid = DateTime.Now.Date; + bookRecord = _MzghbookRepo.FindEntity(p => + p.BookId == req.BookID && p.yyzt == yyzt && p.zt == "1" && p.OrganizeId == orgId && + p.OutDate >= datevalid); + if (bookRecord != null) + { + patid = Convert.ToInt32(bookRecord.patid); + qzjzxh = bookRecord.QueueNo; + if (req.CardNo != bookRecord.kh) + { + message = req.IsBooking == "N" ? "卡信息异常,请重新挂号!" : "卡信息异常,请确认预约信息与患者是否一致"; + throw new FailedException(message); + } + } + else { - message = "卡信息异常,请确认预约信息与患者是否一致"; + message = req.IsBooking == "N" ? "挂号失败,请重试" : "未找到预约号【" + req.BookID + "】,请确认预约状态及日期是否有效"; throw new FailedException(message); } - if (bookRecord.ghxz == ((int)EnumBrxz.zf).ToString() && req.PayFee != bookRecord.RegFee) + var brxxEntiey = GetPatInfo(req.HospitalID, req.CardNo, null, null).FirstOrDefault(); + if (brxxEntiey != null) { - throw new FailedException($"支付费用({req.PayFee}元)与约定挂号费({bookRecord.RegFee}元)不一致,请重新支付!"); + if (patid != brxxEntiey.patid) + { + throw new FailedException("预约信息与卡信息不符"); + } } - else if (req.PayFee > 0 && string.IsNullOrWhiteSpace(req.PayLsh)) + else { - throw new FailedException("交易金额大于0元时,交易流水号必传!"); + throw new FailedException("当前卡号【" + req.CardNo + "】在HIS中不存在!"); } + } - else - { - message = "未找到待支付预约【" + req.BookID + "】,请确认预约状态及日期是否有效"; - throw new FailedException(message); - } - var brxxEntiey = GetPatInfo(req.HospitalID, req.CardNo, null, null).FirstOrDefault(); - if (brxxEntiey == null) - { - throw new FailedException("就诊卡【" + req.CardNo + "】信息无效,请联系管理员!"); - } + //获取门诊号 + string mzh = _OutPatientSettleDmnService.GetRegMzh(patid, bookRecord.ScheduId.ToString(), bookRecord.ks, orgId, null, + bookRecord.QueueNo, bookRecord.OutDate.ToString("yyyy-MM-dd")); MzKsPbDto pbxx = new MzKsPbDto(); var scheduId = Convert.ToInt32(bookRecord.ScheduId); pbxx.HospitalID = req.HospitalID; pbxx.ScheduId = scheduId; var pbEntity = GetMzpbDetail(pbxx).FirstOrDefault(); if (pbEntity == null) - { - throw new FailedException("该排班已停诊或作废,请联系管理员!"); - } - string ghly = ((int)EnumMzghly.His).ToString(); - SysCashPaymentModelEntity zffsEty = new SysCashPaymentModelEntity(); - zffsEty = _sysForCashPayRepository.FindEntity(p => p.xjzffs == req.PayWay && p.zt == "1"); - if (zffsEty == null) - { - throw new FailedException("暂不支持该支付方式!"); - } - var ghlylist = EnumHelper.GetEnumDic().FirstOrDefault(p => req.AppID.Contains(p.Value.ToString())); - - if (string.IsNullOrWhiteSpace(ghlylist.Value)) - { - throw new FailedException("该挂号渠道未授权!"); - } - else - { - ghly = ghlylist.Key.ToString(); - } - - //获取门诊号 - string mzh = _OutPatientSettleDmnService.GetRegMzh(patid, bookRecord.ScheduId.ToString(), bookRecord.ks, orgId, null, - bookRecord.QueueNo, bookRecord.OutDate.ToString("yyyy-MM-dd")); + throw new FailedException("该排班无效,请重试!"); object regobj; OutpatientSettFeeRelatedDTO feeRelated = new OutpatientSettFeeRelatedDTO(); @@ -530,27 +492,42 @@ public RegSettResp BookOutpatRegSett(RegSettReq req) feeRelated.xjzfys = bookRecord.RegFee; feeRelated.yjjzfje = 0; feeRelated.djjess = req.PayFee; + + + string ghly = "1"; + SysCashPaymentModelEntity zffsEty = new SysCashPaymentModelEntity(); + if (bookRecord.AppId == EnumMzghly.WeChat.ToString()) + { + zffsEty = _sysForCashPayRepository.FindEntity(p => + p.xjzffsmc.Contains("微信") && p.zt == "1"); + ghly = ((int)EnumMzghly.WeChat).ToString(); + } + else if (bookRecord.AppId == EnumMzghly.Alipay.ToString()) + { + zffsEty = _sysForCashPayRepository.FindEntity(p => + p.xjzffsmc.Contains("支付宝") && p.zt == "1"); + ghly = ((int)EnumMzghly.Alipay).ToString(); + } feeRelated.zffs1 = zffsEty == null ? "" : zffsEty.xjzffs; feeRelated.zfje1 = zffsEty == null ? null : req.PayFee; feeRelated.djjesszffs = zffsEty == null ? "" : zffsEty.xjzffs; - _OutPatientSettleDmnService.Save(orgId, patid, req.CardNo, ghly, bookRecord.RegType, - bookRecord.ks, bookRecord.ys, pbEntity.OutDeptName, pbEntity.DoctorName, pbEntity.Ghlx, pbEntity.Zlxm, null, null, false, - false, bookRecord.QueueNo, scheduId, feeRelated, bookRecord.ghxz, null, mzh, "0", null, null, null, null, null, + _OutPatientSettleDmnService.Save(orgId, patid, req.CardNo, ghly, pbEntity.RegType, + pbEntity.OutDept, "", pbEntity.OutDeptName, "", pbEntity.Ghlx, pbEntity.Zlxm, null, null, false, + false, bookRecord.QueueNo, scheduId, feeRelated, bookRecord.ghxz, null, mzh, "0", null, null, null, null, null, null, out regobj); var regEty = _outpatientRegRepo.FindEntity(p => p.mzh == mzh && p.zt == "1" && p.OrganizeId == orgId); if (regEty != null) { regEty.ghrq = bookRecord.OutDate; - regEty.CreatorCode = req.AppID; _outpatientRegRepo.Update(regEty); bookRecord.PayFee = req.PayFee; bookRecord.PayLsh = req.PayLsh; bookRecord.LastModifyTime = DateTime.Now; bookRecord.LastModifierCode = req.AppID; - bookRecord.yyzt = ((int)EnumMzyyzt.reg).ToString(); - bookRecord.drghstatu = bookRecord.OutDate == today ? "Y" : ""; + bookRecord.yyzt = req.IsBooking == "N" ? ((int)EnumMzyyzt.bookreg).ToString():((int)EnumMzyyzt.reg).ToString(); + bookRecord.drghstatu =req.IsBooking=="N"?"Y":""; bookRecord.ghrq = bookRecord.OutDate; bookRecord.mzh = mzh; _MzghbookRepo.Update(bookRecord); @@ -559,101 +536,12 @@ public RegSettResp BookOutpatRegSett(RegSettReq req) return new RegSettResp() { RegId = ((dynamic)regobj).jsnm.ToString(), - QueueNo = bookRecord.QueueNo, - Mzh = mzh - }; - } - /// - /// 挂号结算 - /// - /// - /// - public RegSettResp OutpatRegSett(RegSettReq req) - { - int patid = -1; - string orgId = ConfigurationManager.AppSettings[req.HospitalID]; - DateTime today = DateTime.Now.Date; - if (string.IsNullOrWhiteSpace(req.ScheduId.ToString()) || string.IsNullOrWhiteSpace(req.CardNo)) - { - throw new FailedException("排班Id、就诊卡号不可为空"); - } - var brxxEntiey = GetPatInfo(req.HospitalID, req.CardNo, null, null).FirstOrDefault(); - if (brxxEntiey == null) - { - throw new FailedException("就诊卡【" + req.CardNo + "】信息无效,请联系管理员!"); - } - patid = brxxEntiey.patid; - MzKsPbDto pbxx = new MzKsPbDto(); - var scheduId = Convert.ToInt32(req.ScheduId); - pbxx.HospitalID = req.HospitalID; - pbxx.ScheduId = scheduId; - var pbEntity = GetMzpbDetail(pbxx).FirstOrDefault(); - if (pbEntity == null) - { - throw new FailedException("该排班已停诊或作废,请联系管理员!"); - } - if (req.ghxz == ((int)EnumBrxz.zf).ToString() && req.PayFee != pbEntity.RegFee) - { - throw new FailedException($"支付费用({req.PayFee}元)与约定挂号费({pbEntity.RegFee}元)不一致,请重新支付!"); - } - else if (req.PayFee > 0 && string.IsNullOrWhiteSpace(req.PayLsh)) - { - throw new FailedException("交易金额大于0元时,交易流水号必传!"); - } - - string ghly = ((int)EnumMzghly.His).ToString(); - SysCashPaymentModelEntity zffsEty = new SysCashPaymentModelEntity(); - zffsEty = _sysForCashPayRepository.FindEntity(p => p.xjzffs == req.PayWay && p.zt == "1"); - if (zffsEty == null) - { - throw new FailedException("暂不支持该支付方式!"); - } - var ghlylist = EnumHelper.GetEnumDic().FirstOrDefault(p => req.AppID.Contains(p.Value.ToString())); - - if (string.IsNullOrWhiteSpace(ghlylist.Value)) - { - throw new FailedException("该挂号渠道未授权!"); - } - else - { - ghly = ghlylist.Key.ToString(); - } - - //获取门诊号 - var mzh = _OutPatientSettleDmnService.GetCQMzhJzxh(patid, req.ScheduId.ToString(), pbEntity.OutDept, pbEntity.Doctor, orgId, req.AppID, pbEntity.RegType, null, pbEntity.OutDate.ToString("yyyy-MM-dd")); - - object regobj; - OutpatientSettFeeRelatedDTO feeRelated = new OutpatientSettFeeRelatedDTO(); - feeRelated.zje = pbEntity.RegFee; - feeRelated.orglxjzfys = pbEntity.RegFee; - feeRelated.ssk = req.PayFee; - feeRelated.zhaoling = 0; - feeRelated.xjzfys = pbEntity.RegFee; - feeRelated.yjjzfje = 0; - feeRelated.djjess = req.PayFee; - feeRelated.zffs1 = zffsEty == null ? "" : zffsEty.xjzffs; - feeRelated.zfje1 = zffsEty == null ? null : req.PayFee; - feeRelated.djjesszffs = zffsEty == null ? "" : zffsEty.xjzffs; - - _OutPatientSettleDmnService.Save(orgId, patid, req.CardNo, ghly, pbEntity.RegType, - pbEntity.OutDept, pbEntity.Doctor, pbEntity.OutDeptName, pbEntity.DoctorName, pbEntity.Ghlx, pbEntity.Zlxm, null, null, false, - false, mzh.Item1, scheduId, feeRelated, req.ghxz, null, mzh.Item2, "0", null, null, null, null, null, - out regobj); - var regEty = _outpatientRegRepo.FindEntity(p => p.mzh == mzh.Item2 && p.zt == "1" && p.OrganizeId == orgId); - if (regEty != null) - { - regEty.ghrq = pbEntity.OutDate; - regEty.CreatorCode = req.AppID; - _outpatientRegRepo.Update(regEty); - } - return new RegSettResp() - { - RegId = ((dynamic)regobj).jsnm.ToString(), - QueueNo = mzh.Item1, - Mzh = mzh.Item2 + QueueNo= bookRecord.QueueNo, + Mzh=mzh //RegId = regobj.ToString() }; } + /// /// 预约号查询预约信息 /// @@ -665,7 +553,7 @@ public MzAppointmentRecordResp QueryAppRecord(MzAppointmentRecordReq req) cast(ScheduId as int) ScheduId,Ghxz,Xm PatName,xb Gnder,Lxdh,kh CardNo, c.name Dept,d.name Doctor,OutDate ,RegType,e.name RegName,Period,PeriodStart,PeriodEnd,QueueNo,RegFee,PayFee,PayLsh,PayTime -,CancelReason,CancelTime,mzh,ghrq,(case when a.Title>'' then a.Title else a.yynr end)Content +,CancelReason,CancelTime,mzh,ghrq,yynr from [mz_gh_book] a with(nolock) left join xt_brxz b with(nolock) on a.organizeid=b.organizeid and a.ghxz=b.brxz left join [NewtouchHIS_Base].[dbo].[V_S_Sys_Department] c on a.organizeid=c.organizeid and a.ks=c.code and c.zt='1' @@ -691,7 +579,7 @@ left join [NewtouchHIS_Base].[dbo].[V_C_Sys_ItemsDetail] e with(nolock) on a.[Re public IList QueryAppRecordList(MzAppointmentRecordListReq req) { string sql = @"SELECT RegType,cast(BookId as int) BookId,yyzt BookStatus,a.Xm PatName,a.xb Gender, -c.name Dept,OutDate,QueueNo,RegFee,a.CreateTime,(case when a.Title>'' then a.Title else a.yynr end)Content +c.name Dept,OutDate,QueueNo,RegFee,a.CreateTime from [mz_gh_book] a with(nolock) left join xt_brjbxx xtxx with(nolock) on xtxx.patid=a.patid and xtxx.OrganizeId=a.OrganizeId and xtxx.zt=1 left join xt_brxz b with(nolock) on a.organizeid=b.organizeid and a.ghxz=b.brxz @@ -710,11 +598,6 @@ left join xt_brxz b with(nolock) on a.organizeid=b.organizeid and a.ghxz=b.brxz sql += " and xtxx.zjh=@zjh "; para.Add(new SqlParameter("@zjh", req.IDCard)); } - if (req.yyzt >= 0) - { - sql += " and a.yyzt=@yyzt"; - para.Add(new SqlParameter("@yyzt", req.yyzt)); - } if (!string.IsNullOrWhiteSpace(req.RegType)) { sql += " and a.RegType=@RegType "; @@ -730,22 +613,11 @@ left join xt_brxz b with(nolock) on a.organizeid=b.organizeid and a.ghxz=b.brxz sql += " and c.name=@DeptName "; para.Add(new SqlParameter("@DeptName", req.DeptName)); } - if (req.OutDate != null && req.OutDate.Value.Year > 1900) + if (req.OutDate!=null) { sql += " and a.OutDate=convert(varchar(10),@OutDate,121) "; para.Add(new SqlParameter("@OutDate", req.OutDate)); } - else if (!string.IsNullOrWhiteSpace(req.ksrq) && !string.IsNullOrWhiteSpace(req.jsrq)) - { - sql += " and a.OutDate>=convert(varchar(10),@ksrq,121) and a.OutDate<=convert(varchar(10),@jsrq,121) "; - para.Add(new SqlParameter("@ksrq", req.ksrq)); - para.Add(new SqlParameter("@jsrq", req.jsrq)); - } - if (!string.IsNullOrWhiteSpace(req.PatName)) - { - sql += " and a.Xm like @PatName"; - para.Add(new SqlParameter("@PatName", req.PatName + "%")); - } return FindList(sql, para.ToArray()); } /// @@ -756,7 +628,7 @@ public int CancelOutApp(MzAppointmentRecordReq req) { int bookid = Convert.ToInt32(req.BookId); req.HospitalID = ConfigurationManager.AppSettings[req.HospitalID]; - var yyEntity = _MzghbookRepo.FindEntity(p => p.BookId == bookid && p.OrganizeId == req.HospitalID && p.zt == "1"); + var yyEntity = _MzghbookRepo.FindEntity(p => p.BookId == bookid && p.OrganizeId == req.HospitalID && p.zt=="1"); if (yyEntity == null) { throw new FailedException("无效的预约号"); @@ -767,28 +639,24 @@ public int CancelOutApp(MzAppointmentRecordReq req) } if (yyEntity.yyzt != ((int)EnumMzyyzt.book).ToString()) { - throw new FailedException("取消预约失败,当前预约状态为【" + ((EnumMzyyzt)Convert.ToInt32(yyEntity.yyzt)).GetDescription() + "】"); - } - if (!string.IsNullOrWhiteSpace(req.CardNo) && yyEntity.kh != req.CardNo) - { - throw new FailedException("就诊卡信息异常,请重新输入"); - } - if (!string.IsNullOrWhiteSpace(req.Lxdh) && req.Lxdh.Length < 8)//简单校验 - { - throw new FailedException("请输入正确的联系方式"); + throw new FailedException("取消预约失败,当前预约状态为【"+ ((EnumMzyyzt)Convert.ToInt32(yyEntity.yyzt)).GetDescription() + "】"); } yyEntity.yyzt = ((int)EnumMzyyzt.cancel).ToString(); - yyEntity.CancelReason = req.AppID + ";" + yyEntity.lxdh ?? req.Lxdh + req.CancelReason ?? ""; + yyEntity.CancelReason = req.AppID + ";" + yyEntity.lxdh ?? req.Lxdh; yyEntity.CancelTime = DateTime.Now; yyEntity.LastModifierCode = req.AppID; yyEntity.LastModifyTime = DateTime.Now; - var refCnt = _MzghbookRepo.Update(yyEntity); + var refCnt= _MzghbookRepo.Update(yyEntity); var regEty = _OutBookScheduleRepo.FindEntity(p => p.ScheduId == yyEntity.ScheduId && p.zt == "1"); if (regEty != null) { - regEty.YYNum = regEty.YYNum > 0 ? regEty.YYNum - 1 : 0; + regEty.YYNum= regEty.YYNum>0 ? regEty.YYNum - 1: 0; _OutBookScheduleRepo.Update(regEty); } + //else + //{ + // throw new FailedException("取消预约成功,号源退还失败,原因:未找到预约排班!"); + //} return refCnt; } /// @@ -829,28 +697,17 @@ left join [NewtouchHIS_Base].[dbo].[Sys_Duty] duty on /// /// /// - public PatCardInfoResp SysPatInfoSet(RegisterReq req) + public CardInfoResp SysPatInfoSet(RegisterReq req) { - string OrgId = ConfigurationManager.AppSettings[req.HospitalID]; - IDCard sfz = new IDCard(); - if (!IDCard.TryParse(req.IDCard, out sfz)) + string OrgId= ConfigurationManager.AppSettings[req.HospitalID]; + if (!CommmHelper.CheckIDCard(req.IDCard)) { throw new FailedException("证件号格式不正确"); } - var xb = EnumHelper.GetEnumDic().FirstOrDefault(p => p.Key == Convert.ToInt32(req.Gender)); - if (string.IsNullOrWhiteSpace(xb.Value)) - { - throw new FailedException("性别验证失败"); - } - var validatesfz = _SysPatientBasicInfoRepo.FindEntity(p => p.zjlx == ((int)EnumZJLX.sfz).ToString() && p.zjh == req.IDCard && p.OrganizeId == OrgId && p.zt == "1" && p.zjh != null); - if (validatesfz != null) - { - throw new FailedException("证件信息已存在"); - } if (req.PatType != ((int)EnumBrxz.zf).ToString()) { - var khvisit = _SysCardRepo.FindEntity(p => p.CardNo == req.CardNo && p.OrganizeId == OrgId && p.zt == "1"); - if (khvisit != null) + var khvisit = _SysCardRepo.FindEntity(p=>p.CardNo==req.CardNo &&p.OrganizeId==OrgId &&p.zt=="1"); + if(khvisit!=null) throw new FailedException("卡号已经存在,不可多次绑定"); string sql = @" select a.xm from xt_brjbxx a @@ -870,8 +727,8 @@ from xt_brjbxx a var FirstVisit = ConfigurationManager.AppSettings["FirstVisit"]; if (FirstVisit == "N") { - var visit = _SysPatientBasicInfoRepo.FindEntity(p => p.zjh == req.IDCard && p.OrganizeId == OrgId && p.zt == "1"); - if (visit == null) + var visit = _SysPatientBasicInfoRepo.FindEntity(p=>p.zjh==req.IDCard &&p.OrganizeId==OrgId &&p.zt=="1"); + if(visit==null) throw new FailedException("初次就诊需要先线下医院就诊"); } SysHosBasicInfoVO vo = new SysHosBasicInfoVO(); @@ -884,8 +741,7 @@ from xt_brjbxx a vo.kh = req.CardNo; vo.cardtype = ((int)EnumCardType.YBJYK).ToString(); } - else - { + else { vo.kh = _SysCardRepo.GetCardSerialNo(OrgId); } vo.blh = _SysPatientBasicInfoRepo.Getblh(OrgId); @@ -954,8 +810,7 @@ public CancalSettResp CancalSett(CancalSettReq req) } mzh = regEty.mzh; } - else - { + else { string vilidsql = @" select mzzyh,cardno,outtradeno,tradeno,totalamount,Realitytotalamount,jsnm from [dbo].Xt_Order with(nolock) where jsnm=@jsnm and OrderStatus=@status and OrganizeId=@orgId and zt=1"; ordervo = this.FindList(vilidsql, @@ -963,7 +818,7 @@ public CancalSettResp CancalSett(CancalSettReq req) new SqlParameter("@status", (int)EnumOrderStatus.yzf) , new SqlParameter("@jsnm",req.RegId) }).FirstOrDefault(); - if (vilidsql == null) + if (vilidsql==null) { throw new FailedException("无效的结算记录!"); } @@ -982,7 +837,7 @@ public CancalSettResp CancalSett(CancalSettReq req) expectedTmxZje += item.dj * sl; } } - if (expectedTmxZje <= 0) + if (expectedTmxZje<=0) { throw new FailedException("可退金额为零,请确认是否HIS端已退"); } @@ -990,7 +845,7 @@ public CancalSettResp CancalSett(CancalSettReq req) expectedTmxZje, null, out newJszbInfo, out outTradeNo, out refundAmount, null, null, null, null, null, null); - if (newJszbInfo == null) + if (newJszbInfo==null) { throw new FailedException("退费失败,请重试"); } @@ -1032,50 +887,6 @@ public CancalSettResp CancalSett(CancalSettReq req) RegId = ((dynamic)newJszbInfo).jsnm.ToString() }; } - /// - /// 根据门诊号查询账单 - /// - /// - /// - /// - public IList PresUnpayQuery(string mzh, string appId, string orgId) - { - var cfList = _outChargeDmnService.GetNewUnSettedPrescriptionByMzh(mzh, orgId); - return cfList.Select(p => new PrescriptionInfoResp - { - PresId = p.cfnm, - PresNo = p.cfh, - PresAmt = p.zje, - PresTypeName = p.cflxmc, - DeptName = p.ksmc, - DoctorName = p.ysmc, - PresTime = p.klsj - }).ToList(); - } - /// - /// 处方明细 - /// - /// - /// - /// - /// - public IList PresDetailQuery(string mzh, string cfnms, string appId, string orgId) - { - var data = _outChargeDmnService.GetNewAllUnSettedList(mzh, cfnms, orgId); - return data.Select(p=>new PrescriptionDetailResp - { - PresId=p.cfnm.ToString(), - PresItemName=p.sfxmmc, - PresNo=p.cfh, - Amt = p.zje, - Price =p.dj, - Quantity=p.sl, - Unit=p.dw, - ItemGroupName=p.ztmc, - PresItemId=p.xmnm.ToString() - }).ToList(); - } - /// /// 待缴费订单 /// @@ -1083,7 +894,7 @@ public IList PresDetailQuery(string mzh, string cfnms, s /// public IList QueryCostOrder(CostOrderReq req) { - var orgId = ConfigurationManager.AppSettings[req.HospitalID]; + var orgId= ConfigurationManager.AppSettings[req.HospitalID]; var ghEntity = _ioutpatientRegistRepo.IQueryable(p => p.kh == req.CardNo && p.OrganizeId == orgId && p.zt == "1").OrderByDescending(k => k.CreateTime).FirstOrDefault(); if (ghEntity == null) { @@ -1100,16 +911,15 @@ from [dbo].Xt_Order a with(nolock) { feelistsql.Append(" and OrderStatus=1 "); } - else - { - // //暂时先采用删除在生成未缴费订单 - // string sql1 = @" delete Xt_OrderDetail from Xt_OrderDetail a join Xt_Order b on a.OrderId=b.Id and (b.OrderStatus=0 or b.OrderStatus=3) where b.CardNo=@CardNo and b.OrganizeId=@orgId - // delete from Xt_Order where CardNo=@CardNo and OrganizeId=@orgId and (OrderStatus=0 or OrderStatus=3) - //"; - // var pars = new List(); - // pars.Add(new SqlParameter("@orgId", orgId)); - // pars.Add(new SqlParameter("@CardNo", req.CardNo)); - // var i = this.ExecuteSqlCommand(sql1, pars.ToArray()); + else { +// //暂时先采用删除在生成未缴费订单 +// string sql1 = @" delete Xt_OrderDetail from Xt_OrderDetail a join Xt_Order b on a.OrderId=b.Id and (b.OrderStatus=0 or b.OrderStatus=3) where b.CardNo=@CardNo and b.OrganizeId=@orgId +// delete from Xt_Order where CardNo=@CardNo and OrganizeId=@orgId and (OrderStatus=0 or OrderStatus=3) +//"; +// var pars = new List(); +// pars.Add(new SqlParameter("@orgId", orgId)); +// pars.Add(new SqlParameter("@CardNo", req.CardNo)); +// var i = this.ExecuteSqlCommand(sql1, pars.ToArray()); // 发生变化并且订单待支付的处方作废并生成新处方订单 string sql = @" exec Cf_OrderGenerate @orgId, @cardNo "; @@ -1120,14 +930,14 @@ from [dbo].Xt_Order a with(nolock) feelistsql.Append(" and OrderStatus=0 "); } - + List para = new List(); if (!string.IsNullOrWhiteSpace(req.DiagDay.ToString())) { feelistsql.Append(" and ghrq<=GETDATE() and ghrq>=DATEADD(DD,-@DiagDay,GETDATE()) "); para.Add(new SqlParameter("@DiagDay", req.DiagDay)); } - if (req.DiagDate != null) + if (req.DiagDate!=null) { feelistsql.Append(" and ghrq=convert(varchar(10),@DiagDate,121) "); para.Add(new SqlParameter("@DiagDate", req.DiagDate)); @@ -1194,17 +1004,17 @@ JOIN Xt_OrderDetail b with(nolock) on b.orderId=a.Id and a.organizeId=b.organize return new CostOrderDetailResp() { CardNo = baseVO.CardNo, - OrderNo = baseVO.OrderNo, - Mzh = baseVO.Mzh, + OrderNo=baseVO.OrderNo, + Mzh=baseVO.Mzh, PatientName = baseVO.PatientName, Gender = baseVO.Gender, nlshow = baseVO.nlshow, ClinicDoctor = baseVO.ClinicDoctor, ClinicDateTime = baseVO.ClinicDateTime, TotalAmount = baseVO.TotalAmount, - Fph = baseVO.Fph, + Fph=baseVO.Fph, OrderDetailData = costList, - CostTypeData = costTypeList + CostTypeData=costTypeList }; } /// @@ -1226,11 +1036,11 @@ public int CancalOrde(CancalOrderReq req) //new SqlParameter("@status1",((int)EnumOrderStatus.dzf).ToString()), //new SqlParameter("@status2", ((int)EnumOrderStatus.zfz).ToString()) }); - if (orderList == null) - throw new FailedException("订单号:" + req.OrderNo + "无效"); + if(orderList==null) + throw new FailedException("订单号:"+req.OrderNo+"无效"); - if (orderList == ((int)EnumOrderStatus.yzf).ToString() || orderList == ((int)EnumOrderStatus.ytk).ToString()) - throw new FailedException("订单号:" + req.OrderNo + "状态为" + ((EnumOrderStatus)Convert.ToInt32(orderList)).GetDescription() + "不可取消"); + if (orderList==((int)EnumOrderStatus.yzf).ToString()|| orderList == ((int)EnumOrderStatus.ytk).ToString()) + throw new FailedException("订单号:" + req.OrderNo + "状态为"+ ((EnumOrderStatus)Convert.ToInt32(orderList)).GetDescription()+"不可取消"); //string sql = @"update Xt_OrderDetail set zt=0 from Xt_Order a // where xt_OrderDetail.OrderId=a.Id and xt_OrderDetail.organizeId=a.organizeId and a.zt=1 @@ -1271,7 +1081,7 @@ public PreSettResp OutPreSett(PreSettReq req) var orgId = ConfigurationManager.AppSettings[req.HospitalID]; if (req.FeeType == "0") { - if (string.IsNullOrWhiteSpace(req.BookID.ToString()) || string.IsNullOrWhiteSpace(req.IsBooking)) + if (string.IsNullOrWhiteSpace(req.BookID.ToString())|| string.IsNullOrWhiteSpace(req.IsBooking)) { throw new FailedException("入参:BookID和IsBooking不能为空"); } @@ -1295,13 +1105,12 @@ public PreSettResp OutPreSett(PreSettReq req) return new PreSettResp() { ybzf = 0.00.ToDecimal(), - grzf = req.TotalAmount, - xjzf = req.TotalAmount + grzf=req.TotalAmount, + xjzf= req.TotalAmount }; } } - else - { + else { throw new FailedException("获取病人性质异常,请重试"); } } @@ -1323,18 +1132,18 @@ public PreSettResp OutPreSett(PreSettReq req) throw new FailedException("入参:PatType 值错误,该人员性质为自费"); } } - var amount = GetOrderAmount(req.Mzh, orgId); - if (amount.Count == 0) + var amount = GetOrderAmount(req.Mzh,orgId); + if (amount.Count==0) throw new FailedException("订单中心无未结算订单"); if (amount.Count > 1) throw new FailedException("订单中心存在多条未结订单,请取消订单或重新查询代缴费订单"); var jsje = amount.FirstOrDefault().TotalAmount; - if (jsje != req.TotalAmount) + if (jsje!=req.TotalAmount) throw new FailedException("收费金额异常,HIS为:【" + jsje + "】传入金额为:【" + req.TotalAmount + "】"); - if (amount.FirstOrDefault().Orderstatus == ((int)EnumOrderStatus.zfz).ToString()) + if (amount.FirstOrDefault().Orderstatus==((int)EnumOrderStatus.zfz).ToString()) { - throw new FailedException("订单号:" + req.OrderNo + "正在支付中,请勿重复支付"); + throw new FailedException("订单号:"+req.OrderNo+"正在支付中,请勿重复支付"); } var validCf = ValidFee(ghEntity.mzh, orgId); if (!string.IsNullOrWhiteSpace(validCf)) @@ -1350,6 +1159,14 @@ public PreSettResp OutPreSett(PreSettReq req) { //走医保 throw new FailedException("医保收费未开通"); + //医保返回错误需重置 + CancalOrderReq cancalreq = new CancalOrderReq(); + cancalreq.AppID = req.AppID; + cancalreq.HospitalID = req.HospitalID; + cancalreq.Mzh = req.Mzh; + cancalreq.CardNo = req.Mzh; + cancalreq.OrderNo = req.OrderNo; + var cz = ErrOrderCancal(cancalreq); } else { @@ -1367,7 +1184,7 @@ public PreSettResp OutPreSett(PreSettReq req) /// /// /// - public void OutSett(SettReq req, int jsnm, string orgId) + public void OutSett(SettReq req,int jsnm,string orgId) { #region //var orgId = ConfigurationManager.AppSettings[req.HospitalID]; @@ -1518,13 +1335,13 @@ from mz_gh_book ghyy ghsql += " and 1=2"; pars.Add(new SqlParameter("@OrderNo", req.OrderNo)); } - sql += " union all " + tksql + " union all " + ghsql; + sql += " union all " + tksql+" union all "+ghsql; sql += " ) d "; pars.Add(new SqlParameter("@orgId", orgId)); pars.Add(new SqlParameter("@appId", req.AppID)); //var hospitalTradeList = this.QueryWithPage(sql, pt, pars.ToArray()).ToList(); - var hospitalTradeList = this.FindList(sql, pars.ToArray()); + var hospitalTradeList = this.FindList(sql,pars.ToArray()); return hospitalTradeList; //return new ContrastBillResp //{ @@ -1597,7 +1414,7 @@ public string ValidPreSett(PreSettReq req) /// /// /// - public string ValidFee(string mzh, string orgId) + public string ValidFee(string mzh,string orgId) { //考虑医保上传唯一流水号使用明细Id 用处方或项目明细Id判断处方是否发生变化 string sql = @" @@ -1654,7 +1471,7 @@ join Xt_OrderDetail b with(nolock) on b.orderId=a.Id and a.organizeId=b.organize /// /// /// - public List GetOrderAmount(string mzh, string orgId) + public List GetOrderAmount(string mzh,string orgId) { string sql = @" select TotalAmount,orderstatus from [dbo].Xt_Order a with(nolock) where a.zt=1 and a.mzzyh=@mzh and (orderstatus=@status1 or orderstatus=@status2) @@ -1689,67 +1506,28 @@ join Xt_OrderDetail b with(nolock) on b.orderId=a.Id and a.organizeId=b.organize /// public BasicInfoDto2018 getPatInfo(string mzh, string orgId) { - var sql = @"SELECT b.xm ,b.xb ,b.csny ,b.zjh ,b.zjlx ,b.blh ,b.patid ,a.brxz ,a.mzh ,a.ghnm ,a.ys , -NULL sfrq ,NULL fph ,CONVERT(BIT,0) isQfyj,a.kh -FROM NewtouchHIS_Sett..mz_gh a with(nolock) -LEFT JOIN NewtouchHIS_Sett..xt_brjbxx b with(nolock) ON b.OrganizeId = a.OrganizeId AND b.patid = a.patid AND b.zt = '1' -WHERE a.mzh = @mzh AND a.OrganizeId = @orgId "; + var sql = @" SELECT b.xm , + b.xb , + b.csny , + b.zjh , + b.zjlx , + b.blh , + b.patid , + a.brxz , + a.mzh , + a.ghnm , + a.ys , + NULL sfrq , + NULL fph , + CONVERT(BIT,0) isQfyj + FROM NewtouchHIS_Sett..mz_gh a + LEFT JOIN NewtouchHIS_Sett..xt_brjbxx b ON b.OrganizeId = a.OrganizeId + AND b.patid = a.patid + AND b.zt = '1' + WHERE a.mzh = @mzh + AND a.OrganizeId = @orgId "; return this.FirstOrDefault(sql, new[] { new SqlParameter("@mzh", mzh), new SqlParameter("@orgId", orgId) }); } - /// - /// 查询当日已挂号 - /// - /// - /// true 仅当日 - /// - /// - /// 0 待结 1 已结 2 已退 - /// - public IList GetPatRegList(string orgId, string appId, bool todayonly, string kh, string mzh, int[] ghzt = null) - { - var sb = new StringBuilder(); - var pars = new List(); - sb.Append(@"select staff.Name DoctorName,dept.Name DeptName,brxz.brxzmc Ghxzmc,gh.mzh Mzh,gh.kh CardNo,gh.ghly Ghly,gh.mjzbz RegType,gh.ks Dept,gh.ys Doctor, -gh.jzxh QueueNo,gh.ghzt RegStatus,gh.jzbz Jzbz,gh.Createtime RegDate,gh.brxz Ghxz -from mz_gh(nolock) gh -left join [NewtouchHIS_Base]..V_S_Sys_Staff staff on staff.gh = gh.ys and staff.Organizeid = gh.OrganizeId -left join [NewtouchHIS_Base]..V_S_Sys_Department dept(nolock) on dept.Code = gh.ks and dept.Organizeid = gh.OrganizeId -inner join xt_card kxx(nolock) on kxx.CardNo=gh.kh and kxx.CardType=gh.CardType and kxx.OrganizeId=gh.OrganizeId and kxx.zt=1 -left join xt_brxz brxz(nolock) on brxz.brxz = kxx.brxz and brxz.OrganizeId = kxx.OrganizeId and brxz.zt=1 -left join xt_brjbxx jbxx(nolock) on jbxx.patid = gh.patid and jbxx.zt = '1' and jbxx.OrganizeId = gh.OrganizeId -where gh.OrganizeId = @orgId and gh.zt = '1' -"); - if (appId == EnumMzghly.SelfTerminal.ToString()) - { - sb.Append(@" and gh.brxz ='" + ((int)EnumBrxz.zf).ToString() + "'"); - } - if (todayonly) - { - sb.Append(@"and gh.CreateTime >= CONVERT(varchar(100), GETDATE(), 23) "); - } - if (ghzt != null && ghzt.Length > 0) - { - var ghztstr = string.Join(",", ghzt.ToList()); - sb.Append(@" and gh.ghzt in(" + ghztstr + ")"); - } - else - { - sb.Append(@" and gh.ghzt=" + ((int)EnumJieSuanZT.YJ).ToString()); - } - if (!string.IsNullOrEmpty(kh)) - { - sb.Append(@" and gh.kh = @kh "); - pars.Add(new SqlParameter("@kh", kh)); - } - if (!string.IsNullOrEmpty(mzh)) - { - sb.Append(@" and gh.mzh = @mzh "); - pars.Add(new SqlParameter("@mzh", mzh)); - } - sb.Append(@" order by gh.CreateTime desc "); - pars.Add(new SqlParameter("@orgId", orgId)); - return this.FindList(sb.ToString(), pars.ToArray()); - } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/CommonDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/CommonDmnService.cs index 0cd14ceb..54c78c34 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/CommonDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/CommonDmnService.cs @@ -1,4 +1,4 @@ -using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.DmnService; using FrameworkBase.MultiOrg.Domain.Entity; using FrameworkBase.MultiOrg.Infrastructure; using Newtouch.HIS.Domain.BusinessObjects; diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGTradUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGTradUploadDmnService.cs new file mode 100644 index 00000000..0254a361 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGTradUploadDmnService.cs @@ -0,0 +1,161 @@ +using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using Newtouch.HIS.Domain.IDomainServices.DRGManage; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +namespace Newtouch.HIS.DomainServices.DRGManage +{ + public class DRGTradUploadDmnService : DmnServiceBase, IDRGTradUploadDmnService + { + public DRGTradUploadDmnService(IDefaultDatabaseFactory databaseFactory) + : base(databaseFactory) + { + } + + public List GetList(string orgId, string kssj, string jssj, string scqk, string zyh,string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + //if (!string.IsNullOrWhiteSpace(zyh)) + //{ + string sql = ""; + sql = @" exec [usp_drg_trad_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + //db.ExecuteSqlCommand(sql, para); + //db.Commit(); + + return FindList(sql, para); + //} + //else + //{ + // List list = new List(); + // return list; + //} + } + } + + + public int DRGUpload(string orgId, List list,string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + var count = 0; + foreach (var obj in list) + { + var mdtrt_id = obj.mdtrt_id; + var setl_id = obj.setl_id; + if ((!string.IsNullOrWhiteSpace(mdtrt_id)) && (!string.IsNullOrWhiteSpace(setl_id))) + { + string sql = ""; + sql = @" exec [usp_drg_trad_upload] @orgId=@orgId,@mdtrt_id=@mdtrt_id,@setl_id=@setl_id,@tradiNumber=@tradiNumber "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@mdtrt_id",mdtrt_id), + new SqlParameter("@setl_id",setl_id), + new SqlParameter("@tradiNumber",tradiNumber) + }; + db.ExecuteSqlCommand(sql, para); + db.Commit(); + count++; + //return FindList(sql, para); + } + else + { + + //return new List(); + } + } + return count; + } + } + public List GetListYp(string orgId, string kssj, string jssj, string scqk, string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + string sql = ""; + sql = @" exec [usp_Ypxspc_trad_upload_search] @orgId=@orgId,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + return FindList(sql, para); + } + } + public List GetListsqsz(string orgId, string kssj, string jssj, string scqk,string zyh, string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + string sql = ""; + sql = @" exec [usp_sqszpc_trad_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + return FindList(sql, para); + } + } + + public List Getmxlist(string orgid, string zyh, string type) + { + string sql = ""; + + if (type=="4402") + { + sql = @"select sta.Name kdys,dep.Name kdks,yznr xmmc,convert(varchar(30),kssj,120)kdrq from ( +select zyh,ysgh,DeptCode,yznr,kssj,OrganizeId from Newtouch_CIS..zy_cqyz where zyh=@zyh and zt='1' and OrganizeId=@orgId +union all +select zyh,ysgh,DeptCode,yznr,kssj,OrganizeId from Newtouch_CIS..zy_lsyz where zyh=@zyh and zt='1' and OrganizeId=@orgId +)q +left join NewtouchHIS_Base..Sys_Department dep on dep.Code=q.DeptCode and dep.OrganizeId=dep.OrganizeId +left join NewtouchHIS_Base..Sys_Staff sta on sta.gh=q.ysgh and sta.OrganizeId=q.OrganizeId +order by kssj +"; + }else if (type=="4501") + { + sql = @"select sta.Name kdys,dep.Name kdks,xmmc,lcyx,convert(varchar(30),kssj,120)kdrq from ( +select zyh,yzh,sqdh,ysgh,DeptCode,lcyx,ztmc xmmc,max(kssj) kssj,OrganizeId +from Newtouch_CIS..zy_lsyz a where zyh=@zyh and yzlx=7 and zt='1' and OrganizeId=@orgId +group by zyh,yzh,sqdh,lcyx,ztmc,ysgh,DeptCode,OrganizeId +)q +left join NewtouchHIS_Base..Sys_Department dep on dep.Code=q.DeptCode and dep.OrganizeId=dep.OrganizeId +left join NewtouchHIS_Base..Sys_Staff sta on sta.gh=q.ysgh and sta.OrganizeId=q.OrganizeId +order by kssj "; + } + else if (type == "4502") + { + sql = @"select xmzwmc xmmc,xmywmc ,gdbj wjz,xmdw,ckz,jyjg from Newtouch_Interface..Lis_Report_ZY where zyh=@zyh and zt='1' and OrganizeId=@orgId "; + } + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgid), + new SqlParameter("@zyh",zyh), + }; + return FindList(sql, para); + } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGUploadDmnService.cs new file mode 100644 index 00000000..fd458d76 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DRGManage/DRGUploadDmnService.cs @@ -0,0 +1,223 @@ +using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using Newtouch.HIS.Domain.IDomainServices.DRGManage; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.DomainServices.DRGManage +{ + public class DRGUploadDmnService : DmnServiceBase, IDRGUploadDmnService + { + public DRGUploadDmnService(IDefaultDatabaseFactory databaseFactory) + : base(databaseFactory) + { + } + + public List GetList(Pagination pagination, string orgId, string kssj, string jssj, string scqk, string zyh) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + if (!string.IsNullOrWhiteSpace(zyh)) + { + string sql = ""; + sql = @" exec [usp_drg_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + }; + //db.ExecuteSqlCommand(sql, para); + //db.Commit(); + + return FindList(sql, para); + } + else { + List < DRGUploadDto > list= new List(); + return list; + } + } + } + + + public int DRGUpload(string orgId,List list) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + var count = 0; + foreach (var obj in list) + { + var mdtrt_id = obj.mdtrt_id; + var setl_id = obj.setl_id; + if ((!string.IsNullOrWhiteSpace(mdtrt_id)) && (!string.IsNullOrWhiteSpace(setl_id))) + { + string sql = ""; + sql = @" exec [usp_drg_upload] @orgId=@orgId,@mdtrt_id=@mdtrt_id,@setl_id=@setl_id "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@mdtrt_id",mdtrt_id), + new SqlParameter("@setl_id",setl_id) + }; + db.ExecuteSqlCommand(sql, para); + db.Commit(); + count++; + //return FindList(sql, para); + } + else + { + + //return new List(); + } + } + return count; + } + } + + // public List GetList(Pagination pagination, string orgId, string kssj, string jssj,string scqk,string zyh) + // { + // StringBuilder strsql = new StringBuilder(); + // IList inSqlParameterList = null; + // strsql.Append(@" + //create table #temp + //( + //id int identity(1,1), + //setl_id varchar(50), + //mdtrt_id varchar(50), + //zjh varchar(50), + //zyh varchar(50), + //brxm varchar(50), + //ryrq datetime, + //cyrq datetime, + //jsrq datetime, + //basy varchar(50), + //basy_rq datetime, + //ksdm varchar(50), + //ksmc varchar(50), + //ysdm varchar(50), + //ysmc varchar(50), + //jsqd_sclsh varchar(20), + //jsqd_scrq datetime, + //) + + ///*就诊ID-mdtrt_id*/ + //if(1=1) + //begin + //insert into #temp(zyh) + //select @zyh as zyh + + //end + + ///*结算ID/结算流水号-setl_id*/ + + + //update ls set ls.mdtrt_id=js.mdtrt_id + // from NewtouchHIS_Sett..drjk_zyjs_output as js with(nolock),#temp as ls + // where js.setl_id=ls.setl_id + + + + ///*1.病人信息更新*/ + //if(1=1) + //begin + + + ///*更新住院号*/ + //update ls set ls.mdtrt_id =ybry.mdtrt_id + // from NewtouchHIS_Sett..drjk_zyjs_input ybry with(nolock),#temp ls + // where ls.zyh=ybry.zyh + // and ybry.zt=1 + + ///*更新病人信息*/ + //update ls set ls.ryrq=br.ryrq,ls.cyrq=br.cyrq,ls.zjh=br.zjh,ls.ksdm=br.ks,ls.ysdm=br.doctor,ls.brxm=br.xm + // from NewtouchHIS_Sett..zy_brjbxx as br with(nolock),#temp as ls + // where br.zyh=ls.zyh + // and br.zt=1 + + //update ls set ls.ksmc=dept.Name from #temp as ls,NewtouchHIS_Base..Sys_Department as dept with(nolock) + //where ls.ksdm=dept.Code + // and dept.OrganizeId=@orgId + //update ls set ls.ysmc=czy.Name from #temp as ls,NewtouchHIS_Base..Sys_Staff as czy with(nolock) + //where ls.ysdm=czy.gh + // and czy.OrganizeId=@orgId + + ///*更新结算日期*/ + //update ls set ls.jsrq=br.czrq,jsqd_sclsh=br.jsqd_sclsh,jsqd_scrq=br.jsqd_scrq,setl_id=br.setl_id + // from NewtouchHIS_Sett..drjk_zyjs_output as br with(nolock),#temp as ls + // where br.mdtrt_id=ls.mdtrt_id + // and br.zt=1 + + ///*更新病案首页书写状态*/ + //update ls set ls.basy='已书写',ls.basy_rq=ba.CreateTime from Newtouch_EMR..mr_basy as ba with(nolock),#temp as ls + //where ba.ZYH=ls.zyh + // and ba.zt=1 + //update #temp set #temp.basy='--未写病案首页--' where #temp.basy is null + + + + //end + + ///*2.结算上传情况获取*/ + //select rz.hisId,max(rz.inNumbier) inNumbier + // into #rz + // from NewtouchHIS_Sett.dbo.ybjk_logcontent as rz with(nolock) + // where rz.beginDate>='2022-04-01' + // and rz.tradiNumber='4101' + // group by rz.hisId + + ///*3.查询输出*/ + //select ls.zyh [zyh],ls.brxm[xm],ls.zjh [sfzh],ls.setl_id [setl_id],ls.mdtrt_id [mdtrt_id], + // rz1.beginDate [scrq],rz1.inContent [scsr],rz1.outContent [scsc], + // ls.ryrq [ryrq],ls.cyrq [cyrq],ls.basy_rq [basyrq],ls.jsrq [jsrq], + // ls.ksdm [ksdm],ls.ksmc [ks],ls.ysdm [ysdm],ls.ysmc [ysxm],ls.basy [basyqk], + // case when isnull(rz1.errorMsg,'')='' then '已上传' + // when isnull(rz1.errorMsg,'')<>'' then '上传失败' + // else '未上传' + // end [scqk], + // jsqd_sclsh [jsqd], + // rz1.errorMsg [errorMsg] + //INTO #temp_result + // from #temp as ls left join #rz as rz on ls.zyh=rz.hisId + // left join NewtouchHIS_Sett.dbo.ybjk_logcontent as rz1 with(nolock) on rz.inNumbier=rz1.inNumbier + //order by ls.id desc + + //select * from #temp_result + //where scqk =scqk + + //if(object_id('tempdb.dbo.#temp')is not null) drop table #temp + //if(object_id('tempdb.dbo.#rz')is not null) drop table #rz + //if(object_id('tempdb.dbo.#temptable')is not null) drop table #temptable + //if(object_id('tempdb.dbo.#temp_result')is not null) drop table #temp_result + + //return + + //"); + // inSqlParameterList = new List(); + // //if (!string.IsNullOrEmpty(blh)) + // //{ + // // strsql.Append(" AND brjbxx.blh like @blh "); + // // inSqlParameterList.Add(new SqlParameter("@blh", "%" + blh.Trim() + "%")); + // //} + // //if (!string.IsNullOrEmpty(xm)) + // //{ + // // strsql.Append(" AND (brjbxx.xm like @xm or brjbxx.py like @xm)"); + // // inSqlParameterList.Add(new SqlParameter("@xm", "%" + xm.Trim() + "%")); + // //} + // inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + // inSqlParameterList.Add(new SqlParameter("@zyh", zyh)); + // inSqlParameterList.Add(new SqlParameter("@scqk", scqk)); + // return this.QueryWithPage(strsql.ToString(), pagination, inSqlParameterList.ToArray()).ToList(); + // } + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DaySettleManage/DaySettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DaySettleManage/DaySettleDmnService.cs index ac365540..dbd6cfe4 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DaySettleManage/DaySettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DaySettleManage/DaySettleDmnService.cs @@ -276,20 +276,37 @@ select distinct insutype from drjk_mzjs_output /// 开始日期 /// 结束日期 /// - public IList GetQsdzzs(string organizeId, string ksrq, string jsrq) + public IList GetQsdzzs(string organizeId, string ksrq, string jsrq, string qslx, string xz) { StringBuilder sqlStr = new StringBuilder(); - sqlStr.Append(@"exec his_se_qsdzz @organizeId=@organizeId,@ksrq=@ksrq,@jsrq=@jsrq"); + sqlStr.Append(@"exec his_se_qsdzz @organizeId=@organizeId,@ksrq=@ksrq,@jsrq=@jsrq,@qslx=@qslx,@xz=@xz"); SqlParameter[] param = { new SqlParameter("@organizeId", organizeId), new SqlParameter("@ksrq", ksrq), - new SqlParameter("@jsrq", jsrq) + new SqlParameter("@jsrq", jsrq), + new SqlParameter("@qslx", qslx), + new SqlParameter("@xz", xz) }; var list = this.FindList(sqlStr.ToString(), param).ToList(); return list; } + public int inserqssq(System.Xml.XmlDocument ybqssqs, string orgid) + { + //string jsonstr = Newtonsoft.Json.JsonConvert.SerializeObject(ybqssqs); + //System.Xml.XmlDocument xmlstr = (System.Xml.XmlDocument)Newtonsoft.Json.JsonConvert.DeserializeXmlNode(jsonstr, "root"); + StringBuilder sqlStr = new StringBuilder(); + sqlStr.Append(@" exec his_se_inserqssq @orgid=@orgids ,@xml=@xmls "); + SqlParameter[] param = + { + new SqlParameter("@orgids", orgid), + new SqlParameter("@xmls", ybqssqs.InnerXml), + //new SqlParameter("@tfrq", tfsj), + }; + return this.ExecuteSqlCommand(sqlStr.ToString(), param); + } + /// /// 获取清算明细(上半部分) /// @@ -412,5 +429,39 @@ public IList Newdzfysj(string organizeId, string rq) var list = this.FindList(sqlStr.ToString(), param).ToList(); return list; } - } + /// + /// 日对账历史数据 + /// + /// + /// + /// + /// + public IList GetHistoryCheckList(string orgid, string ksrq, string jsrq) + { + StringBuilder sqlStr = new StringBuilder(); + sqlStr.Append(@"select lsh,cardid,czrq jysj,'挂号' lx,curaccountamt dn,hisaccountamt ln,zfdxjzfs+tcdxjzfs+tcdxjzfs xj, +tczfs tc,0 df,ybjsfwfyze-totalexpense flzf,fjdzhzfs+fjdxjzfs+tcdzhzfs+tcdxjzfs+fybjsfwfyze grzf,gh.xm,gh.mzh mzbh,mzjs.jzdyh hm,'' zd,'' bz + from NewtouchHIS_Sett..Ybjk_SH02_Output mzjs + inner join mz_gh gh on mzjs.mzh=gh.mzh and gh.zt='1' + where mzjs.zt='1' + and mzjs.czrq>=@ksrq +and mzjs.czrq<=@jsrq +union all +select lsh,cardid,czrq jysj,'收费' lx,curaccountamt dn,hisaccountamt ln,zfdxjzfs+tcdxjzfs+tcdxjzfs xj, +tczfs tc,0 df,ybjsfwfyze-totalexpense flzf,fjdzhzfs+fjdxjzfs+tcdzhzfs+tcdxjzfs+fybjsfwfyze grzf,gh.xm,gh.mzh mzbh,mzjs.jzdyh hm,'' zd,'' bz + from NewtouchHIS_Sett..Ybjk_SI12_Output mzjs + inner join mz_gh gh on mzjs.mzh=gh.mzh and gh.zt='1' + where mzjs.zt='1' + and mzjs.czrq>=@ksrq +and mzjs.czrq<=@jsrq +"); + SqlParameter[] param = + { + new SqlParameter("@ksrq", ksrq), + new SqlParameter("@jsrq", jsrq), + }; + var list = this.FindList(sqlStr.ToString(), param).ToList(); + return list; + } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DeanInquiryManage/DeanInquiryDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DeanInquiryManage/DeanInquiryDmnService.cs index 75704453..e7ccf1a8 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DeanInquiryManage/DeanInquiryDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/DeanInquiryManage/DeanInquiryDmnService.cs @@ -183,7 +183,6 @@ public List DailyUpdates_GetMzfy(string orgId) inParameters.Add(new SqlParameter("@ksrq", DateTime.Now.ToString("yyyy-MM-dd"))); inParameters.Add(new SqlParameter("@jsrq", DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"))); inParameters.Add(new SqlParameter("@jgdm", orgId)); - return this.FindList("exec [NewtouchHIS_Sett]..[yzcx_jrdt_mzfy] @ksrq,@jsrq, @jgdm", inParameters.ToArray()); } @@ -833,11 +832,11 @@ union all "); if (yptype == "全部") { - sqlStr.Append(@" group by yp.ypmc,yp.ypgg,yp.zxdw, sl ,dj ,yp.ypCode order by je desc "); + sqlStr.Append(@" group by yp.ypmc,yp.ypgg,yp.zxdw, sl ,dj ,yp.ypCode order by sl desc "); } else { - sqlStr.Append(@" where dlmc =@yptype group by yp.ypmc,yp.ypgg,yp.zxdw, sl ,dj,yp.ypCode order by je desc "); + sqlStr.Append(@" where dlmc =@yptype group by yp.ypmc,yp.ypgg,yp.zxdw, sl ,dj,yp.ypCode order by sl desc "); } var param = new DbParameter[] { @@ -889,19 +888,19 @@ public List DoctorBillingRanking_Lsqs(string kssj, string StringBuilder sqlStr = new StringBuilder(); sqlStr.Append(@" select Name,SUM(zje)zje,SUM(sl)sl from ( - select count(1)sl,(sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end )*dj)zje ,Name + select sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end ) sl,(sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end )*dj)zje ,Name from NewtouchHIS_PDS.dbo.zy_ypyzxx yzxx left join NewtouchHIS_PDS..zy_ypyzczjl czjl on yzxx.yzId=czjl.yzId left join NewtouchHIS_Base..Sys_Staff staff on yzxx.ysgh=staff.gh and yzxx.OrganizeId=staff.OrganizeId where (yzxx.fybz=2 or yzxx.fybz=3) and czjl.ypCode=@ypcode and yzxx.OrganizeId=@OrganizeId and czjl.CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) group by Name,dj union all - select count(1)sl,(sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end )*dj)zje ,Name from NewtouchHIS_PDS..mz_cfypczjl czjl left join + select sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end ) sl,(sum(case when operateType=2 then (0-czjl.sl) else czjl.sl end )*dj)zje ,Name from NewtouchHIS_PDS..mz_cfypczjl czjl left join NewtouchHIS_PDS..mz_cfmx cfmx on czjl.mzcfmxId=cfmx.Id left join NewtouchHIS_Base..Sys_Staff staff on cfmx.CreatorCode=staff.gh and cfmx.OrganizeId=staff.OrganizeId where czjl.ypCode=@ypcode and cfmx.OrganizeId=@OrganizeId and czjl.CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) group by Name,dj) xm where xm.zje>0 - group by Name + group by Name order by sl desc "); var param = new DbParameter[] { new SqlParameter("@OrganizeId",OrganizeId), @@ -931,11 +930,11 @@ public List Consumablestatistics_Lsqs(string kssj, s left join NewtouchHIS_Base..xt_sfdl c on b.sfdlCode=c.dlCode and a.OrganizeId=c.OrganizeId where c.dlmc='材料费'and a.zt=1 and a.CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) and a.OrganizeId=@OrganizeId group by b.sfxmmc,b.sfxmCode,sl,b.gg,b.dw union all - select b.sfxmmc,b.sfxmCode,b.gg,b.dw,sl,sum(je) zje from mz_xm a + select b.sfxmmc,b.sfxmCode,b.gg,b.dw,sum(sl) sl,sum(je) zje from mz_xm a left join NewtouchHIS_Base..xt_sfxm b on a.sfxm=b.sfxmCode and a.OrganizeId=b.OrganizeId left join NewtouchHIS_Base..xt_sfdl c on b.sfdlCode=c.dlCode and a.OrganizeId=c.OrganizeId where c.dlmc='材料费'and a.zt=1 and a.CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) and a.OrganizeId=@OrganizeId group by b.sfxmmc,b.sfxmCode,sl,b.gg,b.dw - ) c group by sfxmmc,sfxmCode,gg,dw order by zje desc + ) c group by sfxmmc,sfxmCode,gg,dw order by sl desc "); var param = new DbParameter[] { new SqlParameter("@OrganizeId",OrganizeId), @@ -958,9 +957,9 @@ public List DoctorBillingRankingHC_Lsqs(string kssj, strin StringBuilder sqlStr = new StringBuilder(); sqlStr.Append(@" select Name,sl,zje from( - select ys,count(1) sl,sum(je)zje from mz_xm where sfxm=@sfxmdm and zt=1 and OrganizeId=@OrganizeId and CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) group by ys + select ys,sum(sl) sl,sum(je)zje from mz_xm where sfxm=@sfxmdm and zt=1 and OrganizeId=@OrganizeId and CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) group by ys union all - select ys,count(1)sl,sum(je)zje from V_C_Sys_WsfZyXmjfb where sfxm=@sfxmdm and OrganizeId=@OrganizeId and CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) and zt=1 group by ys + select ys,sum(sl) sl,sum(je)zje from V_C_Sys_WsfZyXmjfb where sfxm=@sfxmdm and OrganizeId=@OrganizeId and CreateTime between convert(datetime,@kssj,120) and convert(datetime,@jssj,120) and zt=1 group by ys ) sfxm left join NewtouchHIS_Base..Sys_Staff staff on sfxm.ys=staff.gh order by zje desc "); diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/DischargeSettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/DischargeSettleDmnService.cs index 2f7cb002..c9cca320 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/DischargeSettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/DischargeSettleDmnService.cs @@ -287,7 +287,8 @@ public List SelectWsfItemList(string zyh, string orgId xmjfb.sl , xmjfb.sl tsl , ( ISNULL(xmjfb.dj, 0) * ISNULL(xmjfb.sl, 0) ) AS je, - (select top 1 sl from zy_xmjfb where jfbbh=xmjfb.jfbbh) ylsl,sfmb.ztbh,dcztbs,sfmb.ztsl ztylsl,xmjfb.ztsl + (select top 1 sl from zy_xmjfb where jfbbh=xmjfb.jfbbh) ylsl,sfmb.ztbh,sfmb.dcztbs,sfmb.ztsl ztylsl,xmjfb.ztsl, + case when lsyz.yzlx in ('6','7') then lsyz.ztmc else lsyz.xmmc end as yzmc FROM [dbo].[V_C_Sys_WsfZyXmjfb] xmjfb LEFT JOIN [NewtouchHIS_Base]..V_S_xt_sfdl sfdl ON xmjfb.dl = sfdl.dlCode AND sfdl.OrganizeId = @orgId @@ -295,6 +296,7 @@ FROM [dbo].[V_C_Sys_WsfZyXmjfb] xmjfb AND sfxm.OrganizeId = @orgId LEFT JOIN (select a.ztbh,b.sfmbmc,b.sfmb,'收费项目组合'sfmblb,a.jfbbh,a.dcztbs,a.ztsl from zy_xmjfb a with(nolock) left join xt_sfmb b on a.ztbh=b.sfmbbh and a.OrganizeId=b.OrganizeId where a.zyh=@zyh and a. ztbh is not null) sfmb on sfmb.jfbbh=xmjfb.jfbbh +LEFT JOIN Newtouch_CIS..zy_lsyz lsyz on (lsyz.Id = xmjfb.yzwym) WHERE xmjfb.OrganizeId = @orgId and xmjfb.zyh=@zyh "); if (kssj.HasValue) { @@ -738,7 +740,7 @@ public void SaveSett(InpatientSettPatInfoVO settpatInfo, InpatientSettleItemBO s //} } - if (jslx == "1" && ybfeeRelated != null) + if (jslx == "1" && ybfeeRelated != null) { if (medicalInsurance == "chongqing") { @@ -801,47 +803,7 @@ left join[NewtouchHIS_Base]..V_S_xt_sfdl sfdl on sfdl.dlCode = dljf.dl and sfdl.OrganizeId = @orgId"; return this.FindList(sql, new[] { new SqlParameter("@orgId", orgId), new SqlParameter("@zyh", zyh) }); } - /// - /// 住院未结账费用明细汇总 - /// - /// - /// - /// - /// - /// - public IList GetHospGroupFeeDetailVOList(string zyh, string orgId, string sfdl) - { - var sql = @"select dd.dlCode,dd.dlmc,dd.sfxm,dd.sfxmmc,Convert(decimal(18,2),dd.dj)dj,sum(dd.sl)sl,dd.jfdw,dd.zfxz,dd.zfxzcode,dd.zzfbz,dd.zzfbzcode,sum(dd.je)je -from( -select dl dlCode,b.dlmc,sfxm,c.sfxmmc,a.dj,sl,jfdw, -(case a.zfxz when 1 then '自费' when 4 then '甲类' when 5 then '乙类' when 6 then '丙类' end)zfxz,convert(varchar(2),a.zfxz) zfxzcode, -CONVERT(NUMERIC(10,2), isnull(a.dj, 0) * isnull(sl, 0)) je ,c.gg ,case isnull(zzfbz,0) when '1' then '是' else '否' end zzfbz,convert(varchar(2),isnull(zzfbz,0)) zzfbzcode -from [V_C_Sys_WsfZyXmjfb] a -left join NewtouchHIS_Base.dbo.V_S_xt_sfdl b with(nolock) on a.OrganizeId=b.OrganizeId and a.dl=b.dlCode and b.zt='1' -left join NewtouchHIS_Base.dbo.V_S_xt_sfxm c with(nolock) on a.OrganizeId=c.OrganizeId and a.sfxm=c.sfxmcode and c.zt='1' -where zyh =@zyh and a.OrganizeId =@orgId and b.zt= '1' -union all -select dl dlCode,bb.dlmc,yp,cc.ypmc,aa.dj,sl,jfdw, -(case aa.zfxz when 1 then '自费' when 4 then '甲类' when 5 then '乙类' when 6 then '丙类' end)zfxz,convert(varchar(2),aa.zfxz) zfxzcode, -CONVERT(NUMERIC(10,2), isnull(aa.dj, 0) * isnull(sl, 0)) je ,cc.ypgg,case isnull(zzfbz,0) when '1' then '是' else '否' end zzfbz,convert(varchar(2),isnull(zzfbz,0)) zzfbzcode -from [V_C_Sys_WsfZyYpjfb] aa -left join NewtouchHIS_Base.dbo.V_S_xt_sfdl bb with(nolock) on aa.OrganizeId=bb.OrganizeId and aa.dl=bb.dlCode and bb.zt='1' -left join NewtouchHIS_Base.dbo.V_C_xt_yp cc with(nolock) on aa.OrganizeId=cc.OrganizeId and aa.yp=cc.ypcode and cc.zt='1' -where zyh = @zyh and aa.OrganizeId = @orgId and bb.zt= '1' -)dd -group by dd.dlCode,dd.dlmc,dd.sfxm,dd.sfxmmc,dd.dj,dd.jfdw,dd.zfxz,dd.zfxzcode,dd.zzfbz,dd.zzfbzcode -"; - if (!string.IsNullOrEmpty(sfdl)) - { - sql = "select * from (" + sql + ") r where r.dlCode=@dl "; - } - return this.FindList(sql, new[] { - new SqlParameter("@orgId", orgId), - new SqlParameter("@zyh", zyh), - new SqlParameter("@dl", sfdl??"") - }); - } - public IList GetHospGroupFeeVOList(Pagination pagination, string zyh, string orgId, string sfdl) + public IList GetHospGroupFeeVOList(Pagination pagination, string zyh, string orgId, string sfdl) { var sql = @"select dd.dlCode,dd.dlmc,dd.sfxm,dd.sfxmmc,Convert(decimal(18,2),dd.dj)dj,sum(dd.sl)sl,dd.jfdw,dd.zfxz,dd.zzfbz,sum(dd.je)je from( @@ -1198,7 +1160,7 @@ public void DoCancel(HospSettlementEntity preSettlEntity, List 0) - { - zfEntity1 = new HospSettlementPaymentModelEntity(); - zfEntity1.zyjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("zy_jszffs"); - zfEntity1.OrganizeId = jszbEntity.OrganizeId; - zfEntity1.jsnm = jszbEntity.jsnm; - zfEntity1.xjzffs = xtzffs.ZYYJZHZF; - zfEntity1.zfje = feeRelated.yjjzfje.Value; - zfEntity1.zt = "1"; - zfEntity1.Create(); - db.Insert(zfEntity1); - jszbEntity.xjzffs = xtzffs.ZYYJZHZF; - } - //if (feeRelated.patZflist.Count() > 0) - if (feeRelated.patZflist != null && feeRelated.patZflist.Count() > 0) - { + if (feeRelated.yjjzfje.Value > 0) + { + zfEntity1 = new HospSettlementPaymentModelEntity(); + zfEntity1.zyjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("zy_jszffs"); + zfEntity1.OrganizeId = jszbEntity.OrganizeId; + zfEntity1.jsnm = jszbEntity.jsnm; + zfEntity1.xjzffs = xtzffs.ZYYJZHZF; + zfEntity1.zfje = feeRelated.yjjzfje.Value; + zfEntity1.zt = "1"; + zfEntity1.Create(); + db.Insert(zfEntity1); + jszbEntity.xjzffs = xtzffs.ZYYJZHZF; + } + if (feeRelated.patZflist.Count() > 0) + { foreach (var item in feeRelated.patZflist) { zfEntity2 = new HospSettlementPaymentModelEntity(); @@ -1414,32 +1375,32 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, zfEntity2.CreateTime = DateTime.Now.AddSeconds(1); db.Insert(zfEntity2); } - jszbEntity.xjzffs = feeRelated.djjesszffs; - } + jszbEntity.xjzffs = feeRelated.djjesszffs; + } - //预交金支付 构建账户收支 //预交金支付 一定作为第一支付方式 - if (zfEntity1 != null && zfEntity1.xjzffs == xtzffs.ZYYJZHZF) - { - var patid = db.IQueryable(p => p.zyh == jszbEntity.zyh && p.OrganizeId == jszbEntity.OrganizeId).Select(p => p.patid).FirstOrDefault(); - if (patid <= 0) - { - return; - } - decimal tye = 0; - if (feeRelated.yjjtye.Value > 0) - { - tye = feeRelated.yjjtye.Value; - } - var accountEntity = db.IQueryable(p => p.patid == patid && p.zhxz == ((int)EnumXTZHXZ.ZYYJKZH) && p.zt == "1" && p.OrganizeId == jszbEntity.OrganizeId).FirstOrDefault(); - if (accountEntity != null) - { - zfEntity1.zh = accountEntity.zhCode; - if (!((zfEntity1.zfje + tye) <= accountEntity.zhye && zfEntity1.zfje <= feeRelated.xjzfys.Value)) - { - throw new FailedException("", "预交金账户信息有更新,请重新结算"); - } - var zhszEntity = new InpatientAccountRevenueAndExpenseEntity() - { + //预交金支付 构建账户收支 //预交金支付 一定作为第一支付方式 + if (zfEntity1 != null && zfEntity1.xjzffs == xtzffs.ZYYJZHZF) + { + var patid = db.IQueryable(p => p.zyh == jszbEntity.zyh && p.OrganizeId == jszbEntity.OrganizeId).Select(p => p.patid).FirstOrDefault(); + if (patid <= 0) + { + return; + } + decimal tye = 0; + if (feeRelated.yjjtye.Value > 0) + { + tye = feeRelated.yjjtye.Value; + } + var accountEntity = db.IQueryable(p => p.patid == patid && p.zhxz == ((int)EnumXTZHXZ.ZYYJKZH) && p.zt == "1" && p.OrganizeId == jszbEntity.OrganizeId).FirstOrDefault(); + if (accountEntity != null) + { + zfEntity1.zh = accountEntity.zhCode; + if (!((zfEntity1.zfje + tye) <= accountEntity.zhye && zfEntity1.zfje <= feeRelated.xjzfys.Value)) + { + throw new FailedException("", "预交金账户信息有更新,请重新结算"); + } + var zhszEntity = new InpatientAccountRevenueAndExpenseEntity() + { OrganizeId = jszbEntity.OrganizeId, zhCode = accountEntity.zhCode, zyh = accountEntity.zyh, @@ -1450,48 +1411,48 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, xjzffs = Constants.xtzffs.ZYYJZHZF, jsnm = jszbEntity.jsnm, zt = "1", - }; - zhszEntity.Create(true); - db.Insert(zhszEntity); - // - accountEntity.zhye = zhszEntity.zhye; - db.Update(accountEntity); - //预交金支付 账户收支 - if (feeRelated.yjjtye.Value > 0 && accountEntity.zhye == feeRelated.yjjtye.Value) - { - //还有一条收支取款(应该是预交金余额全退) - var zhszEntity2 = new InpatientAccountRevenueAndExpenseEntity() - { - OrganizeId = jszbEntity.OrganizeId, - zhCode = accountEntity.zhCode, + }; + zhszEntity.Create(true); + db.Insert(zhszEntity); + // + accountEntity.zhye = zhszEntity.zhye; + db.Update(accountEntity); + //预交金支付 账户收支 + if (feeRelated.yjjtye.Value > 0 && accountEntity.zhye == feeRelated.yjjtye.Value) + { + //还有一条收支取款(应该是预交金余额全退) + var zhszEntity2 = new InpatientAccountRevenueAndExpenseEntity() + { + OrganizeId = jszbEntity.OrganizeId, + zhCode = accountEntity.zhCode, zyh = accountEntity.zyh, szje = 0 - feeRelated.yjjtye.Value, - zhye = accountEntity.zhye - feeRelated.yjjtye.Value, - pzh = null, - szxz = (int)EnumSZXZ.zyjsth, - //xjzffs = Constants.xtzffs.ZYYJZHZF, - xjzffs = Constants.xtzffs.XJZF, //现金 - zt = "1", - }; - zhszEntity2.Create(true); - zhszEntity2.CreateTime = DateTime.Now.AddSeconds(1); - db.Insert(zhszEntity2); - // - accountEntity.zhye = zhszEntity2.zhye; - } - else if (feeRelated.yjjtye.Value > 0) - { - throw new FailedException("ERROR_ACCOUNT_INFO", "预交账户结算成功,退余额失败"); - } - - db.Update(accountEntity); - } - else - { - throw new FailedException("ERROR_ACCOUNT_INFO", "获取预交金账户信息失败"); - } - } - } + zhye = accountEntity.zhye - feeRelated.yjjtye.Value, + pzh = null, + szxz = (int)EnumSZXZ.zyjsth, + //xjzffs = Constants.xtzffs.ZYYJZHZF, + xjzffs = Constants.xtzffs.XJZF, //现金 + zt = "1", + }; + zhszEntity2.Create(true); + zhszEntity2.CreateTime = DateTime.Now.AddSeconds(1); + db.Insert(zhszEntity2); + // + accountEntity.zhye = zhszEntity2.zhye; + } + else if (feeRelated.yjjtye.Value > 0) + { + throw new FailedException("ERROR_ACCOUNT_INFO", "预交账户结算成功,退余额失败"); + } + + db.Update(accountEntity); + } + else + { + throw new FailedException("ERROR_ACCOUNT_INFO", "获取预交金账户信息失败"); + } + } + } #endregion @@ -2646,7 +2607,23 @@ public void SaveSett2303(CqybSett2303Entity YuJieSuan) db.Commit(); } } - #endregion - } + #endregion + + /// + /// 根据住院号获取LIS/PACS报告未完成数量 + /// + /// + /// + /// + public int CountLisIncompletezy(string orgId, string zyh) + { + string sql = @" +select count(*) from [Newtouch_CIS].[dbo].[zy_lsyz] where zyh=@zyh and (syncStatus is null or syncStatus<>2) and yzlx in('6','7') and organizeId=@orgId and zt='1'"; + var sqlpar = new List(); + sqlpar.Add(new SqlParameter("@zyh", zyh)); + sqlpar.Add(new SqlParameter("@orgId", orgId)); + return this.FirstOrDefault(sql, sqlpar.ToArray()); + } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HosPatAccDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HosPatAccDmnService.cs index d5361a26..3af4448e 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HosPatAccDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HosPatAccDmnService.cs @@ -221,7 +221,7 @@ left join xt_brzh e on a.zyh = e.zyh and e.OrganizeId=@OrganizeId and e.zhxz = @xtzhxz and e.zt = '1' --系统 卡 left join xt_card f - on a.patid = f.patid and f.OrganizeId = @OrganizeId and f.zt = '1' + on a.kh = f.CardNo and a.CardType=f.CardType and f.OrganizeId = @OrganizeId and f.zt = '1' left join [NewtouchHIS_Base]..V_C_Sys_UserStaff g on g.gh=a.doctor and g.OrganizeId=a.OrganizeId and g.zt='1' --where diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HospSettDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HospSettDmnService.cs index cbf35ec2..4b4082c8 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HospSettDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/HospitalizationManage/HospSettDmnService.cs @@ -8,14 +8,12 @@ using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.ValueObjects; -using Newtouch.Infrastructure; using Newtouch.Tools; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace Newtouch.HIS.DomainServices { @@ -266,7 +264,7 @@ public IList GetPaginationSettlementList(Pagination pagina sql.Append(@"select zyjs.jsnm, zybrxx.zyh, zybrxx.xm, brxz.brxzmc , zybrxx.ryrq, zybrxx.cyrq, zyjs.fph , zyjs.zje, zyjs.xjzf, zyjs.CreatorCode, zyjs.CreateTime,case zybrxx.xb when '1' then '男' else '女' end xb, zybrxx.zjh,convert(varchar(50),zybrxx.csny,120) csrq,'否' isxsr,isnull(mz.mzmc,'汉族') mz,uf.Name zzys,case brxxk.cyfs when '1' then '治愈' when '2' then '好转' when '3' then '转院' when '4' then '死亡' else '好转' end gz -,case brxxk.cyfs when '3' then '医嘱转院' when '4' then '死亡' else '正常离院' end lyfs,brxxk.cyzdmc cyzd,zybrxx.hu_sheng+zybrxx.hu_shi+zybrxx.hu_xian+zybrxx.hu_dz jtzd +,case brxxk.cyfs when '3' then '医嘱转院' when '4' then '死亡' else '正常离院' end lyfs,brxxk.cyzdmc cyzd,zybrxx.hu_sheng+zybrxx.hu_shi+zybrxx.hu_xian+zybrxx.hu_dz jtzd,ybjs.setl_id zxlsh from zy_js zyjs inner join zy_brjbxx zybrxx on zybrxx.zyh = zyjs.zyh and zybrxx.OrganizeId = zyjs.OrganizeId @@ -277,6 +275,7 @@ left join xt_brxz brxz LEFT JOIN [NewtouchHIS_Base]..V_S_xt_mz mz on mz.mzCode=zybrxx.mz and mz.zt='1' LEFT JOIN [NewtouchHIS_Base]..V_C_Sys_UserStaff uf on uf.gh=zybrxx.doctor and uf.OrganizeId=zybrxx.OrganizeId and uf.zt='1' left join [Newtouch_CIS].[dbo].[zy_brxxk] brxxk on brxxk.zyh=zybrxx.zyh and brxxk.OrganizeId=zybrxx.OrganizeId and brxxk.zt='1' +LEFT JOIN [NewtouchHIS_Sett].[dbo].[drjk_zyjs_output] ybjs ON ybjs.setl_id = zyjs.ybjslsh AND ybjs.zt = '1' where zyjs.OrganizeId = @orgId and zyjs.zt = '1' and zyjs.jszt = '1' and zyjs.jsnm not in (select cxjsnm from zy_js where jszt = '2' and OrganizeId = @orgId)"); @@ -301,6 +300,59 @@ left join xt_brxz brxz return this.QueryWithPage(sql.ToString(), pagination, pars.ToArray()); } + /// + /// 待上传的自费结算病人信息 + /// + /// + /// + /// + /// + /// + /// + public IList GetPaginationZFSettlementList(Pagination pagination, string organizeId, string keyword, DateTime? jsksrq, DateTime? jsjsrq) + { + var sql = new StringBuilder(); + sql.Append(@"select DISTINCT zyjs.jsnm, zybrxx.zyh, zybrxx.xm, brxz.brxzmc , zybrxx.ryrq, zybrxx.cyrq, zyjs.fph +, zyjs.zje, zyjs.xjzf, zyjs.CreatorCode, zyjs.CreateTime,case zybrxx.xb when '1' then '男' else '女' end xb, +zybrxx.zjh,convert(varchar(50),zybrxx.csny,120) csrq,'否' isxsr,isnull(mz.mzmc,'汉族') mz,uf.Name zzys,case brxxk.cyfs when '1' then '治愈' when '2' then '好转' when '3' then '转院' when '4' then '死亡' else '好转' end gz +,case brxxk.cyfs when '3' then '医嘱转院' when '4' then '死亡' else '正常离院' end lyfs,brxxk.cyzdmc cyzd,zybrxx.hu_sheng+zybrxx.hu_shi+zybrxx.hu_xian+zybrxx.hu_dz jtzd,ybjs.setl_id zxlsh, +CASE WHEN drjk.mlbm_id IS NOT NULL THEN '已上传' ELSE '' END AS sfyb +from zy_js zyjs +inner join zy_brjbxx zybrxx +on zybrxx.zyh = zyjs.zyh and zybrxx.OrganizeId = zyjs.OrganizeId +left join xt_brxz brxz +on brxz.brxz = zyjs.brxz and brxz.OrganizeId = zyjs.OrganizeId +LEFT JOIN xt_brjbxx xx ON xx.patid = zybrxx.patid AND xx.zt='1' + AND zybrxx.OrganizeId=xx.OrganizeId +LEFT JOIN [NewtouchHIS_Base]..V_S_xt_mz mz on mz.mzCode=zybrxx.mz and mz.zt='1' +LEFT JOIN [NewtouchHIS_Base]..V_C_Sys_UserStaff uf on uf.gh=zybrxx.doctor and uf.OrganizeId=zybrxx.OrganizeId and uf.zt='1' +left join [Newtouch_CIS].[dbo].[zy_brxxk] brxxk on brxxk.zyh=zybrxx.zyh and brxxk.OrganizeId=zybrxx.OrganizeId and brxxk.zt='1' +LEFT JOIN [NewtouchHIS_Sett].[dbo].[drjk_zyjs_output] ybjs ON ybjs.setl_id = zyjs.ybjslsh AND ybjs.zt = '1' +LEFT JOIN dbo.Drjk_jxcsc_output drjk ON drjk.mlbm_id = CONVERT(VARCHAR(50), zyjs.jsnm) -- 关联条件 +where zyjs.OrganizeId = @orgId +and zyjs.zt = '1' and zyjs.jszt = '1' and zyjs.brxz = '0' +and zyjs.jsnm not in (select cxjsnm from zy_js where jszt = '2' and OrganizeId = @orgId) +"); + var pars = new List(); + pars.Add(new SqlParameter("@orgId", organizeId)); + if (!string.IsNullOrWhiteSpace(keyword)) + { + sql.Append(@" and (zybrxx.xm like @keyword or zybrxx.blh like @keyword or zybrxx.zyh like @keyword)"); + pars.Add(new SqlParameter("@keyword", "%" + (keyword ?? "") + "%")); + } + if (jsksrq.HasValue) + { + sql.Append(@" and zyjs.CreateTime >= @jsksrq"); + pars.Add(new SqlParameter("@jsksrq", jsksrq.Value.Date)); + } + if (jsjsrq.HasValue) + { + sql.Append(@" and zyjs.CreateTime < @jsjsrq"); + pars.Add(new SqlParameter("@jsjsrq", jsjsrq.Value.AddDays(1).Date)); + } + + return this.QueryWithPage(sql.ToString(), pagination, pars.ToArray()); + } /// /// /// @@ -333,7 +385,6 @@ left join [NewtouchHIS_Base]..V_S_xt_sfdl sfdl on sfdl.dlCode = dljf.dl and sfdl.OrganizeId = @orgId"; return this.FindList(sql, new[] { new SqlParameter("@orgId", organizeId), new SqlParameter("@jsnm", jsnm) }); } - /// /// 出院结算查询 费用明细 /// @@ -413,106 +464,6 @@ public void UpdateSettInvoiceNo(string orgId, int jsnm, string fph) db.Commit(); } } - - /// - /// 病人分类收费汇总 - /// - /// - /// - /// - public async Task> SettlementDetailsQueryAsync(string organizeId, string zyh) - { - var sql = @" -SELECT a.sfrq, a.dlCode, a.dlmc, SUM(a.je) je -FROM -( - SELECT CONVERT(VARCHAR(20), a.tdrq, 23) AS sfrq, d.dlCode, d.dlmc - , convert(decimal(18,2),a.sl * (a.dj + isnull(a.fwfdj, 0))) AS je - FROM dbo.zy_ypjfb(NOLOCK) a - LEFT JOIN [NewtouchHIS_Base].dbo.xt_sfdl(NOLOCK) d ON a.dl = d.dlCode AND a.OrganizeId = d.OrganizeId - WHERE a.zyh = @zyh - AND a.zt = 1 - AND a.OrganizeId = @orgId - - UNION ALL - - SELECT CONVERT(VARCHAR(20), a.tdrq, 23) AS sfrq, d.dlCode, d.dlmc - , convert(decimal(18,2),a.sl * (a.dj + isnull(a.fwfdj, 0))) AS je - FROM dbo.zy_xmjfb(NOLOCK) a - LEFT JOIN [NewtouchHIS_Base].dbo.xt_sfdl(NOLOCK) d ON a.dl = d.dlCode AND a.OrganizeId = d.OrganizeId - WHERE a.zyh = @zyh - AND a.zt = 1 - AND a.OrganizeId = @orgId -) a -GROUP BY a.sfrq, a.dlCode, a.dlmc -"; - return this.FindList(sql, new[] { new SqlParameter("@orgId", organizeId), new SqlParameter("@zyh", zyh) }); - } - - /// - /// 计费明细 - /// - /// - /// - /// - /// - /// - /// - public async Task> HospItemFeeDetailQueryAsync(string organizeId, string zyh, DateTime sfrq, string dlCode = "", List dlCodes = null) - { - var dlCodesParam = ""; - if (dlCodes != null && dlCodes.Count > 0) - { - dlCodesParam = string.Join(",", dlCodes); - } - var sql = $@" -SELECT aa.sfxmmc, aa.gg, sum(aa.sl) sl, aa.dw, CONVERT(DateTime,aa.CreateTime) CreateTime -, aa.dj, sum(aa.je) je, staff.Name ysmc, aa.bqmc, ks.ksmc, aa.zxbz, js.fph, staff2.name czry, LTRIM(RTRIM(sfdl.dlmc)) dlmc -FROM -( - --项目 - SELECT CONVERT(VARCHAR(10), xmjfb.tdrq, 120) CreateTime, xmjfb.jfbbh, sfxm.sfxmmc, '' gg, xmjfb.sl, xmjfb.jfdw dw, xmjfb.dj, bq.bqmc - , convert(decimal(18,2),xmjfb.sl * (xmjfb.dj + isnull(xmjfb.fwfdj, 0))) AS je - , (CASE WHEN xmjfb.sl > 0 THEN '记' ELSE '退' END) zxbz, xmjfb.ys, xmjfb.zxks, a.jsnm, xmjfb.dl - FROM zy_xmjfb(nolock) xmjfb - LEFT JOIN zy_jsmx(nolock) a on xmjfb.jfbbh=a.xmjfbbh and a.zt = '1' and isnull(a.xmjfbbh,0)>0 - INNER JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm on sfxm.sfxmCode=xmjfb.sfxm and sfxm.OrganizeId=@orgId - LEFT JOIN NewtouchHIS_Base.dbo.xt_bq bq on bq.bqCode=xmjfb.bq and bq.zt='1' - WHERE xmjfb.OrganizeId=@orgId and xmjfb.zyh=@zyh - and CONVERT(DateTime, CONVERT(VARCHAR(10), xmjfb.tdrq, 120))=@sfrq - - UNION ALL - - --药品 - SELECT CONVERT(VARCHAR(10), ypjf.tdrq, 120) CreateTime, ypjf.jfbbh, yp.ypmc sfxmmc, yp.ypgg gg, ypjf.sl, ypjf.jfdw dw, ypjf.dj, bq.bqmc - , convert(decimal(18,2), ypjf.sl * (ypjf.dj + isnull(ypjf.fwfdj, 0))) AS je - , (CASE WHEN ypjf.sl > 0 THEN '记' ELSE '退' END) zxbz, ypjf.ys, ypjf.ks zxks, a.jsnm, ypjf.dl - FROM zy_ypjfb(nolock) ypjf - LEFT JOIN zy_jsmx(nolock) a on ypjf.jfbbh=a.ypjfbbh and a.zt = '1' and isnull(a.ypjfbbh,0)>0 - INNER JOIN NewtouchHIS_Base.dbo.V_C_xt_yp yp on yp.ypcode=ypjf.yp and yp.zt='1' and yp.OrganizeId=@orgId - LEFT JOIN NewtouchHIS_Base.dbo.xt_bq bq on bq.bqCode=ypjf.bq and bq.zt='1' - WHERE ypjf.OrganizeId=@orgId and ypjf.zyh=@zyh - and CONVERT(DateTime, CONVERT(VARCHAR(10), ypjf.tdrq, 120))=@sfrq -) aa -LEFT JOIN zy_js(nolock) js on js.jsnm=aa.jsnm and js.zyh=@zyh and js.OrganizeId=@orgId -LEFT JOIN lis_sys_kssz ks on ks.ksdm=aa.zxks and ks.OrganizeId=@orgId -LEFT JOIN NewtouchHIS_Base.dbo.Sys_Staff staff on staff.gh=aa.ys and staff.OrganizeId=@orgId -LEFT JOIN NewtouchHIS_Base.dbo.Sys_Staff staff2 on staff2.gh=js.CreatorCode and staff.OrganizeId=@orgId -LEFT JOIN [NewtouchHIS_Base]..V_S_xt_sfdl sfdl on sfdl.dlCode = aa.dl and sfdl.zt='1' and sfdl.OrganizeId = @orgId -WHERE aa.CreateTime<>'' {(string.IsNullOrWhiteSpace(dlCode) || dlCode == "undefined" ? "" : "and aa.dl=@dl")} {(string.IsNullOrWhiteSpace(dlCodesParam) ? "" : $"and aa.dl in (SELECT * FROM dbo.f_split(@dlCodesParam, ','))")} -GROUP BY aa.sfxmmc, aa.gg, aa.dw, aa.CreateTime, aa.dj, staff.Name, aa.bqmc, ks.ksmc, aa.zxbz, js.fph, staff2.name, aa.dl, sfdl.dlmc -ORDER BY aa.CreateTime, aa.dl -"; - return this.FindList(sql, - new[] { - new SqlParameter("@orgId", organizeId), - new SqlParameter("@zyh", zyh), - new SqlParameter("@dl", dlCode=="undefined"?"":dlCode), - new SqlParameter("@sfrq", sfrq), - new SqlParameter("@dlCodesParam", dlCodesParam), - } - ); - } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGTradUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGTradUploadDmnService.cs new file mode 100644 index 00000000..e1580893 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGTradUploadDmnService.cs @@ -0,0 +1,163 @@ +using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using Newtouch.HIS.Domain.IDomainServices.DRGManage; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtouch.HIS.Domain.DTO.OutputDto.JGManage; +using Newtouch.HIS.Domain.IDomainServices.JGManage; + +namespace Newtouch.HIS.DomainServices.DRGManage +{ + public class JGTradUploadDmnService : DmnServiceBase, IJGTradUploadDmnService + { + public JGTradUploadDmnService(IDefaultDatabaseFactory databaseFactory) + : base(databaseFactory) + { + } + + public List GetList(string orgId, string kssj, string jssj, string scqk, string zyh,string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + //if (!string.IsNullOrWhiteSpace(zyh)) + //{ + string sql = ""; + sql = @" exec [usp_drg_trad_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + //db.ExecuteSqlCommand(sql, para); + //db.Commit(); + + return FindList(sql, para); + //} + //else + //{ + // List list = new List(); + // return list; + //} + } + } + + + public int JGUpload(string orgId, List list,string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + var count = 0; + foreach (var obj in list) + { + var mdtrt_id = obj.mdtrt_id; + var setl_id = obj.setl_id; + if ((!string.IsNullOrWhiteSpace(mdtrt_id)) && (!string.IsNullOrWhiteSpace(setl_id))) + { + string sql = ""; + sql = @" exec [usp_drg_trad_upload] @orgId=@orgId,@mdtrt_id=@mdtrt_id,@setl_id=@setl_id,@tradiNumber=@tradiNumber "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@mdtrt_id",mdtrt_id), + new SqlParameter("@setl_id",setl_id), + new SqlParameter("@tradiNumber",tradiNumber) + }; + db.ExecuteSqlCommand(sql, para); + db.Commit(); + count++; + //return FindList(sql, para); + } + else + { + + //return new List(); + } + } + return count; + } + } + public List GetListYp(string orgId, string kssj, string jssj, string scqk, string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + string sql = ""; + sql = @" exec [usp_Jg_trad_upload_search] @orgId=@orgId,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + return FindList(sql, para); + } + } + public List GetListsqsz(string orgId, string kssj, string jssj, string scqk,string zyh, string tradiNumber) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + string sql = ""; + sql = @" exec [usp_sqszpc_trad_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj,@tradiNumber=@tradiNumber "; + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + new SqlParameter("@tradiNumber",tradiNumber), + }; + return FindList(sql, para); + } + } + + public List Getmxlist(string orgid, string zyh, string type) + { + string sql = ""; + + if (type=="4402") + { + sql = @"select sta.Name kdys,dep.Name kdks,yznr xmmc,convert(varchar(30),kssj,120)kdrq from ( +select zyh,ysgh,DeptCode,yznr,kssj,OrganizeId from Newtouch_CIS..zy_cqyz where zyh=@zyh and zt='1' and OrganizeId=@orgId +union all +select zyh,ysgh,DeptCode,yznr,kssj,OrganizeId from Newtouch_CIS..zy_lsyz where zyh=@zyh and zt='1' and OrganizeId=@orgId +)q +left join NewtouchHIS_Base..Sys_Department dep on dep.Code=q.DeptCode and dep.OrganizeId=dep.OrganizeId +left join NewtouchHIS_Base..Sys_Staff sta on sta.gh=q.ysgh and sta.OrganizeId=q.OrganizeId +order by kssj +"; + }else if (type=="4501") + { + sql = @"select sta.Name kdys,dep.Name kdks,xmmc,lcyx,convert(varchar(30),kssj,120)kdrq from ( +select zyh,yzh,sqdh,ysgh,DeptCode,lcyx,ztmc xmmc,max(kssj) kssj,OrganizeId +from Newtouch_CIS..zy_lsyz a where zyh=@zyh and yzlx=7 and zt='1' and OrganizeId=@orgId +group by zyh,yzh,sqdh,lcyx,ztmc,ysgh,DeptCode,OrganizeId +)q +left join NewtouchHIS_Base..Sys_Department dep on dep.Code=q.DeptCode and dep.OrganizeId=dep.OrganizeId +left join NewtouchHIS_Base..Sys_Staff sta on sta.gh=q.ysgh and sta.OrganizeId=q.OrganizeId +order by kssj "; + } + else if (type == "4502") + { + sql = @"select xmzwmc xmmc,xmywmc ,gdbj wjz,xmdw,ckz,jyjg from Newtouch_Interface..Lis_Report_ZY where zyh=@zyh and zt='1' and OrganizeId=@orgId "; + } + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgid), + new SqlParameter("@zyh",zyh), + }; + return FindList(sql, para); + } + + } +} diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGUploadDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGUploadDmnService.cs new file mode 100644 index 00000000..0630224c --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/JGManage/JGUploadDmnService.cs @@ -0,0 +1,225 @@ +using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.Core.Common; +using Newtouch.HIS.Domain.DTO.OutputDto.DRGManage; +using Newtouch.HIS.Domain.IDomainServices.DRGManage; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtouch.HIS.Domain.DTO.OutputDto.JGManage; +using Newtouch.HIS.Domain.IDomainServices.JGManage; + +namespace Newtouch.HIS.DomainServices.DRGManage +{ + public class JGUploadDmnService : DmnServiceBase, IJGUploadDmnService + { + public JGUploadDmnService(IDefaultDatabaseFactory databaseFactory) + : base(databaseFactory) + { + } + + public List GetList(Pagination pagination, string orgId, string kssj, string jssj, string scqk, string zyh) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + if (!string.IsNullOrWhiteSpace(zyh)) + { + string sql = ""; + sql = @" exec [usp_drg_upload_search] @orgId=@orgId,@zyh=@zyh,@scqk=@scqk , @kssj=@kssj,@jssj=@jssj "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@zyh",zyh), + new SqlParameter("@scqk",scqk), + new SqlParameter("@kssj",kssj), + new SqlParameter("@jssj",jssj), + }; + //db.ExecuteSqlCommand(sql, para); + //db.Commit(); + + return FindList(sql, para); + } + else { + List < JGUploadDto > list= new List(); + return list; + } + } + } + + + public int JGUpload(string orgId,List list) + { + using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) + { + var count = 0; + foreach (var obj in list) + { + var mdtrt_id = obj.mdtrt_id; + var setl_id = obj.setl_id; + if ((!string.IsNullOrWhiteSpace(mdtrt_id)) && (!string.IsNullOrWhiteSpace(setl_id))) + { + string sql = ""; + sql = @" exec [usp_drg_upload] @orgId=@orgId,@mdtrt_id=@mdtrt_id,@setl_id=@setl_id "; + + + SqlParameter[] para = new SqlParameter[] { + new SqlParameter("@orgId",orgId), + new SqlParameter("@mdtrt_id",mdtrt_id), + new SqlParameter("@setl_id",setl_id) + }; + db.ExecuteSqlCommand(sql, para); + db.Commit(); + count++; + //return FindList(sql, para); + } + else + { + + //return new List(); + } + } + return count; + } + } + + // public List GetList(Pagination pagination, string orgId, string kssj, string jssj,string scqk,string zyh) + // { + // StringBuilder strsql = new StringBuilder(); + // IList inSqlParameterList = null; + // strsql.Append(@" + //create table #temp + //( + //id int identity(1,1), + //setl_id varchar(50), + //mdtrt_id varchar(50), + //zjh varchar(50), + //zyh varchar(50), + //brxm varchar(50), + //ryrq datetime, + //cyrq datetime, + //jsrq datetime, + //basy varchar(50), + //basy_rq datetime, + //ksdm varchar(50), + //ksmc varchar(50), + //ysdm varchar(50), + //ysmc varchar(50), + //jsqd_sclsh varchar(20), + //jsqd_scrq datetime, + //) + + ///*就诊ID-mdtrt_id*/ + //if(1=1) + //begin + //insert into #temp(zyh) + //select @zyh as zyh + + //end + + ///*结算ID/结算流水号-setl_id*/ + + + //update ls set ls.mdtrt_id=js.mdtrt_id + // from NewtouchHIS_Sett..drjk_zyjs_output as js with(nolock),#temp as ls + // where js.setl_id=ls.setl_id + + + + ///*1.病人信息更新*/ + //if(1=1) + //begin + + + ///*更新住院号*/ + //update ls set ls.mdtrt_id =ybry.mdtrt_id + // from NewtouchHIS_Sett..drjk_zyjs_input ybry with(nolock),#temp ls + // where ls.zyh=ybry.zyh + // and ybry.zt=1 + + ///*更新病人信息*/ + //update ls set ls.ryrq=br.ryrq,ls.cyrq=br.cyrq,ls.zjh=br.zjh,ls.ksdm=br.ks,ls.ysdm=br.doctor,ls.brxm=br.xm + // from NewtouchHIS_Sett..zy_brjbxx as br with(nolock),#temp as ls + // where br.zyh=ls.zyh + // and br.zt=1 + + //update ls set ls.ksmc=dept.Name from #temp as ls,NewtouchHIS_Base..Sys_Department as dept with(nolock) + //where ls.ksdm=dept.Code + // and dept.OrganizeId=@orgId + //update ls set ls.ysmc=czy.Name from #temp as ls,NewtouchHIS_Base..Sys_Staff as czy with(nolock) + //where ls.ysdm=czy.gh + // and czy.OrganizeId=@orgId + + ///*更新结算日期*/ + //update ls set ls.jsrq=br.czrq,jsqd_sclsh=br.jsqd_sclsh,jsqd_scrq=br.jsqd_scrq,setl_id=br.setl_id + // from NewtouchHIS_Sett..drjk_zyjs_output as br with(nolock),#temp as ls + // where br.mdtrt_id=ls.mdtrt_id + // and br.zt=1 + + ///*更新病案首页书写状态*/ + //update ls set ls.basy='已书写',ls.basy_rq=ba.CreateTime from Newtouch_EMR..mr_basy as ba with(nolock),#temp as ls + //where ba.ZYH=ls.zyh + // and ba.zt=1 + //update #temp set #temp.basy='--未写病案首页--' where #temp.basy is null + + + + //end + + ///*2.结算上传情况获取*/ + //select rz.hisId,max(rz.inNumbier) inNumbier + // into #rz + // from NewtouchHIS_Sett.dbo.ybjk_logcontent as rz with(nolock) + // where rz.beginDate>='2022-04-01' + // and rz.tradiNumber='4101' + // group by rz.hisId + + ///*3.查询输出*/ + //select ls.zyh [zyh],ls.brxm[xm],ls.zjh [sfzh],ls.setl_id [setl_id],ls.mdtrt_id [mdtrt_id], + // rz1.beginDate [scrq],rz1.inContent [scsr],rz1.outContent [scsc], + // ls.ryrq [ryrq],ls.cyrq [cyrq],ls.basy_rq [basyrq],ls.jsrq [jsrq], + // ls.ksdm [ksdm],ls.ksmc [ks],ls.ysdm [ysdm],ls.ysmc [ysxm],ls.basy [basyqk], + // case when isnull(rz1.errorMsg,'')='' then '已上传' + // when isnull(rz1.errorMsg,'')<>'' then '上传失败' + // else '未上传' + // end [scqk], + // jsqd_sclsh [jsqd], + // rz1.errorMsg [errorMsg] + //INTO #temp_result + // from #temp as ls left join #rz as rz on ls.zyh=rz.hisId + // left join NewtouchHIS_Sett.dbo.ybjk_logcontent as rz1 with(nolock) on rz.inNumbier=rz1.inNumbier + //order by ls.id desc + + //select * from #temp_result + //where scqk =scqk + + //if(object_id('tempdb.dbo.#temp')is not null) drop table #temp + //if(object_id('tempdb.dbo.#rz')is not null) drop table #rz + //if(object_id('tempdb.dbo.#temptable')is not null) drop table #temptable + //if(object_id('tempdb.dbo.#temp_result')is not null) drop table #temp_result + + //return + + //"); + // inSqlParameterList = new List(); + // //if (!string.IsNullOrEmpty(blh)) + // //{ + // // strsql.Append(" AND brjbxx.blh like @blh "); + // // inSqlParameterList.Add(new SqlParameter("@blh", "%" + blh.Trim() + "%")); + // //} + // //if (!string.IsNullOrEmpty(xm)) + // //{ + // // strsql.Append(" AND (brjbxx.xm like @xm or brjbxx.py like @xm)"); + // // inSqlParameterList.Add(new SqlParameter("@xm", "%" + xm.Trim() + "%")); + // //} + // inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + // inSqlParameterList.Add(new SqlParameter("@zyh", zyh)); + // inSqlParameterList.Add(new SqlParameter("@scqk", scqk)); + // return this.QueryWithPage(strsql.ToString(), pagination, inSqlParameterList.ToArray()).ToList(); + // } + } + +} diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/Newtouch.HIS.DomainServices.csproj b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/Newtouch.HIS.DomainServices.csproj index 6f0433c3..e12ec219 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/Newtouch.HIS.DomainServices.csproj +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/Newtouch.HIS.DomainServices.csproj @@ -9,7 +9,7 @@ Properties Newtouch.HIS.DomainServices Newtouch.HIS.DomainServices - v4.6 + v4.6.2 512 @@ -31,7 +31,8 @@ 4 - + + False ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll @@ -52,10 +53,6 @@ ..\..\his-dll-common\dlls\Newtouch.Core.Common.dll - - False - ..\..\his-dll-common\dlls\Newtouch.Core.Redis.dll - False ..\..\his-dll-common\webapicommondlls\Newtouch.HIS.API.Common.dll @@ -89,16 +86,18 @@ + + + + - - diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutBookDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutBookDmnService.cs index 7ec970ee..9d1e6462 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutBookDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutBookDmnService.cs @@ -2,20 +2,22 @@ using FrameworkBase.MultiOrg.Infrastructure; using Newtouch.Core.Common; using Newtouch.Core.Common.Exceptions; +using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.Entity.OutpatientManage; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IDomainServices.API; using Newtouch.HIS.Domain.IDomainServices.OutpatientManage; using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; +using Newtouch.HIS.DomainServices.API; using Newtouch.HIS.Sett.Request.Booking.Request; -using Newtouch.HIS.Sett.Request.Booking.Response; using Newtouch.Infrastructure; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.DomainServices.OutpatientManage { @@ -47,8 +49,8 @@ from mz_ghpb_config ghpb left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] sfxm on sfxm.sfxmCode=ghpb.ghlx and sfxm.OrganizeId = ghpb.OrganizeId left join NewtouchHIS_Base.[dbo].[V_S_Sys_Department] department -on ghpb.ks =department.Code -left join (select zhcode,zhmc,OrganizeId from mz_gh_zlxmzh group by zhcode,zhmc,OrganizeId) zlsfxm +on ghpb.ks =department.Code and department.OrganizeId=ghpb.OrganizeId and department.zt='1' +left join (select zhcode,zhmc,OrganizeId from mz_gh_zlxmzh where OrganizeId= @OrganizeId group by zhcode,zhmc,OrganizeId) zlsfxm on zlsfxm.zhcode=ghpb.zlxm and zlsfxm.OrganizeId = ghpb.OrganizeId left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff on ghpb.ys=staff.gh @@ -68,8 +70,7 @@ left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff } //获取医生工号姓名对应关系 - public IList GetStaffList(string orgId) - { + public IList GetStaffList(string orgId) { if (string.IsNullOrEmpty(orgId)) { return null; @@ -86,8 +87,7 @@ public IList GetStaffList(string orgId) } //根据医生工号获取医生姓名 - public string getStaffName(string gh) - { + public string getStaffName(string gh) { string sql = "select Name from NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] where 1=1 and zt='1'"; var para = new List(); if (!string.IsNullOrWhiteSpace(gh)) @@ -99,44 +99,44 @@ public string getStaffName(string gh) } //排班页获取排班信息 - public OutBookVO getArrangeInfo(int ghpbId) - { - if (ghpbId == 0) + public OutBookVO getArrangeInfo(int ghpbId,string orgId) { + if (ghpbId==0) { return null; } - // string sql = @"select ghpb.[ghpbId] ,ghpb.[OrganizeId],ghpb.[ks] ,ghpb.[ys],ghpb.[zt] ,ghpb.[zhl] ,ghpb.[ghzb],ghpb.[CreatorCode] ,ghpb.[CreateTime] ,ghpb.[LastModifyTime],ghpb.[LastModifierCode] ,ghpb.[px],ghpb.[ghlx] ,ghpb.[zlxm] ,ghpb.[mjzbz],sfxm.sfxmmc,zlsfxm.sfxmmc zlxmmc,department.name as ksmz,staff.name as ysxm from mz_ghpb_config ghpb - //left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] sfxm on sfxm.sfxmCode=ghpb.ghlx and sfxm.OrganizeId = ghpb.OrganizeId - //left join NewtouchHIS_Base.[dbo].[V_S_Sys_Department] department on ghpb.ks =department.Code - //left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] zlsfxm on zlsfxm.sfxmCode=ghpb.zlxm and zlsfxm.OrganizeId = ghpb.OrganizeId - //left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff on ghpb.ys=staff.gh - //where 1=1 "; +// string sql = @"select ghpb.[ghpbId] ,ghpb.[OrganizeId],ghpb.[ks] ,ghpb.[ys],ghpb.[zt] ,ghpb.[zhl] ,ghpb.[ghzb],ghpb.[CreatorCode] ,ghpb.[CreateTime] ,ghpb.[LastModifyTime],ghpb.[LastModifierCode] ,ghpb.[px],ghpb.[ghlx] ,ghpb.[zlxm] ,ghpb.[mjzbz],sfxm.sfxmmc,zlsfxm.sfxmmc zlxmmc,department.name as ksmz,staff.name as ysxm from mz_ghpb_config ghpb +//left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] sfxm on sfxm.sfxmCode=ghpb.ghlx and sfxm.OrganizeId = ghpb.OrganizeId +//left join NewtouchHIS_Base.[dbo].[V_S_Sys_Department] department on ghpb.ks =department.Code +//left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] zlsfxm on zlsfxm.sfxmCode=ghpb.zlxm and zlsfxm.OrganizeId = ghpb.OrganizeId +//left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff on ghpb.ys=staff.gh +//where 1=1 "; //诊疗项目打包为收费组合 string sql = @"select ghpb.[ghpbId] ,ghpb.[OrganizeId],ghpb.[ks] ,ghpb.[ys],ghpb.[zt] ,ghpb.pbdesc, ghpb.[zhl] ,ghpb.[ghzb],ghpb.[CreatorCode] ,ghpb.[CreateTime] ,ghpb.[LastModifyTime],ghpb.[LastModifierCode] , ghpb.[px],ghpb.[ghlx] ,ghpb.[zlxm] ,ghpb.[mjzbz],sfxm.sfxmmc,zlsfxm.zhmc zlxmmc,department.name as ksmz,staff.name as ysxm from mz_ghpb_config ghpb left join NewtouchHIS_Base.[dbo].[V_S_xt_sfxm] sfxm on sfxm.sfxmCode=ghpb.ghlx and sfxm.OrganizeId = ghpb.OrganizeId -left join NewtouchHIS_Base.[dbo].[V_S_Sys_Department] department on ghpb.ks =department.Code -left join (select zhcode,zhmc,OrganizeId from mz_gh_zlxmzh group by zhcode,zhmc,OrganizeId) zlsfxm on zlsfxm.zhcode=ghpb.zlxm and zlsfxm.OrganizeId = ghpb.OrganizeId +left join NewtouchHIS_Base.[dbo].[V_S_Sys_Department] department on ghpb.ks =department.Code and ghpb.OrganizeId= department.OrganizeId and department.zt='1' +left join (select zhcode,zhmc,OrganizeId from mz_gh_zlxmzh where OrganizeId=@orgId group by zhcode,zhmc,OrganizeId) zlsfxm on zlsfxm.zhcode=ghpb.zlxm and zlsfxm.OrganizeId = ghpb.OrganizeId left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff on ghpb.ys=staff.gh and ghpb.OrganizeId=staff.OrganizeId where 1=1 "; - if (ghpbId != 0) + if (ghpbId!=0) { sql += " and ghpbId=@ghpbId "; } return this.FirstOrDefault(sql, new SqlParameter[] { - new SqlParameter("@ghpbId",ghpbId) + new SqlParameter("@ghpbId",ghpbId), + new SqlParameter("@orgId",orgId) }); } - public IList getDateTimeInfo(string organizeId, int ghpbId, string timeslot) + public IList getDateTimeInfo(string organizeId, int ghpbId,string timeslot) { if (string.IsNullOrEmpty(organizeId)) { return null; } - string sql = @"select top 1 organizeId,ghpbId, + string sql = @"select top 1 organizeId,ghpbId, zyi=(select period from [dbo].[mz_ghpb_date] where 1=1 and OrganizeId=@organizeId and ghpbId=@ghpbId and Weekdd=1 and period=2 and timeslot!='' and timeslot=@timeslot), zer=(select period from [dbo].[mz_ghpb_date] where 1=1 and OrganizeId=@organizeId and ghpbId=@ghpbId and Weekdd=2 and period=2 and timeslot!='' and timeslot=@timeslot), zsan=(select period from [dbo].[mz_ghpb_date] where 1=1 and OrganizeId=@organizeId and ghpbId=@ghpbId and Weekdd=3 and period=2 and timeslot!='' and timeslot=@timeslot), @@ -154,17 +154,16 @@ public IList getDateTimeInfo(string organizeId, int ghpbId, strin sjd=(select timeslot from [dbo].[mz_ghpb_date] where 1=1 and OrganizeId=@organizeId and ghpbId=@ghpbId and Weekdd=1 and period=2 and timeslot!='' and timeslot=@timeslot), isBook=(select Top 1 isBook from [dbo].[mz_ghpb_date] where 1=1 and OrganizeId=@organizeId and ghpbId=@ghpbId and period=2 and timeslot!='' and timeslot=@timeslot) from [dbo].[mz_ghpb_date] where OrganizeId=@organizeId and ghpbId=@ghpbId and timeslot!='' and timeslot=@timeslot"; - return this.FindList(sql, new SqlParameter[] { + return this.FindList(sql, new SqlParameter[] { new SqlParameter("@organizeId",organizeId), new SqlParameter("@timeslot",timeslot), new SqlParameter("@ghpbId",ghpbId) }); } //排班页获取排班时间 - public OutBookDateVO getDateInfo(string organizeId, int ghpbId) - { - - if (string.IsNullOrEmpty(organizeId)) + public OutBookDateVO getDateInfo(string organizeId,int ghpbId) { + + if (string.IsNullOrEmpty(organizeId)) { return null; } @@ -206,8 +205,7 @@ public OutBookDateVO getDateInfo(string organizeId, int ghpbId) } //更新排班信息 - public int UpdateArrange(OutBookArrangeVO entity, int ghpbId, string orgId, string User, DateTime Time) - { + public int UpdateArrange(OutBookArrangeVO entity,int ghpbId,string orgId,string User,DateTime Time) { string sql = @"update [mz_ghpb_config] set organizeId = @organizeId,mjzbz = @mjzbz,ghlx = @ghlx,zlxm = @zlxm,ks = @ks, zt = @zt, LastModifyTime=@Time,LastModifierCode=@User ,ys=@ys,pbdesc=@pbdesc @@ -230,8 +228,7 @@ public int UpdateArrange(OutBookArrangeVO entity, int ghpbId, string orgId, stri } //新增排班信息 - public int InsertArrange(OutBookArrangeVO entity, string orgId, string User, DateTime Time, int ghpbIdNew) - { + public int InsertArrange(OutBookArrangeVO entity, string orgId, string User, DateTime Time,int ghpbIdNew) { string sql = @"insert into [dbo].[mz_ghpb_config] (ghpbId,OrganizeId, ks, mjzbz, ghlx,zlxm, zt, CreatorCode, CreateTime,pbdesc,ys) values(@ghpbId,@OrganizeId, @ks, @mjzbz, @ghlx,@zlxm, '1', @CreatorCode, @CreateTime,@pbdesc,@ys)"; SqlParameter[] para ={ @@ -249,7 +246,7 @@ public int InsertArrange(OutBookArrangeVO entity, string orgId, string User, Dat return this.ExecuteSqlCommand(sql, para); } //新增排班信息 - public int DeleteArrange(int ghpbId, string orgId) + public int DeleteArrange(int ghpbId,string orgId) { string deletesql = @"delete from mz_ghpb_date where ghpbid=@ghpbId and OrganizeId=@organizeId"; // string sql = @"update [mz_ghpb_date] @@ -260,13 +257,13 @@ public int DeleteArrange(int ghpbId, string orgId) new SqlParameter("@ghpbId",ghpbId), new SqlParameter("@organizeId",orgId) }; - return this.ExecuteSqlCommand(deletesql, para); + return this.ExecuteSqlCommand(deletesql, para); } //新增排班时间 - public int InsertghpbTime(string begintime, string endtime, string orgId, string User, DateTime Time, int id) + public int InsertghpbTime(string begintime, string endtime, string orgId, string User, DateTime Time,int id) { - if (id == 1) + if (id==1) { string deletesql = @"delete from mz_ghpb_Time"; SqlParameter[] para1 = { }; @@ -300,13 +297,13 @@ public int InsertghpbTime(string begintime, string endtime, string orgId, string } public int getghpbId() { - string sql = "select isnull(Max(ghpbId),0)+1 ghpbId from [dbo].[mz_ghpb_config] "; + string sql = "select isnull(Max(ghpbId),0)+1 ghpbId from [dbo].[mz_ghpb_config] "; return this.FirstOrDefault(sql, new SqlParameter[] { }); } //根据科室获取医生列表 - public IList getStaffListByKs(string ks, string orgId) + public IList getStaffListByKs(string ks,string orgId) { string sql = "select name from [dbo].[mz_ghpb_rel_doc] ghpb left join NewtouchHIS_Base.[dbo].[V_S_Sys_Staff] staff on ghpb.ys = staff.gh where 1=1 and ghpb.zt='1'"; var para = new List(); @@ -345,17 +342,17 @@ public void SaveDatapb(List pbList, string orgId) { foreach (var item in pbList) { - var uptsentity = db.IQueryable().FirstOrDefault(p => p.ScheduId == item.ScheduId && p.OrganizeId == orgId); - if (uptsentity != null) - { - uptsentity.TotalNum = item.TotalNum; - uptsentity.Modify(); - db.Update(uptsentity); - } - else - { - throw new FailedException("数据异常,未查询到该治疗建议信息"); - } + var uptsentity = db.IQueryable().FirstOrDefault(p => p.ScheduId == item.ScheduId && p.OrganizeId == orgId); + if (uptsentity != null) + { + uptsentity.TotalNum = item.TotalNum; + uptsentity.Modify(); + db.Update(uptsentity); + } + else + { + throw new FailedException("数据异常,未查询到该治疗建议信息"); + } } } @@ -367,23 +364,23 @@ public void SaveDatapb(List pbList, string orgId) /// /// /// - public void SaveDatatzcz(Decimal ScheduId, string czzt, string orgId, string tzyy) + public void SaveDatatzcz(Decimal ScheduId,string czzt, string orgId,string tzyy) { using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) { - var uptsentity = db.IQueryable().FirstOrDefault(p => p.ScheduId == ScheduId && p.OrganizeId == orgId); - if (uptsentity != null) - { - uptsentity.istz = czzt; - uptsentity.tzyy = tzyy; - uptsentity.tzsj = DateTime.Now.ToString(); - uptsentity.Modify(); - db.Update(uptsentity); - } - else - { - throw new FailedException("数据异常,未查询到该治疗建议信息"); - } + var uptsentity = db.IQueryable().FirstOrDefault(p => p.ScheduId ==ScheduId && p.OrganizeId == orgId); + if (uptsentity != null) + { + uptsentity.istz = czzt; + uptsentity.tzyy = tzyy; + uptsentity.tzsj = DateTime.Now.ToString(); + uptsentity.Modify(); + db.Update(uptsentity); + } + else + { + throw new FailedException("数据异常,未查询到该治疗建议信息"); + } db.Commit(); } } @@ -403,7 +400,7 @@ public IList getDateInfosjdcount(int ghpbId, string orgId) /// /// /// - public IList GetMzpbZlxmzh(string zhcode, string keyword, string orgId) + public IList GetMzpbZlxmzh(string zhcode,string keyword, string orgId) { string sql = @"select [zhmc],[zhcode],sum(price) zhje,sfdl from mz_gh_zlxmzh with(nolock) @@ -452,7 +449,7 @@ from mz_gh_zlxmzh with(nolock) public string PatBookGh(string cardNo, int ScheduId, string brxz, string Doctor, DateTime OutDate, string orgId) { MzAppointmentReq req = new MzAppointmentReq(); - req.AppID = EnumMzghly.His.ToString(); + req.AppID = EnumMzghly.His.ToString() ; req.ScheduId = ScheduId; req.OutDate = OutDate; req.HospitalID = "HIS"; @@ -472,31 +469,5 @@ public int CancalBook(string BookId) return cnt; } #endregion - - #region - /// - /// 预约 V2 bychl - /// - /// - /// - /// - public MzAppointmentResp PatBookGh(MzAppointmentReq req) - { - req.HospitalID = req.HospitalID ?? "HIS"; - return _bookingReginsterDmnService.OutAppointment(req); - } - /// - /// 取消预约 V2 bychl - /// - /// - /// - public int CancalBook(MzAppointmentRecordReq req) - { - req.HospitalID = req.HospitalID ?? "HIS"; - var cnt = _bookingReginsterDmnService.CancelOutApp(req); - return cnt; - } - - #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatChargeDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatChargeDmnService.cs index ca7def28..46166d3f 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatChargeDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatChargeDmnService.cs @@ -1313,7 +1313,7 @@ FROM [dbo].[xt_brjbxx] AS A WITH ( NOLOCK ) /// /// /// - public List GetpatientAccountList(DateTime kssj, DateTime jssj, string kh, string zjh, string cardType, string orgId) + public List GetpatientAccountList(DateTime kssj, DateTime jssj, string kh, string zjh,string cardType, string orgId) { const string sql = @" SELECT A.patid , @@ -1372,7 +1372,7 @@ AND gh.ghrq BETWEEN @kssj AND DATEADD(DAY,1,CONVERT(DATETIME,@jssj)) /// /// /// - public List GetOutpatChargePatInfoInAcc(string mzh, string kh, string zjh, string cardType, string orgId) + public List GetOutpatChargePatInfoInAcc(string mzh, string kh,string zjh, string cardType, string orgId) { if (string.IsNullOrWhiteSpace(mzh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType)) && string.IsNullOrWhiteSpace(zjh)) { @@ -1411,7 +1411,9 @@ RIGHT JOIN dbo.mz_gh(NOLOCK) gh ON gh.patid=a.patid and ISNULL(gh.ghzt, '') <> ' WHERE A.zt = '1' and xz.zt = '1' and gh.zt = '1' and a.OrganizeId = @OrganizeId -and (gh.mzh=@mzh or (gh.kh = @kh and gh.CardType = @CardType) or (gh.zjh=@zjh and gh.CardType=@CardType))"); +and (gh.mzh=@mzh or (gh.kh = @kh and gh.CardType = @CardType) or (gh.zjh=@zjh and gh.CardType=@CardType)) +order by gh.ghrq +"); DbParameter[] par1 = { new SqlParameter("@mzh",(mzh??"")), @@ -1433,17 +1435,19 @@ RIGHT JOIN dbo.mz_gh(NOLOCK) gh ON gh.patid=a.patid and ISNULL(gh.ghzt, '') <> ' /// /// /// - public OutpatAccInfoDto GetChargePatInfoInRegister(string kh, string blh, string zjh, string orgId, string cardType, string ly, string CardId) + public OutpatAccInfoDto GetChargePatInfoInRegister(string kh, string blh, string zjh, string orgId, string cardType,string ly,string CardId) { OutpatAccInfoDto patxx = new OutpatAccInfoDto(); if (ly != null) { - string yktsql = @" select patid from [dbo].[xt_brjbxx](NOLOCK) where zjh=@zjh and OrganizeId = @OrganizeId and zt=1 "; + string yktsql = @" select patid from [dbo].[xt_brjbxx](NOLOCK) + where zjh=@zjh and OrganizeId = @OrganizeId and zt=1 +"; DbParameter[] par1 = - { - new SqlParameter("@OrganizeId", orgId), - new SqlParameter("@zjh", zjh??""), - }; + { + new SqlParameter("@OrganizeId", orgId), + new SqlParameter("@zjh", zjh??""), + }; patxx = FindList(yktsql.ToString(), par1).FirstOrDefault(); if (patxx == null) { @@ -1451,74 +1455,67 @@ public OutpatAccInfoDto GetChargePatInfoInRegister(string kh, string blh, string } } string strSql = @" - SELECT A.patid , - a.blh , - A.xm , - A.xb , - A.csny , - A.zjh , - A.zjlx , - A.zjh , - C.CardType, - C.CardTypeName, - c.CardNo kh , - CAST( FLOOR(datediff(DY,a.csny,getdate())/365.25) as int) nl, - xz.brxz, - xz.brxzmc, - xz.brxzbh , - yb.sycs, - A.dh, - A.dybh, - A.brly, - A.phone, - a.jjllrgx lxrgx, - a.jjlldh lxrdh, - a.jjllr lxr, - '' db , - '' dbzd,A.hf, - A.gj gjCode, A.mz mzCode, gj.gjmc, mz.mzmc, c.CardNo sbbh,c.cblb,A.xian_sheng+xian_shi+xian_xian+xian_dz dz, - c.grbh - FROM [dbo].[xt_brjbxx](NOLOCK) A - INNER JOIN dbo.xt_card(NOLOCK) c ON c.patid = a.patid AND A.OrganizeId = c.OrganizeId and c.zt=1 - LEFT JOIN xt_brxz(NOLOCK) xz ON xz.brxz = c.brxz AND xz.OrganizeId = c.OrganizeId and xz.zt=1 - LEFT JOIN xt_ybbab(NOLOCK) yb ON yb.patid = a.patid AND xz.OrganizeId = yb.OrganizeId - LEFT JOIN [NewtouchHIS_Base]..V_S_xt_gj gj ON gj.gjCode = A.gj - LEFT JOIN [NewtouchHIS_Base]..V_S_xt_mz mz ON mz.mzCode = A.mz + SELECT A.patid , + a.blh , + A.xm , + A.xb , + A.csny , + A.zjh , + A.zjlx , + A.zjh , + C.CardType, + C.CardTypeName, + c.CardNo kh , + CAST( FLOOR(datediff(DY,a.csny,getdate())/365.25) as int) nl, + xz.brxz, + xz.brxzmc, + xz.brxzbh , + xz.brxzlb, + yb.sycs, + A.dh, + A.dybh, + A.brly, + A.phone, + a.jjllrgx lxrgx, + a.jjlldh lxrdh, + a.jjllr lxr, + '' db , + '' dbzd,A.hf, + A.gj gjCode, A.mz mzCode, gj.gjmc, mz.mzmc, c.CardNo sbbh,c.cblb,A.xian_sheng+xian_shi+xian_xian+xian_dz dz + FROM [dbo].[xt_brjbxx](NOLOCK) A + INNER JOIN dbo.xt_card(NOLOCK) c ON c.patid = a.patid AND A.OrganizeId = c.OrganizeId and c.zt=1 + LEFT JOIN xt_brxz(NOLOCK) xz ON xz.brxz = c.brxz AND xz.OrganizeId = c.OrganizeId and xz.zt=1 + LEFT JOIN xt_ybbab(NOLOCK) yb ON yb.patid = a.patid AND xz.OrganizeId = yb.OrganizeId + LEFT JOIN [NewtouchHIS_Base]..V_S_xt_gj gj ON gj.gjCode = A.gj + LEFT JOIN [NewtouchHIS_Base]..V_S_xt_mz mz ON mz.mzCode = A.mz "; - var pars = new List - { - new SqlParameter("@kh", kh ?? ""), - new SqlParameter("@cardType", cardType ?? ""), - new SqlParameter("@zjh", zjh ?? ""), - new SqlParameter("@OrganizeId", orgId) - }; + var pars = new List(); + pars.Add(new SqlParameter("@kh", kh ?? "")); + pars.Add(new SqlParameter("@cardType", cardType ?? "")); + pars.Add(new SqlParameter("@zjh", zjh ?? "")); + pars.Add(new SqlParameter("@OrganizeId", orgId)); if (ly == null) { - strSql += @" - WHERE (@kh='' or (c.CardType = @cardType and c.CardNo = @kh)) - AND (A.blh = @blh OR @blh = '') - AND (c.CardId = @CardId OR @CardId = '') - AND ((A.zjh = @zjh and c.CardType = @cardType) or (@zjh = '' and @cardType = @cardType)) - AND a.OrganizeId = @OrganizeId AND A.zt = '1' - ORDER BY A.CreateTime DESC"; + strSql += @" WHERE (@kh='' or (c.CardType = @cardType and c.CardNo = @kh)) + AND(A.blh = @blh OR @blh = '') AND(c.CardId = @CardId OR @CardId = '') AND((A.zjh = @zjh and c.CardType = @cardType) or(@zjh = '' and @cardType = @cardType)) + AND a.OrganizeId = @OrganizeId AND A.zt = '1' +ORDER BY A.CreateTime DESC"; + pars.Add(new SqlParameter("@blh", blh ?? "")); pars.Add(new SqlParameter("@CardId", CardId ?? "")); } - else - { - strSql += @" - WHERE (@kh='' or (c.CardType = @cardType and c.CardNo = @kh)) - AND(A.zjh = @zjh ) - AND a.OrganizeId = @OrganizeId AND A.zt = '1' - ORDER BY A.CreateTime DESC -"; + else { + strSql += @" WHERE (@kh='' or (c.CardType = @cardType and c.CardNo = @kh)) + AND(A.zjh = @zjh ) + AND a.OrganizeId = @OrganizeId AND A.zt = '1' +ORDER BY A.CreateTime DESC"; } var patChargeVo = FindList(strSql, pars.ToArray()).FirstOrDefault(); - + if (patChargeVo == null && !string.IsNullOrWhiteSpace(kh) && !string.IsNullOrWhiteSpace(cardType)) { throw new FailedCodeException("OUTPAT_REGIST_ISINVALID"); @@ -2790,23 +2787,23 @@ public object GetPatientGridJson(string orgId) ( SELECT distinct gh.xm, gh.blh, - gh.mzh, isnull(gh.ghrq,gh.CreateTime) CreateTime + gh.mzh, gh.ghrq FROM mz_gh(NOLOCK) gh join mz_cf(NOLOCK) cf ON cf.ghnm = gh.ghnm -WHERE gh.OrganizeId = @orgId AND ISNULL(gh.mzh, '') != '' AND ISNULL(cf.cfzt, 0) = 0 AND cf.zt = '1' and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') +WHERE gh.OrganizeId = @orgId AND ISNULL(gh.mzh, '') != '' AND cf.cfzt = '0' AND cf.zt = '1' and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') union --20181010添加代收费项目 SELECT distinct gh.xm, gh.blh, - gh.mzh, isnull(gh.ghrq,gh.CreateTime) CreateTime + gh.mzh, gh.ghrq FROM mz_gh(NOLOCK) gh join mz_xm(NOLOCK) xm ON xm.ghnm = gh.ghnm -WHERE gh.OrganizeId = @orgId AND ISNULL(gh.mzh, '') != '' AND ISNULL(xm.xmzt, 0) = 0 AND xm.zt = '1' and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') -) as tt LEFT JOIN dbo.xt_brjbxx xx ON xx.blh = tt.blh +WHERE gh.OrganizeId = @orgId AND ISNULL(gh.mzh, '') != '' AND xm.xmzt = '0' AND xm.zt = '1' and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') +) as tt LEFT JOIN dbo.xt_brjbxx(NOLOCK) xx ON xx.blh = tt.blh AND xx.OrganizeId = @orgId and xx.zt = '1' -where DATEDIFF(d,tt.CreateTime,getdate())<@lastviewday -order by tt.CreateTime desc"); +where tt.ghrq > DATEADD(DAY,-@lastviewday,GETDATE()) +order by tt.ghrq desc"); DbParameter[] par = { new SqlParameter("@orgId", orgId), @@ -2821,19 +2818,18 @@ where DATEDIFF(d,tt.CreateTime,getdate())<@lastviewday select DISTINCT gh.xm, gh.blh, - gh.mzh, isnull(gh.ghrq,gh.CreateTime) CreateTime, + gh.mzh, gh.ghrq, gh.patid, xx.py -from mz_js(nolock) js -LEFT JOIN mz_gh (NOLOCK) gh ON gh.ghnm = js.ghnm - AND gh.OrganizeId = @orgId - LEFT JOIN dbo.xt_brjbxx xx ON xx.blh = gh.blh +from mz_gh(NOLOCK) gh +INNER JOIN mz_js(nolock) js ON js.ghnm = gh.ghnm + LEFT JOIN dbo.xt_brjbxx(NOLOCK) xx ON xx.blh = gh.blh AND xx.OrganizeId = @orgId and xx.zt='1' -where js.isQfyj = 1 and isnull(js.tbz, 0) <> 1 and js.zt = '1' and js.OrganizeId = @orgId and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') +where js.isQfyj = 1 and isnull(js.tbz, 0) <> 1 and js.zt = '1' and gh.OrganizeId = @orgId and gh.zt = '1' and isnull(gh.ghzt,'0') != '2' and (1 = @isContainsJZJS or isnull(gh.jzbz, '') <> '3') ) as ttt -where DATEDIFF(d,ttt.CreateTime,getdate())<@lastviewday -order by CreateTime desc"); +where ttt.ghrq > DATEADD(DAY,-@lastviewday,GETDATE()) +order by ttt.ghrq desc"); DbParameter[] par2 = { new SqlParameter("@orgId", orgId), @@ -3030,113 +3026,96 @@ ORDER BY cf.CreateTime /// 机构ID /// public IList GetNewAllUnSettedListByMzh(string mzh, string cfnms, string orgId) - { - const string strSql = @"select * from( -select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,sum(sl) sl,sum(zje) zje,dw,yzlx,ks,ys,ysmc,ztId,ztmc,cflx from( -SELECT cf.cfh ,cf.cfnm ,yp.ypmc sfxmmc ,mx.yp sfxmCode, - sum(ISNULL(mx.dj, 0.00)) dj , sum(ISNULL(CAST(mx.sl AS INT), 0)) sl , sum(ISNULL(mx.je, 0.00)) zje , - mx.dw, '1' yzlx, - cf.ks, cf.ys, cf.ysmc,null ztId,null ztmc,cf.cflx - FROM mz_cf(NOLOCK) cf - INNER JOIN mz_cfmx(NOLOCK) mx ON cf.cfnm = mx.cfnm AND mx.OrganizeId=cf.OrganizeId AND mx.zt = '1' - INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=cf.ghnm AND gh.zt='1' AND gh.OrganizeId=cf.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.V_C_xt_yp yp ON yp.ypCode=mx.yp AND yp.OrganizeId=cf.OrganizeId AND yp.zt='1' - LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode=mx.dl AND dl.OrganizeId=cf.OrganizeId AND dl.zt='1' - WHERE cf.OrganizeId = @orgId - AND cf.zt= '1' AND cf.cfzt = '0' --处方有效且未收费 - AND gh.mzh=@mzh - AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 - group by cf.cfh,cf.cfnm,yp.ypmc,mx.yp,mx.dw,cf.ks,cf.ys,cf.ysmc,cf.cflx -) b -group by cfh ,cfnm,ztmc,ztId,ks,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx - union all -select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,sum(sl) sl,sum(zje) zje,dw,yzlx,ks,ys,ysmc,ztId,ztmc,cflx from( -SELECT cf.cfh ,cf.cfnm , (case when xm.ztmc is not null then xm.ztmc else sfxm.sfxmmc end) sfxmmc , (case when xm.ztId is not null then xm.ztId else sfxm.sfxmCode end) sfxmCode , - sum(ISNULL(xm.dj, 0.00)) dj , sum(ISNULL(CAST(xm.sl AS INT), 0)) sl , sum(ISNULL(xm.je, 0.00)) zje ,(case when xm.ztId is not null then '组套' else xm.dw end) dw, - '2' yzlx, - xm.ks, xm.ys, xm.ysmc,xm.ztId,xm.ztmc,cf.cflx - FROM dbo.mz_xm(NOLOCK) xm - INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=xm.ghnm and gh.OrganizeId=xm.OrganizeId AND gh.zt='1' - LEFT JOIN dbo.mz_cf(NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm ON sfxm.sfxmCode = xm.sfxm AND sfxm.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode = xm.dl AND dl.OrganizeId = xm.OrganizeId AND dl.zt='1' - WHERE xm.OrganizeId = @orgId - AND xm.zt = '1' and xm.xmzt = '0' --有效且未收费 - and (cf.zt is null or (cf.zt= '1' and cf.cfzt = '0')) --未关联处方 或 处方有效且未收费 - AND gh.mzh=@mzh - AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 - group by cf.cfh ,cf.cfnm,xm.ztmc,xm.ztId,xm.ks, xm.ys, xm.ysmc,sfxm.sfxmmc,sfxm.sfxmCode,xm.dw,cf.cflx - ) a - group by cfh ,cfnm,ztmc,ztId,ks,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx -) z -ORDER by isnull(cfh, 'ZZZZ') "; - var par = new DbParameter[] { - new SqlParameter("@orgId", orgId), - new SqlParameter("@mzh", mzh), - new SqlParameter("@cfnms", cfnms) - }; - return FindList(strSql, par); - } - /// - /// 获取待收费的处方明细列表 - /// 接口版 - /// - /// 门诊号 - /// 逗号分隔的处方内码 - /// 机构ID - /// - public IList GetNewAllUnSettedList(string mzh, string cfnms, string orgId) { - string wherecfnm = ""; - if (!string.IsNullOrWhiteSpace(cfnms)) - { - wherecfnm = " AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 "; + string flagstr = _sysConfigRepo.GetValueByCode("sfxmztbs", orgId); + string strSql = ""; + if (flagstr == "true") + { + strSql = @"select * from( + select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,sum(sl) sl,sum(zje) zje,dw,yzlx,ks,ys,ysmc,ztId,ztmc,cflx from( + SELECT cf.cfh ,cf.cfnm ,yp.ypmc sfxmmc ,mx.yp sfxmCode, + sum(ISNULL(mx.dj, 0.00)) dj , sum(ISNULL(CAST(mx.sl AS INT), 0)) sl , sum(ISNULL(mx.je, 0.00)) zje , + mx.dw, '1' yzlx, + cf.ks, cf.ys, cf.ysmc,null ztId,null ztmc,cf.cflx + FROM mz_cf(NOLOCK) cf + INNER JOIN mz_cfmx(NOLOCK) mx ON cf.cfnm = mx.cfnm AND mx.OrganizeId=cf.OrganizeId AND mx.zt = '1' + INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=cf.ghnm AND gh.zt='1' AND gh.OrganizeId=cf.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.V_C_xt_yp yp ON yp.ypCode=mx.yp AND yp.OrganizeId=cf.OrganizeId AND yp.zt='1' + LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode=mx.dl AND dl.OrganizeId=cf.OrganizeId AND dl.zt='1' + WHERE cf.OrganizeId = @orgId + AND cf.zt= '1' AND cf.cfzt = '0' --处方有效且未收费 + AND gh.mzh=@mzh + AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 + group by cf.cfh,cf.cfnm,yp.ypmc,mx.yp,mx.dw,cf.ks,cf.ys,cf.ysmc,cf.cflx + ) b + group by cfh ,cfnm,ztmc,ztId,ks,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx + union all + select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,case when ztId is not null then 1 else sum(sl) end sl,sum(zje) zje,dw,yzlx,ks,ys,ysmc,ztId,ztmc,cflx from( + SELECT cf.cfh ,cf.cfnm , (case when xm.ztmc is not null then xm.ztmc else sfxm.sfxmmc end) sfxmmc , (case when xm.ztId is not null then xm.ztId else sfxm.sfxmCode end) sfxmCode , + sum(ISNULL(xm.dj, 0.00)) dj , sum(ISNULL(CAST(xm.sl AS INT), 0)) sl , sum(ISNULL(xm.je, 0.00)) zje ,(case when xm.ztId is not null then '组套' else xm.dw end) dw, + '2' yzlx, + xm.ks, xm.ys, xm.ysmc,xm.ztId,xm.ztmc,cf.cflx + FROM dbo.mz_xm(NOLOCK) xm + INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=xm.ghnm and gh.OrganizeId=xm.OrganizeId AND gh.zt='1' + LEFT JOIN dbo.mz_cf(NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.OrganizeId = xm.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm ON sfxm.sfxmCode = xm.sfxm AND sfxm.OrganizeId = xm.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode = xm.dl AND dl.OrganizeId = xm.OrganizeId AND dl.zt='1' + WHERE xm.OrganizeId = @orgId + AND xm.zt = '1' and xm.xmzt = '0' --有效且未收费 + and (cf.zt is null or (cf.zt= '1' and cf.cfzt = '0')) --未关联处方 或 处方有效且未收费 + AND gh.mzh=@mzh + AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 + group by cf.cfh ,cf.cfnm,xm.ztmc,xm.ztId,xm.ks, xm.ys, xm.ysmc,sfxm.sfxmmc,sfxm.sfxmCode,xm.dw,cf.cflx + ) a + group by cfh ,cfnm,ztmc,ztId,ks,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx + ) z + ORDER by isnull(cfh, 'ZZZZ') "; } - string strSql = @"select cfh,cfnm,sfxmmc,sfxmCode,dj, sl,zje,dw,convert(varchar(2),yzlx)yzlx,ks,ksmc,ys,ysmc,ztId,ztmc,convert(int,cflx)cflx,kh from( -select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,sum(sl) sl,sum(zje) zje,dw,yzlx,ks,ksmc,ys,ysmc,ztId,ztmc,cflx,kh from( -SELECT cf.cfh ,cf.cfnm ,yp.ypmc sfxmmc ,mx.yp sfxmCode, - sum(ISNULL(mx.dj, 0.00)) dj , sum(ISNULL(CAST(mx.sl AS INT), 0)) sl , sum(ISNULL(mx.je, 0.00)) zje , - mx.dw, cflx yzlx, - cf.ks,cf.ksmc, cf.ys, cf.ysmc,null ztId,null ztmc,cflxxf cflx ,gh.kh - FROM mz_cf(NOLOCK) cf - INNER JOIN mz_cfmx(NOLOCK) mx ON cf.cfnm = mx.cfnm AND mx.OrganizeId=cf.OrganizeId AND mx.zt = '1' - INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=cf.ghnm AND gh.zt='1' AND gh.OrganizeId=cf.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.V_C_xt_yp yp ON yp.ypCode=mx.yp AND yp.OrganizeId=cf.OrganizeId AND yp.zt='1' - LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode=mx.dl AND dl.OrganizeId=cf.OrganizeId AND dl.zt='1' - WHERE cf.OrganizeId = @orgId - AND cf.zt= '1' AND cf.cfzt = '0' --处方有效且未收费 - AND gh.mzh=@mzh - " + wherecfnm + @" - group by cf.cfh,cf.cfnm,yp.ypmc,mx.yp,mx.dw,cf.ks,cf.ksmc,cf.ys,cf.ysmc,cflxxf,cflx ,gh.kh -) b -group by cfh ,cfnm,ztmc,ztId,ks,ksmc,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx ,kh - union all -select cfh,cfnm,sfxmmc,sfxmCode,sum(dj) dj,sum(sl)/count(sfxmCode) sl,sum(zje) zje,dw,yzlx,ks,ksmc,ys,ysmc,ztId,ztmc,cflx,kh from( -SELECT cf.cfh ,cf.cfnm , (case when xm.ztmc is not null then xm.ztmc else sfxm.sfxmmc end) sfxmmc , (case when xm.ztId is not null then xm.ztId else sfxm.sfxmCode end) sfxmCode , - sum(ISNULL(xm.dj, 0.00)) dj , sum((case when ztid>'' then isnull(ztsl,sl) else ISNULL(CAST(xm.sl AS INT), 0) end)) sl , sum(ISNULL(xm.je, 0.00)) zje ,(case when xm.ztId is not null then '组套' else xm.dw end) dw, - '2' yzlx, - xm.ks,xm.ksmc, xm.ys, xm.ysmc,xm.ztId,xm.ztmc,cflxxf cflx ,gh.kh - FROM dbo.mz_xm(NOLOCK) xm - INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=xm.ghnm and gh.OrganizeId=xm.OrganizeId AND gh.zt='1' - LEFT JOIN dbo.mz_cf(NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm ON sfxm.sfxmCode = xm.sfxm AND sfxm.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode = xm.dl AND dl.OrganizeId = xm.OrganizeId AND dl.zt='1' - WHERE xm.OrganizeId = @orgId - AND xm.zt = '1' and xm.xmzt = '0' --有效且未收费 - and (cf.zt is null or (cf.zt= '1' and cf.cfzt = '0')) --未关联处方 或 处方有效且未收费 - AND gh.mzh=@mzh - " + wherecfnm + @" - group by cf.cfh ,cf.cfnm,xm.ztmc,xm.ztId,xm.ks,xm.ksmc, xm.ys, xm.ysmc,sfxm.sfxmmc,sfxm.sfxmCode,xm.dw,cflxxf ,cflx,gh.kh - ) a - group by cfh ,cfnm,ztmc,ztId,ks,ksmc,ys, ysmc,sfxmmc,sfxmCode,dw,yzlx,cflx ,kh -) z -ORDER by isnull(cfh, 'ZZZZ')"; + else { + strSql = @" + SELECT * + FROM ( + SELECT cf.cfh ,cf.cfnm ,mx.dl sfdlCode,dl.dlmc sfdlmc, yp.ypmc sfxmmc ,mx.yp sfxmCode, + ISNULL(mx.dj, 0.00) dj , ISNULL(CAST(mx.sl AS INT), 0) sl , ISNULL(mx.je, 0.00) zje , + mx.dw, mx.zfbl, mx.zfxz,null dczll, null zxcs,null xmnm, mx.cfmxId cfmxId, mx.CreateTime klsj,'1' yzlx, + cf.ks, cf.ys, cf.ysmc, yp.ybdm ybdm,yp.ybbz, mx.cfmxId mxId, yp.ypgg gg, ISNULL(yp.gjybdm,'') xnhybdm + FROM mz_cf(NOLOCK) cf + INNER JOIN mz_cfmx(NOLOCK) mx ON cf.cfnm = mx.cfnm AND mx.OrganizeId=cf.OrganizeId AND mx.zt = '1' + INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=cf.ghnm AND gh.zt='1' AND gh.OrganizeId=cf.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.V_C_xt_yp yp ON yp.ypCode=mx.yp AND yp.OrganizeId=cf.OrganizeId AND yp.zt='1' + LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode=mx.dl AND dl.OrganizeId=cf.OrganizeId AND dl.zt='1' + WHERE cf.OrganizeId = @orgId + AND cf.zt= '1' AND cf.cfzt = '0' --处方有效且未收费 + AND gh.mzh=@mzh + AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 + + UNION ALL + + SELECT cf.cfh ,cf.cfnm ,xm.dl sfdlCode ,dl.dlmc sfdlmc ,sfxm.sfxmmc sfxmmc , sfxm.sfxmCode sfxmCode , + ISNULL(xm.dj, 0.00) dj , ISNULL(CAST(xm.sl AS INT), 0) sl , ISNULL(xm.je, 0.00) zje ,xm.dw, xm.zfbl, xm.zfxz, + xm.dczll,xm.zxcs,xm.xmnm xmnm, null cfmxId, xm.CreateTime klsj, '2' yzlx, + xm.ks, xm.ys, xm.ysmc, sfxm.ybdm ybdm,sfxm.ybbz, xm.xmnm mxId, ISNULL(sfxm.gg,'') gg, ISNULL(sfxm.gjybdm,'') xnhybdm + FROM dbo.mz_xm(NOLOCK) xm + INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=xm.ghnm and gh.OrganizeId=xm.OrganizeId AND gh.zt='1' + LEFT JOIN dbo.mz_cf(NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.OrganizeId = xm.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm ON sfxm.sfxmCode = xm.sfxm AND sfxm.OrganizeId = xm.OrganizeId + LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode = xm.dl AND dl.OrganizeId = xm.OrganizeId AND dl.zt='1' + WHERE xm.OrganizeId = @orgId + AND xm.zt = '1' and xm.xmzt = '0' --有效且未收费 + and (cf.zt is null or (cf.zt= '1' and cf.cfzt = '0')) --未关联处方 或 处方有效且未收费 + AND gh.mzh=@mzh + AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnms, ',')) --选择的处方内码 + ) as alldata + ORDER by isnull(cfh, 'ZZZZ'),klsj ---ZZZ排在最后 + "; + } + var par = new DbParameter[] { new SqlParameter("@orgId", orgId), new SqlParameter("@mzh", mzh), - new SqlParameter("@cfnms", cfnms??"") + new SqlParameter("@cfnms", cfnms) }; - return FindList(strSql, par); + return FindList(strSql, par); } /// @@ -3188,32 +3167,6 @@ ORDER by isnull(cfh, 'ZZZZ'),klsj ---ZZZ排在最后 return FindList(strSql, par); } - - public IList GetUnSettGhfByMzh(string mzh, string orgId) - { - const string strSql = @" -SELECT cf.cfh ,cf.cfnm ,xm.dl sfdlCode ,dl.dlmc sfdlmc ,sfxm.sfxmmc sfxmmc , sfxm.sfxmCode sfxmCode , - ISNULL(xm.dj, 0.00) dj , ISNULL(CAST(xm.sl AS INT), 0) sl , ISNULL(xm.je, 0.00) zje ,xm.dw, xm.zfbl, xm.zfxz, - xm.dczll,xm.zxcs,xm.xmnm xmnm, null cfmxId, xm.CreateTime klsj, '2' yzlx, - xm.ks, xm.ys, xm.ysmc, sfxm.ybdm ybdm,sfxm.ybbz, xm.xmnm mxId, ISNULL(sfxm.gg,'') gg, ISNULL(sfxm.xnhybdm,'') xnhybdm,'1' ghfy - FROM dbo.mz_xm(NOLOCK) xm - INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.ghnm=xm.ghnm and gh.OrganizeId=xm.OrganizeId AND gh.zt='1' - LEFT JOIN dbo.mz_cf(NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.V_S_xt_sfxm sfxm ON sfxm.sfxmCode = xm.sfxm AND sfxm.OrganizeId = xm.OrganizeId - LEFT JOIN NewtouchHIS_Base.dbo.xt_sfdl(NOLOCK) dl ON dl.dlCode = xm.dl AND dl.OrganizeId = xm.OrganizeId AND dl.zt='1' - WHERE xm.OrganizeId = @orgId - AND xm.zt = '1' and xm.xmzt = '0' --有效且未收费 - and xm.dl = (select top 1 dlcode from NewtouchHIS_Base..xt_sfdl_lx lx where lx.Type='OutpatientReg' and lx.OrganizeId= @orgId) - and (cf.zt is null or (cf.zt= '1' and cf.cfzt = '0')) --未关联处方 或 处方有效且未收费 - AND gh.mzh=@mzh -"; - var par = new DbParameter[] { - new SqlParameter("@orgId", orgId), - new SqlParameter("@mzh", mzh) - }; - return FindList(strSql, par); - } - /// /// 根据结算内码获取结算明细 /// @@ -3438,16 +3391,16 @@ INNER JOIN dbo.mz_gh(NOLOCK) gh ON gh.patid=brxx.patid AND gh.OrganizeId=brxx.Or } - #region 重庆医保 - /// - /// 获取医保待结 - /// - /// - /// - /// - public IList GetCQYBUnSettedListByMzh(Pagination pagination, string mzh, string orgId) - { - const string strSql = @" + #region 重庆医保 + /// + /// 获取医保待结 + /// + /// + /// + /// + public IList GetCQYBUnSettedListByMzh(Pagination pagination, string mzh, string orgId) + { + const string strSql = @" SELECT cf.cfh , CONVERT(VARCHAR(20),mx.CreateTime,120) kfrq , yp.ybdm xmyblsh , @@ -3574,22 +3527,22 @@ LEFT JOIN NewtouchHIS_Base..Sys_Staff (NOLOCK) staff ON staff.OrganizeId = cf.Or ) --未关联处方 或 处方有效且未收费 AND gh.mzh = @mzh "; - IList inSqlParameterList = null; - inSqlParameterList = new List(); - inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); - inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); - return this.QueryWithPage(strSql.ToString(), pagination, inSqlParameterList.ToArray()).ToList(); - } - - /// - /// 获取医保费用金额 - /// - /// - /// - /// - public IList GetCQZFUnSettedListByMzh(string mzh, string cfnm, string orgId) - { - const string strSql = @" + IList inSqlParameterList = null; + inSqlParameterList = new List(); + inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); + inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + return this.QueryWithPage(strSql.ToString(), pagination, inSqlParameterList.ToArray()).ToList(); + } + + /// + /// 获取医保费用金额 + /// + /// + /// + /// + public IList GetCQZFUnSettedListByMzh(string mzh, string cfnm, string orgId) + { + const string strSql = @" select issc,SUM(je) je from ( SELECT ISNULL(mx.sl, 0.00) sl , ISNULL(mx.dj, 0.00) dj , @@ -3640,32 +3593,32 @@ LEFT JOIN dbo.mz_cf (NOLOCK) cf ON cf.cfnm = xm.cfnm AND cf.cfnm IN (SELECT * FROM dbo.f_split(@cfnm, ',')) ) as t group by issc "; - IList inSqlParameterList = null; - inSqlParameterList = new List(); - inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); - inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + IList inSqlParameterList = null; + inSqlParameterList = new List(); + inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); + inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); inSqlParameterList.Add(new SqlParameter("@cfnm", cfnm)); - return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()); - } - - public IList GetChongQingGHMzjs(string ghxm, string zlxm, bool isCkf, bool isGbf, - string orgId = null) - { - string ckf = ""; - string gbf = ""; - if (isCkf) - { - var pzckf = _sysConfigRepo.GetByCode(Constants.xtmzpz.SFXM_GHCKF, orgId); - ckf = pzckf.Value; - } - if (isGbf) - { - var pzgbf = _sysConfigRepo.GetByCode(Constants.xtmzpz.SFXM_GHGBF, orgId); - gbf = pzgbf.Value; - } - IList inSqlParameterList = null; - StringBuilder strBuilder = new StringBuilder(); - strBuilder.Append(@" + return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()); + } + + public IList GetChongQingGHMzjs(string ghxm, string zlxm, bool isCkf, bool isGbf, + string orgId = null) + { + string ckf = ""; + string gbf = ""; + if (isCkf) + { + var pzckf = _sysConfigRepo.GetByCode(Constants.xtmzpz.SFXM_GHCKF, orgId); + ckf = pzckf.Value; + } + if (isGbf) + { + var pzgbf = _sysConfigRepo.GetByCode(Constants.xtmzpz.SFXM_GHGBF, orgId); + gbf = pzgbf.Value; + } + IList inSqlParameterList = null; + StringBuilder strBuilder = new StringBuilder(); + strBuilder.Append(@" select issc,SUM(je) je from ( SELECT case when isnull(zfxz,'1')!='1' then 1 else 0 end issc, ybbz,ybdm,dj je @@ -3676,24 +3629,24 @@ FROM NewtouchHIS_Base..V_S_xt_sfxm ) a group by issc "); - inSqlParameterList = new List(); - inSqlParameterList.Add(new SqlParameter("@ghxm", ghxm)); - inSqlParameterList.Add(new SqlParameter("@zlxm", zlxm)); - inSqlParameterList.Add(new SqlParameter("@ckf", ckf)); - inSqlParameterList.Add(new SqlParameter("@gbf", gbf)); - inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); - return this.FindList(strBuilder.ToString(), inSqlParameterList.ToArray()); - } - - public Input_2203A GetCQjzdjInfo(string mzh, string orgId) - { - StringBuilder strSql = new StringBuilder(); - strSql.Append(@" + inSqlParameterList = new List(); + inSqlParameterList.Add(new SqlParameter("@ghxm", ghxm)); + inSqlParameterList.Add(new SqlParameter("@zlxm", zlxm)); + inSqlParameterList.Add(new SqlParameter("@ckf", ckf)); + inSqlParameterList.Add(new SqlParameter("@gbf", gbf)); + inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + return this.FindList(strBuilder.ToString(), inSqlParameterList.ToArray()); + } + + public Input_2203A GetCQjzdjInfo(string mzh, string orgId) + { + StringBuilder strSql = new StringBuilder(); + strSql.Append(@" SELECT b.jzid mdtrt_id, c.grbh psn_no, case b.mjzbz when '2' then '13' when '4' then '14' when '6' then '14' when '5' then '9901' - when '7' then '14' when '8' then '19' when '9' then '51' when '10' then '9906' else '11' end med_type, + when '7' then '14' when '8' then '19' when '9' then '51' when '10' then '9906' else (case when xzlx='390' then '11' else '11' end) end med_type, case b.mjzbz when '9' then '1' else '' end matn_type, case b.mjzbz when '9' then '9' else '' end birctrl_type, case b.mjzbz when '9' then convert(varchar(10),getdate(),120) else '' end birctrl_matn_date,b.bzbm dise_codg,b.bzmc dise_name @@ -3703,18 +3656,18 @@ FROM [NewtouchHIS_Sett].[dbo].[xt_brjbxx] a WHERE b.mzh = @mzh AND a.OrganizeId = @OrganizeId AND a.zt = '1'; "); - SqlParameter[] par = - { - new SqlParameter("@mzh", mzh), - new SqlParameter("@OrganizeId", orgId) - }; - return this.FindList(strSql.ToString(), par).FirstOrDefault(); - } - - public IList GetCQYBTfListByJsnm(string jsnm, string mzh, string orgId) - { - //cxmxlsh存放jsmxnm - const string strSql = @" + SqlParameter[] par = + { + new SqlParameter("@mzh", mzh), + new SqlParameter("@OrganizeId", orgId) + }; + return this.FindList(strSql.ToString(), par).FirstOrDefault(); + } + + public IList GetCQYBTfListByJsnm(string jsnm, string mzh, string orgId) + { + //cxmxlsh存放jsmxnm + const string strSql = @" SELECT * FROM ( SELECT ISNULL(cf.cfh,'YP'+ CONVERT(VARCHAR(50),a.jsmxnm)) cfh , CONVERT(VARCHAR(20),mx.CreateTime,120) kfrq , @@ -3840,18 +3793,18 @@ AND ISNULL(a.mxnm, 0) != 0 AND a.zt = '1' ) nn "; - IList inSqlParameterList = new List(); - inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); - inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); - inSqlParameterList.Add(new SqlParameter("@jsnm", jsnm)); - return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()).ToList(); - } - - public IList GetCQZFTfListByJsnm(string jsnm, string mzh, string orgId) - { - //cxmxlsh存放jsmxnm - //cxmxlsh存放jsmxnm - const string strSql = @" + IList inSqlParameterList = new List(); + inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); + inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + inSqlParameterList.Add(new SqlParameter("@jsnm", jsnm)); + return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()).ToList(); + } + + public IList GetCQZFTfListByJsnm(string jsnm, string mzh, string orgId) + { + //cxmxlsh存放jsmxnm + //cxmxlsh存放jsmxnm + const string strSql = @" SELECT * FROM ( SELECT cf.cfh , CONVERT(VARCHAR(20),mx.CreateTime,120) kfrq , @@ -3976,12 +3929,12 @@ AND ISNULL(a.mxnm, 0) != 0 AND a.zt = '1' ) nn "; - IList inSqlParameterList = new List(); - inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); - inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); - inSqlParameterList.Add(new SqlParameter("@jsnm", jsnm)); - return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()); - } + IList inSqlParameterList = new List(); + inSqlParameterList.Add(new SqlParameter("@mzh", mzh)); + inSqlParameterList.Add(new SqlParameter("@orgId", orgId)); + inSqlParameterList.Add(new SqlParameter("@jsnm", jsnm)); + return this.FindList(strSql.ToString(), inSqlParameterList.ToArray()); + } public IList GetMzbzml(string mllx) { diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientChargeQueryDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientChargeQueryDmnService.cs index 3a4acaf2..8c59acc3 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientChargeQueryDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientChargeQueryDmnService.cs @@ -92,7 +92,7 @@ public IList SelectRegChargeQuery(Pagination pagination, /// /// /// - public IList RegChargeQuery(Pagination pagination, string kh, string fph,string jsfph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd,string zxlsh) + public IList RegChargeQuery(Pagination pagination, string kh, string fph, string jsfph, string xm, string syy, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd, string zxlsh) { var sqlStr = new StringBuilder(@" SELECT js.blh, js.jsnm,js.jslx, @@ -213,6 +213,95 @@ and ISNULL(js.tbz, 0)=0 return QueryWithPage(sqlStr.ToString(), pagination, paraList.ToArray()); } + /// + /// 待上传的门诊自费病人结算信息 + /// + /// + /// + /// + /// + /// + public IList ZFRegChargeQuery(Pagination pagination, string xm, DateTime? createTimestart, DateTime? createTimeEnd) + { + var sqlStr = new StringBuilder(@" +SELECT DISTINCT js.blh, js.jsnm,js.jslx, + CASE WHEN len(gh.kh) >= 28 THEN substring(gh.kh,1,10) ELSE gh.kh END AS kh, + js.xm, + gh.xb, + gh.mzh,gh.kh sbbh, + gh.zjh, + isnull(js.fph, '') AS fph, + js.zje jszje,js.xjzf jsxjzf,(js.zje-js.xjzf) jsjz, + ybjyfy.ybjsh, ybjyfy.JBZF,ybjyfy.GBZF,ybjyfy.JBYE,ybjyfy.GBYE, + js.CreatorCode, + js.CreateTime, + ks.name AS ghksmc, + ISNULL(CASE WHEN fpdy.oldFPH IS NOT NULL OR LEN(LTRIM(RTRIM(fpdy.oldFPH)))>0 THEN fpdy.oldFPH ELSE js.fph END, '') oldfph, + CASE WHEN fpdy.xfph IS NOT NULL OR fpdy.dyfs=2 THEN '1' ELSE '0' END AS isxfph, + ISNULL(js.LastModifierCode, '') tCreatorCode, + sfyuserstaff.Name CreatorName,ghysStaff.Name ghysmc, + isnull(js.jzsj, js.CreateTime) sfrq, + brxz.brxzmc, + gh.zdmc,jzys.Name jzys,xtjz.zlkssj jzsj,mzybjs.setl_id zxlsh, + CASE WHEN drjk.mlbm_id IS NOT NULL THEN '已上传' ELSE '' END AS sfyb +FROM dbo.mz_js(NOLOCK) js +LEFT JOIN mz_js_ybjyfy(nolock) ybjyfy + ON ybjyfy.jsnm = js.jsnm +LEFT JOIN dbo.mz_gh(NOLOCK) gh + ON gh.ghnm=js.ghnm AND gh.OrganizeId=js.OrganizeId +LEFT JOIN [Newtouch_CIS]..xt_jz xtjz + ON xtjz.mzh=gh.mzh and xtjz.OrganizeId=gh.OrganizeId and xtjz.zt=1 +LEFT JOIN NewtouchHIS_Base..V_S_Sys_Department ks + ON ks.Code = gh.ks AND ks.zt='1' AND ks.OrganizeId=js.OrganizeId +LEFT JOIN mz_curr_fp(nolock) fpdy + ON js.jsnm = fpdy.jsnm AND fpdy.zt='1' AND fpdy.OrganizeId=js.OrganizeId +LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff sfyuserstaff + ON sfyuserstaff.Account = js.CreatorCode AND sfyuserstaff.zt='1' AND sfyuserstaff.OrganizeId=js.OrganizeId +LEFT JOIN NewtouchHIS_Base..V_S_Sys_Staff ghysStaff + ON ghysStaff.gh = gh.ys AND ghysStaff.zt='1' AND ghysStaff.OrganizeId=js.OrganizeId +LEFT JOIN NewtouchHIS_Base..V_S_Sys_Staff jzys + ON jzys.gh = gh.ys AND jzys.zt='1' AND jzys.OrganizeId=js.OrganizeId +LEFT JOIN xt_brxz brxz + on brxz.brxz = js.brxz and brxz.zt = '1' and brxz.OrganizeId = js.OrganizeId +LEFT JOIN dbo.xt_brjbxx xx + ON xx.blh = gh.blh AND xx.OrganizeId = js.OrganizeId AND xx.zt = '1' +LEFT JOIN dbo.drjk_mzjs_output mzybjs + ON mzybjs.setl_id = js.ybjslsh AND mzybjs.zt = '1' +LEFT JOIN dbo.Drjk_jxcsc_output drjk ON drjk.mlbm_id = CONVERT(VARCHAR(50), js.jsnm) -- 关联条件 +WHERE + js.OrganizeId=@OrganizeId and js.zt= '1' + and js.brxz= '0' + --未退 + and ISNULL(js.tbz, 0)=0 +"); + var paraList = new List + { + new SqlParameter("@OrganizeId", OperatorProvider.GetCurrent().OrganizeId) + }; + if (!string.IsNullOrWhiteSpace(xm)) + { + sqlStr.AppendLine("AND (js.xm LIKE @xm or js.blh LIKE @blh or gh.mzh LIKE @xm or xx.py like @xm)"); + paraList.Add(new SqlParameter("@xm", "%" + xm.Trim() + "%")); + paraList.Add(new SqlParameter("@blh", "%" + xm.Trim() + "%")); + } + + if (createTimestart != null) + { + var start = Constants.MinDate; + start = start >= createTimestart ? start : (DateTime)createTimestart; + sqlStr.AppendLine("AND js.CreateTime >= @BeginCreateTime"); + paraList.Add(new SqlParameter("@BeginCreateTime", start)); + } + if (createTimeEnd != null) + { + var end = Constants.MinDate; + end = end >= createTimeEnd ? end : (DateTime)createTimeEnd; + sqlStr.AppendLine("AND js.CreateTime<=@EndCreateTime+' 23:59:59'"); + paraList.Add(new SqlParameter("@EndCreateTime", end)); + } + return QueryWithPage(sqlStr.ToString(), pagination, paraList.ToArray()); + } + /// /// 获取结算支付方式 /// @@ -242,7 +331,7 @@ public IList GetRecordsByJsnm(string jsnm) { IList par = new List(); string sfxmztbs = _sysConfigRepo.GetValueByCode("sfxmztbs", OperatorProvider.GetCurrent().OrganizeId); - if (sfxmztbs=="false") + if (sfxmztbs == "false") { var inParameters = new Dictionary { diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientDmnService.cs index 50a565e3..09675328 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientDmnService.cs @@ -520,7 +520,7 @@ left join NewtouchHIS_Base.dbo.V_S_Sys_Staff h with(nolock) on a.ysgh=h.gh and a if (!string.IsNullOrWhiteSpace(keyword)) { strSql += " and (czksmc like @keyword or ks.py like @keyword or h.py like @keyword or h.name like @keyword or a.Title like @keyword)"; - para.Add(new SqlParameter("@keyword", "%" + keyword + "%")); + para.Add(new SqlParameter("@keyword","%"+ keyword+"%")); } strSql += " order by RegType,ksmc"; diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientSettleDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientSettleDmnService.cs index 406357a4..56ad8fae 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientSettleDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientSettleDmnService.cs @@ -12,7 +12,6 @@ using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.IRepository.OutpatientManage; using Newtouch.HIS.Domain.ValueObjects; -using Newtouch.HIS.Domain.ValueObjects.DaySettleManage; using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; using Newtouch.Infrastructure; using Newtouch.Tools; @@ -21,8 +20,6 @@ using System.Data.Common; using System.Data.SqlClient; using System.Linq; -using System.Runtime.ConstrainedExecution; -using System.Security.Cryptography; using System.Text; using static Newtouch.Infrastructure.Constants; @@ -60,15 +57,15 @@ public OutPatientSettleDmnService(IDefaultDatabaseFactory databaseFactory) : bas /// 磁卡费 /// 工本费 /// - public GHZGroupAndFeesVO GetOutpatientFees(string ghxm, string zlxm, bool isCkf, bool isGbf, string orgId = null) + public GHZGroupAndFeesVO GetOutpatientFees(string ghxm, string zlxm, bool isCkf, bool isGbf,string orgId=null) { var fee = new GHZGroupAndFeesVO(); var sfxmList = new Dictionary(); - if (string.IsNullOrEmpty(orgId)) - { - orgId = OperatorProvider.GetCurrent().OrganizeId; - } - if (!string.IsNullOrWhiteSpace(ghxm)) + if (string.IsNullOrEmpty(orgId)) + { + orgId = OperatorProvider.GetCurrent().OrganizeId; + } + if (!string.IsNullOrWhiteSpace(ghxm)) { //获取挂号费 var ghsfxmSql = new StringBuilder(@"select * from NewtouchHIS_Base..V_S_xt_sfxm where sfxmCode in('" + ghxm + "') and OrganizeId=@OrganizeId"); @@ -147,7 +144,7 @@ public GHZGroupAndFeesVO GetOutpatientFeesbyGroup(string ghxm, string zlxm, bool { //获取挂号费 var ghsfxmSql = new StringBuilder(@"select * from NewtouchHIS_Base..V_S_xt_sfxm where sfxmCode in('" + ghxm + "') and OrganizeId=@OrganizeId"); - var ghsfxmEntity = FindList(ghsfxmSql.ToString(), new SqlParameter[] { new SqlParameter("OrganizeId", orgId) }); + var ghsfxmEntity = FindList(ghsfxmSql.ToString(), new SqlParameter[] { new SqlParameter("OrganizeId", orgId)}); if (ghsfxmEntity != null && ghsfxmEntity.Count > 0) { foreach (var g in ghsfxmEntity) @@ -174,8 +171,7 @@ public GHZGroupAndFeesVO GetOutpatientFeesbyGroup(string ghxm, string zlxm, bool fee.zlfPrice += z.dj; } } - else if (zlsfxmEntity.Count > 0) - { + else if(zlsfxmEntity.Count>0) { fee.zlfPrice = zlsfxmEntity.FirstOrDefault().dj; } sfxmzhList.Add("zlsfxm", zlsfxmEntity); @@ -232,8 +228,8 @@ public IList GetCurrentDayRegList(string orgId, string crea { var sb = new StringBuilder(); var pars = new List(); - var GhSelectOnlyCreator = _sysConfigRepo.GetValueByCode("GhSelectOnlyCreator", orgId); - sb.Append(@"select staff.Name ysmc,dept.Name ksmc,brxz.brxzmc,* + var GhSelectOnlyCreator = _sysConfigRepo.GetValueByCode("GhSelectOnlyCreator", orgId); + sb.Append(@"select staff.Name ysmc,dept.Name ksmc,brxz.brxzmc,* from mz_gh(nolock) gh left join [NewtouchHIS_Base]..V_S_Sys_Staff staff on staff.gh = gh.ys and staff.Organizeid = gh.OrganizeId @@ -247,13 +243,13 @@ left join xt_brjbxx jbxx on jbxx.patid = gh.patid and jbxx.zt = '1' and jbxx.OrganizeId = gh.OrganizeId where gh.OrganizeId = @orgId and gh.zt = '1' and gh.CreateTime >= CONVERT(varchar(100), GETDATE(), 23) "); - if (!string.IsNullOrEmpty(creatorCode) && GhSelectOnlyCreator == "ON") - { - sb.Append(@" and gh.CreatorCode = @creatorCode "); - pars.Add(new SqlParameter("@creatorCode", creatorCode)); - } - sb.Append(@" order by gh.CreateTime desc "); - pars.Add(new SqlParameter("@orgId", orgId)); + if (!string.IsNullOrEmpty(creatorCode) && GhSelectOnlyCreator=="ON") + { + sb.Append(@" and gh.CreatorCode = @creatorCode "); + pars.Add(new SqlParameter("@creatorCode", creatorCode)); + } + sb.Append(@" order by gh.CreateTime desc "); + pars.Add(new SqlParameter("@orgId", orgId)); return this.FindList(sb.ToString(), pars.ToArray()); } @@ -568,7 +564,7 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, , int ghpbId , OutpatientSettFeeRelatedDTO feeRelated, string brxz , string ybjsh, string mzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId, out object newJszbInfo) + , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId,string isjm, out object newJszbInfo) { newJszbInfo = null; //门诊号检重 @@ -576,12 +572,6 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, { throw new FailedException("门诊号重复"); } - //病人性质校验 - var brxzval = EnumHelper.GetEnumDic().FirstOrDefault(p => p.Key.ToString() == brxz); - if (string.IsNullOrWhiteSpace(brxzval.Value)) - { - throw new FailedException("病人性质异常:" + brxz); - } //要返回(作为发票打印的入参) int jsnm = 0; //根据patid获取 病人基本信息 实体 @@ -611,11 +601,11 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, fzbz = _outpatientRegRepo.IQueryable(p => p.patid == patid && p.zt == "1" && p.ghzt != "2").Any() ? (byte)1 : (byte)0, kh = kh, ScheduId = Convert.ToDecimal(ghpbId), - jzid = jzid, - jzpzlx = jzlx, - bzbm = bzbm, - bzmc = bzmc, - ecToken = feeRelated?.ecToken + jzid=jzid, + jzpzlx=jzlx, + bzbm=bzbm, + bzmc=bzmc, + ecToken= feeRelated.ecToken }; var cardEntity = _sysCardRepo.GetCardEntity(gh.kh, brjbxxEntity.OrganizeId); gh.CardType = cardEntity != null ? cardEntity.CardType : ""; @@ -634,8 +624,8 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, gh.gbf = ghFeeResult.gbfPrice; //notSett true暂时不结(门诊收费时一起结),否则结 bool? notSett = null; - var medicalInsurance = _sysConfigRepo.GetValueByCode("Outpatient_MedicalInsurance", orgId); - if (brxz != "0" && gh.CardType == ((int)EnumCardType.YBJYK).ToString()) + var medicalInsurance = _sysConfigRepo.GetValueByCode("Outpatient_MedicalInsurance", orgId); + if (brxz != "0" && gh.CardType == ((int)EnumCardType.YBJYK).ToString()) { //非自费(不用医保卡) 且多加一层判断 用了医保卡 notSett = (_sysConfigRepo.GetBoolValueByCode("Outpatient_ChargeFee_OpenYbSett", orgId) ?? false) && (_sysConfigRepo.GetBoolValueByCode("Outpatient_ChargeFee_yb_SettOnce", orgId) ?? false); @@ -643,16 +633,16 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, if (!(notSett == true)) { //贵安 门诊挂号 不结算 - - if (medicalInsurance == "guian") - { - notSett = true; - } - if (medicalInsurance == "chongqing") - { - notSett = false; - } - } + + if (medicalInsurance == "guian") + { + notSett = true; + } + if (medicalInsurance == "chongqing") + { + notSett = false; + } + } if (notSett == true) { //待结状态 @@ -667,17 +657,17 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, using (var db = new EFDbTransaction(_databaseFactory).BeginTrans()) { gh.Create(); - #region 照顾自助机接口,获取不到登录用户 - if (string.IsNullOrEmpty(gh.CreatorCode)) - { - gh.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) - } - if (string.IsNullOrEmpty(gh.CreateTime.ToString())) - { - gh.CreateTime = DateTime.Now; - } - #endregion - db.Insert(gh); + #region 照顾自助机接口,获取不到登录用户 + if (string.IsNullOrEmpty(gh.CreatorCode)) + { + gh.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) + } + if (string.IsNullOrEmpty(gh.CreateTime.ToString())) + { + gh.CreateTime = DateTime.Now; + } + #endregion + db.Insert(gh); if (xmList != null && xmList.Count > 0) { @@ -693,17 +683,17 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, xmItem.ysmc = ysmc; xmItem.ksmc = ksmc; xmItem.Create(); - #region 照顾自助机接口,获取不到登录用户 - if (string.IsNullOrEmpty(xmItem.CreatorCode)) - { - xmItem.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) - } - if (string.IsNullOrEmpty(xmItem.CreateTime.ToString())) - { - xmItem.CreateTime = DateTime.Now; - } - #endregion - db.Insert(xmItem); + #region 照顾自助机接口,获取不到登录用户 + if (string.IsNullOrEmpty(xmItem.CreatorCode)) + { + xmItem.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) + } + if (string.IsNullOrEmpty(xmItem.CreateTime.ToString())) + { + xmItem.CreateTime = DateTime.Now; + } + #endregion + db.Insert(xmItem); } } else @@ -789,11 +779,12 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, jmje = feeRelated.zkje ?? 0, xjzf = feeRelated.xjzfys ?? 0, zje = mxzje, - xjzffs = feeRelated.zffs1, + xjzffs= feeRelated.zffs1, //记账部分 等 ysk = feeRelated.ssk, zl = feeRelated.zhaoling, - ybjslsh = feeRelated.ybjslsh + ybjslsh=feeRelated.ybjslsh, + isjm = isjm }; jszbEntity.Create(); #region 照顾自助机接口,获取不到登录用户 @@ -819,38 +810,39 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, } } UpdateCurrentFinancialInvoice(db, orgId, fph); - if (medicalInsurance != "chongqing") //里面代码觉得有问题,恒会报错,暂时跳过 lixin 20191216 重庆医保 - { - //if (feeRelated.orglxjzfys.HasValue && feeRelated.xjzfys.HasValue) - //{ - // //要减去记账部分 等金额 - // if (feeRelated.orglxjzfys.Value != jszbEntity.zje - 0) - // { - // throw new FailedException("ERROR_SETT_JE_ERROR", "结算金额异常" + feeRelated.orglxjzfys.Value.ToString() + "不等于" + jszbEntity.zje.ToString()); - // } - // //orglxjzfys xjzfys zkbl zkje要保持一致性 - // var zkje = feeRelated.orglxjzfys.Value * Math.Abs(feeRelated.zkbl ?? 0) + Math.Abs(feeRelated.zkje ?? 0); - // if (Math.Abs(zkje + feeRelated.xjzfys.Value - feeRelated.orglxjzfys.Value) > (decimal)0.01) - // { - // throw new FailedException("ERROR_ZKJE_ZFJE_ERROR", "折扣金额异常"); - // } - //} - //else - //{ - // //要减去记账部分 等金额 - // jszbEntity.xjzf = jszbEntity.zje - 0; - //} - } - + if (medicalInsurance != "chongqing") //里面代码觉得有问题,恒会报错,暂时跳过 lixin 20191216 重庆医保 + { + //if (feeRelated.orglxjzfys.HasValue && feeRelated.xjzfys.HasValue) + //{ + // //要减去记账部分 等金额 + // if (feeRelated.orglxjzfys.Value != jszbEntity.zje - 0) + // { + // throw new FailedException("ERROR_SETT_JE_ERROR", "结算金额异常" + feeRelated.orglxjzfys.Value.ToString() + "不等于" + jszbEntity.zje.ToString()); + // } + // //orglxjzfys xjzfys zkbl zkje要保持一致性 + // var zkje = feeRelated.orglxjzfys.Value * Math.Abs(feeRelated.zkbl ?? 0) + Math.Abs(feeRelated.zkje ?? 0); + // if (Math.Abs(zkje + feeRelated.xjzfys.Value - feeRelated.orglxjzfys.Value) > (decimal)0.01) + // { + // throw new FailedException("ERROR_ZKJE_ZFJE_ERROR", "折扣金额异常"); + // } + //} + //else + //{ + // //要减去记账部分 等金额 + // jszbEntity.xjzf = jszbEntity.zje - 0; + //} + } + if (feeRelated.ssk.HasValue && feeRelated.zhaoling.HasValue) { + jszbEntity.xjwc =(decimal)feeRelated.xjwc; //现金误差 收到的-应收的 - jszbEntity.xjwc = jszbEntity.xjzf - (feeRelated.ssk.Value - feeRelated.zhaoling.Value); - if (Math.Abs(jszbEntity.xjwc) >= (decimal)0.1) - { - throw new FailedException("ERROR_SSK_ZHAOLING", "实收找零金额异常"); - } + //jszbEntity.xjwc = jszbEntity.xjzf - (feeRelated.ssk.Value - feeRelated.zhaoling.Value); + //if (Math.Abs(jszbEntity.xjwc) >= (decimal)0.1) + //{ + // throw new FailedException("ERROR_SSK_ZHAOLING", "实收找零金额异常"); + //} } PaymentModelAccountReserveII(db, jszbEntity, feeRelated); @@ -859,7 +851,7 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, //else 否则没有费用明细 没必要生成结算 //新增服务费项目(取消) - var result = db.Commit(); + var result = db.Commit(); // SiteCISAPIHelper.KeepAnAppointment(mzyyghId, DateTime.Now, gh.CreatorCode); } @@ -874,227 +866,6 @@ public void Save(string orgId, int patid, string kh, string ghly, string mjzbz, }; } - public int submitOutpatGhCharge(string orgId, string fph, DateTime? sfrq, OutpatientSettFeeRelatedDTO feeRelated, IList ghxmnmList) - { - try - { - using (var db = new EFDbTransaction(_databaseFactory).BeginTrans()) - { - var xmList = db.IQueryable(p => ghxmnmList.Contains(p.xmnm)).ToList(); - var ghnm = xmList.FirstOrDefault()?.ghnm; - if (!xmList.Any() || ghnm == null) - return 0; - var magh = db.IQueryable(p => p.ghnm == ghnm).FirstOrDefault(); - var jsnm = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt(OutpatientSettlementEntity.GetTableName()); - var jsrq = DateTime.Now; - //总金额 - decimal mxzje = 0; - //挂号收费 - var jslx = ((int)EnumJslx.GH).ToString(); - foreach (var xmItem in xmList) - { - mxzje += xmItem.je; - //门诊结算明细 - var jsmxEntity = new OutpatientSettlementDetailEntity - { - jsmxnm = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt(OutpatientSettlementDetailEntity.GetTableName()), - jsnm = jsnm, - mxnm = xmItem.xmnm, - sl = xmItem.sl, - jslx = jslx, - jyje = xmItem.je, - OrganizeId = orgId - }; - //处方明细内码 - jsmxEntity.Create(); - db.Insert(jsmxEntity); - xmItem.xmzt = "1"; - xmItem.jsnm = jsnm; - db.Update(xmItem); - } - feeRelated.ssk = feeRelated.ssk - mxzje; - feeRelated.zje = feeRelated.zje - mxzje; - feeRelated.xjzfys = feeRelated.xjzfys - mxzje; - feeRelated.orglxjzfys = feeRelated.orglxjzfys - mxzje; - feeRelated.djjess = feeRelated.djjess - mxzje; - //门诊结算主表 - var jszbEntity = new OutpatientSettlementEntity - { - jsnm = jsnm, - OrganizeId = orgId, - patid = magh.patid, - brxz = magh.brxz, - jslx = jslx, - fph = fph, - jszt = (int)EnumJieSuanZT.YJ, - ghnm = magh.ghnm, - xm = magh.xm, - xb = magh.xb, - csny = magh.csny, - blh = magh.blh, - zjh = magh.zjh, - zjlx = magh.zjlx, - jzsj = sfrq, - jmbl = 0, - jmje = 0, - xjzf = mxzje, - zje = mxzje, - xjzffs = feeRelated.zffs1, - //记账部分 等 - ysk = mxzje, - zl = 0, - ybjslsh = feeRelated.ybjslsh - }; - jszbEntity.Create(); - if (!string.IsNullOrWhiteSpace(feeRelated.yjjzfje.ToString()) && (feeRelated.yjjzfje ?? 0) > 0) - { - jszbEntity.xjzffs = xtzffs.ZYYJZHZF; - } - if (!string.IsNullOrWhiteSpace(feeRelated.djjess.ToString()) && (feeRelated.djjess ?? 0) > 0) - { - jszbEntity.xjzffs = feeRelated.djjesszffs; - } - db.Insert(jszbEntity); - var result = db.Commit(); - return jsnm; - } - } - catch (Exception ex) - { - throw new FailedException($"挂号费收费失败:{ex.Message}"); - } - - } - - public void UnSettSave(string orgId, int patid, string kh, string ghly, string mjzbz, - string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm, bool isCkf, bool isGbf - , int jzxh - , int ghpbId, string brxz - , string ybjsh, string mzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc, string mzyyghId, out object newJszbInfo) - { - newJszbInfo = null; - //门诊号检重 - if (_outpatientRegRepo.IQueryable(p => p.mzh == mzh).Any()) - { - throw new FailedException("门诊号重复"); - } - //要返回(作为发票打印的入参) - int jsnm = 0; - //根据patid获取 病人基本信息 实体 - var brjbxxEntity = _sysPatBasicInfoRepository.GetInfoByPatid(patid.ToString(), orgId); - if (brjbxxEntity == null) - { - throw new FailedCodeException("OUTPAT_NO_PATIENT_INFORMATION"); - } - //构造mz_gh Entity - var gh = new OutpatientRegistEntity - { - ghnm = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt(OutpatientRegistEntity.GetTableName()), - ybjsh = ybjsh, - jzyy = jzyy, - OrganizeId = orgId, - ghly = ghly, - mjzbz = mjzbz, - ks = ks, - ys = ys, - jzbz = ((int)EnumOutpatientJzbz.Djz).ToString(), - jzxh = (short)jzxh, - yyghId = mzyyghId, - //门诊号 - mzh = mzh, - ghlx = ghxm, - //要排除已退的 - fzbz = _outpatientRegRepo.IQueryable(p => p.patid == patid && p.zt == "1" && p.ghzt != "2").Any() ? (byte)1 : (byte)0, - kh = kh, - ScheduId = Convert.ToDecimal(ghpbId), - jzid = jzid, - jzpzlx = jzlx, - bzbm = bzbm, - bzmc = bzmc, - //ecToken = feeRelated.ecToken - }; - var cardEntity = _sysCardRepo.GetCardEntity(gh.kh, brjbxxEntity.OrganizeId); - gh.CardType = cardEntity != null ? cardEntity.CardType : ""; - gh.CardTypeName = cardEntity != null ? cardEntity.CardTypeName : ""; - gh.ghrq = DateTime.Now; - gh.patid = patid; - gh.brxz = brxz; - AssembleGhInfo(brjbxxEntity, gh); - //获取挂号、诊疗项目list - GHZGroupAndFeesVO ghFeeResult; - //可能返回Count=0 挂空号 - var xmList = GetXmList(gh, isCkf, isGbf, out ghFeeResult, ghxm, zlxm, orgId); - gh.ghf = ghFeeResult.ghfPrice; - gh.zlf = ghFeeResult.zlfPrice; - gh.ckf = ghFeeResult.ckfPrice; - gh.gbf = ghFeeResult.gbfPrice; - //待结状态 - gh.ghzt = "0"; - using (var db = new EFDbTransaction(_databaseFactory).BeginTrans()) - { - gh.Create(); - db.Insert(gh); - if (xmList != null && xmList.Count > 0) - { - if (gh.ghzt == "0") - { - //ghzt待结 //有计费项目,但此时不结算,作为门诊收费时 带入 之 - foreach (var xmItem in xmList) - { - xmItem.ghnm = gh.ghnm; - xmItem.xmzt = "0"; //mz_xm明细处于待结状态 - xmItem.ys = ys; - xmItem.ks = ks; - xmItem.ysmc = ysmc; - xmItem.ksmc = ksmc; - xmItem.Create(); - db.Insert(xmItem); - } - } - } - //else 否则没有费用明细 没必要生成结算 - - //新增服务费项目(取消) - var result = db.Commit(); - // SiteCISAPIHelper.KeepAnAppointment(mzyyghId, DateTime.Now, gh.CreatorCode); - } - } - - - /// - /// 转诊 - /// - /// - /// - /// - public void submitReferralForm(int patid, string ks, string ys, string OrganizeId, string UserCode, int ghnm, string mzh, string zzyy, string ghpbId) - { - using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) - { - // 一次挂号只能允许最多一次转诊 - var oldzzjl = db.IQueryable(p => p.ghnm == ghnm && p.zt == "1").FirstOrDefault(); - if (oldzzjl != null) - { - oldzzjl.zt = "0"; - db.Update(oldzzjl); - } - var zzjl = new OutpatientReferralEntity(); - zzjl.ks = ks; - zzjl.ys = ys; - zzjl.OrganizeId = OrganizeId; - zzjl.patid = patid; - zzjl.zzyy = zzyy; - zzjl.ghnm = ghnm; - zzjl.mzh = mzh; - zzjl.scheduid = ghpbId; - zzjl.zt = "1"; - zzjl.Create(); - db.Insert(zzjl); - db.Commit(); - } - } - /// /// 生成唯一门诊号、就诊序号 /// @@ -1103,7 +874,7 @@ public void submitReferralForm(int patid, string ks, string ys, string OrganizeI /// /// /// - public Tuple GetMzhJzxh(int patid, string ghpbId, string ks, string ys, string OrganizeId, string UserCode) + public Tuple GetMzhJzxh(int patid, string ghpbId, string ks, string ys,string OrganizeId,string UserCode) { //验证病人性质是否适用于门诊 //CheckBrxz(gh.kh, updateBrxz); @@ -1155,7 +926,7 @@ public Tuple GetMzhJzxh(int patid, string ghpbId, string ks, stri /// /// /// - public string GetRegMzh(int patid, string ghpbId, string ks, string OrganizeId, string UserCode, int jzxh, string jzrq) + public string GetRegMzh(int patid, string ghpbId, string ks, string OrganizeId, string UserCode,int jzxh,string jzrq) { //验证病人性质是否适用于门诊 //CheckBrxz(gh.kh, updateBrxz); @@ -1208,10 +979,10 @@ public string GetRegMzh(int patid, string ghpbId, string ks, string OrganizeId, /// /// /// - public Tuple GetCQMzhJzxh(int patid, string ghpbId, string ks, string ys, string OrganizeId, string UserCode, string mjzbz, string QueueNo, string OutDate) + public Tuple GetCQMzhJzxh(int patid, string ghpbId, string ks, string ys, string OrganizeId, string UserCode,string mjzbz,string QueueNo,string OutDate) { - short jzxh = 0; - string mzh = ""; + short jzxh=0; + string mzh=""; //该患者是否已预约挂号 //var isAppointment = _outPatientDmnService.GetIsMzghBookSchedule(mjzbz, patid.ToString(),OrganizeId); if (!string.IsNullOrWhiteSpace(QueueNo)) @@ -1226,7 +997,7 @@ public Tuple GetCQMzhJzxh(int patid, string ghpbId, string ks, st jzxh = mzhjzxh.Item1; mzh = GetRegMzh(patid, ghpbId, ks, OrganizeId, UserCode, jzxh, DateTime.Now.ToString()); } - + return Tuple.Create(jzxh, mzh); } @@ -1347,11 +1118,11 @@ public long Book(OutpatientRegistEntity gh, decimal ssk, string fph, bool isCkf, /// private static long OrderBookProcess(OutpatientRegistEntity gh, OutpatientSettlementEntity mzjs, List ghxmList) { - //var result = Proxy.CreateOrderProxy.Instance.Book(gh, mzjs, ghxmList); - //if (result != null && result.ResponseStatus.IsSucceed) - //{ - // return result.OrderId; - //} + var result = Proxy.CreateOrderProxy.Instance.Book(gh, mzjs, ghxmList); + if (result != null && result.ResponseStatus.IsSucceed) + { + return result.OrderId; + } return 0; } @@ -1361,7 +1132,7 @@ private static long OrderBookProcess(OutpatientRegistEntity gh, OutpatientSettle /// private static void OrderCommitProcess(OutpatientRegistEntity gh) { - //Proxy.CreateOrderProxy.Instance.Commit(gh.OrderId); + Proxy.CreateOrderProxy.Instance.Commit(gh.OrderId); } #endregion @@ -1414,7 +1185,7 @@ public List GetGhxmList(OutpatientRegistEntity gh, b /// 磁卡费 /// 工本费 /// - public List GetXmList(OutpatientRegistEntity gh, bool isCkf, bool isGbf, out GHZGroupAndFeesVO ghFeeResult, string ghxm, string zlxm, string orgId = null) + public List GetXmList(OutpatientRegistEntity gh, bool isCkf, bool isGbf, out GHZGroupAndFeesVO ghFeeResult, string ghxm, string zlxm,string orgId=null) { //挂号项目 var xmList = new List(); @@ -1500,10 +1271,10 @@ public List GetXmList(OutpatientRegistEntity gh, bool isCk xm.je = sfxm.dj * xm.sl; xmList.Add(xm); } - } - - - + } + + + return xmList; } /// @@ -1512,11 +1283,11 @@ public List GetXmList(OutpatientRegistEntity gh, bool isCk /// /// /// - public CqybGjbmInfoVo GetDepartmentDoctorIdC(string orgId, string ks, string ys) + public CqybGjbmInfoVo GetDepartmentDoctorIdC(string orgId, string ks,string ys) { CqybGjbmInfoVo vo = new CqybGjbmInfoVo(); string sql = ""; - if (ys != null) + if (ys!=null) { sql = @"select zjh,gjybdm,b.ybksbm,a.gh,a.name,b.Name ksmc from [NewtouchHIS_Base].[dbo].[V_S_Sys_Staff] a @@ -1527,8 +1298,7 @@ from [NewtouchHIS_Base].[dbo].[V_S_Sys_Staff] a vo = this.FirstOrDefault(sql, new[] { new SqlParameter("@ysgh", ys), new SqlParameter("@orgId", orgId) }); } - else - { + else { sql = @"select isnull(a.zjh,'') zjh ,gjybdm,dept.ybksbm,b.gh,b.name,dept.Name ksmc from [dbo].[Sys_DepartmentBinding] a left join [NewtouchHIS_Base]..V_S_Sys_Staff b on a.gh=b.gh and a.OrganizeId=b.OrganizeId left join NewtouchHIS_Base.dbo.V_S_Sys_Department dept on dept.code=a.ks and dept.OrganizeId=a.OrganizeId and dept.zt='1' @@ -1704,10 +1474,8 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, } OutpatientSettlementPaymentModelEntity mzzfEntity1 = null; OutpatientSettlementPaymentModelEntity mzzfEntity2 = null; - bool isnew = false; if (feeRelated.yjjzfje.Value > 0) { - isnew = true; mzzfEntity1 = new OutpatientSettlementPaymentModelEntity(); mzzfEntity1.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); mzzfEntity1.OrganizeId = jszbEntity.OrganizeId; @@ -1719,59 +1487,29 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, db.Insert(mzzfEntity1); jszbEntity.xjzffs = xtzffs.ZYYJZHZF; } - if (feeRelated.djjess.Value > 0) - { - isnew = true; - mzzfEntity2 = new OutpatientSettlementPaymentModelEntity(); - mzzfEntity2.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); - mzzfEntity2.OrganizeId = jszbEntity.OrganizeId; - mzzfEntity2.jsnm = jszbEntity.jsnm; - mzzfEntity2.xjzffs = feeRelated.djjesszffs; - mzzfEntity2.zfje = feeRelated.xjzfys.Value - feeRelated.yjjzfje.Value; - mzzfEntity2.zt = "1"; - mzzfEntity2.Create(); - #region 照顾自助机接口,获取不到登录用户 - if (string.IsNullOrEmpty(mzzfEntity2.CreatorCode)) - { - mzzfEntity2.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) - } - #endregion - mzzfEntity2.CreateTime = DateTime.Now.AddSeconds(1); - db.Insert(mzzfEntity2); - jszbEntity.xjzffs = feeRelated.djjesszffs; - } - if (!isnew) + if (feeRelated.patZflist.Count() > 0) { - if (!string.IsNullOrWhiteSpace(feeRelated.zffs1) && (feeRelated.zfje1 ?? 0) > 0) - { - mzzfEntity1 = new OutpatientSettlementPaymentModelEntity(); - mzzfEntity1.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); - mzzfEntity1.OrganizeId = jszbEntity.OrganizeId; - mzzfEntity1.jsnm = jszbEntity.jsnm; - mzzfEntity1.xjzffs = feeRelated.zffs1; - mzzfEntity1.zfje = feeRelated.zfje1.Value; - mzzfEntity1.zt = "1"; - mzzfEntity1.Create(); - db.Insert(mzzfEntity1); - } - if (!string.IsNullOrWhiteSpace(feeRelated.zffs2) && (feeRelated.zfje2 ?? 0) > 0) + foreach (var item in feeRelated.patZflist) { mzzfEntity2 = new OutpatientSettlementPaymentModelEntity(); mzzfEntity2.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); mzzfEntity2.OrganizeId = jszbEntity.OrganizeId; mzzfEntity2.jsnm = jszbEntity.jsnm; - mzzfEntity2.xjzffs = feeRelated.zffs2; - mzzfEntity2.zfje = feeRelated.zfje2.Value; + mzzfEntity2.xjzffs = item.zffsmc; + mzzfEntity2.zfje = (decimal)item.zfje; mzzfEntity2.zt = "1"; mzzfEntity2.Create(); + #region 照顾自助机接口,获取不到登录用户 + if (string.IsNullOrEmpty(mzzfEntity2.CreatorCode)) + { + mzzfEntity2.CreatorCode = "zzjadmin";//如果为空,设置为自助机挂号(接口) + } + #endregion mzzfEntity2.CreateTime = DateTime.Now.AddSeconds(1); db.Insert(mzzfEntity2); } + jszbEntity.xjzffs = feeRelated.djjesszffs; } - - - - //预交金支付 构建账户收支 //预交金支付 一定作为第一支付方式 if (mzzfEntity1 != null && mzzfEntity1.xjzffs == xtzffs.ZYYJZHZF) { @@ -1909,177 +1647,14 @@ left join Newtouch_CIS..xt_jz jz (nolock) on gh.mzh=jz.mzh and gh.OrganizeId=jz. return this.FindList(sb.ToString(), pars.ToArray()); } - public List GetDailyFeeListByCreateCode(string orgId, string czr, DateTime kssj, DateTime jssj, string isJZ, string qsfph, string jsfph) - { - StringBuilder strSql = new StringBuilder(); - strSql.Append(@"SELECT js.jsnm,js.jzsj,js.CreateTime,js.OrganizeId,brxz.brxzmc,gh.mzh,gh.xm,gh.xb,gh.nlshow,js.fph,ISNULL(SUM(ISNULL(zje, 0)),0) jszje , -ISNULL(SUM(ISNULL(zje, 0)) - SUM(ISNULL(xjzf, 0)),0) ybbx , ISNULL(SUM(ISNULL(xjzf,0)),0) jsxjzf , dbo.fn_getformatmoney(ISNULL(SUM(ISNULL(zje, 0)),0)) zjedx -FROM dbo.mz_js js left join mz_gh gh on js.ghnm=gh.ghnm AND gh.OrganizeId=js.OrganizeId LEFT JOIN xt_brxz brxz on brxz.brxz = js.brxz and brxz.zt = '1' -and brxz.OrganizeId = js.OrganizeId WHERE -js.CreatorCode=@czr and js.OrganizeId=@orgId and js.OrganizeId=@orgId - AND js.CreateTime >= @kssj - AND js.CreateTime <= @jssj AND ISNULL(isJZ, 0)!='1'"); - //已交账 - //if (isJZ == "1") - //{ - // strSql.Append(" AND ISNULL(isJZ, 0)='1' "); - //} - //else if (isJZ == "0") //未交账 - //{ - // strSql.Append(" AND ISNULL(isJZ, 0)!='1' "); - //} - List param = new List() - { - new SqlParameter("@orgId",orgId), - new SqlParameter("@czr",czr), - new SqlParameter("@kssj",kssj), - new SqlParameter("@jssj",jssj) - }; - if (!string.IsNullOrWhiteSpace(qsfph) && !string.IsNullOrWhiteSpace(jsfph)) - { - int qs = qsfph.ToInt(); - int js = jsfph.ToInt(); - param.Add(new SqlParameter("@qsfph", qs)); - param.Add(new SqlParameter("@jsfph", js)); - strSql.Append(@" and (CAST(SUBSTRING(fph,2,len(fph)) as int))> @qsfph and (CAST(SUBSTRING(fph,2,len(fph)) as int))<@jsfph"); - } - - strSql.Append(@" and isnull(fph,'')<>'' group by js.jzsj,js.jsnm,gh.xb,js.CreateTime,js.OrganizeId,brxz.brxzmc,gh.mzh,gh.xm,gh.nlshow,js.fph having ISNULL(SUM(ISNULL(zje, 0)),0)>0 order by fph"); - - return this.FindList(strSql.ToString(), param.ToArray()); - } - - public List GetDailyFeeListOfDoneByCreateCode(string orgId, string czr, DateTime ksjzsj, DateTime jsjzsj) - { - StringBuilder strSql = new StringBuilder(); - //已交账 - strSql.Append(@"select rjb.*,rjbmx.fpd1,dbo.fn_getformatmoney(ISNULL(rjb.zje,0)) zjedx from rpt_mz_rjb rjb -left join rpt_mz_rjbfpmx rjbmx on rjbmx.mainId=rjb.Id and rjbmx.zt=1 -where rjb.czr=@czr and rjb.zt=1 and (ISNULL(@ksjzsj,'')='' or rjb.CreateTime>=@ksjzsj) and (ISNULL(@jsjzsj,'')='' or rjb.CreateTime<=@jsjzsj) -order by rjb.CreateTime desc"); - - - List param = new List() - { - new SqlParameter("@orgId",orgId), - new SqlParameter("@czr",czr), - new SqlParameter("@ksjzsj",ksjzsj), - new SqlParameter("@jsjzsj",jsjzsj) - }; - var list = this.FindList(strSql.ToString(), param.ToArray()); - if (list.Count > 0) - { - var dict = new Dictionary>(); - - foreach (var item in list) - { - if (!string.IsNullOrWhiteSpace(item.fpd1)) - { - if (item.fpd1.IndexOf('/') != -1) - { - var arr = item.fpd1.Split('/'); - var stuff = ""; - if (arr != null && arr.Length >= 2) - { - var fphLength = arr[0].Length; - if (!long.TryParse(arr[0], out long start)) - { - stuff = arr[0][0].ToString(); - long.TryParse(arr[0].Substring(1), out start); - } - - if (!long.TryParse(arr[1], out long end)) - { - long.TryParse(arr[1].Substring(1), out end); - } - - for (long i = start; i <= end; i++) - { - var fph = $"{stuff}{i.ToString().PadLeft(fphLength - stuff.Length, '0')}"; - if (dict.ContainsKey(item.fpd1)) - { - dict[item.fpd1].Add(fph); - } - else - { - dict.Add(item.fpd1, new List { fph }); - } - - } - } - - - } - else - { - dict.Add(item.fpd1, new List { item.fpd1 }); - } - } - } - - //已交账时间 - var fphArr = new List(); - foreach (var item in dict) - { - fphArr.AddRange(item.Value); - } - //var jsParam = new List() { new SqlParameter("@fphArr", ) }; - var jsSql = $@"select * from mz_js js -where js.fph in ({string.Join(",", fphArr.Select(p => $"'{p}'"))}) and js.jszt=1 and js.isJZ=1 -order by js.jzsj"; - - var jsList = FindList(jsSql); - - foreach (var item in list) - { - if (dict.ContainsKey(item.fpd1)) - { - - var relatedJS = jsList.Where(p => dict[item.fpd1].Contains(p.fph)).OrderBy(p => p.jzsj).ToList(); - if (relatedJS.Count == 1) - { - item.kssfsj = relatedJS[0].jzsj; - item.jssfsj = relatedJS[0].jzsj; - } - else if (relatedJS.Count > 1) - { - item.kssfsj = relatedJS[0].jzsj; - item.jssfsj = relatedJS[relatedJS.Count - 1].jzsj; - } - } - } - } - - return list; - } - - - public List GetDailyFeeList(string orgId, string czr) - { - StringBuilder strSql = new StringBuilder(); - strSql.Append(@"select a.Id,a.kssj,a.jssj,a.zje,a.xjzf,b.fpd1,b.cnt from rpt_mz_rjb a left join rpt_mz_rjbfpmx b on a.Id=b.mainId and a.OrganizeId=b.OrganizeId - where a.zt='1' and b.fplx='1' and a.CreatorCode=@czr and a.OrganizeId=@orgId and CONVERT(VARCHAR(10), a.CreateTime, 120)=CONVERT(VARCHAR(10), GETDATE(), 120) - order by a.CreateTime desc"); - SqlParameter[] param = - { - new SqlParameter("@orgId",orgId), - new SqlParameter("@czr",czr) - }; - return this.FindList(strSql.ToString(), param); - } - - /// - /// 获取当天可以撤销的交账数据 - /// - public void CancelDailyFee(string Id) + public CqybGjbmInfoVo GetYbjzdjVo(string mzh, string orgId) { - StringBuilder strSql = new StringBuilder(); - strSql.Append(@"exec rpt_Outpatient_CancelDailyFee @Id"); - SqlParameter[] param = - { - new SqlParameter("@Id",Id) - }; - this.ExecuteSqlCommand(strSql.ToString(), param); + string sqlstr = @" select staff.zjh,staff.gjybdm,staff.gh,staff.name,mzgh.ks,dept.ybksbm,dept.Name ksmc,jzid +from mz_gh mzgh (nolock) +left join NewtouchHIS_Base..V_S_Sys_Staff staff on staff.gh=mzgh.ys and staff.OrganizeId=mzgh.OrganizeId and staff.zt='1' +left join NewtouchHIS_Base.dbo.V_S_Sys_Department dept on dept.code=mzgh.ks and dept.OrganizeId=mzgh.OrganizeId and dept.zt='1' +where mzgh.mzh=@mzh and mzgh.OrganizeId=@orgId and mzgh.zt='1' "; + return this.FirstOrDefault(sqlstr, new[] { new SqlParameter("@mzh", mzh), new SqlParameter("@orgId", orgId) }); } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientUniversalDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientUniversalDmnService.cs index 9ee4ec96..824b26fc 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientUniversalDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/OutPatientUniversalDmnService.cs @@ -1074,10 +1074,10 @@ public void RefundSettlement(string orgId, int jsnm if (oldJszbEntity.xjzf != oldJszbEntity.zje) { //非全自费结算记录 - //if (tjehj != oldJszbEntity.zje) - //{ - // throw new FailedException("非全自费结算记录只支持全退,请重试"); - //} + if (tjehj != oldJszbEntity.zje) + { + throw new FailedException("非全自费结算记录只支持全退,请重试"); + } newJszbEntity.xjzf = 0; //退完了 ytw = true; //已退完 @@ -2355,10 +2355,8 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, } OutpatientSettlementPaymentModelEntity mzzfEntity1 = null; OutpatientSettlementPaymentModelEntity mzzfEntity2 = null; - bool isnew = false; if (!string.IsNullOrWhiteSpace(feeRelated.yjjzfje.ToString()) &&(feeRelated.yjjzfje ?? 0) > 0) { - isnew = true; mzzfEntity1 = new OutpatientSettlementPaymentModelEntity(); mzzfEntity1.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); mzzfEntity1.OrganizeId = jszbEntity.OrganizeId; @@ -2370,56 +2368,25 @@ private void PaymentModelAccountReserveII(Infrastructure.EF.EFDbTransaction db, db.Insert(mzzfEntity1); jszbEntity.xjzffs = xtzffs.ZYYJZHZF; } - if (!string.IsNullOrWhiteSpace(feeRelated.djjess.ToString()) && (feeRelated.djjess?? 0) > 0) - { - isnew = true; - mzzfEntity2 = new OutpatientSettlementPaymentModelEntity(); - mzzfEntity2.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); - mzzfEntity2.OrganizeId = jszbEntity.OrganizeId; - mzzfEntity2.jsnm = jszbEntity.jsnm; - mzzfEntity2.xjzffs = feeRelated.djjesszffs; - var xjzfys = feeRelated.xjzfys ==null? 0:feeRelated.xjzfys; - var yjjzfje = feeRelated.yjjzfje == null ? 0 : feeRelated.yjjzfje; - mzzfEntity2.zfje = xjzfys.ToDecimal() - yjjzfje.ToDecimal(); - //mzzfEntity2.zfje = feeRelated.xjzfys.Value - feeRelated.yjjzfje.Value; - mzzfEntity2.zt = "1"; - mzzfEntity2.Create(); - mzzfEntity2.CreateTime = DateTime.Now.AddSeconds(1); - db.Insert(mzzfEntity2); - jszbEntity.xjzffs = feeRelated.djjesszffs; - } - if (!isnew) + if (feeRelated.patZflist.Count() > 0) { - if (!string.IsNullOrWhiteSpace(feeRelated.zffs1) && (feeRelated.zfje1 ?? 0) > 0) - { - mzzfEntity1 = new OutpatientSettlementPaymentModelEntity(); - mzzfEntity1.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); - mzzfEntity1.OrganizeId = jszbEntity.OrganizeId; - mzzfEntity1.jsnm = jszbEntity.jsnm; - mzzfEntity1.xjzffs = feeRelated.zffs1; - mzzfEntity1.zfje = feeRelated.zfje1.Value; - mzzfEntity1.zt = "1"; - mzzfEntity1.Create(); - db.Insert(mzzfEntity1); - } - if (!string.IsNullOrWhiteSpace(feeRelated.zffs2) && (feeRelated.zfje2 ?? 0) > 0) + foreach (var item in feeRelated.patZflist) { mzzfEntity2 = new OutpatientSettlementPaymentModelEntity(); mzzfEntity2.mzjszffsbh = EFDBBaseFuncHelper.Instance.GetNewPrimaryKeyInt("mz_jszffs"); mzzfEntity2.OrganizeId = jszbEntity.OrganizeId; mzzfEntity2.jsnm = jszbEntity.jsnm; - mzzfEntity2.xjzffs = feeRelated.zffs2; - mzzfEntity2.zfje = feeRelated.zfje2.Value; + mzzfEntity2.xjzffs = item.zffsmc; + mzzfEntity2.zfje = (decimal)item.zfje; mzzfEntity2.zt = "1"; mzzfEntity2.Create(); mzzfEntity2.CreateTime = DateTime.Now.AddSeconds(1); db.Insert(mzzfEntity2); } + jszbEntity.xjzffs = feeRelated.djjesszffs; } - - //预交金支付 构建账户收支 //预交金支付 一定作为第一支付方式 if (mzzfEntity1 != null && mzzfEntity1.xjzffs == xtzffs.ZYYJZHZF) { diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/RefundDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/RefundDmnService.cs index 424124f3..ced6b56f 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/RefundDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/OutpatientManage/RefundDmnService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SqlClient; -using System.Linq; -using System.Text; -using FrameworkBase.MultiOrg.DmnService; +using FrameworkBase.MultiOrg.DmnService; using FrameworkBase.MultiOrg.Domain.IDomainServices; using FrameworkBase.MultiOrg.Infrastructure; using Newtouch.Common; @@ -20,6 +14,12 @@ using Newtouch.Infrastructure; using Newtouch.Tools; using Newtouch.Tools.DB; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; using DbParameter = System.Data.Common.DbParameter; namespace Newtouch.HIS.DomainServices @@ -27,13 +27,7 @@ namespace Newtouch.HIS.DomainServices public class RefundDmnService : DmnServiceBase, IRefundDmnService { private readonly ISysPatientBasicInfoRepo _sysPatBasicInfoRepository; - private OperatorModel userModel - { - get - { - return OperatorProvider.GetCurrent(); //获取当前登录用户对象 - } - } + private OperatorModel userModel => OperatorProvider.GetCurrent(); //获取当前登录用户对象 private readonly IFinancialInvoiceRepo _financialInvoiceRepo;//发票号 private readonly IOutpatientSettlementRepo _outPatientSettleRepo; private readonly ISysUserDmnService _sysUserDmnService; @@ -907,73 +901,42 @@ public bool InsertRemainFromReturns(OutpatientSettlementEntity js, List public List GetBasicInfoSearchList(Pagination pagination, string blh, string mzh, string xm, string kssj, string jssj, string orgId, string usercode, string jiuzhenbiaozhi) { - var newPat = @" -SELECT DISTINCT A.patid , - a.blh , - A.xm , - A.xb , - A.csny , - A.zjlx , - A.zjh , - c.CardNo kh , - CAST(FLOOR(DATEDIFF(DY, a.csny, GETDATE()) / 365.25) AS INT) nl , - xz.brxz , - xz.brxzmc , - yb.sycs , - A.dh , - A.dybh , - '' ghsj, - '' mzh, - A.phone -FROM [dbo].[xt_brjbxx] AS A WITH ( NOLOCK ) - INNER JOIN dbo.xt_card c ON c.patid = a.patid AND A.OrganizeId = c.OrganizeId - LEFT JOIN xt_brxz xz ON xz.brxz = c.brxz AND xz.OrganizeId = c.OrganizeId - LEFT JOIN xt_ybbab yb ON yb.patid = a.patid AND xz.OrganizeId = yb.OrganizeId - LEFT JOIN dbo.mz_gh gh ON gh.patid=a.patid AND gh.OrganizeId=c.OrganizeId -WHERE A.CreateTime BETWEEN @kssj and @jssj - and gh.ghnm is NULL - and (isnull(@jiuzhenbiaozhi, '') = '' or isnull(gh.jzbz,'1') in (select * from [f_split](@jiuzhenbiaozhi,','))) - AND ( A.xm like @xm or A.py like @xm OR @xm = '%%' ) - AND ( a.blh like @blh OR @blh ='%%' ) - AND a.OrganizeId = @OrganizeId - and (isnull(@usercode, '') = '' or A.CreatorCode=@usercode) - -UNION ALL - -"; - var strSql = $@" -{(string.IsNullOrWhiteSpace(mzh) ? newPat : "")} -SELECT A.patid , - a.blh , - A.xm , - A.xb , - A.csny , - A.zjlx , - A.zjh , - c.CardNo kh , - CAST(FLOOR(DATEDIFF(DY, a.csny, GETDATE()) / 365.25) AS INT) nl , - xz.brxz , - xz.brxzmc , - yb.sycs , - A.dh , - A.dybh , - gh.CreateTime ghsj, - gh.mzh, - A.phone + var strSql = new StringBuilder(); + strSql.Append(@"SELECT A.patid, + a.blh, + A.xm, + A.xb, + A.csny, + A.zjlx, + A.zjh, + MAX(c.CardNo) kh, -- 使用 MAX 确保每个字段只取一个值 + CAST(FLOOR(DATEDIFF(DY, a.csny, GETDATE()) / 365.25) AS INT) nl, + MAX(xz.brxz) brxz, + MAX(xz.brxzmc) brxzmc, + MAX(yb.sycs) sycs, + A.dh, + A.dybh, + MAX(gh.CreateTime) ghsj, + gh.mzh, + A.phone FROM [dbo].[xt_brjbxx] AS A WITH ( NOLOCK ) - INNER JOIN dbo.xt_card c ON c.patid = a.patid AND A.OrganizeId = c.OrganizeId - LEFT JOIN xt_brxz xz ON xz.brxz = c.brxz AND xz.OrganizeId = c.OrganizeId - LEFT JOIN xt_ybbab yb ON yb.patid = a.patid AND xz.OrganizeId = yb.OrganizeId - RIGHT JOIN dbo.mz_gh gh ON gh.patid=a.patid AND gh.OrganizeId=c.OrganizeId -WHERE gh.ghrq >=@kssj and gh.ghrq<@jssj and ( gh.mzh like @mzh OR @mzh = '%%' ) - and (isnull(@jiuzhenbiaozhi, '') = '' or isnull(gh.jzbz,'1') in (select * from [f_split](@jiuzhenbiaozhi,','))) - AND ( gh.xm like @xm or A.py like @xm OR @xm = '%%' ) - AND ( a.blh like @blh OR @blh ='%%' ) - AND a.OrganizeId = @OrganizeId and gh.zt='1' - and isnull(gh.ghzt,'') <> '2' --排除已退 - and (isnull(@usercode, '') = '' or gh.CreatorCode=@usercode) -"; - + INNER JOIN dbo.xt_card c ON c.patid = a.patid + AND A.OrganizeId = c.OrganizeId + LEFT JOIN xt_brxz xz ON xz.brxz = c.brxz + AND xz.OrganizeId = c.OrganizeId + LEFT JOIN xt_ybbab yb ON yb.patid = a.patid + AND xz.OrganizeId = yb.OrganizeId + RIGHT JOIN dbo.mz_gh gh ON gh.patid=a.patid + AND gh.OrganizeId=c.OrganizeId +WHERE gh.ghrq >=@kssj and gh.ghrq<@jssj and ( gh.mzh like @mzh OR @mzh = '%%') + and (isnull(@jiuzhenbiaozhi, '') = '' or isnull(gh.jzbz,'1') in (select * from [f_split](@jiuzhenbiaozhi,','))) + AND ( gh.xm like @xm or A.py like @xm OR @xm = '%%') + AND ( a.blh like @blh OR @blh ='%%') + AND a.OrganizeId = @OrganizeId and gh.zt='1' + --and isnull(gh.ghzt,'') <> '0' --排除挂号未结 + AND isnull(gh.ghzt,'') <> '2' --排除已退 + AND (isnull(@usercode, '') = '' or gh.CreatorCode=@usercode) +GROUP BY A.patid, a.blh, A.xm, A.xb, A.csny, A.zjlx, A.zjh, A.dh, A.dybh, gh.mzh, A.phone"); DbParameter[] param = { new SqlParameter("@xm","%"+(xm??"")+"%"), @@ -985,7 +948,7 @@ and isnull(gh.ghzt,'') <> '2' --排除已退 new SqlParameter("@kssj",Convert.ToDateTime(kssj).ToString("yyyy-MM-dd") ?? ""), new SqlParameter("@jssj",Convert.ToDateTime(jssj).AddDays(1).ToString("yyyy-MM-dd") ?? ""), }; - return QueryWithPage(strSql, pagination, param).ToList(); + return QueryWithPage(strSql.ToString(), pagination, param).ToList(); } /// @@ -996,7 +959,7 @@ and isnull(gh.ghzt,'') <> '2' --排除已退 /// /// /// - public List GetBasicInfoSearchListInRegister(Pagination pagination, string blh, string xm, string orgId, string zjh) + public List GetBasicInfoSearchListInRegister(Pagination pagination, string blh, string xm, string orgId, string zjh, string zjlx) { var strSql = new StringBuilder(); strSql.Append(@" SELECT A.patid , @@ -1040,7 +1003,7 @@ FROM [dbo].[xt_brjbxx] AS A WITH ( NOLOCK ) { new SqlParameter("@xm","%"+(xm??"")+"%"), new SqlParameter("@blh","%"+(blh??"")+"%"), - new SqlParameter("@zjh","%"+(zjh??"")+"%"), + new SqlParameter("@zjh", string.IsNullOrWhiteSpace(zjlx)? "%"+(zjh??"")+"%":zjh), new SqlParameter("@OrganizeId",orgId) }; return QueryWithPage(strSql.ToString(), pagination, param).ToList(); @@ -1077,9 +1040,9 @@ public List GetBasicInfoSearchListInRegister(string keyword, s a.jjlldh lxrdh, a.jjllr lxr FROM [dbo].[xt_brjbxx] AS A WITH ( NOLOCK ) - --INNER JOIN dbo.xt_card c ON c.patid = a.patid - --AND A.OrganizeId = c.OrganizeId - LEFT JOIN xt_brxz xz ON xz.brxz = a.brxz + INNER JOIN dbo.xt_card c ON c.patid = a.patid + AND A.OrganizeId = c.OrganizeId + LEFT JOIN xt_brxz xz ON xz.brxz = c.brxz AND xz.OrganizeId = a.OrganizeId LEFT JOIN ( SELECT TOP 1 * @@ -1111,13 +1074,14 @@ public List Getjzjsxx(string type, string keyword, string grbh, st } else { - strSql.Append(@"select distinct '门诊' type ,b.mzh zymzh,c.jsnm, b.jzid, d.jylsh ,convert(varchar(20),c.CreateTime,120) jssj"); + strSql.Append(@"select distinct '门诊' type ,b.mzh zymzh,c.jsnm, b.jzid, c.ybjslsh jylsh ,convert(varchar(20),c.CreateTime,120) jssj"); } strSql.Append(@" from xt_brjbxx a join mz_gh b on a.patid=b.patid and a.OrganizeId=b.OrganizeId +join xt_card kh on kh.CardNo=b.kh and kh.CardType=b.CardType and kh.OrganizeId=b.OrganizeId and kh.zt='1' join mz_js c on b.patid=c.patid and b.ghnm=c.ghnm and c.OrganizeId=b.OrganizeId and c.jsnm not in(select cxjsnm from mz_js where jszt='2') -join cqyb_OutPut05 d on d.jsnm=c.jsnm and d.OrganizeId=c.OrganizeId where a.grbh=@rybh +left join cqyb_OutPut05 d on d.jsnm=c.jsnm and d.OrganizeId=c.OrganizeId where kh.grbh=@rybh and a.OrganizeId=@orgId "); if (type == "1") { @@ -1125,13 +1089,14 @@ and c.jsnm not in(select cxjsnm from mz_js where jszt='2') } else { - strSql.Append(@" union all select distinct '住院' type,b.zyh zymzh,d.jsnm ,c.jylsh jzid,e.jylsh,convert(varchar(20),d.createtime,120) jssj"); + strSql.Append(@" union all select distinct '住院' type,b.zyh zymzh,d.jsnm ,c.jylsh jzid,d.ybjslsh jylsh,convert(varchar(20),d.createtime,120) jssj"); } strSql.Append(@" from xt_brjbxx a join zy_brjbxx b on a.patid=b.patid and a.OrganizeId=b.OrganizeId +join xt_card kh on kh.CardNo=b.kh and kh.CardType=b.CardType and kh.OrganizeId=b.OrganizeId and kh.zt='1' join cqyb_OutPut02 c on c.zymzh=b.zyh and c.OrganizeId=b.OrganizeId join zy_js d on d.zyh=b.zyh and d.OrganizeId=b.OrganizeId and d.jsnm not in (select cxjsnm from zy_js where jszt='2') -join cqyb_OutPut05 e on e.jsnm=d.jsnm and e.OrganizeId=d.OrganizeId where a.grbh=@rybh and a.OrganizeId=@orgId +left join cqyb_OutPut05 e on e.jsnm=d.jsnm and e.OrganizeId=d.OrganizeId where kh.grbh=@rybh and a.OrganizeId=@orgId "); if (type == "1") { @@ -1727,8 +1692,8 @@ union all select ypjsmx.ghnm,ypjsmx.jsmxnm,ypjsmx.jslx ,ypjsmx.sl --未发药 全部可退, --已发药需要药房药库接口告知 已退药全部退掉后可以退费 - ,case when cf.fybz = '2' then CONVERT(numeric, isnull(tymx.tysl,0)/yp.bzs) else ypjsmx.sl end ktsl - ,case when cf.fybz = '2' then CONVERT(numeric, isnull(tymx.tysl,0)/yp.bzs) else ypjsmx.sl end tsl + ,case when cf.fybz = '2' and tymx.tysl>yp.bzs then CONVERT(numeric, isnull(tymx.tysl,0)/yp.bzs) else ypjsmx.sl end ktsl + ,case when cf.fybz = '2' and tymx.tysl>yp.bzs then CONVERT(numeric, isnull(tymx.tysl,0)/yp.bzs) else ypjsmx.sl end tsl ,ypjsmx.jyje jsmxje ,ypmx.dj, 1 feeType, ypmx.dw ,cf.cfh @@ -1952,15 +1917,17 @@ public IList RefundableChongQingQuery(string orgId, DateTime? mzjs.fph --现金支付方式 --多种时不行 , - xjzffs.xjzffsmc xjzffsmc - FROM mz_js mzjs - LEFT JOIN mz_gh mzgh ON mzgh.ghnm = mzjs.ghnm + xjzffs.xjzffsmc+':'+cast(jszffs.zfje as varchar) xjzffsmc + into #jsxx + FROM mz_js mzjs with(nolock) + LEFT JOIN mz_gh mzgh with(nolock) ON mzgh.ghnm = mzjs.ghnm AND mzgh.OrganizeId = mzjs.OrganizeId LEFT JOIN [NewtouchHIS_Base]..V_C_Sys_UserStaff userstaff ON userstaff.Account = mzjs.CreatorCode AND userstaff.OrganizeId = mzjs.OrganizeId - LEFT JOIN drjk_mzjs_input ybfy ON ybfy.setl_id = mzjs.ybjslsh + LEFT JOIN drjk_mzjs_input ybfy with(nolock) ON ybfy.setl_id = mzjs.ybjslsh AND ybfy.zt = '1' - LEFT JOIN xt_xjzffs xjzffs ON mzjs.xjzffs = xjzffs.xjzffs + LEFT JOIN mz_jszffs jszffs ON jszffs.jsnm=mzjs.jsnm and jszffs.OrganizeId=mzjs.OrganizeId + LEFT JOIN xt_xjzffs xjzffs ON jszffs.xjzffs = xjzffs.xjzffs WHERE mzjs.OrganizeId = @orgId AND mzjs.zt = '1' AND mzgh.mzh = @mzh @@ -1973,7 +1940,12 @@ OR ISNULL(mzjs.jzsj, mzjs.CreateTime) >= @kssj AND ( @jssj IS NULL OR ISNULL(mzjs.jzsj, mzjs.CreateTime) < @jssj ) - ORDER BY mzjs.CreateTime; + select mzh,ghly,jsnm,ybjsh,jzid,pch,yllb,bzbm,jszje,jsxjzf,sfrq,createtime,creatorcode,creatorusername,jslx,fph + ,xjzffsmc = ( stuff((select ',' + xjzffsmc from #jsxx where jsnm = jsxx.jsnm for xml path('')), 1, 1, '') ) + from #jsxx jsxx + group by mzh,ghly,jsnm,ybjsh,jzid,pch,yllb,bzbm,jszje,jsxjzf,sfrq,createtime,creatorcode,creatorusername,jslx,fph + order by CreateTime + ; "; var pars = new DbParameter[] { diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientCenter/PatientCenterDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientCenter/PatientCenterDmnService.cs index a14a0230..1da14625 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientCenter/PatientCenterDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientCenter/PatientCenterDmnService.cs @@ -1,10 +1,7 @@ using FrameworkBase.MultiOrg.DmnService; using FrameworkBase.MultiOrg.Infrastructure; -using Newtouch.Common; using Newtouch.Core.Common; -using Newtouch.Core.Common.Exceptions; using Newtouch.HIS.Domain.IDomainServices; -using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.ReportTemplateVO; using Newtouch.HIS.Domain.ValueObjects; using Newtouch.HIS.Domain.ValueObjects.PatientManage; @@ -17,10 +14,8 @@ namespace Newtouch.HIS.DomainServices { - public class PatientCenterDmnService : DmnServiceBase, IPatientCenterDmnService + public class PatientCenterDmnService: DmnServiceBase, IPatientCenterDmnService { - private readonly IOutpatientRegistRepo _outpatientRegist; - private readonly IOutpatientPrescriptionRepo _prescriptionRepo; public PatientCenterDmnService(IDefaultDatabaseFactory databaseFactory) : base(databaseFactory) { @@ -28,7 +23,7 @@ public PatientCenterDmnService(IDefaultDatabaseFactory databaseFactory) #region 患者信息 - public HosPatientVo PatBrxzInfo(string patid, string orgId) + public HosPatientVo PatBrxzInfo(string patid,string orgId) { // string sql = @"select a.patid, a.brxz,(case when a.brxz='1' and a.cblb='3' then '离休医保' //when a.brxz='1' and a.xzlx is not null and a.xzlx='310' then '职工医保' @@ -47,27 +42,7 @@ public HosPatientVo PatBrxzInfo(string patid, string orgId) return null; } - - - public List InHosPatientBasic(string zyh, string zjh, int? zybz, string orgId, string kh = "") - { - var patList = PatientBasic(zyh, null, null, null, orgId, "zy", kh, zjh); - if (patList != null && patList.zyinfolist.Count > 0) - { - var result = patList.zyinfolist.Where(p => p.zybz != ((int)EnumZYBZ.Wry).ToString()).OrderByDescending(p => p.zyh).ToList(); - foreach (var i in result) - { - if (i.cyrq.HasValue) - { - i.zyts = DateTimeHelper.GetInHospDays(i.ryrq.Value, i.cyrq.Value); - } - } - return result; - - } - return patList.zyinfolist; - } - public PatientCenterVO PatientBasic(string zyh, string mzh, string keyword, string blh, string orgId, string ywlx = "", string kh = "", string zjh = "") + public PatientCenterVO PatientBasic(string zyh,string mzh,string keyword,string blh,string orgId, string ywlx="") { PatientCenterVO pat = new PatientCenterVO(); string sql = ""; @@ -81,14 +56,6 @@ from mz_gh a with(nolock) { sql += " and a.mzh = @mzh "; } - if (!string.IsNullOrWhiteSpace(kh)) - { - sql += " and a.kh = @kh "; - } - if (!string.IsNullOrWhiteSpace(zjh)) - { - sql += " and a.zjh = @zjh "; - } if (!string.IsNullOrWhiteSpace(blh)) { sql += " and a.blh = @blh "; @@ -102,39 +69,27 @@ from mz_gh a with(nolock) { sql += " and a.CreateTime>=@zjdjrq "; } - sql += " order by a.mzh desc"; pat.mzinfolist = FindList(sql, new SqlParameter[] { new SqlParameter("orgId",orgId), new SqlParameter("mzh",mzh), - new SqlParameter("kh",kh??""), new SqlParameter("blh",blh), - new SqlParameter("zjh",zjh??""), new SqlParameter("zjdjrq",DateTime.Now.AddDays(-1).ToShortDateString()), new SqlParameter("keyword",keyword??"") }); break; case "zy": - sql = @"select a.zyh,a.patid,a.brxz,a.zybz,a.ks ryks,a.bq ward,bq.bqmc wardname,a.ryrq,a.rytj,a.rqry,a.rqrq,a.zy,a.mz,a.gj,a.cs_sheng,a.cs_shi,a.cs_xian,a.hu_sheng,a.hu_shi,a.hu_xian,a.hu_dz,a.xian_sheng,a.xian_shi,a.xian_xian,a.xian_dz,a.hy,a.bje,a.lxr,a.lxrgx,a.lxrdh,a.lxrdz,a.cyjdry,a.cyjdrq,a.cyrq,a.cyzd,a.cybq,a.lxrjtdh,a.lxrWebchat,a.lxrEmail,a.lxr2,a.lxrgx2,a.lxryddh2,a.lxrjtdh2,a.lxrWebchat2,a.lxrEmail2,a.lxrdz2,a.gms,ys,doctor,a.CreatorCode,a.CreateTime,a.LastModifierCode,a.LastModifyTime,kh,CardType,CardTypeName,jkjl,cw,rybq,ryzd,a.zt,a.xm,a.xb,a.blh,a.csny,a.zjh,a.zjlx,a.nl,a.brly,nlshow,zcyy,a.jjlxr_sheng,a.jjlxr_shi,a.jjlxr_dz,a.jjlxr_xian,jzid,bzbm,bzmc,jzlx + sql = @"select a.zyh,a.patid,a.brxz,a.zybz,a.ks,a.bq,a.ryrq,a.rytj,a.rqry,a.rqrq,a.zy,a.mz,a.gj,a.cs_sheng,a.cs_shi,a.cs_xian,a.hu_sheng,a.hu_shi,a.hu_xian,a.hu_dz,a.xian_sheng,a.xian_shi,a.xian_xian,a.xian_dz,a.hy,a.bje,a.lxr,a.lxrgx,a.lxrdh,a.lxrdz,a.cyjdry,a.cyjdrq,a.cyrq,a.cyzd,a.cybq,a.lxrjtdh,a.lxrWebchat,a.lxrEmail,a.lxr2,a.lxrgx2,a.lxryddh2,a.lxrjtdh2,a.lxrWebchat2,a.lxrEmail2,a.lxrdz2,a.gms,ys,doctor,a.CreatorCode,a.CreateTime,a.LastModifierCode,a.LastModifyTime,kh,CardType,CardTypeName,jkjl,cw,rybq,ryzd,a.zt,a.xm,a.xb,a.blh,a.csny,a.zjh,a.zjlx,a.nl,a.brly,nlshow,zcyy,a.jjlxr_sheng,a.jjlxr_shi,a.jjlxr_dz,a.jjlxr_xian,jzid,bzbm,bzmc,jzlx ,d.cwmc,c.brxzmc from zy_brjbxx a with(nolock) left join xt_brxz c with(nolock) on a.brxz=c.brxz and a.OrganizeId=c.OrganizeId and c.zt='1' left join[NewtouchHIS_Base].dbo.xt_cw d on a.cw=d.cwcode and a.bq=d.bqcode and a.OrganizeId=d.OrganizeId and d.zt='1' left join xt_brjbxx k on a.patid=k.patid and k.zt='1' -left join NewtouchHIS_Base.dbo.xt_bq bq with(nolock) on a.bq=bq.bqCode and a.OrganizeId=bq.OrganizeId and bq.zt='1' where a.organizeid=@orgId and a.zt='1' "; if (!string.IsNullOrWhiteSpace(zyh)) { sql += " and a.zyh = @zyh "; } - if (!string.IsNullOrWhiteSpace(kh)) - { - sql += " and a.kh = @kh "; - } - if (!string.IsNullOrWhiteSpace(zjh)) - { - sql += " and a.zjh = @zjh "; - } - if (!string.IsNullOrWhiteSpace(blh) || !string.IsNullOrWhiteSpace(keyword)) + if (!string.IsNullOrWhiteSpace(blh)|| !string.IsNullOrWhiteSpace(keyword)) { sql += " and exists(select 1 from xt_brjbxx b with(nolock) where a.patid=b.patid and a.organizeid=b.organizeid and b.zt='1' "; if (!string.IsNullOrWhiteSpace(blh)) @@ -149,18 +104,15 @@ left join NewtouchHIS_Base.dbo.xt_bq bq with(nolock) on a.bq=bq.bqCode and a.Org sql += " )"; } - if (string.IsNullOrWhiteSpace(zyh) && string.IsNullOrWhiteSpace(blh) && string.IsNullOrWhiteSpace(keyword) && string.IsNullOrWhiteSpace(kh)) + if (string.IsNullOrWhiteSpace(zyh) && string.IsNullOrWhiteSpace(blh) && string.IsNullOrWhiteSpace(keyword)) { sql += " and a.CreateTime>=@zjdjrq "; } - sql += " order by a.zyh desc"; pat.zyinfolist = FindList(sql, new SqlParameter[] { new SqlParameter("orgId",orgId), new SqlParameter("zyh",zyh), - new SqlParameter("kh",kh??""), - new SqlParameter("zjh",zjh??""), new SqlParameter("blh",blh??""), - new SqlParameter("zjdjrq",DateTime.Now.AddDays(-180).ToShortDateString()), + new SqlParameter("zjdjrq",DateTime.Now.AddDays(-30).ToShortDateString()), new SqlParameter("keyword",keyword??"") }); break; @@ -183,7 +135,7 @@ from xt_brjbxx c with(nolock) /// /// /// - public IList InHospitalHistory(string patid, string zyh, string orgId) + public IList InHospitalHistory(string patid,string zyh, string orgId) { string sql = @"select convert(int,row_number()over(order by syxh)) zycx,* from( select distinct a.syxh, a.zyh,a.patid,a.brxz,(case when a.LastModifyTime>=e.LastModifyTime then a.zybz else convert(varchar(10),e.zybz) end )zybz, @@ -198,7 +150,7 @@ public IList InHospitalHistory(string patid, string zyh, string or d.cwmc,e.DeptCode ksCode,g.Name ksmc,e.WardCode ward,i.bqmc wardname ,isnull(m.zhye,0.00) zhye --,convert(decimal(18,2),isnull(j.xmzfy,0.00)+isnull(j.ypzfy,0.00)) zfy,isnull(j.yjfy,0.00) yjfy, ---(case when a.zybz in (" + (int)EnumZYBZ.Bqz + "," + (int)EnumZYBZ.Djz + "," + (int)EnumZYBZ.Zq + @") then convert(decimal(18,2),isnull(j.zhye,0.00)-isnull(j.xmzfy,0.00)-isnull(j.ypzfy,0.00)) else 0.00 end)djfy +--(case when a.zybz in (" + (int)EnumZYBZ.Bqz+","+ (int)EnumZYBZ.Djz+","+ (int)EnumZYBZ.Zq + @") then convert(decimal(18,2),isnull(j.zhye,0.00)-isnull(j.xmzfy,0.00)-isnull(j.ypzfy,0.00)) else 0.00 end)djfy from zy_brjbxx a with(nolock) left join xt_brjbxx k with(nolock) on a.patid=k.patid and a.organizeid=k.organizeid and k.zt='1' left join Newtouch_CIS.dbo.zy_brxxk e with(nolock) on a.zyh=e.zyh and a.OrganizeId=e.OrganizeId and e.zt='1' @@ -229,10 +181,10 @@ left join xt_zh m with(nolock) on a.patid=m.patid and a.organizeid=m.organizeid /// /// /// - public HosPatientVo InHospitalDoctorInfo(string zyh, string orgId, ref HosPatientVo patvo) + public HosPatientVo InHospitalDoctorInfo(string zyh, string orgId,ref HosPatientVo patvo) { string sql = @"select zyh,max(case when [type]=" + (int)EnumYslx.ZyDoc + @" then ysgh else '' end)zyys, -max(case when [type]=" + (int)EnumYslx.ZyDoc + @" then ysmc else '' end)zyysmc, +max(case when [type]=" + (int)EnumYslx.ZyDoc+ @" then ysmc else '' end)zyysmc, max(case when [type]=" + (int)EnumYslx.ZzDoc + @" then ysgh else '' end)zzys, max(case when [type]=" + (int)EnumYslx.ZzDoc + @" then ysmc else '' end)zzysmc, max(case when [type]=" + (int)EnumYslx.ZrDoc + @" then ysgh else '' end)zrys, @@ -256,9 +208,9 @@ from Newtouch_CIS.dbo.zy_PatDocInfo with(nolock) return patvo; } - public IList InHospitalSett(string zyh, string jsxz, string orgId) + public IList InHospitalSett(string zyh,string jsxz,string orgId) { - string sql = @"select a.jsnm,a.OrganizeId,zyh,brxz,zyts,zje,zlfy,zffy,flzffy,jzfy,xjzf,xjwc,zhjz,xjzffs,fph,jszt,cxjsnm,cxjsyy,zh,jsxz,jsksrq,jsjsrq,fpdm,jmje,jylx,ysk,zl,sfrq,OutTradeNo + string sql= @"select a.jsnm,a.OrganizeId,zyh,brxz,zyts,zje,zlfy,zffy,flzffy,jzfy,xjzf,xjwc,zhjz,xjzffs,fph,jszt,cxjsnm,cxjsyy,zh,jsxz,jsksrq,jsjsrq,fpdm,jmje,jylx,ysk,zl,sfrq,OutTradeNo ,b.jylsh setl_id,a.CreateTime setl_time from zy_js a with(nolock) left join cqyb_OutPut05 b with(nolock) on a.jsnm=b.jsnm and b.zt='1' and a.OrganizeId=b.OrganizeId @@ -385,7 +337,7 @@ FROM zy_js b /// yyyy-mm-dd /// yyyy-mm-dd /// - public IList GetPatjfbInfo(string zyh, string group, string sfdl, string sfxm, string orgId, string kssj, string jssj) + public IList GetPatjfbInfo(string zyh,string group,string sfdl,string sfxm,string orgId,string kssj, string jssj) { List list = new List(); if (!string.IsNullOrWhiteSpace(zyh)) @@ -403,7 +355,7 @@ public IList GetPatjfbInfo(string zyh, strin } return list; } - public IList GetPatjfbInfo(string zyh, string group, string sfdl, string sfxm, string orgId, string kssj, string jssj, string keyword) + public IList GetPatjfbInfo(string zyh,string group,string sfdl,string sfxm,string orgId,string kssj, string jssj, string keyword) { IList list = new List(); if (!string.IsNullOrWhiteSpace(zyh)) @@ -436,14 +388,14 @@ public List GetAdvancePayment(string zyh, string orgId) StringBuilder strSql = new StringBuilder(); strSql.Append(@"select a.szje,a.zhye,a.pzh,s.Name Creator,a.CreateTime,a.szxz,b.xjzffsmc,b.xjzffs,a.Id,szjl.Id tId from [NewtouchHIS_Sett].[dbo].[zy_brjbxx] z with(nolock) -left join xt_zhszjl a WITH ( NOLOCK ) on z.patid=a.patid and a.OrganizeId=z.OrganizeId and z.zt='1' +left join zy_zhszjl a WITH ( NOLOCK ) on z.zyh=a.zyh and a.OrganizeId=z.OrganizeId and z.zt='1' LEFT JOIN xt_xjzffs b WITH ( NOLOCK ) ON a.xjzffs = b.xjzffs LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff s ON s.Account=a.CreatorCode -LEFT JOIN dbo.xt_zhszjl szjl ON szjl.pzh = a.pzh +LEFT JOIN dbo.zy_zhszjl szjl ON szjl.pzh = a.pzh AND szjl.szje + a.szje = 0 AND a.szje > 0 AND szjl.zt = '1' WHERE z.zyh=@zyh and -a.OrganizeId = '6d5752a7-234a-403e-aa1c-df8b45d3469f' AND a.zt = '1' +a.OrganizeId =@orgId AND a.zt = '1' ORDER BY a.CreateTime DESC"); SqlParameter[] par = { new SqlParameter("@zyh", zyh), @@ -456,14 +408,14 @@ LEFT JOIN xt_xjzffs b WITH ( NOLOCK ) ON a.xjzffs = b.xjzffs #region 诊断 - public IList GetDiagLsit(string orgId, string zyh) + public IList GetDiagLsit( string orgId, string zyh) { - // string zdsql = @"SELECT Id,[BAH],[ZYH],[ZDOrder],[JBDM],[JBMC],[RYBQ],[RYBQMS] - //,[CYQK],[CYQKMS] - //,[LastModifierCode],[OrganizeId] - // FROM [Newtouch_MRMS].[dbo].[mr_basy_zd] with(nolock) - //where zt='1' and OrganizeId=@orgId and ZYH=@zyh and JBDM<>'999999999' "; - +// string zdsql = @"SELECT Id,[BAH],[ZYH],[ZDOrder],[JBDM],[JBMC],[RYBQ],[RYBQMS] +//,[CYQK],[CYQKMS] +//,[LastModifierCode],[OrganizeId] +// FROM [Newtouch_MRMS].[dbo].[mr_basy_zd] with(nolock) +//where zt='1' and OrganizeId=@orgId and ZYH=@zyh and JBDM<>'999999999' "; + string zdsql = @"declare @jsrq datetime select @jsrq=max(createtime) from [NewtouchHIS_Sett].[dbo].[zy_js] with(nolock) @@ -523,7 +475,7 @@ from [Newtouch_MRMS].[dbo].[mr_basy_zd] z with(nolock) /// /// /// - public IList MedInsurPreSettList(string zyh, string orgId) + public IList MedInsurPreSettList(string zyh,string orgId) { string sql = @" declare @zjh varchar(50)='' @@ -585,207 +537,5 @@ from drjk_zyjs_output a with(nolock) }); } #endregion - - #region 报告 - public List OutPatReportList(string kh, string mzh, string sqdzt, int cflx, string appId, string orgId) - { - string sql = ""; - List ghnmList = new List(); - if (!string.IsNullOrWhiteSpace(mzh)) - { - var ghxx = _outpatientRegist.FindEntity(p => p.mzh == mzh && p.OrganizeId == orgId && p.zt == "1"); - if (ghxx == null) - { - throw new FailedException("未找到挂号信息"); - } - ghnmList.Add(ghxx.ghnm); - } - if (!string.IsNullOrWhiteSpace(kh)) - { - //查找三天内检验报告 - DateTime ksrq = DateTime.Now.AddDays(-3); - var reglist = _outpatientRegist.IQueryable(p => p.kh == kh && p.CreateTime > ksrq && p.OrganizeId == orgId && p.zt == "1").ToList(); - if (reglist == null || reglist.Count == 0) - { - throw new FailedException("未找到挂号信息"); - } - ghnmList = reglist.Select(p => p.ghnm).ToList(); - } - sql += @"select b.cfh sqdh,a.ksmc,a.ysmc,ztId xmdm,ztmc xmmc ,convert(varchar(2),isnull(b.sqdzt,0)) sqdzt,'1' ywlx,b.createtime sqsj -from mz_cf b with(nolock),mz_xm a with(nolock) -where b.OrganizeId=@orgId and b.ghnm in(select col from dbo.f_split(@ghnmstr,',')) and b.cflxxf=@cflx and b.cfzt='1' and a.cfnm=b.cfnm and a.OrganizeId=b.OrganizeId and a.zt='1' and b.zt='1' -"; - if (!string.IsNullOrWhiteSpace(sqdzt)) - { - sql += " and b.sqdzt=@sqdzt "; - } - sql += " group by b.cfh,a.ksmc,a.ysmc,ztId,ztmc,b.sqdzt ;"; - var jysqd = FindList(sql, new SqlParameter[] { - new SqlParameter("orgId",orgId), - new SqlParameter("ghnmstr",string.Join(",",ghnmList)), - new SqlParameter("cflx",cflx), - new SqlParameter("sqdzt",sqdzt??""), - }); - return jysqd; - } - /// - /// 住院检验报告 - /// - /// - /// - /// - /// - /// - /// - /// - public List InHosPatReportList(string kh, string zyh, string sqdzt, int cflx, string appId, string orgId) - { - var patInfo = PatientBasic(zyh, null, null, null, orgId, "zy", kh); - if (patInfo == null || patInfo.zyinfolist.Count == 0) - { - throw new FailedException("未找到患者住院信息"); - } - //最近一次住院 - var last = patInfo.zyinfolist.OrderByDescending(p => p.ryrq).FirstOrDefault(); - if (last.cyrq != null && appId == EnumMzghly.SelfTerminal.ToString()) - { - DateTime limitdt = Convert.ToDateTime(last.cyrq).AddDays(3); - if (DateTime.Now.Date > limitdt.Date) - { - throw new FailedException("出院三日后报告请至服务中心领取"); - } - } - if (string.IsNullOrWhiteSpace(zyh)) - { - zyh = last.zyh; - } - string sql = @"exec sp_report_lisrecord_zy @zyh,@sqdh,@orgId;"; - var jysqd = FindList(sql, new SqlParameter[] { - new SqlParameter("zyh",zyh), - new SqlParameter("sqdh",""), - new SqlParameter("orgId",orgId) - }); - return jysqd; - } - /// - /// 报告明细 - /// - /// - /// - /// - /// - public PatLisReportDetail PatLisReportDetail(string sqdh, string xmdm, string ywlx, string appId, string orgId) - { - if (string.IsNullOrWhiteSpace(sqdh)) - { - throw new FailedException("申请单号不可为空"); - } - PatLisReportDetail rpt = new PatLisReportDetail(); - if (ywlx == "1") //门诊 - { - //查找已完成检验处方 - var cfxx = _prescriptionRepo.IQueryable(p => p.cfh == sqdh && p.cfzt == "1" && p.sqdzt == 2 && p.OrganizeId == orgId && p.zt == "1").ToList().FirstOrDefault(); - if (cfxx == null) - { - throw new FailedException("未找到已完成的报告"); - } - var ghxx = _outpatientRegist.FindEntity(p => p.ghnm == cfxx.ghnm); - if (ghxx == null) - { - throw new FailedException("挂号信息异常,请联系管理员"); - } - rpt.patInfo = new LisPatInfo - { - xm = ghxx.xm, - xb = ghxx.xb, - nlshow = ghxx.nlshow, - ksmc = cfxx.ksmc, - ysmc = cfxx.ysmc, - mzh = ghxx.mzh, - brxz = ghxx.brxz - }; - } - else - { - string zypatsql = @"exec sp_report_lisrecord_zy @zyh,@sqdh,@orgId;"; - var zysqd = FindList(zypatsql, new SqlParameter[] { - new SqlParameter("zyh",""), - new SqlParameter("sqdh",sqdh), - new SqlParameter("orgId",orgId) - }).FirstOrDefault(); - if (zysqd == null) - { - throw new FailedException("挂号信息异常,请联系管理员"); - } - rpt.patInfo = zysqd; - } - string sql = @"exec sp_report_lisdetail @sqdh,@xmdm,@ywlx,@orgId;"; - rpt.sqdInfo = FindList(sql, new SqlParameter[] { - new SqlParameter("orgId",orgId), - new SqlParameter("sqdh",sqdh), - new SqlParameter("xmdm",xmdm??""), - new SqlParameter("ywlx",ywlx??"1") - }); - return rpt; - } - #endregion - - - #region 门诊 - /// - /// 查询当日已挂号 - /// - /// - /// true 仅当日 - /// - /// - /// 0 待结 1 已结 2 已退 - /// - public IList GetPatRegList(string orgId, string appId, bool todayonly, string kh, string mzh, int[] ghzt = null) - { - var sb = new StringBuilder(); - var pars = new List(); - sb.Append(@"select staff.Name DoctorName,dept.Name DeptName,brxz.brxzmc Ghxzmc,gh.mzh Mzh,gh.kh CardNo,gh.ghly Ghly,gh.mjzbz RegType,gh.ks Dept,gh.ys Doctor, -gh.jzxh QueueNo,gh.ghzt RegStatus,gh.jzbz Jzbz,gh.Createtime RegDate,gh.brxz Ghxz -from mz_gh(nolock) gh -left join [NewtouchHIS_Base]..V_S_Sys_Staff staff on staff.gh = gh.ys and staff.Organizeid = gh.OrganizeId -left join [NewtouchHIS_Base]..V_S_Sys_Department dept(nolock) on dept.Code = gh.ks and dept.Organizeid = gh.OrganizeId -inner join xt_card kxx(nolock) on kxx.CardNo=gh.kh and kxx.CardType=gh.CardType and kxx.OrganizeId=gh.OrganizeId and kxx.zt=1 -left join xt_brxz brxz(nolock) on brxz.brxz = kxx.brxz and brxz.OrganizeId = kxx.OrganizeId and brxz.zt=1 -left join xt_brjbxx jbxx(nolock) on jbxx.patid = gh.patid and jbxx.zt = '1' and jbxx.OrganizeId = gh.OrganizeId -where gh.OrganizeId = @orgId and gh.zt = '1' -"); - if (appId == EnumMzghly.SelfTerminal.ToString()) - { - sb.Append(@" and gh.brxz ='" + ((int)EnumBrxz.zf).ToString() + "'"); - } - if (todayonly) - { - sb.Append(@"and gh.CreateTime >= CONVERT(varchar(100), GETDATE(), 23) "); - } - if (ghzt != null && ghzt.Length > 0) - { - var ghztstr = string.Join(",", ghzt.ToList()); - sb.Append(@" and gh.ghzt in(" + ghztstr + ")"); - } - else - { - sb.Append(@" and gh.ghzt=" + ((int)EnumJieSuanZT.YJ).ToString()); - } - if (!string.IsNullOrEmpty(kh)) - { - sb.Append(@" and gh.kh = @kh "); - pars.Add(new SqlParameter("@kh", kh)); - } - if (!string.IsNullOrEmpty(mzh)) - { - sb.Append(@" and gh.mzh = @mzh "); - pars.Add(new SqlParameter("@mzh", mzh)); - } - sb.Append(@" order by gh.CreateTime desc "); - pars.Add(new SqlParameter("@orgId", orgId)); - return this.FindList(sb.ToString(), pars.ToArray()); - } - #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/InpatientReserveDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/InpatientReserveDmnService.cs index b6b6dc12..6b66227b 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/InpatientReserveDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/InpatientReserveDmnService.cs @@ -42,7 +42,8 @@ public List GetAccPayInfo(int zh, string orgId, string zhx b.xjzffsmc , b.xjzffs, a.Id, - a.memo + a.memo, + a.outTradeNo FROM zy_zhszjl a WITH ( NOLOCK ) LEFT JOIN xt_xjzffs b WITH ( NOLOCK ) ON a.xjzffs = b.xjzffs LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff s WITH ( NOLOCK ) ON s.Account=a.CreatorCode diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/PatientBasicInfoDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/PatientBasicInfoDmnService.cs index 5284a0e3..9d17a36c 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/PatientBasicInfoDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/PatientManage/PatientBasicInfoDmnService.cs @@ -43,7 +43,8 @@ public class PatientBasicInfoDmnService : DmnServiceBase, IPatientBasicInfoDmnSe private readonly ISysPatientAccountRepo _SysPatAccRepository; private readonly ISysConfigRepo _sysConfigRepo; private readonly ISysPatientBasicInfoRepo _sysPatientBasicInfoRepo; - private readonly ISysPatientNatureRepo _sysPatientNatureRepo; + private readonly ISysPatientNatureRepo _sysPatientNatureRepo; + #region 贵安新农合 private readonly ITTCataloguesComparisonDmnService _ttCataloguesComparisonDmnService; @@ -94,6 +95,7 @@ LEFT JOIN xt_brxz (NOLOCK) xz ON xz.brxz = c.brxz }; return FirstOrDefault(strSql.ToString(), par.ToArray()); } + /// /// 同时保存病人和卡信息 /// @@ -122,20 +124,20 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea SysxtbrjbxxlogEntity xtbrjbxxlog = null; //修改病人信息 //根据身份证号判断病人基本信息 - var validatepat = _SysPatBasicInfoRepository.IQueryable().Where(p => p.zjlx == ((int)EnumZJLX.sfz).ToString() && p.zjh == vo.zjh && p.OrganizeId == orgId && p.zt == "1" && p.zjh!=null); + var validatepat = _SysPatBasicInfoRepository.IQueryable().Where(p => p.zjlx == vo.zjlx && p.zjh == vo.zjh && p.OrganizeId == orgId && p.zt == "1" && p.zjh != null); if ((vo.patid ?? 0) > 0 && vo.yktbz!= "yktcardregister") { if (!string.IsNullOrWhiteSpace(vo.zjh)) { if (validatepat.Count() > 1) { - throw new FailedException("身份证号为:" + vo.zjh + "的病人已存在"); + throw new FailedException("证件号为:" + vo.zjh + "的病人已存在"); } if (validatepat.Count()==1) { if (validatepat.FirstOrDefault().patid != vo.patid) { - throw new FailedException("身份证号为:" + vo.zjh + "的病人一卡通信息已存在"); + throw new FailedException("证件号为:" + vo.zjh + "的病人一卡通信息已存在"); } } @@ -172,7 +174,7 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea } if (validatepat.Count() > 1) { - throw new FailedException("身份证号为:" + vo.zjh + "的一卡通信息存在多条"); + throw new FailedException("证件号为:" + vo.zjh + "的一卡通信息存在多条"); } if (validatepat.Count() == 1) { @@ -182,7 +184,7 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea var isexitCard = _SysCardRepository.GetCardEntity(patiententity.patid, vo.cardtype, orgId); if (isexitCard != null&&isexitCard.brxz!=((int)EnumBrxz.zf).ToString()) { - throw new FailedException("身份证号为:" + vo.zjh + "的" + isexitCard.CardTypeName + "信息已经存在"); + throw new FailedException("证件号为:" + vo.zjh + "的" + isexitCard.CardTypeName + "信息已经存在"); } } newCardEntity = _SysCardRepository.GetCardEntity(vo.cardtype, vo.kh, orgId); @@ -228,7 +230,7 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea } } //通过身份证获取真实出生日期和性别 - var BirthdayAdnSix = CommmHelper.GetBirthdayAdnSix(vo.zjh); + var BirthdayAdnSix = vo.zjlx == ((int)EnumZJLX.sfz).ToString() ? CommmHelper.GetBirthdayAdnSix(vo.zjh) : null; //修改病人基本信息 patiententity.xm = vo.xm; patiententity.zjlx = vo.zjlx; @@ -355,8 +357,8 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea { //差别数据统计 data_name += (pi.Name == "" ? "NULL" : pi.Name) + ","; - datavalue_old += (get_old == "" ? "NULL" : get_old) + "卍"; - datavalue_new += (get_new == "" ? "NULL" : get_new) + "卍"; + datavalue_old += (get_old == "" ? "NULL" : get_old) + ","; + datavalue_new += (get_new == "" ? "NULL" : get_new) + ","; } } @@ -366,21 +368,21 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea var CreatorCodes = CreatorCode; var CreateTime = DateTime.Now; data_name = (data_name != "" ? data_name.Substring(0, data_name.LastIndexOf(",")) : ""); - datavalue_old = (datavalue_old != "" ? datavalue_old.Substring(0, datavalue_old.LastIndexOf("卍")) : ""); - datavalue_new = (datavalue_new != "" ? datavalue_new.Substring(0, datavalue_new.LastIndexOf("卍")) : ""); - //string strSql = string.Format(@"insert into [NewtouchHIS_Sett].[dbo].[xt_brjbxxLOG] " + - // " select newid(),*,@CreatorCodes,@CreateTime,NULL,NULL,@data_name data_name,@datavalue_old datavalue_old,@datavalue_new datavalue_new from [NewtouchHIS_Sett].[dbo].[xt_brjbxx] with(nolock) where patid=@patid and blh=@blh and zt='1' and OrganizeId=@orgId "); - //var param = new DbParameter[] { - // new SqlParameter("@data_name",data_name), - // new SqlParameter("@datavalue_old",datavalue_old), - // new SqlParameter("@datavalue_new",datavalue_new), - // new SqlParameter("@patid",vo.patid), - // new SqlParameter("@blh",vo.blh), - // new SqlParameter("@orgId",orgId), - // new SqlParameter("@CreatorCodes",CreatorCode), - // new SqlParameter("@CreateTime",CreateTime), - // }; - //this.ExecuteSqlCommand(strSql, param); + datavalue_old = (datavalue_old != "" ? datavalue_old.Substring(0, datavalue_old.LastIndexOf(",")) : ""); + datavalue_new = (datavalue_new != "" ? datavalue_new.Substring(0, datavalue_new.LastIndexOf(",")) : ""); + string strSql = string.Format(@"insert into [NewtouchHIS_Sett].[dbo].[xt_brjbxxLOG] " + + " select newid(),*,@CreatorCodes,@CreateTime,NULL,NULL,@data_name data_name,@datavalue_old datavalue_old,@datavalue_new datavalue_new from [NewtouchHIS_Sett].[dbo].[xt_brjbxx] with(nolock) where patid=@patid and blh=@blh and zt='1' and OrganizeId=@orgId "); + var param = new DbParameter[] { + new SqlParameter("@data_name",data_name), + new SqlParameter("@datavalue_old",datavalue_old), + new SqlParameter("@datavalue_new",datavalue_new), + new SqlParameter("@patid",vo.patid), + new SqlParameter("@blh",vo.blh), + new SqlParameter("@orgId",orgId), + new SqlParameter("@CreatorCodes",CreatorCode), + new SqlParameter("@CreateTime",CreateTime), + }; + this.ExecuteSqlCommand(strSql, param); } xtbrjbxxlog.data_name = data_name; @@ -422,7 +424,7 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea db.Insert(patiententity); xtbrjbxxlog.patid = newPatId; - xtbrjbxxlog.Create(true); + xtbrjbxxlog.Create(true); #region 照顾自助机/小程序接口,获取不到登录用户 if (string.IsNullOrEmpty(xtbrjbxxlog.CreatorCode)) { @@ -433,10 +435,8 @@ public void SavePatBasicCardInfo(SysHosBasicInfoVO vo, string orgId, string Crea xtbrjbxxlog.CreateTime = DateTime.Now; } #endregion + db.Insert(xtbrjbxxlog); } - xtbrjbxxlog.patid = patiententity.patid; - xtbrjbxxlog.Create(true); - db.Insert(xtbrjbxxlog); if (newCardEntity != null) { @@ -866,7 +866,7 @@ public string SaveSysBasicAccountInfo(SysHosBasicInfoVO VO, string OrganizeId, o //卡 hospPatientBasicInfo.kh = VO.kh; VO.cardtype = string.IsNullOrWhiteSpace(VO.cardtype) ? ((int)EnumCardType.XNK).ToString() : VO.cardtype; - hospPatientBasicInfo.CardType = VO.cardtype; + hospPatientBasicInfo.CardType =VO.cardtype ; hospPatientBasicInfo.CardTypeName = ((EnumCardType)(Convert.ToInt32(VO.cardtype))).GetDescription(); hospPatientBasicInfo.lxrjtdh = VO.lxrjtdh; @@ -1298,8 +1298,7 @@ LEFT JOIN xt_card cd with(nolock) on cd.cardno=a.kh and cd.CardType=a.CardType a //sqlparam.Add(new SqlParameter("@keyword", "%" + keyword.Trim() + "%")); } } - else - { + else { strsql.Append(@" select a.jzid mdtrt_id,'' setl_id,cd.grbh psn_no,b.xm psn_name, a.mzh zymzh, SUBSTRING(l.inHead,CHARINDEX(',',l.inHead)+6,CHARINDEX(',',l.inHead,CHARINDEX(',',l.inHead)+1)-CHARINDEX(',',l.inHead)-6 ) medins_setl_id, cd.cbdbm,l.errormsg errormsg,l.tradiNumber infno @@ -1446,8 +1445,8 @@ WHEN 9 THEN '取消入院' d.Name ksmc , e.bqCode bq , e.bqmc , - f.cwCode cw , - f.cwmc --, + f.cwCode, + f.cwmc cw--, --//g.zh , --//g.zhye , --预交金 --//h.zdCode , @@ -1503,7 +1502,6 @@ public List OutPatientRegistrationQuery( , string mjzbz = null , string jiuzhenbz = null , string keyword = null - , string zzhz = null , Pagination pagination = null) { var paraList = new List() { }; @@ -1514,8 +1512,8 @@ public List OutPatientRegistrationQuery( paraList.Add(new SqlParameter("@ysgh", ysgh ?? "")); paraList.Add(new SqlParameter("@mjzbz", mjzbz ?? "")); paraList.Add(new SqlParameter("@jiuzhenbz", jiuzhenbz ?? "")); - paraList.Add(new SqlParameter("@zzhz", zzhz ?? "")); paraList.Add(new SqlParameter("@keyword", "%" + (keyword ?? "") + "%")); + paraList.Add(new SqlParameter("@zzhz", "0")); // pagination = pagination ?? new Pagination(); pagination.page = pagination.page <= 0 ? 1 : pagination.page; @@ -1542,7 +1540,7 @@ public List OutPatientRegistrationQuery( paraList.Add(outParameter4); var list = this.FindList(@"exec usp_interface_OutPatientRegistrationQuery @orgId, @lastUpdateTime -, @outpatientNumber, @ksCode, @ysgh, @mjzbz, @jiuzhenbz, @keyword, @zzhz +, @outpatientNumber, @ksCode, @ysgh, @mjzbz, @jiuzhenbz, @keyword,@zzhz -- ,@page ,@rows ,@sidx ,@sord -- @@ -1646,12 +1644,17 @@ public IList GetInPatientList( ,zyxx.brxz, xz.brxzmc,xz.brxzlb ,isnull(zyxx.blh, xx.blh) blh - ,zd.zdCode AS zzdCode,zd.icd10 AS zzdicd10,zd.zdmc zzdmc + ,zd.zdCode AS zzdCode,zd.icd10 AS zzdicd10 + ,(select ls.zdmc from zy_rydzd ls where ls.zyh=zd.zyh and ls.zdpx= '1' and zt='1' )zzdmc + ,(select ls.zdmc from zy_rydzd ls where ls.zyh=zd.zyh and ls.zdpx= '2' and zt='1' ) zzdmc2 + ,(select ls.zdmc from zy_rydzd ls where ls.zyh=zd.zyh and ls.zdpx= '3' and zt='1' ) zzdmc3 ,CONVERT(varchar(100), zyxx.csny, 23) AS csny ,CONVERT(varchar(100), zyxx.ryrq, 23) AS ryrq ,CONVERT(varchar(100), zyxx.cyrq, 23) AS cyrq - ,zyxx.bq bqCode,bq.bqmc bqmc - ,zybz zybz + ,zyxx.bq bqCode,bq.bqmc bqmc,cw.cwmc + ,zyxx.zybz zybz + ,zdb.Name zy + ,(zyxx.xian_sheng+zyxx.xian_shi+zyxx.xian_xian+zyxx.xian_dz) xzz ,case zyxx.zybz when '0' then '入院登记' when '1' then '病区中' when '2' then '病区出院' when '3' then '病人出院' when '9' then '作废记录' else '' end AS zybzmc ,isnull(zyxx.LastModifyTime, zyxx.CreateTime) UpdateTime ,xx.py, '' wb @@ -1661,21 +1664,33 @@ public IList GetInPatientList( ,(CASE zyxx.zjlx WHEN 1 THEN zyxx.zjh ELSE '' END) AS idCardNo ,(CASE zyxx.xb WHEN '1' THEN '1' WHEN '2' THEN '2' ELSE '3' END ) as sex ,(CASE zyxx.xb WHEN '1' THEN '男' WHEN '2' THEN '女' ELSE '不详' END ) as sexValue - ,zyxx.lxr AS contPerName + ,xx.cyzdmc cyzd + ,(CASE xx.cyfs WHEN '1'THEN '治愈' WHEN '2' THEN '好转' WHEN '3' THEN '转院' ELSE '' END ) cyfs + ,CONVERT(VARCHAR(25),CASE DATEDIFF(DAY, zyxx.ryrq,ISNULL(cyrq,CONVERT(varchar,GETDATE(),120))) WHEN 0 THEN 1 else DATEDIFF(DAY, zyxx.ryrq,ISNULL(cyrq,CONVERT(varchar,GETDATE(),120)))END )+'天' inHosDays + ,(zyxx.lxr+'('+ + (CASE zyxx.lxrgx WHEN '1' THEN '夫妻'WHEN '2' THEN '父子'WHEN '3' THEN '母子'WHEN '4' THEN '父女'WHEN '5' THEN '母女'WHEN '6' THEN '兄弟'WHEN '7' THEN '姐弟'WHEN '8' THEN '姐妹'WHEN '9' THEN '祖孙' + WHEN 'A' THEN '公媳' WHEN 'B' THEN '婆媳'WHEN 'C' THEN '岳婿'WHEN 'D' THEN '连襟'WHEN 'E' THEN '妯娌'WHEN 'F' THEN '朋友'WHEN 'G' THEN '兄妹'ELSE '其他' END)+')') + AS contPerName ,zyxx.lxrdh AS contPerPhoneNum ,lxrItem.Code AS contPerRel ,lxrItem.Name AS contPerRelValue - ,zyxx.ks, ks.Name ksmc, zyxx.doctor, ysStaff.Name ysxm + ,zyxx.ks, ks.Name ksmc, ysStaff.Name doctor,'' jzDoctor, '' pkbz,ysStaff.Name ysxm ,zyxx.kh, zyxx.CardType, zyxx.CardTypeName,zyxx.jzh,zyxx.lxrdh,mz.mzmc,zyxx.rybq + ,case isnull(ybjs.jsqd_sclsh,'0') when '0' then '未上传' else '已上传' end isscm + ,ybjs.setl_id, + ybjs.psn_no,ybjs.mdtrt_id from zy_brjbxx(nolock) zyxx -left join xt_brjbxx(nolock) xx - on zyxx.patid = xx.patid AND zyxx.OrganizeId = xx.OrganizeId AND xx.zt = '1' +left join [Newtouch_CIS].[dbo].[zy_brxxk] xx + on zyxx.zyh = xx.zyh AND zyxx.OrganizeId = xx.OrganizeId AND xx.zt = '1' left join xt_brxz(nolock) xz ON xz.brxz = zyxx.brxz and xz.OrganizeId = zyxx.OrganizeId left join zy_rydzd(nolock) zd ON zd.zyh = zyxx.zyh AND zd.OrganizeId = zyxx.OrganizeId and zd.zdpx = 1 AND zd.zt = '1' +left join Newtouch_CIS..zy_PatDxInfo(nolock) cyzd + ON cyzd.zyh = zyxx.zyh AND cyzd.OrganizeId = zyxx.OrganizeId and cyzd.zdlb=2 and cyzd.zdlx=0 AND cyzd.zt = '1' left join [NewtouchHIS_Base]..V_S_xt_bq(nolock) bq ON bq.bqCode = zyxx.bq AND bq.OrganizeId = zyxx.OrganizeId AND bq.zt = '1' +left join [NewtouchHIS_Base].[dbo].[xt_cw] cw with(nolock) ON xx.OrganizeId=cw.OrganizeId and xx.BedCode=cw.bfCode and cw.zt='1' LEFT JOIN NewtouchHIS_Base..V_C_Sys_ItemsDetail lxrItem ON ( lxrItem.OrganizeId = zyxx.OrganizeId OR lxrItem.OrganizeId = '*') AND lxrItem.Code = zyxx.lxrgx @@ -1686,6 +1701,8 @@ left join NewtouchHIS_Base..V_S_Sys_Staff ysStaff on ysStaff.gh = zyxx.doctor and ysStaff.OrganizeId = zyxx.OrganizeId left join xt_card kh on kh.CardNo=zyxx.kh and kh.OrganizeId=zyxx.OrganizeId and kh.zt=1 left join NewtouchHIS_Base..xt_mz mz on mz.mzCode=zyxx.mz and mz.zt=1 +left join drjk_zyjs_output ybjs on ybjs.zyh=zyxx.zyh and ybjs.zt=1 +left join [NewtouchHIS_Base].[dbo].[Sys_ItemsDetail] zdb on zdb.Code=zyxx.zy and zdb.zt=1 where zyxx.zt = '1' and zyxx.OrganizeId = @orgId "); @@ -1844,9 +1861,9 @@ left join [NewtouchHIS_Base].[dbo].[V_S_xt_zd] b with(nolock) on b.organizeid in /// public IList GetPatSearchList(Pagination pagination, string orgId, string zyh, string xm, string brzybzType = null) { - var sql = @"select zyxx.* from zy_brjbxx zyxx -left join xt_brjbxx xtbrxx -on xtbrxx.patid = zyxx.patid and xtbrxx.zt = '1' and xtbrxx.OrganizeId = zyxx.OrganizeId + var sql = @"select zyxx.*,cw.BedNo from zy_brjbxx zyxx +left join xt_brjbxx xtbrxx on xtbrxx.patid = zyxx.patid and xtbrxx.zt = '1' and xtbrxx.OrganizeId = zyxx.OrganizeId +left join [Newtouch_CIS].[dbo].[zy_cwsyjlk] cw on zyxx.OrganizeId=cw.OrganizeId and zyxx.zyh=cw.zyh and cw.zt='1' where zyxx.OrganizeId = @orgId and zyxx.zt = '1' and (@zyh = '%%' or zyxx.zyh like @zyh) and (@xm = '%%' or zyxx.xm like @xm or xtbrxx.py like @xm)"; @@ -2378,6 +2395,19 @@ ORDER BY px }; return FirstOrDefault(strSql.ToString(), par.ToArray()); } + + public string GetUpqdScData(string kssj, string jssj) + { + var strSql = new StringBuilder(@"select distinct stuff((select distinct ','+zyh from drjk_zyjs_output where zt='1' and jsqd_scrq is null and jsqd_sclsh is null +and czrq>=@kssj and czrq<=@jssj FOR XML Path('')),1,1,'') as zyh from drjk_zyjs_output"); + DbParameter[] par = + { + new SqlParameter("@kssj", kssj), + new SqlParameter("@jssj", jssj) + + }; + return FirstOrDefault(strSql.ToString(), par.ToArray()); + } #endregion #region 重庆医保 @@ -2428,11 +2458,10 @@ public void OutPatZFchangetoYB(string orgId, string mzh, int patid, ZYToYBDto pa entity.zt = "1"; if (patInfo.jzpzlx != ((int)EnumCardType.YBJYK).ToString()) { - entity.CardNo = _SysCardRepository.GetCardSerialNo(orgId); + entity.CardNo = _SysCardRepository.GetCardSerialNo(orgId); } - else - { - entity.CardNo = patInfo.kh; + else { + entity.CardNo = patInfo.kh; } entity.CardType = patInfo.jzpzlx; entity.CardTypeName= ((EnumCardType)(Convert.ToInt32(patInfo.jzpzlx))).GetDescription(); @@ -2492,17 +2521,18 @@ public void InPatZFchangetoYB(string orgId, string zyh, int patid, ZYToYBDto pat { throw new FailedException("参数异常,身份证号为空"); } - if (string.IsNullOrWhiteSpace(patInfo.kh)) - { - throw new FailedException("参数异常,卡号为空"); - } + //if (string.IsNullOrWhiteSpace(patInfo.kh)) + //{ + // throw new FailedException("参数异常,卡号为空"); + //} using (var db = new EFDbTransaction(this._databaseFactory).BeginTrans()) { - if (patInfo.kh.Count() > 15) - { - // var sfsobj = _sysPatientBasicInfoRepo.IQueryable().Where(p => p.zjh == patInfo.kh && p.OrganizeId == orgId && p.brxz == "1" && p.zt == "1").FirstOrDefault(); - //patInfo.kh = sfsobj.sbbh; - } + //if (patInfo.kh.Count() > 15) + //{ + // var sfsobj = _sysPatientBasicInfoRepo.IQueryable().Where(p => p.zjh == patInfo.kh && p.OrganizeId == orgId && p.brxz == "1" && p.zt == "1").FirstOrDefault(); + //patInfo.kh = sfsobj.sbbh; + // } + var cardEnitty = db.IQueryable(p => p.patid == patid && p.OrganizeId==orgId && p.CardType==patInfo.jzpzlx).First(); var oldpatid = 0; var zybrxxEntity = db.IQueryable(p => p.zyh == zyh && p.OrganizeId == orgId).First(); //if (zybrxxEntity.patid != patid) @@ -2511,10 +2541,10 @@ public void InPatZFchangetoYB(string orgId, string zyh, int patid, ZYToYBDto pat //} oldpatid = zybrxxEntity.patid; //更新zy_brjbxx - zybrxxEntity.brxz = "1"; //普通医保 + zybrxxEntity.brxz = cardEnitty.brxz; //普通医保 zybrxxEntity.zjlx = ((int)EnumZJLX.sfz).ToString(); zybrxxEntity.zjh = patInfo.sfzh; - zybrxxEntity.kh = patInfo.kh; + zybrxxEntity.kh = cardEnitty.CardNo;//patInfo.kh; zybrxxEntity.CardType = patInfo.jzpzlx; zybrxxEntity.CardTypeName = ((EnumCardType)(Convert.ToInt32(patInfo.jzpzlx))).GetDescription(); zybrxxEntity.patid = patid; @@ -2654,6 +2684,84 @@ public void UpdateCqybOut02(string zyh, string orgId) } #endregion + #region 秦皇岛医保 + public Input_Bbrxx GetQHDjzdjInfo(string zyh, string orgId) + { + StringBuilder strSql = new StringBuilder(); + strSql.Append(@" + SELECT a.zyh hisId ,b.mdtrt_id mdtrt_id,a.OrganizeId orgid, + case when rytj is not null then rytj else '21' end med_type ,e.cbdbm insuplc_admdvs,e.grbh psn_no,e.xzlx insutype, + c.gh operatorId,c.name operatorName,'03' mdtrt_cert_type,kh mdtrt_cert_no,isnull('','') dise_codg,isnull('','') dise_name +FROM NewtouchHIS_Sett..zy_brjbxx a + left join [drjk_rybl_input] b on a.zyh=b.zyh and b.zt='1' + LEFT JOIN [NewtouchHIS_Base].[dbo].[V_S_Sys_Staff] c ON c.OrganizeId = a.OrganizeId + AND c.gh = a.doctor + AND c.zt = '1' + LEFT JOIN [NewtouchHIS_Sett].[dbo].[xt_brjbxx] e ON e.patid = a.patid + AND e.OrganizeId = a.OrganizeId + AND e.zt = '1' + +WHERE +a.zyh = @zyh + and e.brxz!='0' + AND a.OrganizeId = @OrganizeId + AND a.zt = '1' "); + SqlParameter[] par = + { + new SqlParameter("@zyh", zyh), + new SqlParameter("@OrganizeId", orgId) + }; + return this.FirstOrDefault(strSql.ToString(), par); + } + public string GetQHDSzshData(string zyh, string orgId) + { + StringBuilder strSql = new StringBuilder(); + strSql.Append(@" select jr_id from [dbo].[Drjk_sqsh_Output] where issqsz='1' and zt='1' and zyh=@zyh "); + SqlParameter[] par = + { + new SqlParameter("@zyh", zyh), + new SqlParameter("@OrganizeId", orgId) + }; + return this.FirstOrDefault(strSql.ToString(), par); + } + public string GetQHDTFDate(string zyh, string orgId) + { + StringBuilder strSql = new StringBuilder(); + strSql.Append(@" +select distinct + stuff(( +select feedetl_sn+',' from( +select mxsc.feedetl_sn from zy_xmjfb xmjfb1 +left join zy_xmjfb xmjfb2 on xmjfb1.cxzyjfbbh=xmjfb2.jfbbh +left join [drjk_zyfymxsc_input] mxsc on mxsc.feedetl_sn='XM'+convert(varchar(20),xmjfb2.jfbbh) + where xmjfb1.zyh=@zyh and xmjfb1.cxzyjfbbh!='0' and xmjfb1.zt='1' and mxsc.zt!='0' and (xmjfb1.sl+xmjfb2.sl)!=mxsc.cnt + AND xmjfb1.OrganizeId = @OrganizeId + union all + select mxsc.feedetl_sn from zy_ypjfb ypjfb1 +left join zy_ypjfb ypjfb2 on ypjfb1.cxzyjfbbh=ypjfb2.jfbbh +left join [drjk_zyfymxsc_input] mxsc on mxsc.feedetl_sn='YP'+convert(varchar(20),ypjfb2.jfbbh) + where ypjfb1.zyh=@zyh and ypjfb1.cxzyjfbbh!='0' and ypjfb1.zt='1' and mxsc.zt!='0' and (ypjfb1.sl+ypjfb2.sl)!=mxsc.cnt +AND ypjfb1.OrganizeId = @OrganizeId +union all +select mxsc.feedetl_sn from zy_xmjfb xmjfb +left join [drjk_zyfymxsc_input] mxsc on mxsc.feedetl_sn='XM'+convert(varchar(20),xmjfb.jfbbh) + where xmjfb.zyh=@zyh and mxsc.zt!='0' and xmjfb.zt='0' + AND xmjfb.OrganizeId = @OrganizeId + union all + select mxsc.feedetl_sn from zy_ypjfb ypjfb +left join [drjk_zyfymxsc_input] mxsc on mxsc.feedetl_sn='XM'+convert(varchar(20),ypjfb.jfbbh) + where ypjfb.zyh=@zyh and mxsc.zt!='0' and ypjfb.zt='0' + AND ypjfb.OrganizeId =@OrganizeId +) a for xml path('')),1,0,'') feedetl_sn "); + SqlParameter[] par = + { + new SqlParameter("@zyh", zyh), + new SqlParameter("@OrganizeId", orgId) + }; + return this.FirstOrDefault(strSql.ToString(), par); + } + #endregion + #region 医保业务 public SysPatBasicInfoVo ValidateFirstVisit(string sfzh, string xm,string orgId,string kh=null,string jzpzlx=null) { @@ -2998,7 +3106,7 @@ public bool updateZybrxxkExpandZhye(string zyh, string organizeId,decimal? zhye) } public List GetksZzdList(string orgid) { - string sqlstr = @"select code,name,py,convert(varchar(10),mzzybz)mzzybz,zxks,ybksbm,bmdm from NewtouchHIS_Base..[Sys_Department] where zt='1' and OrganizeId=@orgid and zlks='1'"; + string sqlstr = @"select code,name,py,convert(varchar(10),mzzybz)mzzybz,zxks,ybksbm from NewtouchHIS_Base..[Sys_Department] where zt='1' and OrganizeId=@orgid and zlks='1'"; @@ -3010,6 +3118,105 @@ public List GetksZzdList(string orgid) return this.FindList(sqlstr, par.ToArray()); } + #region 基金结算清单上传内容查询 + public IList GetSettlementList(string orgId, string sczt, string tjzt, string keyword = null, Pagination pagination = null, DateTime? cykssj = null, DateTime? cyjssj = null) + { + var sb = new StringBuilder(); + sb.Append(@"select zyxx.zyh, isnull(zyxx.xm, xx.xm) xm + ,case when isnull(zyxx.nl,0) <> 0 then zyxx.nl else (case when zyxx.csny is not null and zyxx.ryrq is not null then datediff(yy,zyxx.csny,zyxx.ryrq) else 0 end) end nl + ,zyxx.brxz, xz.brxzmc,isnull(zyxx.blh, xx.blh) blh + ,zd.zdCode AS zzdCode,zd.icd10 AS zzdicd10,zd.zdmc zzdmc + ,CONVERT(varchar(100), zyxx.csny, 23) AS csny + ,CONVERT(varchar(100), zyxx.ryrq, 23) AS ryrq + ,CONVERT(varchar(100), zyxx.cyrq, 23) AS cyrq + ,zyxx.bq bqCode,bq.bqmc bqmc + ,zybz zybz + ,case zyxx.zybz when '0' then '入院登记' when '1' then '病区中' when '2' then '病区出院' when '3' then '病人出院' when '9' then '作废记录' else '' end AS zybzmc + ,isnull(zyxx.LastModifyTime, zyxx.CreateTime) UpdateTime + ,xx.py, '' wb + ,zyxx.zjlx zjlx + ,(CASE zyxx.zjlx WHEN '1'THEN '身份证' WHEN '2' THEN '护照' WHEN '3' THEN '军官证' ELSE '其他' END ) zjlxValue + ,zyxx.zjh zjh + ,(CASE zyxx.zjlx WHEN 1 THEN zyxx.zjh ELSE '' END) AS idCardNo + ,(CASE zyxx.xb WHEN '1' THEN '1' WHEN '2' THEN '2' ELSE '3' END ) as sex + ,(CASE zyxx.xb WHEN '1' THEN '男' WHEN '2' THEN '女' ELSE '不详' END ) as sexValue + ,zyxx.lxr AS contPerName + ,zyxx.lxrdh AS contPerPhoneNum + ,lxrItem.Code AS contPerRel + ,lxrItem.Name AS contPerRelValue + ,zyxx.ks, ks.Name ksmc, zyxx.doctor, ysStaff.Name ysxm + ,zyxx.kh, zyxx.CardType, zyxx.CardTypeName,zyxx.jzh,zyxx.patid, + case isnull(ybjs.jsqd_sclsh,'0') when '0' then '未上传' else '已上传' end sczt, + case isnull(ybjs.jsqd_tjzt,'0') when '0' then '未提交' else '已提交' end tjzt, + ybjs.setl_id, + ybjs.psn_no +from zy_brjbxx(nolock) zyxx +left join xt_brjbxx(nolock) xx + on zyxx.patid = xx.patid AND zyxx.OrganizeId = xx.OrganizeId AND xx.zt = '1' +left join xt_brxz(nolock) xz + ON xz.brxz = zyxx.brxz and xz.OrganizeId = zyxx.OrganizeId +left join drjk_rybl_input rybl on rybl.zyh=zyxx.zyh and rybl.zt='1' +left join zy_rydzd(nolock) zd + ON zd.zyh = zyxx.zyh AND zd.OrganizeId = zyxx.OrganizeId and zd.zdpx = 1 AND zd.zt = '1' +left join [NewtouchHIS_Base]..V_S_xt_bq(nolock) bq + ON bq.bqCode = zyxx.bq AND bq.OrganizeId = zyxx.OrganizeId AND bq.zt = '1' +LEFT JOIN NewtouchHIS_Base..V_C_Sys_ItemsDetail lxrItem + ON ( lxrItem.OrganizeId = zyxx.OrganizeId OR lxrItem.OrganizeId = '*') + AND lxrItem.Code = zyxx.lxrgx AND lxrItem.CateCode = 'RelativeType' +left join NewtouchHIS_Base..V_S_Sys_Department ks + on ks.Code = zyxx.ks and ks.OrganizeId = zyxx.OrganizeId +left join NewtouchHIS_Base..V_S_Sys_Staff ysStaff + on ysStaff.gh = zyxx.doctor and ysStaff.OrganizeId = zyxx.OrganizeId +left join drjk_zyjs_output ybjs + on ybjs.zyh = zyxx.zyh and ybjs.zt = '1' +where zyxx.zt = '1' + and zyxx.brxz in ('1','2','3','11','12','13') + and zyxx.OrganizeId = @orgId +"); + + var pars = new List(); + pars.Add(new SqlParameter("@orgId", orgId)); + if (!string.IsNullOrWhiteSpace(keyword)) + { + sb.Append(@" and (zyxx.xm like @keyword or zyxx.blh like @keyword or zyxx.zyh like @keyword)"); + pars.Add(new SqlParameter("@keyword", "%" + (keyword ?? "") + "%")); + } + if (cykssj.HasValue) + { + sb.Append(@" and zyxx.cyrq >= @cykssj"); + pars.Add(new SqlParameter("@cykssj", cykssj.Value.Date)); + } + if (cyjssj.HasValue) + { + sb.Append(@" and zyxx.cyrq < @cyjssj"); + pars.Add(new SqlParameter("@cyjssj", cyjssj.Value.AddDays(1).Date)); + } + if (!string.IsNullOrWhiteSpace(sczt)) + { + if (sczt == "1") + { + sb.Append(@" and ybjs.jsqd_sclsh is null"); + } + else + { + sb.Append(@" and ybjs.jsqd_sclsh is not null"); + } + } + if (!string.IsNullOrWhiteSpace(tjzt)) + { + if (tjzt == "1") + { + sb.Append(@" and ybjs.jsqd_tjzt is null"); + } + else + { + sb.Append(@" and ybjs.jsqd_tjzt is not null"); + } + } + return this.QueryWithPage(sb.ToString(), pagination, pars.ToArray()); + } + #endregion + } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/ReportManage/ReportCommonDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/ReportManage/ReportCommonDmnService.cs index 72aea5ca..70edd280 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/ReportManage/ReportCommonDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/ReportManage/ReportCommonDmnService.cs @@ -10,6 +10,7 @@ using Newtouch.Core.Common.Exceptions; using Newtouch.HIS.Domain.ValueObjects.ReportManage; using System.Data.Common; +using Newtouch.Core.Common; namespace Newtouch.HIS.DomainServices { @@ -163,7 +164,7 @@ public void turnInFee(string orgId, string czr, DateTime kssj, DateTime jssj) //获取大类名称 public IList GetDlMc(string OrganizeId) { - return FindList(@"select dlmc,dlcode from NewtouchHIS_Base..xt_sfdl where OrganizeId=@orgId", new DbParameter[] { new SqlParameter("@orgId", OrganizeId) }); + return FindList(@"select dlmc,dlcode from NewtouchHIS_Base..xt_sfdl where OrganizeId=@orgId and zt='1' ", new DbParameter[] { new SqlParameter("@orgId", OrganizeId) }); } public YBSBMX_DCdbfVO yBSBMX_DCdbfs(string types, string ksrq, string jsrq, string orgid) @@ -230,7 +231,285 @@ public YBSBMX_DCdbfVO yBSBMX_DCdbfs(string types, string ksrq, string jsrq, stri return list; } + //获取收费项目 + public IList Getsfxm(Pagination pagination, string xzstr,string py,string sfdl, string OrganizeId) + { + if (xzstr==null) + { + xzstr = ""; + } + if (py == null) + { + py = ""; + } + string sql = @" select sfxmcode,sfxmmc,dw,dj from [NewtouchHIS_Base].[dbo].[xt_sfxm] sfxm + left join [NewtouchHIS_herp]..wz_product wz on wz.productCode=sfxm.sfxmCode + where sfxm.OrganizeId=@orgId + and (sfxmcode in (select * from f_split(@xzstr,',')) or @xzstr='') + and (sfxm.py like @py+'%' or sfxmmc like '%' + @py + '%') + and (sfdlCode = @sfdl or @sfdl='') +"; + if (sfdl=="18") + { + sql += " and (wz.iswzsame='1')"; + } + return this.QueryWithPage(sql, pagination, new[] { new SqlParameter("@xzstr", xzstr), new SqlParameter("@py", py), new SqlParameter("@orgId", OrganizeId), new SqlParameter("@sfdl", sfdl) }); + } + //获取交易记录库 + public IList GetJyjlData(Pagination pagination, string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +ybjs.setl_id lsh, +'H31011500088' jgdm, +gh.kh kh, +ybjs.psn_no zhbz, +'一般病人' brlx, +'1' jzcs, +convert(varchar(50),ybjs.setl_time,120) jysj, +'110' jslx, +convert(varchar(50),ybjs.medfee_sumamt) jyzfy, +convert(varchar(50),isnull((select sum(fund_payamt) from [NewtouchHIS_Sett]..drjk_mzjs_output_mx where fund_pay_type='本年账户支' and mzh=ybjs.mzh),'0')) dnzhzf, +convert(varchar(50),isnull((select sum(fund_payamt) from [NewtouchHIS_Sett]..drjk_mzjs_output_mx where fund_pay_type='历年账户支' and mzh=ybjs.mzh),'0')) lnzhzf, +'' zfdxj, +'' qfdxj, +'' qfdzh, +convert(varchar(50),ybjs.psn_cash_pay) tcdxj, +convert(varchar(50),ybjs.acct_pay) tcdzh, +convert(varchar(50),ybjs.hifp_pay) tczj, +'' fjdxj, +'' fjdzh, +'' fjzf, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwze, +convert(varchar(50),ybjs.fulamt_ownpay_amt+overlmt_selfpay) fybfwzf, +brxz.brxzmc yblx, +js.fph fphm, +case js.cxjsnm when 0 then '收费' else '退费' end tfbz, +convert(varchar(50),ybjs.setl_time,112) ksrq, +'无减负' jfbz, +'' jfje +from [NewtouchHIS_Sett]..drjk_mzjs_output ybjs +inner join [NewtouchHIS_Sett]..mz_gh gh on ybjs.mzh=gh.mzh and gh.zt='1' +left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' +left join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' +where ybjs.zt='1' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq "; + return this.QueryWithPage(sql, pagination, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + public IList GetJyjlDatatotxt(string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +ybjs.setl_id lsh, +'H31011500088' jgdm, +gh.kh kh, +ybjs.psn_no zhbz, +'一般病人' brlx, +'1' jzcs, +convert(varchar(50),ybjs.setl_time,120) jysj, +'110' jslx, +convert(varchar(50),ybjs.medfee_sumamt) jyzfy, +convert(varchar(50),isnull((select sum(fund_payamt) from [NewtouchHIS_Sett]..drjk_mzjs_output_mx where fund_pay_type='本年账户支' and mzh=ybjs.mzh),'0')) dnzhzf, +convert(varchar(50),isnull((select sum(fund_payamt) from [NewtouchHIS_Sett]..drjk_mzjs_output_mx where fund_pay_type='历年账户支' and mzh=ybjs.mzh),'0')) lnzhzf, +'' zfdxj, +'' qfdxj, +'' qfdzh, +convert(varchar(50),ybjs.psn_cash_pay) tcdxj, +convert(varchar(50),ybjs.acct_pay) tcdzh, +convert(varchar(50),ybjs.hifp_pay) tczj, +'' fjdxj, +'' fjdzh, +'' fjzf, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwze, +convert(varchar(50),ybjs.fulamt_ownpay_amt+overlmt_selfpay) fybfwzf, +brxz.brxzmc yblx, +js.fph fphm, +case js.cxjsnm when 0 then '收费' else '退费' end tfbz, +convert(varchar(50),ybjs.setl_time,112) ksrq, +'无减负' jfbz, +'' jfje +from [NewtouchHIS_Sett]..drjk_mzjs_output ybjs +inner join [NewtouchHIS_Sett]..mz_gh gh on ybjs.mzh=gh.mzh and gh.zt='1' +left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' +left join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' +where ybjs.zt='1' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq +and gh.OrganizeId=@orgId"; + return this.FindList(sql, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + /// + /// 门急诊大病挂号库 + /// + /// + /// + /// + /// + /// + public IList GetMjzdbghData(Pagination pagination, string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +ybjs.setl_id lsh, +gh.kh kh, +gh.ks ksbm, +ks.Name ksmc, +convert(varchar(50),ybjs.medfee_sumamt-ybjs.inscp_scp_amt) ghf, +convert(varchar(50),ybjs.inscp_scp_amt) zlf, +convert(varchar(50),ybjs.medfee_sumamt) jyzfy, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwze, +convert(varchar(50),ybjs.inscp_scp_amt-ybjs.inscp_scp_amt) fybfwze, +convert(varchar(50),ybjs.setl_time,120) jysj, +brxz.brxzmc yblx, +'110' jslx, +case gh.ghzt when '2' then '退费' else '收费' end tfbz, +gh.patid jzlsh + from +[NewtouchHIS_Sett]..mz_gh gh +inner join [NewtouchHIS_Sett]..drjk_mzjs_output ybjs on ybjs.mzh=gh.mzh +left join [NewtouchHIS_Base]..V_S_Sys_Department ks on ks.Code=gh.ks and ks.OrganizeId=gh.OrganizeId +left join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' +left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' +where gh.brxz!='0' +and gh.zt='1' +and js.jslx='0' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq and gh.OrganizeId=@orgId "; + return this.QueryWithPage(sql, pagination, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + public IList GetYbMjzdbghtxt(string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +ybjs.setl_id lsh, +gh.kh kh, +gh.ks ksbm, +ks.Name ksmc, +convert(varchar(50),ybjs.medfee_sumamt-ybjs.inscp_scp_amt) ghf, +convert(varchar(50),ybjs.inscp_scp_amt) zlf, +convert(varchar(50),ybjs.medfee_sumamt) jyzfy, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwze, +convert(varchar(50),ybjs.inscp_scp_amt-ybjs.inscp_scp_amt) fybfwze, +convert(varchar(50),ybjs.setl_time,120) jysj, +brxz.brxzmc yblx, +'110' jslx, +case gh.ghzt when '2' then '退费' else '收费' end tfbz, +gh.patid jzlsh + from +[NewtouchHIS_Sett]..mz_gh gh +inner join [NewtouchHIS_Sett]..drjk_mzjs_output ybjs on ybjs.mzh=gh.mzh +left join [NewtouchHIS_Base]..V_S_Sys_Department ks on ks.Code=gh.ks and ks.OrganizeId=gh.OrganizeId +left join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' +left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' +where gh.brxz!='0' +and gh.zt='1' +and js.jslx='0' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq and gh.OrganizeId=@orgId"; + return this.FindList(sql, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + /// + /// 获取门急诊大病加床收费数据 + /// + /// + /// + /// + /// + /// + public IList GetMjzjcsfData(Pagination pagination, string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +convert(varchar(50),ybjs.setl_id) yblsh, +gh.kh kh, +gh.ks ksbm, +ks.Name ksmc, +jz.jzys ysgh, +jz.jzysmc ysxm, +convert(varchar(50),isnull(jsmx.cf_mxnm,jsmx.mxnm)) cfbh, +(select dlmc from [NewtouchHIS_Base]..xt_sfdl where dlcode=xmmx.dl or dlcode=yp.dlCode) fylb, +isnull(yp.ypmc,sfxm.sfxmmc) xmmc, +isnull(cfmx.dw,xmmx.dw) xmdw, +convert(varchar(50),isnull(cfmx.dj,xmmx.dj)) xmdj, +convert(varchar(50),isnull(cfmx.sl,xmmx.sl)) xmsl, +convert(varchar(50),isnull(cfmx.je,xmmx.je)) xmje, +convert(varchar(50),isnull(cfmx.je,xmmx.je)) jyje, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwje, +'可报' bxbz, +convert(varchar(50),ybjs.setl_time) jysj, +brxz.brxzmc yblx, +'120' jslx, +case ybjs.zt when '0' then '退费' else '收费' end tfbz, +convert(varchar(50),jsmx.jsmxnm) lsh, +'' xflsh, +isnull(ypsx.gjybmc,'') yptym, +isnull(ypsx.pzwh,'') zczh, +isnull(ypsx.ybgg,'') mxxmgg +--isnull((case yp.zfxz when '0' then '可报' else (case xmmx.zfxz when '0' then '可报' else null end) end),) jyje, + from [NewtouchHIS_Sett]..drjk_mzjs_output ybjs + inner join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' + inner join [NewtouchHIS_Sett]..mz_gh gh on ybjs.mzh=gh.mzh + inner join [NewtouchHIS_Base]..V_S_Sys_Department ks on ks.Code=gh.ks and ks.OrganizeId=gh.OrganizeId and ks.zt='1' + inner join [Newtouch_CIS]..xt_jz jz on gh.mzh=jz.mzh and jz.OrganizeId=gh.OrganizeId and jz.zt='1' + inner join [NewtouchHIS_Sett]..mz_jsmx jsmx on js.jsnm=jsmx.jsnm and js.OrganizeId=jsmx.OrganizeId and jsmx.zt='1' + left join [NewtouchHIS_Sett]..mz_cfmx cfmx on jsmx.cf_mxnm=cfmx.cfmxId and cfmx.OrganizeId=jsmx.OrganizeId + left join [NewtouchHIS_Sett]..mz_xm xmmx on jsmx.mxnm=xmmx.xmnm + left join [NewtouchHIS_Base]..xt_sfxm sfxm on xmmx.sfxm=sfxm.sfxmCode and xmmx.OrganizeId=xmmx.OrganizeId + left join [NewtouchHIS_Base]..xt_yp yp on cfmx.yp=yp.ypCode and yp.OrganizeId=cfmx.OrganizeId + left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' + left join [NewtouchHIS_Base]..xt_ypsx ypsx on ypsx.ypCode=yp.ypCode and ypsx.OrganizeId=yp.OrganizeId + left join [NewtouchHIS_Base]..V_S_xt_sfdl sfdl on (yp.dlCode=sfdl.dlCode or xmmx.dl=sfdl.dlCode) and sfdl.OrganizeId=yp.OrganizeId + --left join [NewtouchHIS_Base]..xt_sfdl sfdl2 on sfdl2.dlCode=xmmx.dl and sfdl2.OrganizeId=yp.OrganizeId +where js.jslx!='0' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq and gh.OrganizeId=@orgId "; + return this.QueryWithPage(sql, pagination, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + public IList GetMjzjcsfDatatxt(string ksrq, string jsrq, string OrganizeId) + { + string sql = @"select +convert(varchar(50),ybjs.setl_id) yblsh, +gh.kh kh, +gh.ks ksbm, +ks.Name ksmc, +jz.jzys ysgh, +jz.jzysmc ysxm, +convert(varchar(50),isnull(jsmx.cf_mxnm,jsmx.mxnm)) cfbh, +(select dlmc from [NewtouchHIS_Base]..xt_sfdl where dlcode=xmmx.dl or dlcode=yp.dlCode) fylb, +isnull(yp.ypmc,sfxm.sfxmmc) xmmc, +isnull(cfmx.dw,xmmx.dw) xmdw, +convert(varchar(50),isnull(cfmx.dj,xmmx.dj)) xmdj, +convert(varchar(50),isnull(cfmx.sl,xmmx.sl)) xmsl, +convert(varchar(50),isnull(cfmx.je,xmmx.je)) xmje, +convert(varchar(50),isnull(cfmx.je,xmmx.je)) jyje, +convert(varchar(50),ybjs.inscp_scp_amt) ybfwje, +'可报' bxbz, +convert(varchar(50),ybjs.setl_time) jysj, +brxz.brxzmc yblx, +'120' jslx, +case ybjs.zt when '0' then '退费' else '收费' end tfbz, +convert(varchar(50),jsmx.jsmxnm) lsh, +'' xflsh, +isnull(ypsx.gjybmc,'') yptym, +isnull(ypsx.pzwh,'') zczh, +isnull(ypsx.ybgg,'') mxxmgg +--isnull((case yp.zfxz when '0' then '可报' else (case xmmx.zfxz when '0' then '可报' else null end) end),) jyje, + from [NewtouchHIS_Sett]..drjk_mzjs_output ybjs + inner join [NewtouchHIS_Sett]..mz_js js on js.ybjslsh=ybjs.setl_id and js.zt='1' + inner join [NewtouchHIS_Sett]..mz_gh gh on ybjs.mzh=gh.mzh + inner join [NewtouchHIS_Base]..V_S_Sys_Department ks on ks.Code=gh.ks and ks.OrganizeId=gh.OrganizeId and ks.zt='1' + inner join [Newtouch_CIS]..xt_jz jz on gh.mzh=jz.mzh and jz.OrganizeId=gh.OrganizeId and jz.zt='1' + inner join [NewtouchHIS_Sett]..mz_jsmx jsmx on js.jsnm=jsmx.jsnm and js.OrganizeId=jsmx.OrganizeId and jsmx.zt='1' + left join [NewtouchHIS_Sett]..mz_cfmx cfmx on jsmx.cf_mxnm=cfmx.cfmxId and cfmx.OrganizeId=jsmx.OrganizeId + left join [NewtouchHIS_Sett]..mz_xm xmmx on jsmx.mxnm=xmmx.xmnm + left join [NewtouchHIS_Base]..xt_sfxm sfxm on xmmx.sfxm=sfxm.sfxmCode and xmmx.OrganizeId=xmmx.OrganizeId + left join [NewtouchHIS_Base]..xt_yp yp on cfmx.yp=yp.ypCode and yp.OrganizeId=cfmx.OrganizeId + left join [NewtouchHIS_Sett]..xt_brxz brxz on gh.brxz=brxz.brxz and gh.OrganizeId=brxz.OrganizeId and brxz.zt='1' + left join [NewtouchHIS_Base]..xt_ypsx ypsx on ypsx.ypCode=yp.ypCode and ypsx.OrganizeId=yp.OrganizeId + left join [NewtouchHIS_Base]..V_S_xt_sfdl sfdl on (yp.dlCode=sfdl.dlCode or xmmx.dl=sfdl.dlCode) and sfdl.OrganizeId=yp.OrganizeId + --left join [NewtouchHIS_Base]..xt_sfdl sfdl2 on sfdl2.dlCode=xmmx.dl and sfdl2.OrganizeId=yp.OrganizeId - } +where js.jslx!='0' +and ybjs.setl_time>=@ksrq +and ybjs.setl_time<=@jsrq and gh.OrganizeId=@orgId"; + return this.FindList(sql, new[] { new SqlParameter("@ksrq", ksrq), new SqlParameter("@jsrq", jsrq), new SqlParameter("@orgId", OrganizeId) }); + } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/SystemManage/SysFinancialDmnService.cs b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/SystemManage/SysFinancialDmnService.cs index c22a98fa..efb5b455 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/SystemManage/SysFinancialDmnService.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.DomainServices/SystemManage/SysFinancialDmnService.cs @@ -1,10 +1,10 @@ using FrameworkBase.MultiOrg.DmnService; using FrameworkBase.MultiOrg.Infrastructure; +using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.ValueObjects.SystemManage; -using Newtouch.Infrastructure; -using System; using System.Collections.Generic; +using System.Data.Common; using System.Data.SqlClient; using System.Text; @@ -18,83 +18,50 @@ public SysFinancialDmnService(IDefaultDatabaseFactory databaseFactory) { } - public IList GetFinancialInvoiceList(string keyValue, string OrganizeId, string zt = "1") + public IList GetFinancialInvoiceList(string keyValue, string OrganizeId) { - var sqlStr3 = $@" - SELECT a.cwsjId , + var sqlStr3 = new StringBuilder(); + + sqlStr3.Append(@"SELECT a.cwsjId , a.szm , a.qssjh , a.dqsjh , a.jssjh , staff.Name ry FROM dbo.cw_sj a - LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff staff ON staff.Account = a.ry AND a.OrganizeId = staff.OrganizeId - WHERE a.OrganizeId = @orgId {(string.IsNullOrWhiteSpace(zt) ? "" : $"AND a.zt = @zt ")} - AND ((a.ry = @Id or @Id='') or (staff.Name = @Id or @Id='')) - order by a.zt desc - "; - - return this.FindList(sqlStr3, new[] { - new SqlParameter("@orgId", OrganizeId), - new SqlParameter("@Id", keyValue??""), - new SqlParameter("@zt", zt??"") - }); ; - } + LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff staff ON staff.Account = a.ry + AND a.OrganizeId = staff.OrganizeId + WHERE a.zt = '1' + AND a.OrganizeId = @orgId + AND ((a.ry = @Id or @Id='') or (staff.Name = @Id or @Id=''))"); - public IList GetCwfpList(string keyValue, string lyry, string OrganizeId) - { - var sqlStr3 = $@" -SELECT a.fpdm , - a.szm , - a.lyry , - a.dqfph , - a.qsfph ,a.jsfph,a.zt,a.CreateTime,a.CreatorCode, - staff.Name ry , - a.zt , - isnull(a.is_del, 0) is_del -FROM dbo.cw_fp a - LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff staff ON staff.Account = a.lyry AND a.OrganizeId = staff.OrganizeId - WHERE a.OrganizeId = @orgId - AND ((a.lyry = @Id or @Id='') or (staff.Name = @Id or @Id='')) {(string.IsNullOrWhiteSpace(lyry) ? "" : "AND a.lyry = @lyry ")} - order by a.is_del asc, a.zt desc, a.CreateTime desc "; - - return this.FindList(sqlStr3.ToString(), new[] { + return this.FindList(sqlStr3.ToString(), new[] { new SqlParameter("@orgId", OrganizeId), - new SqlParameter("@lyry", lyry??""), new SqlParameter("@Id", keyValue??"") }); ; } - - public IList InvoiceQueryList(DateTime kssj, DateTime jssj, string orgId, string creatorCode) + public IList GetCwfpList(string keyValue, string OrganizeId) { - var sqlStr3 = $@" -SELECT * -FROM ( - SELECT '门诊' jzlx, gh.mzh jzh, js.fph, brxx.xm, gh.kh, dept.Name ks, js.zje, js.jzsj sfrq - FROM mz_js(nolock) js - INNER JOIN mz_gh(nolock) gh on gh.ghnm=js.ghnm and gh.OrganizeId=js.OrganizeId AND gh.zt='1' - INNER JOIN dbo.xt_brjbxx(nolock) brxx on brxx.patid=js.patid and brxx.OrganizeId=brxx.OrganizeId AND brxx.zt='1' - LEFT JOIN NewtouchHIS_Base.dbo.Sys_Department(nolock) dept on dept.Code=gh.ks and dept.OrganizeId=brxx.OrganizeId AND dept.zt='1' - WHERE ISNULL(js.fph, '')<>'' and js.OrganizeId=@orgId and js.zt='1' - and js.CreatorCode=@creatorCode AND js.jzsj BETWEEN @kssj AND @jssj + var sqlStr3 = new StringBuilder(); - UNION ALL + sqlStr3.Append(@"SELECT a.fpdm , + a.szm , + a.lyry , + a.dqfph , + a.qsfph ,a.jsfph,a.zt,a.CreateTime,a.CreatorCode, + staff.Name ry + FROM dbo.cw_fp a + LEFT JOIN NewtouchHIS_Base..V_C_Sys_UserStaff staff ON staff.Account = a.lyry + AND a.OrganizeId = staff.OrganizeId + WHERE a.zt = '1' + AND a.OrganizeId = @orgId + AND ((a.lyry = @Id or @Id='') or (staff.Name = @Id or @Id=''))"); - SELECT '住院' jzlx, js.zyh jzh, js.fph, brxx.xm, brxx.kh, dept.Name ks , js.zje, js.CreateTime sfrq - FROM zy_js(nolock) js - INNER JOIN zy_brjbxx(nolock) brxx on brxx.zyh=js.zyh and brxx.OrganizeId=js.OrganizeId AND brxx.zt='1' - LEFT JOIN NewtouchHIS_Base.dbo.Sys_Department(nolock) dept on dept.Code=brxx.ks and dept.OrganizeId=brxx.OrganizeId AND dept.zt='1' - WHERE ISNULL(js.fph, '')<>'' and js.OrganizeId=@orgId and js.zt='1' - and js.CreatorCode=@creatorCode AND js.CreateTime BETWEEN @kssj AND @jssj -) a -ORDER BY a.fph, a.sfrq DESC "; - return FindList(sqlStr3.ToString(), new[] { - new SqlParameter("@orgId", orgId), - new SqlParameter("@kssj", kssj<=Constants.MinDate?Constants.MinDate:kssj), - new SqlParameter("@jssj", jssj>DateTime.Now?DateTime.Now:jssj), - new SqlParameter("@creatorCode", creatorCode??"") - }); ; + return this.FindList(sqlStr3.ToString(), new[] { + new SqlParameter("@orgId", OrganizeId), + new SqlParameter("@Id", keyValue??"") + }); ; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogCore.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogCore.cs new file mode 100644 index 00000000..2768d48e --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogCore.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Newtouch.Core.Common.Utils; +using NLog.Client; +using NLog.Contact.DTO; +using System.IO; +using System.Configuration; + +namespace Newtouch.HIS.Proxy.Log +{ + /// + /// 日志组件 + /// + public class LogCore + { + private static readonly ILog Logger = LogProxy.GetLogger(string.IsNullOrWhiteSpace(ConfigurationHelper.GetAppConfigValue("ServiceName")) ? "Newtouch.Sett" : ConfigurationHelper.GetAppConfigValue("ServiceName")); + + private static string xnhLogAddress = + string.IsNullOrEmpty(ConfigurationManager.AppSettings["xnhLogAddress"]) + ? "C:\\HISLog\\log_xinnonghe_guigan" + : ConfigurationManager.AppSettings["xnhLogAddress"]; + private static string LogAddress = + string.IsNullOrEmpty(ConfigurationManager.AppSettings["settLogAddress"]) + ? "C:\\HISLog\\log_sett_web" + : ConfigurationManager.AppSettings["settLogAddress"]; + public static void Info(string title, T message, Dictionary addInfo = null) + { + Logger.Info(title, message, tags: addInfo); + } + + internal static void Debug(string title, string message = "", Dictionary addInfo = null) + { + Logger.Debug(title, message, tags: addInfo); + } + + public static void Error(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + if (ex != null && string.IsNullOrWhiteSpace(message)) + { + message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; + } + Logger.Error(title, message, ex, addInfo); + } + + public static void Fatal(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + if (ex != null && string.IsNullOrWhiteSpace(message)) + { + message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; + } + Logger.Fatal(title, message, ex, addInfo); + } + + public static void Warn(string title, Exception ex = null, string message = "", Dictionary addInfo = null) + { + Logger.Warn(title, message, ex, addInfo); + } + + public static void Moniter(string title, object message, MoniterDTO moniter, Dictionary addInfo = null) + { + Logger.Moniter(title, message, moniter, addInfo); + } + + /// + /// 写本地日志 + /// + /// + public static void WriteInfo(string message) + { + try + { + var date = DateTime.Now.ToString("yyyyMMddHHmm"); + var dirPath = string.Format("{0}\\{1}", xnhLogAddress, date.Substring(0, 8)); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + var filePath = string.Format("{0}\\{1}.txt", dirPath, date.Substring(8, 3)); + File.AppendAllText(filePath, string.Format("\r\n\r\n{0}.Info.{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), message)); + } + catch { } + } + /// + /// 写本地日志 + /// + /// + public static void WriteInfoWeb(string message) + { + try + { + var date = DateTime.Now.ToString("yyyyMMddHHmm"); + var dirPath = string.Format("{0}\\{1}", LogAddress, date.Substring(0, 8)); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + var filePath = string.Format("{0}\\{1}.txt", dirPath, date.Substring(8, 3)); + File.AppendAllText(filePath, string.Format("\r\n\r\n{0}.Info.{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), message)); + } + catch { } + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogProxy.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogProxy.cs new file mode 100644 index 00000000..ff2893a3 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Log/LogProxy.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Newtouch.Common.Operator; +using NLog.Client; +using NLog.Contact.DTO; + +namespace Newtouch.HIS.Proxy.Log +{ + /// + /// log proxy + /// + public class LogProxy : ILog + { + private static ILog _log; + #region 单例 + + /// + /// 服务名称 + /// + private static string _serviceName = string.Empty; + + private static readonly LogProxy Instance = new LogProxy(); + + private LogProxy() { } + + public static LogProxy GetLogger(string serviceName) + { + try + { + _serviceName = serviceName; + _log = LogManage.GetLogger(_serviceName, OperatorProvider.GetCurrent() != null ? OperatorProvider.GetCurrent().OrganizeId : ""); + return Instance; + } + catch (Exception e) + { + Console.WriteLine(e); + _log = LogManage.GetLogger(_serviceName, ""); + return Instance; + } + } + + #endregion + + public void Debug(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Debug(title, message, exception, tags); + } + + public void Error(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Error(title, message, exception, tags); + } + + public void Fatal(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Fatal(title, message, exception, tags); + } + + public void Info(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Info(title, message, exception, tags); + } + + public void Warn(string title, object message, System.Exception exception = null, Dictionary tags = null) + { + _log.Warn(title, message, exception, tags); + } + + public void Moniter(string title, object message, MoniterDTO moniter, Dictionary tags = null) + { + _log.Moniter(title, message, moniter, tags); + } + + public void ChangeRecord(string title, object message, Exception exception = null, Dictionary tags = null) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Newtouch.HIS.Proxy.csproj b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Newtouch.HIS.Proxy.csproj index 22ceb9b3..bb20bc8a 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Newtouch.HIS.Proxy.csproj +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/Newtouch.HIS.Proxy.csproj @@ -9,7 +9,7 @@ Properties Newtouch.HIS.Proxy Newtouch.HIS.Proxy - v4.6 + v4.6.2 512 true diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/guian/CommonProxy.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/guian/CommonProxy.cs index fec764cc..79159948 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/guian/CommonProxy.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Proxy/guian/CommonProxy.cs @@ -65,7 +65,7 @@ public bool InterfaceS02(out string billCode) S02RequestDTO inBody = new S02RequestDTO { userName = "gaxqzd", - passWord = "***********" + passWord = "08A73F723AE68F27945DB81EC8DB45CB" }; string responseDtoStr = WebServiceHelper.xnh_InterfaceCall(inHead, inBody); ResponseBaseDTO resDto = XMLHelper.XmlDeserialize>(responseDtoStr); diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/ApiControllerBase.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/ApiControllerBase.cs index 6a4d90a0..34f091da 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/ApiControllerBase.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/ApiControllerBase.cs @@ -1,10 +1,5 @@ using Autofac; -using Newtonsoft.Json; -using Newtouch.Core.Redis; using Newtouch.HIS.API.Common.Models; -using Newtouch.Infrastructure; -using System; -using System.Web; namespace Newtouch.HIS.Sett.API { @@ -28,21 +23,7 @@ public UserIdentity UserIdentity return this.Identity as UserIdentity; } } - /// - /// 获取请求来源 - /// - /// - /// - public string GetBookTerminal(string AppID) - { - if (AppID.Contains("SelfTerminal")) - { - return EnumMzghly.SelfTerminal.ToString(); - } - return EnumMzghly.His.ToString(); - } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/AppLog/AppLog_2022-09-06_FAIL.txt b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/AppLog/AppLog_2022-09-06_FAIL.txt new file mode 100644 index 00000000..0380c360 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/AppLog/AppLog_2022-09-06_FAIL.txt @@ -0,0 +1,8 @@ +[2022-09-06 14:51:14][MONITER]Message{"AreaName":"api","ControllerName":"Patient","ActionName":"InPatientInfoQuery","EnterTime":"2022-09-06T14:51:14.0396646+08:00","CostMSec":91,"IP":null,"IsAjax":false,"RequestQueryString":null,"RequestForm":[{"Key":"RequestFormKey","Value":"{\"xm\":\"\",\"sfzh\":\"500101199809152959\",\"zyh\":\"2106089740001\",\"OrganizeId\":\"6d5752a7-234a-403e-aa1c-df8b45d3469f\",\"AppId\":\"\",\"TokenType\":\"\",\"Token\":\"\",\"Timestamp\":\"2022-09-06T06:38:24.467Z\",\"ResponseColumns\":\"\"}"}],"RouteDataCollections":null,"ResponseStatusCode":40004,"ResponseSubCode":"TOKEN_IS_REQUIRED","ResponseSubMsg":"Ϊ","UserIdentity":null,"Path":null,"ResponseContent":"{\"code\":40004,\"msg\":null,\"sub_code\":\"TOKEN_IS_REQUIRED\",\"sub_msg\":\"Ϊ\",\"data\":null}","MoniterType":0} + +[2022-09-06 14:52:29][MONITER]Message{"AreaName":"api","ControllerName":"Patient","ActionName":"InPatientInfoQuery","EnterTime":"2022-09-06T14:52:29.7502901+08:00","CostMSec":80,"IP":null,"IsAjax":false,"RequestQueryString":null,"RequestForm":[{"Key":"RequestFormKey","Value":"{\"xm\":\"\",\"sfzh\":\"500101199809152959\",\"zyh\":\"2106089740001\",\"OrganizeId\":\"6d5752a7-234a-403e-aa1c-df8b45d3469f\",\"AppId\":\"\",\"TokenType\":\"\",\"Token\":\"\",\"Timestamp\":\"2022-09-06T06:38:24.467Z\",\"ResponseColumns\":\"\"}"}],"RouteDataCollections":null,"ResponseStatusCode":40004,"ResponseSubCode":"TOKEN_IS_REQUIRED","ResponseSubMsg":"Ϊ","UserIdentity":null,"Path":null,"ResponseContent":"{\"code\":40004,\"msg\":null,\"sub_code\":\"TOKEN_IS_REQUIRED\",\"sub_msg\":\"Ϊ\",\"data\":null}","MoniterType":0} + +[2022-09-06 14:52:50][MONITER]Message{"AreaName":"api","ControllerName":"Patient","ActionName":"InPatientInfoQuery","EnterTime":"2022-09-06T14:52:50.520514+08:00","CostMSec":46,"IP":null,"IsAjax":false,"RequestQueryString":null,"RequestForm":[{"Key":"RequestFormKey","Value":"{\"xm\":\"\",\"sfzh\":\"500101199809152959\",\"zyh\":\"2106089740001\",\"OrganizeId\":\"6d5752a7-234a-403e-aa1c-df8b45d3469f\",\"AppId\":\"\",\"TokenType\":null,\"Token\":null,\"Timestamp\":\"2022-09-06T06:38:24.467Z\",\"ResponseColumns\":\"\"}"}],"RouteDataCollections":null,"ResponseStatusCode":40004,"ResponseSubCode":"TOKEN_IS_REQUIRED","ResponseSubMsg":"Ϊ","UserIdentity":null,"Path":null,"ResponseContent":"{\"code\":40004,\"msg\":null,\"sub_code\":\"TOKEN_IS_REQUIRED\",\"sub_msg\":\"Ϊ\",\"data\":null}","MoniterType":0} + +[2022-09-06 14:54:58][MONITER]Message{"AreaName":"api","ControllerName":"Patient","ActionName":"InPatientInfoQuery","EnterTime":"2022-09-06T14:54:58.5336025+08:00","CostMSec":335,"IP":null,"IsAjax":false,"RequestQueryString":null,"RequestForm":[{"Key":"RequestFormKey","Value":"{\"xm\":\"string\",\"sfzh\":\"string\",\"zyh\":\"string\",\"OrganizeId\":\"string\",\"AppId\":\"string\",\"TokenType\":\"string\",\"Token\":\"string\",\"Timestamp\":\"2022-09-06T06:54:26.308Z\",\"ResponseColumns\":\"string\"}"}],"RouteDataCollections":null,"ResponseStatusCode":40004,"ResponseSubCode":"TOKEN_IS_EXPIRED","ResponseSubMsg":"ѹ","UserIdentity":null,"Path":null,"ResponseContent":"{\"code\":40004,\"msg\":null,\"sub_code\":\"TOKEN_IS_EXPIRED\",\"sub_msg\":\"ѹ\",\"data\":null}","MoniterType":0} + diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/database.config b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/database.config index f9ffce7f..255176f5 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/database.config +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/database.config @@ -1,11 +1,14 @@  - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/system.config b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/system.config index d29b2999..e5d0553a 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/system.config +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Configs/system.config @@ -19,12 +19,12 @@ - + - + - + @@ -33,10 +33,4 @@ - - - - - - \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/Booking/BookingController.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/Booking/BookingController.cs index cb19ce6c..d0995d7f 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/Booking/BookingController.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/Booking/BookingController.cs @@ -1,5 +1,6 @@ using Autofac; using FrameworkBase.MultiOrg.Domain.IRepository; +using Newtouch.Common.Operator; using Newtouch.HIS.API.Common; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IDomainServices.API; @@ -11,23 +12,23 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net.Http; using System.Web; using System.Web.Http; +using FrameworkBase.MultiOrg.Domain.DTO; using FrameworkBase.MultiOrg.Domain.IDomainServices; using Newtonsoft.Json; +using Newtouch.Core.Common.Extensions; using Newtouch.Core.Redis; using Newtouch.HIS.API.Common.Filter; using Newtouch.HIS.API.Common.Models; +using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.ValueObjects.API; -using Newtouch.HIS.Domain.IDomainServices.OutpatientManage; -using Newtouch.HIS.Domain.IRepository.OutpatientManage; -using Newtouch.Core.Common; -using Newtouch.HIS.Sett.Request.Booking.Request; namespace Newtouch.HIS.Sett.API.Controllers { - [RoutePrefix("api/OutpBook")] - public class BookingApiController : ApiControllerBase + [RoutePrefix("api/Booking")] + public class BookingController : ApiControllerBase { private readonly ISysDepartmentRepo _sysDepartmentRepo; private readonly IBookingDmnService _BookingDmnService; @@ -38,28 +39,22 @@ public class BookingApiController : ApiControllerBase private readonly ISysPatientBasicInfoRepo _SysPatientBasicInfoRepo; private readonly IBaseDataDmnService _baseDataDmnService; private readonly IMzghbookRepo _MzghbookRepo; - #region 新排班 - private readonly IOutBookDmnService _outBookDmnService; - private readonly IOutBookScheduleRepo _outBookScheduleRepo; - private readonly IBookingRegisterDmnService _bookingRegisterDmn; - private readonly IOutPatientDmnService _outPatientDmn; - #endregion private string user; - public BookingApiController(IComponentContext com) + public BookingController(IComponentContext com) : base(com) { } - private string GetAuth(string orgId, string AppId = "API") + private string GetAuth(string orgId) { var identity = new UserIdentity { - AppId = AppId, + AppId = "API", TokenType = "", - UserId = GetBookTerminal(AppId), - Account = "API." + GetBookTerminal(AppId), + UserId = "APIAdmin", + Account = "APIAdmin", OrganizeId = orgId, TopOrganizeId = orgId, }; @@ -73,9 +68,9 @@ private string GetAuth(string orgId, string AppId = "API") [HttpPost] [IgnoreTokenDecrypt] [Route("BookingESB")] - public ResponseBase BookingEsb(BookingReqBase dto) + public HttpResponseMessage BookingEsb(BookingReqBase dto) { - ResponseBase httpresp = new ResponseBase(); + HttpResponseMessage httpresp=new HttpResponseMessage(); DefaultResponse resp = new DefaultResponse(); if (dto != null) { @@ -84,13 +79,15 @@ public ResponseBase BookingEsb(BookingReqBase dto) if (resp.code == ResponseResultCode.SUCCESS) { //身份设置 - dto.user = GetAuth(dto.OrganizeId, dto.AppId); - + dto.user = GetAuth(dto.OrganizeId); switch (dto.methodcode) { case "Y002"://系统科室列表 + //para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; //dto.FormatMedRequest(dto.paradata, "ksdm"); + //para.ksmc = dto.paradata.ContainsKey("ksmc") == true ? dto.paradata["ksmc"] : null; //dto.FormatMedRequest(dto.paradata, "ksmc"); + //resp = SysDeptartment(para.ks, resp); httpresp = SysDepartmentInfo(dto); - break; + break; case "Y003": //医生人员信息 httpresp = SysStaffInfo(dto); break; @@ -98,8 +95,8 @@ public ResponseBase BookingEsb(BookingReqBase dto) #region 患者查询与登记 if (dto.optype == "1") { - if (dto.paradata != null && dto.paradata.ContainsKey("zjh") - && dto.paradata.ContainsKey("xm") && dto.paradata.ContainsKey("xb") && dto.paradata.ContainsKey("csrq")) + if (dto.paradata!=null && dto.paradata.ContainsKey("zjh") + && dto.paradata.ContainsKey("xm") && dto.paradata.ContainsKey("xb")&& dto.paradata.ContainsKey("csrq")) { httpresp = SysPatInfoSet(dto); } @@ -107,10 +104,10 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键参数不可为空"; - + httpresp = CreateResponse(resp); } } - else if (dto.optype == "3") // 2020-2-19 与his登记同步 不强制要求证件号非空 + else if(dto.optype=="3") // 2020-2-19 与his登记同步 不强制要求证件号非空 { if (dto.paradata != null && dto.paradata.ContainsKey("xm") && dto.paradata.ContainsKey("xb") && dto.paradata.ContainsKey("csrq")) { @@ -120,14 +117,14 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键参数不可为空"; - + httpresp = CreateResponse(resp); } } else if (dto.paradata == null || !dto.paradata.ContainsKey("xm") || string.IsNullOrWhiteSpace(dto.paradata["xm"])) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键参数不可为空"; - + httpresp = CreateResponse(resp); } else if ((dto.paradata.ContainsKey("zjh") && !string.IsNullOrWhiteSpace(dto.paradata["zjh"])) || (dto.paradata.ContainsKey("kh") && !string.IsNullOrWhiteSpace(dto.paradata["kh"]))) @@ -139,37 +136,40 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键参数不可为空"; - + httpresp = CreateResponse(resp); } #endregion break; case "Y005"://医院药品信息 - //httpresp = SysDrugInfo(dto); + httpresp = SysDrugInfo(dto); break; case "Y006"://医疗项目信息 - // httpresp = SysMedicalInfo(dto); + httpresp = SysMedicalInfo(dto); break; case "Y007"://门诊疾病信息 - //httpresp = SysDiseaseInfo(dto); + httpresp = SysDiseaseInfo(dto); break; - case "Y008"://挂号项目类别 + case "Y008"://挂号项目类别 + httpresp = SysRegType(dto); break; - case "Y009"://门诊排班New - httpresp = dto.optype == "1" ? GetScheduleWithPage(dto) : GetSchedule(dto); + case "Y009"://门诊排班 + httpresp = GetMzpbSchedule(dto); break; case "Y010": //门诊排班详细号源信息 - //httpresp = GetMzpbScheduleDetail(dto); + httpresp = GetMzpbScheduleDetail(dto); break; case "Y011": + httpresp = GetRecipeInfo(dto); break; case "Y012": + httpresp = GetRecipeDrugInfo(dto); break; case "Y021"://预约记录 httpresp = OutBookRecord(dto); break; case "Y022"://预约 #region 门诊预约 - if (dto.paradata != null && dto.paradata.ContainsKey("ghxz") && dto.paradata.ContainsKey("ScheduId") && dto.paradata.ContainsKey("kh")) + if (dto.paradata != null && dto.paradata.ContainsKey("ghxz")&& dto.paradata.ContainsKey("scheduId")&& dto.paradata.ContainsKey("kh")) { httpresp = OutBookApply(dto); } @@ -177,12 +177,13 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - + httpresp = CreateResponse(resp); } #endregion break; case "Y023"://取消预约 - if (dto.paradata != null && dto.paradata.ContainsKey("BookId") && dto.paradata.ContainsKey("kh")) + if (dto.paradata != null && dto.paradata.ContainsKey("bookId") && dto.paradata.ContainsKey("kh") && + dto.paradata.ContainsKey("lxdh")) { httpresp = OutBookCancel(dto); } @@ -190,11 +191,11 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - + httpresp = CreateResponse(resp); } break; case "Y024"://挂号支付 - if (dto.paradata != null && dto.paradata.ContainsKey("BookId") && dto.paradata.ContainsKey("kh") && + if (dto.paradata != null && dto.paradata.ContainsKey("bookId") && dto.paradata.ContainsKey("kh") && dto.paradata.ContainsKey("PayFee") && dto.paradata.ContainsKey("PayLsh")) { httpresp = OutBookPay(dto); @@ -203,7 +204,7 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - + httpresp = CreateResponse(resp); } break; case "Y025"://预约退号 @@ -216,11 +217,11 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - + httpresp = CreateResponse(resp); } break; case "Y026"://无预约挂号 - if (dto.paradata != null && dto.paradata.ContainsKey("ScheduId") && dto.paradata.ContainsKey("kh") + if (dto.paradata != null && dto.paradata.ContainsKey("ks") && dto.paradata.ContainsKey("kh") && dto.paradata.ContainsKey("ghxz")) { httpresp = CommonRegist(dto); @@ -229,75 +230,36 @@ public ResponseBase BookingEsb(BookingReqBase dto) { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - - } - break; - case "Y027"://当日挂号记录 - if (dto.paradata != null && dto.paradata.ContainsKey("mzh") && dto.paradata.ContainsKey("kh")) - { - httpresp = OutpatRegRecord(dto, true); - } - else - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "门诊号/卡号信息不可为空"; - } - break; - case "Y028": //获取待支付账单 - if (dto.paradata != null && dto.paradata.ContainsKey("mzh") && dto.paradata.ContainsKey("kh")) - { - httpresp = PresUnpayQuery(dto); - } - else - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "门诊号及卡号信息不可为空"; - } - break; - case "Y029": //获取待支付账单 - if (dto.paradata != null && dto.paradata.ContainsKey("PresId") && dto.paradata.ContainsKey("mzh")) - { - httpresp =PresDetailQuery(dto); - } - else - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "门诊号及卡号信息不可为空"; + httpresp = CreateResponse(resp); } break; - case "Y030"://门诊收费信息查询 作废 + case "Y030"://门诊收费信息查询 if (dto.paradata != null && dto.paradata.ContainsKey("mzh") && dto.paradata.ContainsKey("kh")) { - //httpresp = OutpatChargeInfo(dto); + httpresp = OutpatChargeInfo(dto); } else { resp.code = ResponseResultCode.FAIL; resp.msg = "关键信息不可为空"; - + httpresp = CreateResponse(resp); } break; - default: - resp.code = ResponseResultCode.FAIL; - resp.msg = "关键信息不可为空"; - - break; - } } else { - + httpresp = CreateResponse(resp); } } else { resp.code = ResponseResultCode.FAIL; resp.msg = "请校验参数格式是否正确"; - + httpresp = CreateResponse(resp); } - if (httpresp != null && (httpresp.data != null || !string.IsNullOrWhiteSpace(httpresp.msg) || !string.IsNullOrWhiteSpace(httpresp.sub_msg))) return httpresp; - return resp; + + return httpresp; } @@ -311,8 +273,7 @@ private DefaultResponse SysDeptartment(string ksdm, DefaultResponse resp) /// /// /// - private ResponseBase SysDepartmentInfo(BookingReqBase dto) - { + private HttpResponseMessage SysDepartmentInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; @@ -323,7 +284,7 @@ private ResponseBase SysDepartmentInfo(BookingReqBase dto) } Action ac = (req, resp) => { - var list = _BookingDmnService.GetDepartmentInfo(para.OrgId, para.ks, para.ksmc); + var list = _BookingDmnService.GetDepartmentInfo(para.OrgId,para.ks, para.ksmc); if (list.Count > 0) { resp.data = list; @@ -336,7 +297,8 @@ private ResponseBase SysDepartmentInfo(BookingReqBase dto) } }; - return base.CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// @@ -344,40 +306,36 @@ private ResponseBase SysDepartmentInfo(BookingReqBase dto) /// /// /// - private ResponseBase SysStaffInfo(BookingReqBase dto) + private HttpResponseMessage SysStaffInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; if (dto.paradata != null) { - para.ys = dto.paradata.ContainsKey("ysgh") == true ? dto.paradata["ysgh"] : null; - para.xm = dto.paradata.ContainsKey("ysxm") == true ? dto.paradata["ysxm"] : null; - para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; + para.ys = dto.paradata.ContainsKey("ys") == true ? dto.paradata["ys"] : null; + para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; } Action ac = (req, resp) => { var staffList = _BookingDmnService.GetStaffInfo(para.OrgId, para.ys, para.xm); - var list = new List(); + var list = new List(); foreach (var obj in staffList) { - if (string.IsNullOrWhiteSpace(para.ks) || (!string.IsNullOrWhiteSpace(para.ks) && obj.departmentCode == para.ks)) + SysVSStaffVO staff = new SysVSStaffVO(); + if (obj.Gender == true) { - SysDoctorVO staff = new SysDoctorVO(); - if (obj.Gender == true) - { - string xb = ((EnumSex)(Convert.ToInt32(obj.Gender))).GetDescription(); - //properties - staff.ks = obj.departmentCode; - staff.ksmc = obj.departmentName; - staff.DutyId = obj.DutyId; - staff.dutyName = obj.dutyName; - staff.xb = xb ?? ""; - staff.ysgh = obj.gh; - staff.organizeId = obj.organizeId; - staff.ysxm = obj.staffName; - list.Add(staff); - } + string Gender = ((EnumSex)(Convert.ToInt32(obj.Gender))).GetDescription(); + //properties + staff.departmentCode = obj.departmentCode; + staff.departmentName = obj.departmentName; + staff.DutyId = obj.DutyId; + staff.dutyName = obj.dutyName; + staff.Gender = Gender; + staff.gh = obj.gh; + staff.organizeId = obj.organizeId; + staff.staffName = obj.staffName; + list.Add(staff); } } if (list.Count > 0) @@ -391,8 +349,9 @@ private ResponseBase SysStaffInfo(BookingReqBase dto) resp.msg = "未找到相关记录"; } }; - - return base.CommonExecute(ac, para); + + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } @@ -404,7 +363,7 @@ private ResponseBase SysStaffInfo(BookingReqBase dto) /// /// /// - private ResponseBase SysPatInfo(BookingReqBase dto) + private HttpResponseMessage SysPatInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; @@ -413,8 +372,7 @@ private ResponseBase SysPatInfo(BookingReqBase dto) para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; para.dh = dto.paradata.ContainsKey("dh") == true ? dto.paradata["dh"] : null; - Action ac = (req, resp) => - { + Action ac = (req, resp) => { var list = _BookingDmnService.GetPatInfo(para.OrgId, para.kh, para.zjh, para.xm); if (list != null && list.Count > 0) { @@ -428,8 +386,9 @@ private ResponseBase SysPatInfo(BookingReqBase dto) resp.msg = "患者信息不存在"; } }; - - return base.CommonExecute(ac, para); + + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// /// Y004 添加新患者信息 @@ -439,17 +398,18 @@ private ResponseBase SysPatInfo(BookingReqBase dto) /// /// /// - private ResponseBase SysPatInfoSet(BookingReqBase dto) + private HttpResponseMessage SysPatInfoSet(BookingReqBase dto) { - BookingRequestDto bookdto = new BookingRequestDto(); + BookingRequestDto bookdto=new BookingRequestDto(); bookdto.OrgId = dto.OrganizeId; bookdto.Timestamp = dto.Timestamp; if (dto.paradata != null) { + //bookdto.patid = dto.paradata.ContainsKey("patid") == true ? dto.paradata["patid"] : null; bookdto.zjh = dto.paradata.ContainsKey("zjh") == true ? dto.paradata["zjh"] : null; - //bookdto.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; + bookdto.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; bookdto.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; - bookdto.lxdh = dto.paradata.ContainsKey("lxdh") == true ? dto.paradata["lxdh"] : null; + bookdto.dh = dto.paradata.ContainsKey("dh") == true ? dto.paradata["dh"] : null; if (dto.paradata.ContainsKey("csrq")) { bookdto.csrq = Convert.ToDateTime(dto.paradata["csrq"]); @@ -458,29 +418,79 @@ private ResponseBase SysPatInfoSet(BookingReqBase dto) } Action ac = (req, resp) => { - var list = _bookingRegisterDmn.SysPatInfoSet(new RegisterReq + if (CommmHelper.CheckIDCard(bookdto.zjh)) { - IDCard = bookdto.zjh, - Name = bookdto.xm, - Phone = bookdto.dh, - HospitalID = "His", - PatType = ((int)EnumBrxz.zf).ToString(), - Gender = bookdto.xb - }); - resp.data = list; - resp.code = ResponseResultCode.SUCCESS; - if (list == null) + var validatepat = _SysPatientBasicInfoRepo.IQueryable().Where(p => + p.zjlx == ((int) EnumZJLX.sfz).ToString() && p.zjh == bookdto.zjh && p.OrganizeId == bookdto.OrgId && + p.zt == "1"); + if (validatepat.Count() > 0) + { + resp.code = ResponseResultCode.FAIL; + resp.sub_code = "10001"; + resp.msg = "证件信息已存在"; + } + else + { + SysHosBasicInfoVO vo = new SysHosBasicInfoVO(); + //var khpz = _sysConfigRepo.GetBoolValueByCode("xt_kh", OrgId, true).Value ? "ON" : "OFF"; + //if (khpz == "ON") + //{ + // vo.kh = _SysCardRepo.GetCardSerialNo(OrgId); + //} + //var blhpz = _sysConfigRepo.GetBoolValueByCode("xt_blh", OrgId, false).Value ? "ON" : "OFF"; + //if (blhpz == "ON") + //{ + // vo.blh = _SysPatientBasicInfoRepo.Getblh(OrgId); + //} + vo.kh = _SysCardRepo.GetCardSerialNo(bookdto.OrgId); + vo.blh = _SysPatientBasicInfoRepo.Getblh(bookdto.OrgId); + vo.xm = bookdto.xm; + vo.csny = bookdto.csrq.ToDateString(); + vo.zjlx = ((int) EnumZJLX.sfz).ToString(); + vo.zjh = bookdto.zjh; + vo.dh = bookdto.dh; + vo.xb = bookdto.xb; + vo.py = CommmHelper.StrConvertToPinyin(bookdto.xm, "1"); + //vo.patfrom = dto.AppId; + + if (vo.xb == "1" || vo.xb == "2") + { + vo.brxz = _SysPatientNatureRepo.GetbxzcBySearch("自费", bookdto.OrgId)[0].brxz; + try + { + _PatientBasicInfoDmnService.SavePatBasicCardInfo(vo, bookdto.OrgId,""); + var list = _BookingDmnService.GetPatInfo(bookdto.OrgId, vo.kh, vo.zjh, vo.xm); + resp.data = list; + resp.code = ResponseResultCode.SUCCESS; + resp.msg = "患者信息添加成功"; + } + catch (Exception ex) + { + resp.code = ResponseResultCode.ERROR; + resp.msg = ex.InnerException.InnerException.ToString(); + } + } + else + { + resp.code = ResponseResultCode.FAIL; + resp.sub_code = "10003"; + resp.msg = "参数字典不规范"; + } + } + + } + else { resp.code = ResponseResultCode.FAIL; - resp.msg = "建卡信息登记失败,请重试"; + resp.sub_code = "10002"; + resp.msg = "证件格式不规范"; } - }; - return CommonExecute(ac, bookdto); - + var response = base.CommonExecute(ac, bookdto); + return base.CreateResponse(response); } - private ResponseBase SysPatInfoSetPub(BookingReqBase dto) + private HttpResponseMessage SysPatInfoSetPub(BookingReqBase dto) { BookingRequestDto bookdto = new BookingRequestDto(); bookdto.OrgId = dto.OrganizeId; @@ -501,10 +511,11 @@ private ResponseBase SysPatInfoSetPub(BookingReqBase dto) Action ac = (req, resp) => { var validatepat = _SysPatientBasicInfoRepo.IQueryable().Where(p => - p.xm == bookdto.xm && p.csny == bookdto.csrq && p.xb == bookdto.xb && p.OrganizeId == bookdto.OrgId && p.zt == "1"); + p.xm == bookdto.xm && p.csny == bookdto.csrq && p.xb == bookdto.xb &&p.OrganizeId==bookdto.OrgId && p.zt == "1"); if (validatepat.Count() > 0) { resp.code = ResponseResultCode.FAIL; + resp.sub_code = "10001"; resp.msg = "患者信息已存在"; } else @@ -524,7 +535,7 @@ private ResponseBase SysPatInfoSetPub(BookingReqBase dto) vo.brxz = _SysPatientNatureRepo.GetbxzcBySearch("自费", bookdto.OrgId)[0].brxz; try { - _PatientBasicInfoDmnService.SavePatBasicCardInfo(vo, bookdto.OrgId, ""); + _PatientBasicInfoDmnService.SavePatBasicCardInfo(vo, bookdto.OrgId,""); var list = _BookingDmnService.GetPatInfo(bookdto.OrgId, vo.kh, vo.zjh, vo.xm); resp.data = list; resp.code = ResponseResultCode.SUCCESS; @@ -544,8 +555,8 @@ private ResponseBase SysPatInfoSetPub(BookingReqBase dto) } } }; - return CommonExecute(ac, bookdto); - + var response = base.CommonExecute(ac, bookdto); + return base.CreateResponse(response); } @@ -554,12 +565,12 @@ private ResponseBase SysPatInfoSetPub(BookingReqBase dto) /// /// /// - private ResponseBase SysDrugInfo(BookingReqBase dto) + private HttpResponseMessage SysDrugInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - int ypId = 0; string ypmc = null; + int ypId = 0; string ypmc = null; if (dto.paradata != null) { ypId = dto.paradata.ContainsKey("ypId") == true ? int.Parse(dto.paradata["ypId"]) : 0; @@ -587,8 +598,8 @@ private ResponseBase SysDrugInfo(BookingReqBase dto) } }; - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// @@ -596,13 +607,12 @@ private ResponseBase SysDrugInfo(BookingReqBase dto) /// /// /// - private ResponseBase SysMedicalInfo(BookingReqBase dto) - { + private HttpResponseMessage SysMedicalInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - int sfxmId = 0; string sfxmCode = null; string sfxmmc = null; + int sfxmId = 0;string sfxmCode = null; string sfxmmc = null; if (dto.paradata != null) { sfxmId = dto.paradata.ContainsKey("sfxmId") == true ? int.Parse(dto.paradata["sfxmId"]) : 0; @@ -611,11 +621,10 @@ private ResponseBase SysMedicalInfo(BookingReqBase dto) } Action ac = (req, resp) => { - var MedicalList = _BookingDmnService.GetMedicalInfo(para.OrgId, sfxmId, sfxmCode, sfxmmc); - var list = new List(); - foreach (var obj in MedicalList) - { - obj.zfxz = ((EnumZiFuXingZhi)int.Parse(obj.zfxz)).GetDescription(); + var MedicalList = _BookingDmnService.GetMedicalInfo(para.OrgId, sfxmId,sfxmCode,sfxmmc); + var list= new List(); + foreach (var obj in MedicalList) { + obj.zfxz= ((EnumZiFuXingZhi)int.Parse(obj.zfxz)).GetDescription(); list.Add(obj); } if (list.Count > 0) @@ -630,8 +639,8 @@ private ResponseBase SysMedicalInfo(BookingReqBase dto) } }; - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// @@ -639,7 +648,7 @@ private ResponseBase SysMedicalInfo(BookingReqBase dto) /// /// /// - private ResponseBase SysDiseaseInfo(BookingReqBase dto) + private HttpResponseMessage SysDiseaseInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; @@ -666,28 +675,20 @@ private ResponseBase SysDiseaseInfo(BookingReqBase dto) } }; - return CommonExecute(ac, para); - - } + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); + } - /// - /// Y010 排班号源明细 + /// Y008 ghlx 挂号类型 /// - /// + /// /// - private ResponseBase GetMzpbScheduleDetail(BookingReqBase dto) + private HttpResponseMessage SysRegType(BookingReqBase dto) { - BookingRequestDto para = new BookingRequestDto(); - para.OrgId = dto.OrganizeId; - para.Timestamp = dto.Timestamp; - if (dto.paradata != null) - { - para.ScheduId = dto.paradata.ContainsKey("ScheduId") == true ? dto.paradata["ScheduId"] : null; - } - Action ac = (req, resp) => + Action ac = (req, resp) => { - var list = _BookingDmnService.GetScheduleDetail(para.OrgId, para.ScheduId); + var list = _BookingDmnService.SysItemDetail(dto.OrganizeId, "RegType"); if (list.Count > 0) { resp.data = list; @@ -699,505 +700,501 @@ private ResponseBase GetMzpbScheduleDetail(BookingReqBase dto) resp.msg = "未找到相关记录"; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, dto); + return base.CreateResponse(response); } - /// - /// Y021 预约记录查询 + /// Y009 门诊排班 /// - /// + /// + /// + /// + /// + /// + /// + /// /// - private ResponseBase OutBookRecord(BookingReqBase dto) + private HttpResponseMessage GetMzpbSchedule(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = dto.AppId; - para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; - para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - para.BookId = dto.paradata.ContainsKey("BookId") == true ? dto.paradata["BookId"] : null; - para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; - para.ys = dto.paradata.ContainsKey("ysgh") == true ? dto.paradata["ysgh"] : null; - para.outDate = dto.paradata.ContainsKey("OutDate") == true ? dto.paradata["OutDate"] : null; - para.yyzt = dto.paradata.ContainsKey("yyzt") == true ? dto.paradata["yyzt"] : null; - if (dto.paradata.ContainsKey("ksrq") && !string.IsNullOrWhiteSpace(dto.paradata["ksrq"])) - { - para.ksrq = Convert.ToDateTime(dto.paradata["ksrq"]).ToString("yyyy-MM-dd"); - } - - if (dto.paradata.ContainsKey("jsrq") && !string.IsNullOrWhiteSpace(dto.paradata["jsrq"])) + if (dto.paradata != null) { - para.jsrq = Convert.ToDateTime(dto.paradata["jsrq"]).ToString("yyyy-MM-dd"); + para.outDate = dto.paradata.ContainsKey("outDate") == true ? dto.paradata["outDate"] : null; + para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; + para.ys = dto.paradata.ContainsKey("ys") == true ? dto.paradata["ys"] : null; + para.regType = dto.paradata.ContainsKey("regType") == true ? dto.paradata["regType"] : null; + para.ghpbId = dto.paradata.ContainsKey("ghpbId") == true ? dto.paradata["ghpbId"] : null; + para.scheduId = dto.paradata.ContainsKey("scheduId") == true ? dto.paradata["scheduId"] : null; + para.FromoutDate = dto.paradata.ContainsKey("FromoutDate") == true ? dto.paradata["FromoutDate"] : null; } - Action ac = (req, resp) => { - if (!string.IsNullOrWhiteSpace(para.BookId)) + var pblx = (int) EnumMzpblx.yy; + var list = _BookingDmnService.GetMzpbSchedule(para.OrgId, para.outDate, para.ks, para.ys, para.regType, para.ghpbId, para.scheduId,null,pblx); + if (list.Count > 0) { - var list = _bookingRegisterDmn.QueryAppRecord(new MzAppointmentRecordReq - { - BookId = para.BookId, - HospitalID = "His" - }); resp.data = list; resp.code = ResponseResultCode.SUCCESS; - if (list == null) - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到预约记录"; - } } else { - var requestModel = new MzAppointmentRecordListReq - { - CardNo = para.kh, - PatName = para.xm, - Dept = para.ks, - DeptName = para.ksmc, - IDCard = para.zjh, - RegType = para.RegType, - ysgh = para.ys, - ksrq = para.ksrq, - jsrq = para.jsrq, - HospitalID = "His" - }; - if (!string.IsNullOrWhiteSpace(para.yyzt)) - { - requestModel.yyzt = Convert.ToInt32(para.yyzt); - } - if (!string.IsNullOrWhiteSpace(para.outDate)) - { - requestModel.OutDate = Convert.ToDateTime(para.outDate); - } - var list = _bookingRegisterDmn.QueryAppRecordList(requestModel); - resp.data = list; - resp.code = ResponseResultCode.SUCCESS; - if (list.Count == 0) - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到预约记录"; - } + resp.code = ResponseResultCode.FAIL; + resp.msg = "未找到相关记录"; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// - /// Y022 门诊预约 + /// Y010 排班号源明细 /// + /// /// - private ResponseBase OutBookApply(BookingReqBase dto) + private HttpResponseMessage GetMzpbScheduleDetail(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = GetBookTerminal(dto.AppId); - para.ghxz = dto.paradata.ContainsKey("ghxz") == true ? dto.paradata["ghxz"] : null; - para.ScheduId = dto.paradata.ContainsKey("ScheduId") == true ? dto.paradata["ScheduId"] : null; - para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - + if (dto.paradata != null) + { + para.scheduId = dto.paradata.ContainsKey("scheduId") == true ? dto.paradata["scheduId"] : null; + } Action ac = (req, resp) => { - - var yyresult = _outBookDmnService.PatBookGh( - new MzAppointmentReq - { - CardNo = para.kh, - ScheduId = Convert.ToInt32(para.ScheduId), - ghxz = para.ghxz, - AppID = dto.AppId - }); - if (yyresult != null) + var list = _BookingDmnService.GetScheduleDetail(para.OrgId, para.scheduId); + if (list.Count > 0) { - resp.data = yyresult; + resp.data = list; resp.code = ResponseResultCode.SUCCESS; - resp.msg = "预约成功"; } else { - resp.data = yyresult; resp.code = ResponseResultCode.FAIL; - resp.msg = "操作异常,系统无返回"; + resp.msg = "未找到相关记录"; } }; - - - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } - /// - /// Y023 取消预约 - /// - /// - /// - private ResponseBase OutBookCancel(BookingReqBase dto) - { - BookingRequestDto para = new BookingRequestDto(); - para.OrgId = dto.OrganizeId; - para.Timestamp = dto.Timestamp; - para.AppId = dto.AppId; - para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - para.BookId = dto.paradata.ContainsKey("BookId") == true ? dto.paradata["BookId"] : null; - para.lxdh = dto.paradata.ContainsKey("lxdh") == true ? dto.paradata["lxdh"] : null; - para.CancelReason = dto.paradata.ContainsKey("CancelReason") == true ? dto.paradata["CancelReason"] : null; - Action ac = (req, resp) => - { - var result = _outBookDmnService.CancalBook(new MzAppointmentRecordReq - { - BookId = para.BookId, - AppID = GetBookTerminal(para.AppId), - Lxdh = para.lxdh, - CardNo = para.kh - }); - resp.data = "BookId:" + para.BookId; - resp.code = result > 0 ? ResponseResultCode.SUCCESS : ResponseResultCode.FAIL; - resp.msg = (result == 2 ? "预约已取消,请勿重复操作" : (result <= 0 ? "操作异常,请重新查询预约状态" : "取消成功")); - }; - return CommonExecute(ac, para); - - } /// - /// Y024 预约挂号/预约签到 + /// Y011 就诊处方信息 /// /// /// - private ResponseBase OutBookPay(BookingReqBase dto) + private HttpResponseMessage GetRecipeInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = dto.AppId; - para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - para.BookId = dto.paradata.ContainsKey("BookId") == true ? dto.paradata["BookId"] : null; - para.PayFee = dto.paradata.ContainsKey("PayFee") == true ? dto.paradata["PayFee"] : null; - para.PayLsh = dto.paradata.ContainsKey("PayLsh") == true ? dto.paradata["PayLsh"] : null; - para.PayWay = dto.paradata.ContainsKey("PayWay") == true ? dto.paradata["PayWay"] : null; - Action ac = (req, resp) => - { - //去挂号 - var data = _bookingRegisterDmn.BookOutpatRegSett(new RegSettReq + var cfnm = ""; + var mzh = ""; + cfnm = dto.paradata.ContainsKey("cfnm") == true ? dto.paradata["cfnm"] : null; + mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null; + Action ac = (req, resp) => { + var recipeList = _BookingDmnService.GetRecipeInfo(para.OrgId, cfnm, mzh); + var list = new List(); + foreach (var obj in recipeList) { - BookID = Convert.ToInt32(req.BookId), - CardNo = req.kh, - PayFee = Convert.ToDecimal(req.PayFee), - PayLsh = req.PayLsh, - PayWay = req.PayWay, - HospitalID = "His", - AppID = GetBookTerminal(req.AppId) - }); - if (data != null && !string.IsNullOrWhiteSpace(data.Mzh)) + obj.cfzt = ((EnumZfzt)(Convert.ToInt32(obj.cfzt))).GetDescription(); + obj.mjzbz= ((EnumJzzt)(Convert.ToInt32(obj.mjzbz))).GetDescription(); + list.Add(obj); + } + if (list != null && list.Count > 0) { resp.code = ResponseResultCode.SUCCESS; - resp.msg = "挂号签到成功"; - resp.data = data; + resp.data = list; + resp.msg = "查询成功"; } else { resp.code = ResponseResultCode.FAIL; - resp.msg = "操作失败,HIS未返回结果,请刷新重试"; + resp.msg = "就诊处方信息不存在"; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } + /// - /// Y025 取消挂号 + /// Y012 门诊处方明细 /// /// /// - private ResponseBase OutBookRegistCancel(BookingReqBase dto) - { - BookingRequestDto para = new BookingRequestDto - { - OrgId = dto.OrganizeId, - Timestamp = dto.Timestamp, - AppId = dto.AppId, - kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null, - mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null - }; + private HttpResponseMessage GetRecipeDrugInfo(BookingReqBase dto) { - Action ac = (req, resp) => - { - var res = _BookingDmnService.OutPatRegCancel(para.OrgId, dto.user, para.mzh, para.kh, para.AppId); - if (res.code == 0) + BookingRequestDto para = new BookingRequestDto(); + para.OrgId = dto.OrganizeId; + para.Timestamp = dto.Timestamp; + var cfmxId = ""; + var cfnm = ""; + cfmxId = dto.paradata.ContainsKey("cfmxId") == true ? dto.paradata["cfmxId"] : null; + cfnm = dto.paradata.ContainsKey("cfnm") == true ? dto.paradata["cfnm"] : null; + Action ac = (req, resp) => { + var recipeDrugList = _BookingDmnService.GetRecipeDrugInfo(para.OrgId, cfmxId, cfnm); + var list = new List(); + foreach (var obj in recipeDrugList) { - resp.code = ResponseResultCode.FAIL; - resp.sub_code = res.sub_code.ToString(); - resp.msg = res.msg; + obj.zfxz = ((EnumZiFuXingZhi)(Convert.ToInt32(obj.zfxz))).GetDescription(); + list.Add(obj); } - else + if (list != null && list.Count > 0) { resp.code = ResponseResultCode.SUCCESS; - resp.msg = res.msg; - resp.data = res.data; + resp.data = list; + resp.msg = "查询成功"; + } + else + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "门诊处方明细信息不存在"; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// - /// Y026 挂号 + /// Y021 预约记录查询 /// /// /// - private ResponseBase CommonRegist(BookingReqBase dto) + private HttpResponseMessage OutBookRecord(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; para.AppId = dto.AppId; + para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - para.ScheduId = dto.paradata.ContainsKey("ScheduId") == true ? int.Parse(dto.paradata["ScheduId"].ToString().Substring(0, dto.paradata["ScheduId"].ToString().IndexOf('.'))).ToString() : null; - - para.ghxz = dto.paradata.ContainsKey("ghxz") == true ? dto.paradata["ghxz"] : null; - para.PayFee = dto.paradata.ContainsKey("PayFee") == true ? dto.paradata["PayFee"] : null; - para.PayLsh = dto.paradata.ContainsKey("PayLsh") == true ? dto.paradata["PayLsh"] : null; - para.PayWay = dto.paradata.ContainsKey("PayWay") == true ? dto.paradata["PayWay"] : null; + para.bookId = dto.paradata.ContainsKey("bookId") == true ? dto.paradata["bookId"] : null; + para.lxdh = dto.paradata.ContainsKey("lxdh") == true ? dto.paradata["lxdh"] : null; + para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; + para.ys = dto.paradata.ContainsKey("ys") == true ? dto.paradata["ys"] : null; + if (dto.paradata.ContainsKey("ksrq") && !string.IsNullOrWhiteSpace(dto.paradata["ksrq"])) + { + para.ksrq = Convert.ToDateTime(dto.paradata["ksrq"]).ToString("yyyy-MM-dd"); + } + if (dto.paradata.ContainsKey("jsrq") && !string.IsNullOrWhiteSpace(dto.paradata["jsrq"])) + { + para.jsrq = Convert.ToDateTime(dto.paradata["jsrq"]).ToString("yyyy-MM-dd"); + } + + if (dto.paradata.ContainsKey("yyzt") && !string.IsNullOrWhiteSpace(dto.paradata["yyzt"])) + { + para.yyzt = Convert.ToInt32(dto.paradata["yyzt"]); + } Action ac = (req, resp) => { - //去挂号 - var data = _bookingRegisterDmn.OutpatRegSett(new RegSettReq - { - AppID = GetBookTerminal(req.AppId), - HospitalID = "His", - CardNo = req.kh, - ScheduId = Convert.ToDecimal(req.ScheduId), - ghxz = req.ghxz, - PayFee = Convert.ToDecimal(req.PayFee), - PayLsh = req.PayLsh, - PayWay = req.PayWay - }); - if (data != null && !string.IsNullOrWhiteSpace(data.Mzh)) + var list=_BookingDmnService.OutbookRecord(para.OrgId, para.kh,para.xm, para.lxdh, para.bookId, + para.yyzt, para.ksrq, para.jsrq, para.ks, para.ys,para.AppId); + if (list.Count > 0) { + resp.data = list; resp.code = ResponseResultCode.SUCCESS; - resp.msg = "挂号成功"; - resp.data = data; } else { - resp.code = ResponseResultCode.FAIL; - resp.msg = "挂号失败,HIS未返回挂号结果,请刷新重试"; + resp.msg = "未找到预约记录"; } }; - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } /// - /// Y027 门诊挂号查询 + /// 门诊预约 /// - /// /// - private ResponseBase OutpatRegRecord(BookingReqBase dto, bool todayonly = true) + private HttpResponseMessage OutBookApply(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = GetBookTerminal(dto.AppId); + para.AppId = dto.AppId; + para.ghxz = dto.paradata.ContainsKey("ghxz") == true ? dto.paradata["ghxz"] : null; + para.scheduId = dto.paradata.ContainsKey("scheduId") == true ? dto.paradata["scheduId"] : null; para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; - para.mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null; - para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; + para.patid = dto.paradata.ContainsKey("patid") == true ? dto.paradata["patid"] : null; Action ac = (req, resp) => { - //去挂号 - var data = _bookingRegisterDmn.GetPatRegList(req.OrgId, req.AppId, true, req.kh, req.mzh); - if (data.Count > 0) + //患者身份验证 + var pat = _BookingDmnService.GetPatInfo(para.OrgId, para.kh, null, null).FirstOrDefault(); + //排班有效性验证 + if (pat!= null) { - resp.code = ResponseResultCode.SUCCESS; - resp.msg = ""; - resp.data = data; + //仅限预约当天之后的有效预约 + string nowday = DateTime.Now.ToString("yyyy-MM-dd"); + + var pb = _BookingDmnService.GetMzpbSchedule(para.OrgId, null, null, null, null, null, + para.scheduId, nowday,(int)EnumMzpblx.yy).FirstOrDefault(); + if (pb!=null) + { + DateTime pbOutdate = Convert.ToDateTime(pb.OutDate); + var pbety = _MzghbookRepo.FindEntity(p => + p.OrganizeId == para.OrgId && p.yyzt != ((int) EnumMzyyzt.cancel).ToString() && + p.zt == "1" && p.kh == para.kh && p.ScheduId.ToString() == para.scheduId); + var kspbety = _MzghbookRepo.FindEntity(p => + p.OrganizeId == para.OrgId && p.yyzt != ((int) EnumMzyyzt.cancel).ToString() && + p.zt == "1" && p.kh == para.kh && p.ks == pb.czks && p.OutDate == pbOutdate); + if (pbety != null) + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "同一号源不可重复预约"; + } + else if (kspbety!=null) + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "同一科室当天不可重复预约"; + } + else + { + var bookid= _BookingDmnService.OutbookingApply(para, pat,pb).ToString(); + var bookety = bookid == null + ? null + : _BookingDmnService.OutbookRecord(para.OrgId, null, null,null, bookid, + (int) EnumMzyyzt.book, null, null, null, null,para.AppId); + if (bookety != null) + { + resp.data = bookety; + resp.code = ResponseResultCode.SUCCESS; + resp.msg = "预约成功"; + } + else + { + resp.code = ResponseResultCode.FAIL; + if (bookid == "-100") + { + resp.msg = "该排班已无可约号源"; + } + else if (bookid == "-200") + { + resp.msg = "无法获取号源信息,请重试"; + } + else if (bookid == "-300") + { + resp.msg = "关键信息不可为空"; + } + else + { + resp.msg = "预约失败"; + } + + } + } + } + else + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "当前排班不可约"; + } } else { - resp.code = ResponseResultCode.FAIL; - resp.msg = "未能查询到有效挂号信息"; + resp.msg = "未找到卡信息"; } + + }; - return CommonExecute(ac, para); + + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); + } /// - /// Y028 门诊待支付处方 + /// 取消预约 /// /// /// - private ResponseBase PresUnpayQuery(BookingReqBase dto) + private HttpResponseMessage OutBookCancel(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = GetBookTerminal(dto.AppId); - para.mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null; + para.AppId = dto.AppId; para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; + para.bookId = dto.paradata.ContainsKey("bookId") == true ? dto.paradata["bookId"] : null; + para.lxdh = dto.paradata.ContainsKey("lxdh") == true ? dto.paradata["lxdh"] : null; Action ac = (req, resp) => { - //查询门诊挂号信息 - var patInfo = _bookingRegisterDmn.getPatInfo(para.mzh, para.OrgId); - if (patInfo == null || patInfo.kh != para.kh) - { - resp.code = ResponseResultCode.FAIL; - resp.msg = "卡信息异常"; - } - else + //校验预约信息是否一致、预约状态 + var record = _MzghbookRepo.FindEntity(p => + p.BookId.ToString() == para.bookId && p.OrganizeId == para.OrgId && p.zt == "1"); + if (record != null) { - //去挂号 - var res = _bookingRegisterDmn.PresUnpayQuery(para.mzh, para.AppId, para.OrgId); - if (res == null || res.Count == 0) + if (record.kh == para.kh) { - resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到相关收费信息"; + if (record.yyzt == ((int) EnumMzyyzt.book).ToString()) + { + record.yyzt = ((int) EnumMzyyzt.cancel).ToString(); + record.CancelReason = para.AppId + ";" + para.lxdh; + record.CancelTime=DateTime.Now; + record.LastModifyTime=DateTime.Now; + var up=_MzghbookRepo.Update(record); + if (up > 0) + { + resp.code = ResponseResultCode.SUCCESS; + resp.msg = "取消预约成功"; + resp.data = new {BookId = record.BookId}; + } + else + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "取消预约失败,当前预约状态不可取消"; + } + } + else + { + resp.code = ResponseResultCode.FAIL; + resp.msg = "取消预约失败,当前预约状态不可取消"; + } } else { - resp.code = ResponseResultCode.SUCCESS; - resp.msg = ""; - resp.data = res; + resp.code = ResponseResultCode.FAIL; + resp.msg = "操作失败,卡信息异常"; } } }; - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } - /// - /// Y029 门诊待支付处方明细 - /// - /// - /// - private ResponseBase PresDetailQuery(BookingReqBase dto) + private HttpResponseMessage OutBookPay(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.AppId = GetBookTerminal(dto.AppId); - para.mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null; - para.PresId = dto.paradata.ContainsKey("PresId") == true ? dto.paradata["PresId"] : null; + para.AppId = dto.AppId; + para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; + para.bookId = dto.paradata.ContainsKey("bookId") == true ? dto.paradata["bookId"] : null; + //para.lxdh = dto.paradata.ContainsKey("lxdh") == true ? dto.paradata["lxdh"] : null; + para.PayFee= dto.paradata.ContainsKey("PayFee") == true ? dto.paradata["PayFee"] : null; + para.PayLsh = dto.paradata.ContainsKey("PayLsh") == true ? dto.paradata["PayLsh"] : null; Action ac = (req, resp) => { //去挂号 - var res = _bookingRegisterDmn.PresDetailQuery(para.mzh,para.PresId, para.AppId, para.OrgId); - if (res == null || res.Count == 0) + var res = _BookingDmnService.OutpatRegApply(para.bookId, para.kh, para.OrgId, para.PayFee, para.PayLsh,dto.user); + if (res.code == 0) { resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到相关收费信息"; + resp.msg = res.msg; } else { resp.code = ResponseResultCode.SUCCESS; - resp.msg = ""; - resp.data = res; + resp.msg = res.msg; + resp.data = res.data; } }; - return CommonExecute(ac, para); - + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } + private HttpResponseMessage OutBookRegistCancel(BookingReqBase dto) + { + BookingRequestDto para = new BookingRequestDto + { + OrgId = dto.OrganizeId, + Timestamp = dto.Timestamp, + AppId = dto.AppId, + kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null, + mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null + }; - #region 新排班 - /// - /// Y009 - /// - /// - /// - private ResponseBase GetSchedule(BookingReqBase dto) + Action ac = (req, resp) => + { + var res = _BookingDmnService.OutPatRegCancel(para.OrgId, dto.user, para.mzh, para.kh, para.AppId); + if (res.code == 0) + { + resp.code = ResponseResultCode.FAIL; + resp.sub_code = res.sub_code.ToString(); + resp.msg = res.msg; + } + else + { + resp.code = ResponseResultCode.SUCCESS; + resp.msg = res.msg; + resp.data = res.data; + } + }; + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); + } + + private HttpResponseMessage CommonRegist(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; + para.AppId = dto.AppId; + para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; + //para.ghrq = dto.paradata.ContainsKey("ghrq") == true ? dto.paradata["ghrq"] : null; + para.ghrq = DateTime.Now.ToString("yyyy-MM-dd"); para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; - para.ScheduId = dto.paradata.ContainsKey("ScheduId") == true ? dto.paradata["ScheduId"] : null; - para.ys = dto.paradata.ContainsKey("ys") == true ? dto.paradata["ys"] : null; - para.ksrq = dto.paradata.ContainsKey("ksrq") == true ? dto.paradata["ksrq"] : null; - para.jsrq = dto.paradata.ContainsKey("jsrq") == true ? dto.paradata["jsrq"] : null; - para.RegType = dto.paradata.ContainsKey("RegType") == true ? dto.paradata["RegType"] : null; - para.IsBook = dto.paradata.ContainsKey("IsBook") == true ? dto.paradata["IsBook"] : "1"; + para.ghxz = dto.paradata.ContainsKey("ghxz") == true ? dto.paradata["ghxz"] : null; + para.ghlybz = dto.paradata.ContainsKey("ghlybz") == true ? dto.paradata["ghlybz"] : null; + - //var doclist = _outBookDmnService.getStaffListByKs(para.ks, para.OrgId); Action ac = (req, resp) => { - var res = _outBookScheduleRepo.GetPagintionListTime(para.OrgId, para.ksrq, para.jsrq, para.ys, "", para.ScheduId, para.ks, para.ScheduId, para.IsBook); ; - if (res == null || res.Count == 0) + //去挂号 + var res = _BookingDmnService.OutpatReg(para.kh, para.OrgId, para.ghrq, para.ghxz, para.ks, dto.user, para.AppId, para.ghlybz); + if (res.code == 0) { resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到相关排班信息"; + resp.msg = res.msg; } else { resp.code = ResponseResultCode.SUCCESS; - resp.msg = ""; - resp.data = res; + resp.msg = res.msg; + resp.data = res.data; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } - /// - /// Y009 分页获取排班 - /// - /// - /// - private ResponseBase GetScheduleWithPage(BookingReqBase dto) + + private HttpResponseMessage OutpatChargeInfo(BookingReqBase dto) { BookingRequestDto para = new BookingRequestDto(); para.OrgId = dto.OrganizeId; para.Timestamp = dto.Timestamp; - para.ks = dto.paradata.ContainsKey("ks") == true ? dto.paradata["ks"] : null; - para.ScheduId = dto.paradata.ContainsKey("ScheduId") == true ? dto.paradata["ScheduId"] : null; - para.ys = dto.paradata.ContainsKey("ys") == true ? dto.paradata["ys"] : null; - para.ksrq = dto.paradata.ContainsKey("ksrq") == true ? dto.paradata["ksrq"] : null; - para.jsrq = dto.paradata.ContainsKey("jsrq") == true ? dto.paradata["jsrq"] : null; - para.RegType = dto.paradata.ContainsKey("RegType") == true ? dto.paradata["RegType"] : null; - para.IsBook = dto.paradata.ContainsKey("IsBook") == true ? dto.paradata["IsBook"] : null; - var pagination = dto.paradata.ContainsKey("pagination") == true && !string.IsNullOrWhiteSpace(dto.paradata["pagination"]) ? JsonConvert.DeserializeObject(dto.paradata["pagination"]) : new Pagination - { - page = 1, - rows = 20, - sidx = "outdate" - }; - pagination.sidx = string.IsNullOrWhiteSpace(pagination.sidx) ? "outdate" : pagination.sidx; - //var doclist = _outBookDmnService.getStaffListByKs(para.ks, para.OrgId); + para.AppId = dto.AppId; + para.kh = dto.paradata.ContainsKey("kh") == true ? dto.paradata["kh"] : null; + para.mzh = dto.paradata.ContainsKey("mzh") == true ? dto.paradata["mzh"] : null; + para.xm = dto.paradata.ContainsKey("xm") == true ? dto.paradata["xm"] : null; + Action ac = (req, resp) => { - Pagination paging = new Pagination(); - var res = _outBookScheduleRepo.GetPagintionListTime(pagination, para.OrgId, para.ksrq, para.jsrq, para.ys, "", para.ScheduId, para.ks, para.RegType, para.IsBook, out paging); ; - if (res == null || res.Count == 0) + //去挂号 + var res = _BookingDmnService.OutpatChargeInfo(para.OrgId, para.kh, para.mzh,para.AppId); + if (res==null || res.Count==0) { resp.code = ResponseResultCode.FAIL; - resp.msg = "未找到相关排班信息"; + resp.msg = "未找到相关收费信息"; } else { resp.code = ResponseResultCode.SUCCESS; resp.msg = ""; - resp.sub_msg = paging.ToJson(); resp.data = res; } }; - return CommonExecute(ac, para); + var response = base.CommonExecute(ac, para); + return base.CreateResponse(response); } - #endregion - - //#region privare method - ///// - ///// 获取预约来源 - ///// - ///// - ///// - //private string GetBookTerminal(string AppID) - //{ - // if (AppID.Contains("SelfTerminal")) - // { - // return EnumMzghly.SelfTerminal.ToString(); - // } - // return EnumMzghly.His.ToString(); - //} - //#endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/BookingRegisterController.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/BookingRegisterController.cs index 5713f5f2..f7273d4b 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/BookingRegisterController.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/BookingRegisterController.cs @@ -306,7 +306,7 @@ public HttpResponseMessage OutpatRegSett(RegSettReq req) } else { - var list = _BookingRegisterDmnService.BookOutpatRegSett(req); + var list = _BookingRegisterDmnService.OutpatRegSett(req); resp.data = list; resp.code = ResponseResultCode.SUCCESS; if (list == null) @@ -650,9 +650,9 @@ public HttpResponseMessage QueryCostOrderDetail(CostOrderDetailReq req) } catch (Exception ex) { - if (!string.IsNullOrEmpty(((FailedException)ex).Msg)) + if (!string.IsNullOrEmpty(((Newtouch.Core.Common.Exceptions.FailedException)ex).Msg)) { - resp.msg = ((FailedException)ex).Msg; + resp.msg = ((Newtouch.Core.Common.Exceptions.FailedException)ex).Msg; } else { @@ -866,8 +866,8 @@ public HttpResponseMessage OutSett(SettReq req) } } } - //异步推送处方收费成功的通知给药房药库 - notifyPDS(jsnmList[0], DateTime.Now, cfnmlist, patInfo.fph, orgId, req.AppID); + //异步推送处方收费成功的通知给药房药库(取消mq的用法) + //notifyPDS(jsnmList[0], DateTime.Now, cfnmlist, patInfo.fph, orgId, req.AppID); resp.data = new SettResp() { RegId = jsnmList[0].ToString(), xjzf = req.TotalAmount, ybzf = 0.00.ToDecimal(), grzf = req.TotalAmount }; resp.msg = ""; resp.code = ResponseResultCode.SUCCESS; diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PatientController.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PatientController.cs index ef83b019..834e63dd 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PatientController.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PatientController.cs @@ -56,7 +56,6 @@ public HttpResponseMessage OutPatientRegistrationQuery(OutPatientRegistrationQue , par.mjzbz , par.jiuzhenbz , par.keyword - , par.zzhz , par.pagination); //这是分页查询 diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PrescriptionController.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PrescriptionController.cs index 5d447d00..5cb6ff44 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PrescriptionController.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/PrescriptionController.cs @@ -263,7 +263,7 @@ private IList convert(IList convert(IList /// /// - private IList convert(IList dtoList, string cflxmc) + private IList convert(IList dtoList) { if (dtoList == null) { @@ -300,19 +300,18 @@ private IList convert(IList d dw = p.dw, dj = -1, //CIS医生没有定价的权限 -1后面会更新为字典价格 zzfbz = p.zzfbz, - ztId = p.ztId, - ztmc = p.ztmc, - ztsl = p.ztsl + ztId=p.ztId, + ztmc=p.ztmc, + ztsl=p.ztsl }; if (string.IsNullOrWhiteSpace(newEntity.sfxm)) { throw new ArgumentsRequiredException("sfxm"); } - newEntity.sl = newEntity.sl < 0 ? 0 : newEntity.sl; //后面 根据‘单位计量数’计算 - if (newEntity.sl <= 0 && cflxmc.Contains("康复")) + if (newEntity.sl <= 0) { //throw new ArgumentsRequiredException("sl"); - + newEntity.sl = 0; //后面 根据‘单位计量数’计算 if ((newEntity.dczll ?? 0) <= 0) { throw new ArgumentsRequiredException("dczll"); @@ -352,7 +351,6 @@ private void add(IList prs, string mzh, string ys var cf = new FeeItemsGroupedBO(); cf.xmWithCf = true; cf.cflx = pr.cflx; - cf.cflxxf = pr.cflxxf; cf.cflxmc = pr.cflxmc; cf.cfh = pr.cfh; cf.lyyf = pr.lyyf; @@ -360,8 +358,8 @@ private void add(IList prs, string mzh, string ys cf.djbz = pr.djbz == true ? 1 : 0; cf.ypList = convert(pr.AddMedicineItems); cf.ztInvalidYpList = convert(pr.DeleteMedicineItems); - cf.xmList = convert(pr.AddTreamentItems, pr.cflxmc); - cf.ztInvalidXmList = convert(pr.DeleteTreamentItems, pr.cflxmc); + cf.xmList = convert(pr.AddTreamentItems); + cf.ztInvalidXmList = convert(pr.DeleteTreamentItems); cfs.Add(cf); } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/SelfServiceController.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/SelfServiceController.cs index 4b80e500..95e02161 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/SelfServiceController.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/SelfServiceController.cs @@ -1,22 +1,30 @@ using Autofac; using Newtouch.HIS.API.Common; +using Newtouch.HIS.API.Common.Attributes; +using Newtouch.HIS.Application.Interface; using Newtouch.HIS.Domain.DTO; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IDomainServices.OutpatientManage; using Newtouch.HIS.Domain.IRepository; using Newtouch.HIS.Domain.IRepository.OutpatientManage; +using Newtouch.HIS.Domain.ValueObjects.OutpatientManage; using Newtouch.HIS.Sett.Request.SelfService; +using Newtouch.Infrastructure; +using Newtouch.Tools; using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; using System.Net.Http; using System.Web.Http; namespace Newtouch.HIS.Sett.API.Controllers { - /// - /// 自助机相关(弃用) - /// - [RoutePrefix("api/SelfService")] + /// + /// 自助机相关 + /// + [RoutePrefix("api/SelfService")] public class SelfServiceController : ApiControllerBase { //private readonly IOutpatientRegApp _outpatientRegApp; @@ -75,7 +83,7 @@ public HttpResponseMessage OutpatientRegistration(OutpatientRegistrationReqDTO o } //保存 _outPatientSettleDmnService.Save(oData.OrganizeId, cardEntity.patid, oData.kh, "0", oData.mjzbz, - oData.ks, "", oData.ksmc, "", entity.ghlx, entity.zlxm, null, null, false, false, (int)qzjzxh.Value, entity.ghpbId, feeRelated, oData.brxz, null, qzmzh, "0", null,null,null,null,null, out newJszbInfo); + oData.ks, "", oData.ksmc, "", entity.ghlx, entity.zlxm, null, null, false, false, (int)qzjzxh.Value, entity.ghpbId, feeRelated, oData.brxz, null, qzmzh, "0", null,null,null,null,null,null, out newJszbInfo); resp.data = new { mzh = qzmzh }; resp.msg = ""; resp.code = ResponseResultCode.SUCCESS; @@ -92,7 +100,7 @@ public HttpResponseMessage OutpatientRegistration(OutpatientRegistrationReqDTO o return base.CreateResponse(resp); } /// - /// 获取科室排班(弃用) + /// 获取科室排班 /// /// /// @@ -110,19 +118,19 @@ public HttpResponseMessage queryRegistDeptMark(queryRegistDeptMarkReqDTO req) } else { - //DateTime pbrq = DateTime.Parse(req.VisitDate); - //var pbList= _outPatientDmnService.GetZzjRegScheduleList(pbrq, req.OrganizeId); - //if (pbList==null || pbList.Count<1) - //{ - // resp.msg = "日期:"+ pbrq.ToString()+"暂无排班!"; - // resp.code = ResponseResultCode.FAIL; - //} - //else - //{ - // resp.data = pbList; - // resp.msg = ""; - // resp.code = ResponseResultCode.SUCCESS; - //} + DateTime pbrq = DateTime.Parse(req.VisitDate); + var pbList= _outPatientDmnService.GetZzjRegScheduleList(pbrq, req.OrganizeId); + if (pbList==null || pbList.Count<1) + { + resp.msg = "日期:"+ pbrq.ToString()+"暂无排班!"; + resp.code = ResponseResultCode.FAIL; + } + else + { + resp.data = pbList; + resp.msg = ""; + resp.code = ResponseResultCode.SUCCESS; + } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/UAControllor.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/UAControllor.cs index 39b48db6..894d91bf 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/UAControllor.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Controllers/UAControllor.cs @@ -10,7 +10,6 @@ using System.Net.Http; using System.Web.Http; using Newtouch.HIS.API.Common.Filter; -using Newtouch.Core.Common.Utils; namespace Newtouch.HIS.Base.HOSP.API.Controllers { @@ -132,7 +131,6 @@ public HttpResponseMessage OutPatientRegistrationQueryPre(string organizeId) , null , null , null - , null , pagination); return CreateResponse(""); diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Newtouch.HIS.Sett.API.csproj b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Newtouch.HIS.Sett.API.csproj index 3c4289d3..f2af1976 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Newtouch.HIS.Sett.API.csproj +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Newtouch.HIS.Sett.API.csproj @@ -1,6 +1,5 @@  - @@ -16,7 +15,7 @@ Properties Newtouch.HIS.Sett.API Newtouch.HIS.Sett.API - v4.6 + v4.6.2 true @@ -26,8 +25,6 @@ - LaunchBrowser - http://{ServiceIPAddress} @@ -83,17 +80,12 @@ False ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Repository.dll - - False - ..\..\his-dll-common\FrameworkBase\FrameworkBase.MultiOrg.Web.dll - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll True - - False + ..\..\his-dll-common\dlls\MsgPack.dll @@ -125,21 +117,18 @@ False - ..\..\his-dll-common\dlls\Newtouch.Tools.dll + ..\..\his-dll-common\hiscommondlls\Newtouch.Tools.dll ..\..\his-dll-common\dlls\NLog.Client.dll - - False + ..\..\his-dll-common\dlls\StackExchange.Redis.dll - - False + ..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.Core.dll - - False + ..\..\his-dll-common\dlls\StackExchange.Redis.Extensions.MsgPack.dll @@ -184,14 +173,8 @@ Designer - - Designer - - - - Dockerfile - - + + Web.config @@ -216,9 +199,7 @@ - - @@ -274,11 +255,11 @@ - False + True True 17361 / - http://localhost:17361/ + http://localhost:7002/ False False @@ -294,10 +275,7 @@ - - - - true - false - true + True + False + True Release Any CPU FileSystem - D:\发布地址\开源\SettAPI + D:\Pulish\HisApi FileSystem <_TargetId>Folder diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Properties/PublishProfiles/PublishProfile.pubxml b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Properties/PublishProfiles/PublishProfile.pubxml new file mode 100644 index 00000000..ed6ed5fa --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Properties/PublishProfiles/PublishProfile.pubxml @@ -0,0 +1,18 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + ..\..\publish\SettAPI + FileSystem + <_TargetId>Folder + + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Web.config b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Web.config index b6657a68..49a66187 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Web.config +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/Web.config @@ -15,13 +15,12 @@ 可在 标记上设置以下特性。 - + --> - - - + + diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/packages.config b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/packages.config index 793e7f40..c46c91e4 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/packages.config +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.API/packages.config @@ -10,6 +10,5 @@ - \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/BookingRequestDto.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/BookingRequestDto.cs index 75d1008b..9edb82f3 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/BookingRequestDto.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/BookingRequestDto.cs @@ -1,5 +1,9 @@ using System; -using Newtouch.Core.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; using Newtouch.HIS.API.Common; namespace Newtouch.HIS.Sett.Request @@ -43,11 +47,10 @@ public class BookingRequestDto: RequestBase /// public string FromoutDate { get; set; } public string ys { get; set; } - public string ysxm { get; set; } /// - /// 门诊类型 普通专家副高等 mjzbz + /// 门诊类型 普通专家副高等 /// - public string RegType { get; set; } + public string regType { get; set; } /// /// mz_ghpb_config 排班id /// @@ -55,7 +58,7 @@ public class BookingRequestDto: RequestBase /// /// mz_ghpb_schedule 预约既定日程Id /// - public string ScheduId { get; set; } + public string scheduId { get; set; } /// /// 挂号性质 自费医保等 brxz 等同 /// @@ -63,11 +66,11 @@ public class BookingRequestDto: RequestBase /// /// 预约号 /// - public string BookId { get; set; } + public string bookId { get; set; } /// /// 门诊预约状态 /// - public string yyzt { get; set; } + public int? yyzt { get; set; } /// /// 已支付费用 /// @@ -77,10 +80,6 @@ public class BookingRequestDto: RequestBase /// public string PayLsh { get; set; } /// - /// 支付方式 xjzffs - /// - public string PayWay { get; set; } - /// /// 联系方式 /// public string lxdh { get; set; } @@ -101,29 +100,5 @@ public class BookingRequestDto: RequestBase /// 体检用 /// public string ghlybz { get; set; } - /// - /// 是否网络可约 0 不可约 - /// - public string IsBook { get; set; } - /// - /// 预约取消原因 - /// - public string CancelReason { get; set; } - /// - /// 处方Id - /// - public string PresId { get; set; } - /// - /// 处方Id 集合 - /// - public string[] PresIds { get; set; } - /// - /// 分页信息 - /// - public Pagination pagination { get; set; } - //public int page { get; set; } - //public int records { get; set; } - //public string sidx { get; set; } - //public string sord { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentRecordReq.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentRecordReq.cs index 5c538bb0..fcd95b5f 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentRecordReq.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentRecordReq.cs @@ -1,5 +1,9 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Sett.Request.Booking.Request { @@ -8,11 +12,7 @@ public class MzAppointmentRecordReq: BookingReqBaseDto [Required(AllowEmptyStrings = false, ErrorMessage = "BookId is required")] public string BookId { get; set; } public string Lxdh { get; set; } - public string CardNo { get; set; } - /// - /// 预约取消原因 - /// - public string CancelReason { get; set; } + } public class MzAppointmentRecordListReq : BookingReqBaseDto @@ -23,25 +23,5 @@ public class MzAppointmentRecordListReq : BookingReqBaseDto public DateTime? OutDate { get; set; } public string Dept { get; set; } public string DeptName { get; set; } - /// - /// 患者姓名 - /// - public string PatName { get; set; } - /// - /// 医生工号 - /// - public string ysgh { get; set; } - /// - /// 开始日期 - /// - public string ksrq { get; set; } - /// - /// 结束日期 - /// - public string jsrq { get; set; } - /// - /// 预约状态 - /// - public int? yyzt { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentReq.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentReq.cs index d45a350d..fdefab71 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentReq.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/MzAppointmentReq.cs @@ -1,5 +1,9 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Sett.Request.Booking.Request { @@ -11,7 +15,9 @@ public class MzAppointmentReq : BookingReqBaseDto public string CardNo { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "ghxz is required")] public string ghxz { get; set; } + [Required(AllowEmptyStrings = false, ErrorMessage = "OutDate is required")] public DateTime OutDate { get; set; } + [Required(AllowEmptyStrings = false, ErrorMessage = "IsBooking is required")] public string IsBooking { get; set; } } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/RegSettReq.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/RegSettReq.cs index 3255ab22..df6284f0 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/RegSettReq.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Request/RegSettReq.cs @@ -1,26 +1,25 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Sett.Request.Booking.Request { public class RegSettReq: BookingReqBaseDto { - public int? BookID { get; set; } - public decimal? ScheduId { get; set; } - public string ghxz { get; set; } + [Required(AllowEmptyStrings = false, ErrorMessage = "BookingID is required")] + public int BookID { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "CardNo is required")] public string CardNo { get; set; } + [Required(AllowEmptyStrings = false, ErrorMessage = "PayLsh is required")] public string PayLsh { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "PayFee is required")] public decimal? PayFee { get; set; } [Required(AllowEmptyStrings = false, ErrorMessage = "PayTime is required")] public DateTime PayTime { get; set; } - /// - /// 支付方式 - /// - public string PayWay { get; set; } + [Required(AllowEmptyStrings = false, ErrorMessage = "IsBooking is required")] public string IsBooking { get; set; } } - - } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/CardInfoResp.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/CardInfoResp.cs index 7deaecce..d16c6f59 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/CardInfoResp.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/CardInfoResp.cs @@ -1,4 +1,8 @@ using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Sett.Request.Booking.Response { @@ -43,46 +47,4 @@ public class CardInfoResp public string PatTypeName { get; set; } public string Zjh { get; set; } } - - public class PatCardInfoResp - { - /// - /// 患者ID - /// - public int patid { get; set; } - /// - /// 患者姓名 - /// - public string xm { get; set; } - /// - /// 性别 - /// - public string xb { get; set; } - /// - /// 出生日期 - /// - public DateTime csrq { get; set; } - /// - /// 卡号 - /// - public string kh { get; set; } - - /// - /// 卡类型0自费卡,1医保卡 - /// - public string klx { get; set; } - /// - /// 卡类型名称 - /// - public string klxmc { get; set; } - /// - /// 病人性质 - /// - public string brxz { get; set; } - /// - /// 病人性质名称 - /// - public string brxzmc { get; set; } - public string zjh { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzAppointmentRecordResp.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzAppointmentRecordResp.cs index 0d5d032c..0773935c 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzAppointmentRecordResp.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzAppointmentRecordResp.cs @@ -1,4 +1,8 @@ using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Newtouch.HIS.Sett.Request.Booking.Response { @@ -14,8 +18,6 @@ public class MzAppointmentRecordListResp public DateTime OutDate { get; set; } public DateTime CreateTime { get; set; } public decimal? RegFee { get; set; } - public string DoctorName { get; set; } - public string Content { get; set; } } public class MzAppointmentRecordResp @@ -144,10 +146,6 @@ public class MzAppointmentRecordResp /// /// public string Mzh { get; set; } - /// - /// 预约内容 - /// - public string Content { get; set; } /// /// ghrq diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzpbScheduleResp.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzpbScheduleResp.cs index c7058e1e..9adc7c93 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzpbScheduleResp.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/MzpbScheduleResp.cs @@ -68,10 +68,5 @@ public class MzpbScheduleResponse /// 剩余号源 /// public int? BookNum { get; set; } - /// - /// 是否可约 - /// - public string IsBook { get; set; } - } } diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/RegSettResp.cs b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/RegSettResp.cs index f4fa3892..c0763d72 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/RegSettResp.cs +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Booking/Response/RegSettResp.cs @@ -1,4 +1,10 @@ -namespace Newtouch.HIS.Sett.Request.Booking.Response +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Newtouch.HIS.Sett.Request.Booking.Response { public class RegSettResp { diff --git a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Newtouch.HIS.Sett.Request.csproj b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Newtouch.HIS.Sett.Request.csproj index 383c4d7b..08f0965e 100644 --- a/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Newtouch.HIS.Sett.Request.csproj +++ b/Newtouch.HIS.Sett/Newtouch.HIS.Sett.Request/Newtouch.HIS.Sett.Request.csproj @@ -9,7 +9,7 @@ Properties Newtouch.HIS.Sett.Request Newtouch.HIS.Sett.Request - v4.6 + v4.6.2 512 @@ -66,7 +66,6 @@ - @@ -84,8 +83,6 @@ - - @@ -107,12 +104,10 @@ - - @@ -153,7 +148,6 @@ Newtouch.Infrastructure - + + + + + + + + + - \ No newline at end of file + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Controllers/DaySettleController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Controllers/DaySettleController.cs index 4a241efa..1fd545a9 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Controllers/DaySettleController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Controllers/DaySettleController.cs @@ -1,5 +1,6 @@ using Newtouch.Core.Common; using Newtouch.HIS.Domain.IDomainServices; +using Newtouch.HIS.Domain.ValueObjects.DaySettleManage; using Newtouch.Tools; using System; using System.Collections.Generic; @@ -174,11 +175,20 @@ public ActionResult Getinsutype() /// 开始日期 /// 结束日期 /// - public ActionResult GetQszdd(string ksrq, string jsrq) + public ActionResult GetQszdd(string ksrq, string jsrq,string qslx,string xz) { - var list = _DaySettleDmnService.GetQsdzzs(this.OrganizeId, ksrq, jsrq); + var list = _DaySettleDmnService.GetQsdzzs(this.OrganizeId, ksrq, jsrq, qslx, xz); return Content(list.ToJson()); } + + public ActionResult inserqssq(ybqssq ybqssq) + { + string jsonstr = Newtonsoft.Json.JsonConvert.SerializeObject(ybqssq); + System.Xml.XmlDocument xmlstr = (System.Xml.XmlDocument)Newtonsoft.Json.JsonConvert.DeserializeXmlNode(jsonstr, "root"); + var list = _DaySettleDmnService.inserqssq(xmlstr, this.OrganizeId); + return Content(list.ToJson()); + } + /// /// 获取清算明细(上半部分) /// @@ -237,8 +247,19 @@ public ActionResult DzrForm() { return View(); } - - public ActionResult lsdzList(string ksrq, string jsrq) + public ActionResult DzrCheck() + { + return View(); + } + /// + /// 历史对账记录 + /// + /// + public ActionResult DzrHistory() + { + return View(); + } + public ActionResult lsdzList(string ksrq, string jsrq) { var list = _DaySettleDmnService.lsdzList(this.OrganizeId, ksrq, jsrq); return Content(list.ToJson()); @@ -249,6 +270,16 @@ public ActionResult Newdzfysj(string rq) var list = _DaySettleDmnService.Newdzfysj(this.OrganizeId, rq); return Content(list.ToJson()); } - - } + /// + /// 获取本地对账数据明细 + /// + /// + /// + /// + public ActionResult GetHistoryCheckList(string ksrq, string jsrq) + { + var list = _DaySettleDmnService.GetHistoryCheckList(this.OrganizeId, ksrq, jsrq); + return Content(list.ToJson()); + } + } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationDetailed.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationDetailed.cshtml index 4beb658f..1c2abc81 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationDetailed.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationDetailed.cshtml @@ -4,14 +4,18 @@ Layout = "~/Views/Shared/_Index.cshtml"; var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); } - +
      @@ -19,13 +23,13 @@ - + @* - *@ +
      结算日期: - + 险种类型:险种类型: - - - + + +
      @@ -53,7 +57,7 @@ initLayout("MyTabGrid"); }); getclrtypeList(); - getinsutypeList(); + //getinsutypeList(); //结算主记录 gridJSListData(); gridJSListData1(); @@ -95,31 +99,34 @@ } }); } - + function gridJSListData() { var gridSort = 'CreateTime asc'; var $gridJsList = $("#gridJSList"); $gridJsList.dataGrid({ //postData: getSearchPostData(), height: 300, + caption: "结算笔数:0", url: "", colModel: [ - { label: '个人编码', name: 'grbm', width: 100, align: 'left' }, - { label: '就诊ID', name: 'jzid', width: 100, align: 'left' }, - { label: '结算ID', name: 'jsid', width: 100, align: 'left' }, - { label: '姓名', name: 'xm', width: 100, align: 'left' }, + { label: '个人编码', name: 'grbm', width: 180, align: 'left' }, + { label: '就诊ID', name: 'jzid', width: 140, align: 'left' }, + { label: '结算ID', name: 'jsid', width: 140, align: 'left' }, + { label: '姓名', name: 'xm', width: 80, align: 'left' }, { - label: '医保结算日期', name: 'ybjsrq', width: 100, align: 'left', + label: '医保结算日期', name: 'ybjsrq', width: 130, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } }, - { label: '总费用', name: 'zfy', width: 100, align: 'left' }, - { label: '基金支付金额', name: 'jjzfje', width: 100, align: 'left' }, - { label: '共济支付金额', name: 'gjje', width: 100, align: 'left' }, - { label: '是否退费', name: 'sftf', width: 100, align: 'left' }, + { label: '总费用', name: 'zfy', width: 80, align: 'left' }, + { label: '基金支付金额', name: 'jjzfje', width: 80, align: 'left' }, + { label: '个人账户金额', name: 'acct_pay', width: 80, align: 'left' }, + { label: '现金支付金额', name: 'psn_cash_pay', width: 80, align: 'left' }, + { label: '共济支付金额', name: 'gjje', width: 80, align: 'left' }, + { label: '是否退费', name: 'sftf', width: 80, align: 'left' }, { label: '报销类型', name: 'bxlx', width: 100, align: 'left' }, - { label: '身份证', name: 'sfz', width: 100, align: 'left' }, - { label: '收据编号', name: 'sjh', width: 100, align: 'left' }, - { label: '清算类别', name: 'qslb', width: 100, align: 'left' }, - { label: '险种', name: 'xz', width: 100, align: 'left' }, + { label: '身份证', name: 'sfz', width: 120, align: 'left' }, + { label: '收据编号', name: 'sjh', width: 80, align: 'left' }, + { label: '清算类别', name: 'qslb', width: 80, align: 'left' }, + { label: '险种', name: 'xz', width: 80, align: 'left' }, ], //pager: "#gridPager", //sortname: gridSort, @@ -129,8 +136,28 @@ //userDataOnFooter: true, loadComplete: function () { - var gridData = $("#gridJSList").jqGrid('getGridParam', 'data'); - + var gridData = $("#gridJSList").jqGrid('getRowData_AllLine'); + var sl = gridData.length; + var zfy = 0.00; + var jjzfje = 0.00; + var grzhje = 0.00; + var xjzfje = 0.00; + if (sl>0) { + $.each(gridData, function () { + zfy += parseFloat(this.zfy); + jjzfje += parseFloat(this.jjzfje); + grzhje += parseFloat(this.acct_pay); + xjzfje += parseFloat(this.psn_cash_pay); + + }); + } + zfy = parseFloat(zfy).toFixed(2); + jjzfje = parseFloat(jjzfje).toFixed(2); + grzhje = parseFloat(grzhje).toFixed(2); + xjzfje = parseFloat(xjzfje).toFixed(2); + var textcaption = "结算笔数:" + sl + "(其中 总费用:" + zfy + " 基金支付金额:" + jjzfje + " 账户支付金额:" + grzhje + " 现金支付金额:" + xjzfje + " )"; + $("#gridJSList").jqGrid("setCaption", textcaption); + //$("#gridJSList").jqGrid('footerData', 'set', { name: "count", count: gridData.length }); }, @@ -145,11 +172,11 @@ } }); - //统计按钮点击事件 + //统计按钮点击事件 $("#btn_search_tj").click(function () { $('#gridJSList').jqGrid("clearGridData");//先清空明细 $gridJsList.jqGrid('setGridParam', { - postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: $("#xzlx").val() }, + postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: '' }, url: '/DaySettleManage/DaySettle/GetQsmx', //page: 1, }).trigger('reloadGrid'); @@ -158,8 +185,8 @@ $("#btn_search_dmx").click(function () { - var ksrq = $("#ksrq").val(); - var jsrq = $("#jsrq").val(); + var ksrq = $("#ksrq").val() +" 00:00:00"; + var jsrq = $("#jsrq").val() +" 23:59:59"; var ts = Date.parse(jsrq) - Date.parse(ksrq)+1; //if (ts >= 11) { // $.modalAlert("间隔时间大于10天,清算明细对账", 'warning'); @@ -169,11 +196,12 @@ var predata = { hisId : "", operatorId : '@(opr.rygh)', - operatorName : '@(opr.UserName)', + operatorName: '@(opr.UserName)', + orgId: '@(opr.OrganizeId)', insuplc_admdvs : "", - stmt_begndate: $("#ksrq").val(), - stmt_enddate: $("#jsrq").val(), - insutype: $("#xzlx").val(), + stmt_begndate: ksrq, + stmt_enddate: jsrq, + insutype: '', clr_type: $("#jslx").val(), setl_optins : "", medfee_sumamt : 0.00, @@ -190,22 +218,30 @@ dataType: "json", async: false, success: function (data) { - refinfo = eval('(' + data + ')'); - //console.log(refinfo); + refinfo = eval('(' + data + ')'); + }, + error: function (request, error, ex) { + $.modalAlert("医保服务【3202】(医保对明细账)不可访问:[" + ex + "]", 'error'); } }); if (refinfo) { - if (refinfo.result && refinfo.result.length>0) { - $('#gridJSList1').jqGrid("clearGridData");//先清空明细 - $('#gridJSList1').jqGrid('setGridParam', { - postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: $("#xzlx").val() }, - url: '/DaySettleManage/DaySettle/GetQsmx_1', - //page: 1, - }).trigger('reloadGrid'); - } + if (refinfo.infcode == "0" || refinfo.infcode == 0) + { + if (refinfo.result && refinfo.result.length > 0) + { + $('#gridJSList1').jqGrid("clearGridData");//先清空明细 + $('#gridJSList1').jqGrid('setGridParam', { + postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: '' }, + url: '/DaySettleManage/DaySettle/GetQsmx_1', + //page: 1, + }).trigger('reloadGrid'); + } + } else { + $.modalAlert("医保对总账失败:" + refinfo.err_msg, 'error'); + } } else { - + $.modalAlert("医保服务【3202】(医保对明细账)未返回信息", 'error'); } }); @@ -236,27 +272,28 @@ userDataOnFooter: true, loadComplete: function () { - var gridData = $("#gridJSList1").jqGrid('getGridParam', 'data'); - - $("#gridJSList1").jqGrid('footerData', 'set', { name: "count", count: gridData.length }); - + //var gridData = $("#gridJSList1").jqGrid('getGridParam', 'data'); }, onSelectRow_page: function (rowid) { // console.log(rowid); }, - gridComplete: function (gridJszbList) { - //jszbList = null; - //if (gridJszbList && gridJszbList.rows) { - // jszbList = gridJszbList.rows; - //} - } + gridComplete: function () { + var ids = $("#gridJSList1").jqGrid('getDataIDs'); + for (i = 0; i < ids.length; i++) { + var rowData = $("#gridJSList1").jqGrid('getRowData', ids[i]); + if (rowData.bz.length >4) { + $('#gridJSList1 tr[id="' + ids[i] + '"]').addClass('red'); + } + + } + }, }); //查询事件 $("#btn_search_tj").click(function () { $('#gridJSList1').jqGrid("clearGridData");//先清空明细 $gridJsList1.jqGrid('setGridParam', { - postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: $("#xzlx").val()}, + postData: { ksrq: $("#ksrq").val(), jsrq: $("#jsrq").val(), jslx: $("#jslx").val(), xzlx: ''}, url: '/DaySettleManage/DaySettle/GetQsmx_1', //page: 1, }).trigger('reloadGrid'); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationIndex.cshtml index 96f9cf13..374ece50 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/ApplicationIndex.cshtml @@ -1,63 +1,63 @@  @{ - ViewBag.Title = "ApplicationIndex"; - Layout = "~/Views/Shared/_Index.cshtml"; - var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + ViewBag.Title = "ApplicationIndex"; + Layout = "~/Views/Shared/_Index.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); } -
      - - - - + + + + + + +
      结算日期: - - - +
      + + + + - - - - - - -
      结算日期: + + + - - 清算类型: - - 险种类型: - - - - -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - - - - - -
      - 对帐结果: - - -
      -
      + +
      清算类型: + + 险种类型: + + + + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + + + + +
      + 对帐结果: + + +
      +
      @@ -119,17 +119,17 @@ colModel: [ { label: '清算类别', name: 'qslbmc', width: 100, align: 'left' }, { label: '清算类别', name: 'qslb', width: 100, hidden: true, align: 'left' }, - { label: '险种', name: 'xzmc', width: 100, align: 'left' }, + { label: '险种', name: 'xzmc', width: 130, align: 'left' }, { label: '险种', name: 'xz', width: 100, hidden: true, align: 'left' }, - { label: '是否异地', name: 'sfyd', width: 100, align: 'left' }, - { label: '开始日期', name: 'ksrq', width: 130, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } }, - { label: '结束日期', name: 'jsrq', width: 130, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } }, - { label: '总费用', name: 'zfy', width: 100, align: 'left' }, - { label: '基金支付金额', name: 'jjzfje', width: 100, align: 'left' }, - { label: '个帐支付', name: 'grzh', width: 100, align: 'left' }, - { label: '现金支付金额', name: 'xjzfje', width: 100, align: 'left' }, - { label: '结算笔数', name: 'jsbs', width: 100, align: 'left' }, - { label: '是否退费', name: 'sftf', width: 100, align: 'left' }, + { label: '是否异地', name: 'sfyd', width: 60, align: 'left' }, + { label: '开始日期', name: 'ksrq', width: 120, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } }, + { label: '结束日期', name: 'jsrq', width: 120, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' } }, + { label: '总费用', name: 'zfy', width: 80, align: 'left' }, + { label: '基金支付金额', name: 'jjzfje', width: 80, align: 'left' }, + { label: '个帐支付', name: 'grzh', width: 80, align: 'left' }, + { label: '现金支付金额', name: 'xjzfje', width: 80, align: 'left' }, + { label: '结算笔数', name: 'jsbs', width: 80, align: 'left' }, + { label: '是否退费', name: 'sftf', width: 80, align: 'left' }, { label: '城镇职工基本医疗保险统筹基金', name: 'czzgtcjj', hidden: true, align: 'left' }, { label: '城镇职工基本医疗保险统筹基金人次', name: 'czzgtcjjrc', hidden: true, align: 'left' }, diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrCheck.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrCheck.cshtml new file mode 100644 index 00000000..cafc2ba0 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrCheck.cshtml @@ -0,0 +1,120 @@ + +@{ + ViewBag.Title = "DzrCheck"; + Layout = "~/Views/Shared/_Form.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); +} +
      +
      + + + + + + +
      日期: + + + + + + @**@ +
      +
      +
      +
      +
      +
      +
      + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrForm.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrForm.cshtml index c1686f04..686b6326 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrForm.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrForm.cshtml @@ -1,8 +1,8 @@  @{ - ViewBag.Title = "DzrForm"; - Layout = "~/Views/Shared/_Form.cshtml"; - var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + ViewBag.Title = "DzrForm"; + Layout = "~/Views/Shared/_Index.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); }
      @@ -10,11 +10,16 @@ - +
      对账日期: - - - - + + + +       + + + + +
      @@ -152,19 +157,19 @@
      -
      -
      - - - - - - -
      对账结果:
      -
      -
      +
      +
      + + + + + + +
      对账结果:
      +
      +
      @@ -220,7 +225,11 @@ } }); } - function dzqq() { + function dzqq() { + if ($("#daycollate").val() == null || $("#daycollate").val()=="") { + $.modalAlert("请选择产生按钮生成数据进行对账!", 'warning'); + return; + } $.loading(true, "对账请求开始 请稍等!!"); var dzsjinput = { @@ -245,10 +254,14 @@ dataType: "json", async: false, success: function (data) { - var refinfo = data; - console.log("对账返回:",refinfo); - $("#dzjg").val(refinfo); - + var refinfo = eval('(' + data + ')');; + console.log("对账返回:", refinfo); + $("#dzjg").val(data); + if (refinfo.xxfhm == "P900") { + $.modalAlert(refinfo.fhxx, 'warning'); + } else { + $.modalAlert("对账成功", 'success'); + } }, error: function (ex) { console.log("对账请求报错返回:", ex); @@ -258,8 +271,63 @@ setTimeout(function () { $.loading(false); },3000); - } + } + $("#btn_search_ls").click(function () { + $.modalOpen({ + id: "DzrHistory", + title: "对账历史", + url: "/DaySettleManage/DaySettle/DzrHistory", + width: "1200px", + height: "650px", + callBack: function (iframeId) { + $.currentWindow(iframeId).AcceptClick(function (feeRelated) { + console.log("对账入参信息:", feeRelated); + }); + }, + cancelCallBack: function (iframeId) { + + $.loading(false); + } + }); + + + }); + $("#btn_search_lsmx").click(function () { + $.modalOpen({ + id: "DzrIndex", + title: "对账明细", + url: "/DaySettleManage/DaySettle/DzrIndex", + width: "1000px", + height: "650px", + callBack: function (iframeId) { + $.currentWindow(iframeId).AcceptClick(function (feeRelated) { + console.log("对账入参信息:", feeRelated); + }); + }, + cancelCallBack: function (iframeId) { + + $.loading(false); + } + }); + }); + $("#btn_search_mxhd").click(function () { + $.modalOpen({ + id: "DzrCheck", + title: "对账明细", + url: "/DaySettleManage/DaySettle/DzrCheck", + width: "1200px", + height: "650px", + callBack: function (iframeId) { + $.currentWindow(iframeId).AcceptClick(function (feeRelated) { + console.log("对账入参信息:", feeRelated); + }); + }, + cancelCallBack: function (iframeId) { + $.loading(false); + } + }); + }); function AcceptClick(callBack) { var dzsjinput = { daycollate: $("#daycollate").val(), //对帐日 日期格式 8 非空 diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrHistory.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrHistory.cshtml new file mode 100644 index 00000000..4e55d59e --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrHistory.cshtml @@ -0,0 +1,79 @@ + +@{ + ViewBag.Title = "DzrHistory"; + Layout = "~/Views/Shared/_Form.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); +} +
      +
      + + + + + + + +
      对账日期: + + + + + + @**@ + + +
      +
      +
      +
      + +
      + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrIndex.cshtml index 84fb94a9..2be2e361 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/DaySettleManage/Views/DaySettle/DzrIndex.cshtml @@ -1,181 +1,71 @@  @{ - ViewBag.Title = "DzrIndex"; - Layout = "~/Views/Shared/_Index.cshtml"; - var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + ViewBag.Title = "DzrIndex"; + Layout = "~/Views/Shared/_Form.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); } - -
      -
      - - - - - - -
      对账日期: - - - - - - -
      -
      -
      -
      -
      -
      -
      - +
      +
      + + + + + + +
      对账日期: + + + + + + @**@ +
      +
      +
      +
      + +
      \ No newline at end of file + function search() { + if ($('#txtCreateTimestart').val().length == 0) { + $.modalAlert("缺少开始时间", "error"); + return; + } + if ($('#txtCreateTimeEnd').val().length == 0) { + $.modalAlert("缺少结束时间", "error"); + return; + } + if ($('#txtCreateTimestart').val() > $('#txtCreateTimeEnd').val()) { + $.modalAlert("开始时间不能大于结束时间", "error"); + return; + } + + var url = getUrl(); + var orgId = '@opr.OrganizeId'; + url += "&orgId=" + orgId; + url += "&kssj=" + $('#txtCreateTimestart').val(); + url += "&jssj=" + $('#txtCreateTimeEnd').val(); + setTimeout("$.loading(true, '正在请求报表页面...');", 10); + $("#iframerightiframerightiframerightttt").attr('src', url); + } + function getUrl() { + var srcUrl = '@Html.Raw(reportUrl)'; + srcUrl += "?tempCode=1260" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; + return srcUrl; + } + $("#iframerightiframerightiframerightttt").load(function () { + $.loading(false); + }); + function AcceptClick(callBack) { + $.modalClose(); + } + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/BookkeepInHosController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/BookkeepInHosController.cs index 8213d048..ed349f53 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/BookkeepInHosController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/BookkeepInHosController.cs @@ -273,6 +273,7 @@ public ActionResult AddData(string zyh,List ItemFeeVO) zyYpjfb.cls = (short?)ItemFeeVO[i].cls; zyYpjfb.zxks = ItemFeeVO[i].yfdm; //药品补记账 默认执行科室为 _HospMedicinFeeApp.SubmitForm(zyYpjfb, null); + _hospdrugbillingRepo.Updatezyaddfee(OrganizeId, ItemFeeVO[i].sl, ItemFeeVO[i].yfdm, ItemFeeVO[i].sfxm); #endregion } } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/DischargeSettleController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/DischargeSettleController.cs index 55ca0b96..f87faeb2 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/DischargeSettleController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/DischargeSettleController.cs @@ -1,4 +1,5 @@ using FrameworkBase.MultiOrg.Domain.IRepository; +using Newtouch.Common.Operator; using Newtouch.Core.Common; using Newtouch.Core.Common.Exceptions; using Newtouch.HIS.Application.Interface; @@ -18,181 +19,183 @@ using Newtouch.HIS.Proxy.guian; using Newtouch.HIS.Proxy.guian.DTO; using Newtouch.Infrastructure; +using Newtouch.Infrastructure.Model; using Newtouch.Tools; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; using System.Linq; using System.Web.Mvc; namespace Newtouch.HIS.Web.Areas.HospitalizationManage.Controllers { - /// - /// - /// - public class DischargeSettleController : ControllerBase - { - // GET: HospitalizationManage/DischargeSettle - - private readonly IDischargeSettleApp _dischargeSettleApp; - private readonly ISysConfigRepo _sysConfigRepo; - private readonly IPayApp _payApp; - private readonly IDischargeSettleDmnService _dischargeSettleDmnService; - private readonly IHospSimulateSettlementGAYBFeeRepo _hospSimulateSettlementGAYBFeeRepo; - private readonly IHospFeeDmnService _hospFeeDmnService; - private readonly IHospSettlementGAYBZYMXXRFeeRepo _hospSettlementGAYBZYMXXRFeeRepo; - private readonly IInpatientApp _inpatientApp; - private readonly IPatientBasicInfoDmnService _patientBasicInfoDmnService; - private readonly ICqybSett05Repo _cqybSett05Repo; - private readonly IBookingDmnService _bookingDmnService; - private readonly IHospMultiDiagnosisRepo _hospMultiDiagnosisRepo; - private readonly IHospSettlementRepo _hospSettlementRepo; - private readonly IHospDrugBillingRepo _hospdrugbillingRepo; + /// + /// + /// + public class DischargeSettleController : ControllerBase + { + // GET: HospitalizationManage/DischargeSettle + + private readonly IDischargeSettleApp _dischargeSettleApp; + private readonly ISysConfigRepo _sysConfigRepo; + private readonly IPayApp _payApp; + private readonly IDischargeSettleDmnService _dischargeSettleDmnService; + private readonly IHospSimulateSettlementGAYBFeeRepo _hospSimulateSettlementGAYBFeeRepo; + private readonly IHospFeeDmnService _hospFeeDmnService; + private readonly IHospSettlementGAYBZYMXXRFeeRepo _hospSettlementGAYBZYMXXRFeeRepo; + private readonly IInpatientApp _inpatientApp; + private readonly IPatientBasicInfoDmnService _patientBasicInfoDmnService; + private readonly ICqybSett05Repo _cqybSett05Repo; + private readonly IBookingDmnService _bookingDmnService; + private readonly IHospMultiDiagnosisRepo _hospMultiDiagnosisRepo; + private readonly IHospSettlementRepo _hospSettlementRepo; + private readonly IHospDrugBillingRepo _hospdrugbillingRepo; public override ActionResult Index() - { - return View(); - } - - public ActionResult CancelIndex() - { - return View(); - } - - public ActionResult MedicalInsuranceApproval() - { - return View(); - } - - /// - /// - /// - /// - public ActionResult ConfirmForm() - { - return View(); - } - - public ActionResult SettConfirmForm() - { - return View(); - } - - public ActionResult HosAccountDeposit() - { - return View(); - } - public ActionResult SimulateFeeItems() - { - return View(); - } - public ActionResult HospFeeItems() - { - return View(); - } - public ActionResult DetailedQuery() - { - return View(); - } - public ActionResult HospFeeDetailedQuery() - { - return View(); - } - public ActionResult HospZyFeeDetailedQuery() - { - return View(); - } - public ActionResult SimulateIndex2021() - { - return View(); - } - - public ActionResult Index2021() - { - return View(); - } - - [HttpPost] - [HandlerAjaxOnly] - public ActionResult GetUploadFeeDetails(Pagination pagination, string zyh) - { - decimal ybzje = Convert.ToDecimal(0.0000); - var data = new - { - updata = _dischargeSettleDmnService.GetUploadFeeDetails(pagination, zyh, this.OrganizeId, this.UserIdentity.UserName, out ybzje), - ybzje = ybzje, - total = pagination.total, - page = pagination.page - }; - return Content(data.ToJson()); - } - - #region 重庆医保 - public ActionResult GetCQUploadFeeDetails(Pagination pagination, string zyh) - { - decimal ybzje = Convert.ToDecimal(0.0000); - decimal zfzje = Convert.ToDecimal(0.0000); - var data = new - { - updata = _dischargeSettleDmnService.GetCQUploadFeeDetails(pagination, zyh, this.OrganizeId, this.UserIdentity.UserCode, out ybzje, out zfzje), - ybzje = ybzje, - //zfzje = zfzje, - total = pagination.total, - page = pagination.page, - records = pagination.records - }; - return Content(data.ToJson()); - } - public ActionResult GetCQAlreadyUploadFeeDetails(string mzzyh) - { - var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetails(mzzyh, this.OrganizeId); - var data = new - { - ybzje = ybzje - }; - return Content(data.ToJson()); - } - public ActionResult GetNogjybdm(string mzzyh, string cfnms, string cflx) - { - var xmmc = _dischargeSettleDmnService.Getgjybdm(mzzyh, cfnms, cflx, this.OrganizeId); - var data = new - { - xmmc = xmmc - }; - return Content(data.ToJson()); - - } - /// - /// 上传至医保总费用 - /// - /// - /// - public ActionResult GetCQAlreadyUploadFeeDetailsV2(string mzzyh, DateTime jssj) - { - var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetailsV2(mzzyh, this.OrganizeId, jssj); - var data = new - { - ybzje = ybzje.zje, - csrq = ybzje.cyrq.ToString("yyyy-MM-dd") - }; - return Content(data.ToJson()); - } - public ActionResult ValialUploadData(string zyh, DateTime jssj, string jsbz) - { - var zjjfbh = ""; - var jfbh = _dischargeSettleDmnService.ValialUploadData(zyh, this.OrganizeId, jssj); - if (jsbz == "2")//中途结算 - { - zjjfbh = _dischargeSettleDmnService.ValialPartialUploadData(zyh, this.OrganizeId, jssj); - } - var data = new - { - jfbh = jfbh, - zjjfbh = zjjfbh - }; - return Content(data.ToJson()); - - } + { + return View(); + } + + public ActionResult CancelIndex() + { + return View(); + } + + public ActionResult MedicalInsuranceApproval() + { + return View(); + } + + /// + /// + /// + /// + public ActionResult ConfirmForm() + { + return View(); + } + + public ActionResult SettConfirmForm() + { + return View(); + } + + public ActionResult HosAccountDeposit() + { + return View(); + } + public ActionResult SimulateFeeItems() + { + return View(); + } + public ActionResult HospFeeItems() + { + return View(); + } + public ActionResult DetailedQuery() + { + return View(); + } + public ActionResult HospFeeDetailedQuery() + { + return View(); + } + public ActionResult HospZyFeeDetailedQuery() + { + return View(); + } + public ActionResult SimulateIndex2021() + { + return View(); + } + + public ActionResult Index2021() + { + return View(); + } + + [HttpPost] + [HandlerAjaxOnly] + public ActionResult GetUploadFeeDetails(Pagination pagination, string zyh) + { + decimal ybzje = Convert.ToDecimal(0.0000); + var data = new + { + updata = _dischargeSettleDmnService.GetUploadFeeDetails(pagination, zyh, this.OrganizeId, this.UserIdentity.UserName, out ybzje), + ybzje = ybzje, + total = pagination.total, + page = pagination.page + }; + return Content(data.ToJson()); + } + + #region 重庆医保 + public ActionResult GetCQUploadFeeDetails(Pagination pagination, string zyh) + { + decimal ybzje = Convert.ToDecimal(0.0000); + decimal zfzje = Convert.ToDecimal(0.0000); + var data = new + { + updata = _dischargeSettleDmnService.GetCQUploadFeeDetails(pagination, zyh, this.OrganizeId, this.UserIdentity.UserCode, out ybzje, out zfzje), + ybzje = ybzje, + //zfzje = zfzje, + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + } + public ActionResult GetCQAlreadyUploadFeeDetails(string mzzyh) + { + var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetails(mzzyh, this.OrganizeId); + var data = new + { + ybzje = ybzje + }; + return Content(data.ToJson()); + } + public ActionResult GetNogjybdm(string mzzyh, string cfnms, string cflx) + { + var xmmc = _dischargeSettleDmnService.Getgjybdm(mzzyh, cfnms, cflx, this.OrganizeId); + var data = new + { + xmmc = xmmc + }; + return Content(data.ToJson()); + + } + /// + /// 上传至医保总费用 + /// + /// + /// + public ActionResult GetCQAlreadyUploadFeeDetailsV2(string mzzyh, DateTime jssj) + { + var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetailsV2(mzzyh, this.OrganizeId, jssj); + var data = new + { + ybzje = ybzje.zje, + csrq = ybzje.cyrq.ToString("yyyy-MM-dd") + }; + return Content(data.ToJson()); + } + public ActionResult ValialUploadData(string zyh, DateTime jssj, string jsbz) + { + var zjjfbh = ""; + var jfbh = _dischargeSettleDmnService.ValialUploadData(zyh, this.OrganizeId, jssj); + if (jsbz == "2")//中途结算 + { + zjjfbh = _dischargeSettleDmnService.ValialPartialUploadData(zyh, this.OrganizeId, jssj); + } + var data = new + { + jfbh = jfbh, + zjjfbh = zjjfbh + }; + return Content(data.ToJson()); + + } /// /// 获取上海医保未上传的信息 /// @@ -218,922 +221,921 @@ public ActionResult ValialUploadDataShyb(string zyh, DateTime jssj, string jsbz) /// /// public ActionResult GetCQJshtInfo(int jsnm) - { - CqybSett05Entity entity = - _cqybSett05Repo.FindEntity(p => p.jsnm == jsnm && p.zt == "1" && p.OrganizeId == this.OrganizeId); - return Content(entity.ToJson()); - } - - /// - /// 获取结算信息 - /// - /// - /// - public ActionResult GetCQJsPatInfo(string zyh) - { - var data = _dischargeSettleDmnService.GetCQInpatientSettYbPatInfo(zyh, this.OrganizeId); - if (data == null) - { - return Error("入院办理信息未找到"); - } - return Content(data.ToJson()); - } - #endregion - - #region 贵安新农合 - - public ActionResult GuiAnXnhMnjs(string zyh) - { - try - { - bool isSuccess = true; - string message = string.Empty; - string state = "1"; - object retdata = null; - if (string.IsNullOrEmpty(zyh)) - { - isSuccess = false; - state = "0"; - message = "住院号不能为空,请重试!"; - } - - InpatientSettXnhPatInfoVO patinfo = null; - if (isSuccess) - { - patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); - if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) - { - isSuccess = false; - state = "0"; - message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; - } - } - - - if (isSuccess) - { - decimal nhfyzje; - S10RequestDTO S10ReqDto = _dischargeSettleDmnService.GetUploadXnhFeeDetails(zyh, this.OrganizeId, out nhfyzje); - if (S10ReqDto.list.Count == 0) - { - isSuccess = false; - state = "0"; - message = "该患者所产生的费用中,没有可报销的项目或药品,无法进行农合结算!请核对项目或药品配置是否有误,或将该患者转为自费结算!"; - } - - if (isSuccess) - { - string delMsg = ""; - //每次上传之前,先删除历史上传的明细 - if (GuiAnXnhDelFeeDetails(S10ReqDto.inpId, out delMsg)) - { - - //住院费用明细上传 - Response S10ResDto = HospitalizationProxy.GetInstance(OrganizeId).S10(S10ReqDto); - if (S10ResDto.state) - { - S13RequestDTO S13ReqDTO = new S13RequestDTO() - { - inpId = patinfo.inpId - }; - Response S13ResDto = HospitalizationProxy.GetInstance(OrganizeId).S13(S13ReqDTO); - if (S13ResDto.state) - { - S13OutResponseDTO S13Out = new S13OutResponseDTO(); - S13ResDto.data.MapperTo(S13Out); - S13Out.nhzje = nhfyzje; - S13Out.salvaQTCost = Convert.ToDecimal(S13Out.accidentRedeem) + - Convert.ToDecimal(S13Out.bottomSecondRedeem ?? "0.00") + - Convert.ToDecimal(S13Out.medicineCost ?? "0.00") + - Convert.ToDecimal(S13Out.trafficCost ?? "0.00") + - Convert.ToDecimal(S13Out.liveCost ?? "0.00") + - Convert.ToDecimal(S13Out.medicalCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaYFCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaCLCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaJKCost ?? "0.00") + - Convert.ToDecimal(S13Out.continentInsuranceCost ?? "0.00") + - Convert.ToDecimal(S13Out.nurseCost ?? "0.00") + - Convert.ToDecimal(S13Out.cwAccountCost ?? "0.00") + - Convert.ToDecimal(S13Out.specialPovertyCost ?? "0.00") + - Convert.ToDecimal(S13Out.medicalAssistanceCost ?? "0.00"); - S13Out.nhxjzf = Convert.ToDecimal(S13Out.totalCost) - - Convert.ToDecimal(S13Out.compensateCost ?? "0.00") - - Convert.ToDecimal(S13Out.insureCost ?? "0.00") - - Convert.ToDecimal(S13Out.civilCost ?? "0.00") - - Convert.ToDecimal(S13Out.salvaJSCost ?? "0.00") - - Convert.ToDecimal(S13Out.bottomRedeem ?? "0.00") - - S13Out.salvaQTCost; - - retdata = S13Out; - } - else - { - isSuccess = false; - state = "0"; - message = "模拟结算失败,农保返回信息为:【" + S13ResDto.message + "】请重试!"; - } - } - if (!S10ResDto.state) - { - isSuccess = false; - state = "0"; - message = "新农合患者住院费用明细上传失败:" + S10ResDto.message; - } - } - else - { - isSuccess = false; - state = "0"; - message = "新农合住院患者,删除已经上传的明细失败【" + delMsg + "】"; - } - } - - } - var data = new - { - state = state, - message = message, - Data = retdata - }; - return Content(data.ToJson()); - - } - catch (Exception ex) - { - var data = new - { - state = "0", - message = ex.Message, - Data = "" - }; - return Content(data.ToJson()); - } - } - - /// - /// 贵安新农合结算 - /// - /// - /// - /// - public ActionResult GuiAnXnhSettlement(string zyh) - { - try - { - bool isSuccess = true; - string message = string.Empty; - string state = "1"; - object retdata = null; - if (string.IsNullOrEmpty(zyh)) - { - isSuccess = false; - state = "0"; - message = "住院号不能为空,请重试!"; - } - - InpatientSettXnhPatInfoVO patinfo = null; - if (isSuccess) - { - patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); - if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) - { - isSuccess = false; - state = "0"; - message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; - } - } - - - if (isSuccess) - { - decimal nhfyzje; - S10RequestDTO S10ReqDto = _dischargeSettleDmnService.GetUploadXnhFeeDetails(zyh, this.OrganizeId, out nhfyzje); - if (S10ReqDto.list.Count == 0) - { - isSuccess = false; - state = "0"; - message = "该患者所产生的费用中,没有可报销的项目或药品,无法进行农合结算!请核对项目或药品配置是否有误,或将该患者转为自费结算!"; - } - string delMsg = ""; - if (isSuccess) - { - //每次上传之前,先删除历史上传的明细 - if (GuiAnXnhDelFeeDetails(S10ReqDto.inpId, out delMsg)) - { - //住院费用明细上传 - Response S10ResDto = HospitalizationProxy.GetInstance(OrganizeId).S10(S10ReqDto); - if (S10ResDto.state) - { - S07RequestDTO S07ReqDto = - _dischargeSettleDmnService.GetXnhS07RequestDTO(zyh, this.OrganizeId); - if (S07ReqDto != null && !string.IsNullOrEmpty(S07ReqDto.inpId) && !string.IsNullOrEmpty(S07ReqDto.dischargeDate) && !string.IsNullOrEmpty(S07ReqDto.dischargeDepartments) && !string.IsNullOrEmpty(S07ReqDto.dischargeStatus)) - { - //患者出院办理 - Response S07ResDto = HospitalizationProxy.GetInstance(OrganizeId).S07(S07ReqDto); - if (S07ResDto.state) - { - S13RequestDTO S13ReqDTO = new S13RequestDTO() - { - inpId = patinfo.inpId - }; - Response S13ResDto = HospitalizationProxy.GetInstance(OrganizeId).S13(S13ReqDTO); - if (S13ResDto.state) - { - S13OutResponseDTO S13Out = new S13OutResponseDTO(); - S13ResDto.data.MapperTo(S13Out); - S13Out.nhzje = nhfyzje; - S13Out.salvaQTCost = Convert.ToDecimal(S13Out.accidentRedeem) + - Convert.ToDecimal(S13Out.bottomSecondRedeem ?? "0.00") + - Convert.ToDecimal(S13Out.medicineCost ?? "0.00") + - Convert.ToDecimal(S13Out.trafficCost ?? "0.00") + - Convert.ToDecimal(S13Out.liveCost ?? "0.00") + - Convert.ToDecimal(S13Out.medicalCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaYFCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaCLCost ?? "0.00") + - Convert.ToDecimal(S13Out.salvaJKCost ?? "0.00") + - Convert.ToDecimal(S13Out.continentInsuranceCost ?? "0.00") + - Convert.ToDecimal(S13Out.nurseCost ?? "0.00") + - Convert.ToDecimal(S13Out.cwAccountCost ?? "0.00") + - Convert.ToDecimal(S13Out.specialPovertyCost ?? "0.00") + - Convert.ToDecimal(S13Out.medicalAssistanceCost ?? "0.00"); - S13Out.nhxjzf = Convert.ToDecimal(S13Out.totalCost) - - Convert.ToDecimal(S13Out.compensateCost ?? "0.00") - - Convert.ToDecimal(S13Out.insureCost ?? "0.00") - - Convert.ToDecimal(S13Out.civilCost ?? "0.00") - - Convert.ToDecimal(S13Out.salvaJSCost ?? "0.00") - - Convert.ToDecimal(S13Out.bottomRedeem ?? "0.00") - - S13Out.salvaQTCost; - - retdata = S13Out; - } - else - { - S08RequestDTO S08ReqDTO = new S08RequestDTO() - { - inpId = patinfo.inpId, - areaCode = "", - isTransProvincial = "0", - reason = "" - }; - Response S08ResDto = HospitalizationProxy.GetInstance(OrganizeId).S08(S08ReqDTO); - if (S08ResDto.state) - { - isSuccess = false; - state = "0"; - message = "新农合患者结算失败,农保返回信息为:【" + S13ResDto.message + "】请重试!"; - } - else - { - isSuccess = false; - state = "0"; - message = "新农合患者结算失败,农保返回信息为:【" + S07ResDto.message + "】" + "新农合患者出院办理回退失败,农保返回信息为:【" + S08ResDto.message + "】"; - } - } - } - else - { - isSuccess = false; - state = "0"; - message = "新农合患者出院办理失败:" + S07ResDto.message; - } - } - else - { - isSuccess = false; - state = "0"; - message = "新农合患者出院办理失败:获取出院办理S07必填信息为空或失败"; - } - } - if (!S10ResDto.state) - { - isSuccess = false; - state = "0"; - message = "新农合患者住院费用明细上传失败:" + S10ResDto.message; - } - } - else - { - isSuccess = false; - state = "0"; - message = "新农合住院患者,删除已经上传的明细失败【" + delMsg + "】"; - } - } - - - } - var data = new - { - state = state, - message = message, - Data = retdata - }; - return Content(data.ToJson()); - - } - catch (Exception ex) - { - var data = new - { - state = "0", - message = ex.Message, - Data = "" - }; - return Content(data.ToJson()); - } - - } - - /// - /// 取消出院结算 - /// - /// - /// - public ActionResult GuiAnXnhSettCancel(string zyh) - { - try - { - bool isSuccess = true; - string message = string.Empty; - string state = "1"; - object retdata = null; - if (string.IsNullOrEmpty(zyh)) - { - isSuccess = false; - state = "0"; - message = "住院号不能为空,请重试!"; - } - - InpatientSettXnhPatInfoVO patinfo = null; - if (isSuccess) - { - patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); - if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) - { - isSuccess = false; - state = "0"; - message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; - } - - if (isSuccess) - { - S15RequestDTO S15ReqDTO = new S15RequestDTO() - { - inpId = patinfo.inpId, - areaCode = "", - isTransProvincial = "0" - }; - Response S15ResDto = HospitalizationProxy.GetInstance(OrganizeId).S15(S15ReqDTO); - if (S15ResDto.state) - { - S04RequestDTO S04ReqDTO = _inpatientApp.GetZfToXnhPatInfo(zyh); - if (S04ReqDTO == null || string.IsNullOrEmpty(S04ReqDTO.memberId) || string.IsNullOrEmpty(S04ReqDTO.inpatientNo) || string.IsNullOrEmpty(S04ReqDTO.admissionDate) || string.IsNullOrEmpty(S04ReqDTO.admissionDepartments)) - { - isSuccess = false; - state = "0"; - message = "入院办理缺少必须的值!"; - } - Response S04ResDto = HospitalizationProxy.GetInstance(OrganizeId).S04(S04ReqDTO); - if (!S04ResDto.state) - { - isSuccess = false; - state = "0"; - message = "入院办理失败,农保返回错误信息为:【" + S04ResDto.message + "】,请联系HIS运维解决"; - } - else - { - GuianXnhS04InfoEntity S04InfoEntity = new GuianXnhS04InfoEntity() - { - Id = Guid.NewGuid().ToString(), - inpId = S04ResDto.data.inpId, - zyh = zyh, - xnhgrbm = patinfo.memberNo, - xnhylzh = patinfo.bookNo, - OrganizeId = this.OrganizeId, - zt = "1" - }; - string msg = string.Empty; - if (!_patientBasicInfoDmnService.InpatXnhInsertS04data(S04InfoEntity, out msg)) - { - isSuccess = false; - state = "0"; - message = "新农合患者取消结算失败:【" + msg + "】"; - } - } - } - else - { - isSuccess = false; - state = "0"; - message = "新农合患者取消结算失败,农保返回信息为:【" + S15ResDto.message + "】"; - } - } - } - var data = new - { - state = state, - message = message - }; - return Content(data.ToJson()); - } - catch (Exception e) - { - var data = new - { - state = "0", - message = "取消出院结算失败:【" + e.Message + "】" - }; - return Content(data.ToJson()); - } - } - /// - /// 出院回退 - /// - /// - /// - public ActionResult GuiAnXnhCyblCancel(string zyh) - { - try - { - bool isSuccess = true; - string message = string.Empty; - string state = "1"; - object retdata = null; - if (string.IsNullOrEmpty(zyh)) - { - isSuccess = false; - state = "0"; - message = "住院号不能为空,请重试!"; - } - - InpatientSettXnhPatInfoVO patinfo = null; - if (isSuccess) - { - patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); - if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) - { - isSuccess = false; - state = "0"; - message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; - } - - if (isSuccess) - { - S08RequestDTO S08ReqDTO = new S08RequestDTO() - { - inpId = patinfo.inpId, - areaCode = "", - isTransProvincial = "0", - reason = "" - }; - Response S08ResDto = HospitalizationProxy.GetInstance(OrganizeId).S08(S08ReqDTO); - if (!S08ResDto.state) - { - isSuccess = false; - state = "0"; - message = "取消出院办理失败,农保返回错误信息为:【" + S08ResDto.message + "】"; - } - } - } - var data = new - { - state = state, - message = message - }; - return Content(data.ToJson()); - } - catch (Exception e) - { - var data = new - { - state = "0", - message = "取消出院结算失败:【" + e.Message + "】" - }; - return Content(data.ToJson()); - } - } - - - - /// - /// 删除住院患者已上传的费用明细信息 - /// - /// - /// - public bool GuiAnXnhDelFeeDetails(string inpId, out string delMsg) - { - S11RequestDTO S11ReqDTO = new S11RequestDTO() - { - inpId = inpId, - startDate = "", - endDate = "", - areaCode = "", - isTransProvincial = "0" - }; - Response> S11ResDTO = HospitalizationProxy.GetInstance(OrganizeId).S11(S11ReqDTO); - if (S11ResDTO.state) - { - if (S11ResDTO.data.Count == 0) - { - delMsg = ""; - return true; - } - List listStr = new List(); - foreach (var item in S11ResDTO.data) - { - listStr.Add(item.detailId); - } - S12RequestDTO S12ReqDTO = new S12RequestDTO() - { - inpId = inpId, - isTransProvincial = "0", - areaCode = "", - list = listStr - }; - Response S12ResDTO = HospitalizationProxy.GetInstance(OrganizeId).S12(S12ReqDTO); - if (!S12ResDTO.state) - { - delMsg = S12ResDTO.message; - return false; - } - } - else - { - delMsg = S11ResDTO.message; - return false; - } - delMsg = ""; - return true; - } - /// - /// 根据个人编码获取住院号(新农合) - /// - /// 个人编码 - /// 是否结算1已结 0 未结 - /// - public ActionResult GetZyhByGrbm(string xnhgrbm, string sfjs) - { - var zyh = _dischargeSettleDmnService.GetZyhByGrbm(xnhgrbm, sfjs, this.OrganizeId); - return Success(null, zyh); - } - - #endregion - - #region 出院结算//(无医保算法)//20190408改为有医保算法 - - /// - /// 住院号查询数据(包括病人信息和计费明细) zyh 或 kh +cardType 或 sfz +cardType - /// - /// - /// - /// - /// - /// - [HandlerAjaxOnly] - public ActionResult GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) - { - if (!string.IsNullOrWhiteSpace(zyh)) - { - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 - } - var dto = _dischargeSettleApp.GetInpatientSettleStatusDetail(zyh, sfz, kh, cardType, jslx, ver); - return Success("", dto); - } - [HandlerAjaxOnly] - public ActionResult GetInpatientSettleStatusDetailbySfdl(Pagination pagination, string zyh, string dlCode) - { - var dto = _dischargeSettleDmnService.GetHospGroupFeeVOList(pagination, zyh, OrganizeId, dlCode); - var data = new - { - rows = dto, - total = pagination.total, - page = pagination.page, - records = pagination.records, - }; - return Content(data.ToJson()); - } - /// - /// 带模糊查询 - /// - /// - /// - /// - /// - [HandlerAjaxOnly] - public ActionResult GetInpatientSettleStatusDetailbySfdlData(Pagination pagination, string zyh, string keyword) - { - var dto = _dischargeSettleDmnService.GetHospGroupFeeVOData(pagination, zyh, OrganizeId, keyword); - var data = new - { - rows = dto, - total = pagination.total, - page = pagination.page, - records = pagination.records, - }; - return Content(data.ToJson()); - } - /// - /// 查询项目明细 - /// - /// - /// - /// - /// - [HandlerAjaxOnly] - public ActionResult GetDetailedQuery(Pagination pagination, string zyh, string sfxmCode, string zzfbz, decimal? dj) - { - var dto = _dischargeSettleDmnService.GetDetailedQuery(pagination, zyh, OrganizeId, sfxmCode, zzfbz, dj); - var data = new - { - rows = dto, - total = pagination.total, - page = pagination.page, - records = pagination.records, - }; - return Content(data.ToJson()); - } - /// - /// 查询住院费用账单 - /// - /// - /// - /// - /// - [HandlerAjaxOnly] - public ActionResult GetZyDetailedQuery(Pagination pagination, string zyh, string sfxmCode, string zzfbz) - { - var dto = _dischargeSettleDmnService.GetFyzdDetailedQuery(pagination, zyh, OrganizeId, sfxmCode); - var data = new - { - rows = dto, - total = pagination.total, - page = pagination.page, - records = pagination.records, - }; - return Content(data.ToJson()); - } - #region 医保数据传输 - [HandlerAjaxOnly] - public ActionResult GetZybrInfo(string zyh, string jslx) - { - if (!string.IsNullOrWhiteSpace(zyh)) - { - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 - } - var dto = _dischargeSettleApp.GetZyUploadDetail(zyh, jslx); - return Success("", dto); - } - - public ActionResult GetZyUploadDetailJe(string zyh, string sczt, DateTime jssj, string xmmc) - { - var dto = _dischargeSettleApp.GetInpatientSettleJe(zyh, sczt, null, jssj, xmmc); - return Success("", dto); - } - - [HandlerAjaxOnly] - public ActionResult GetZyUploadDetail(Pagination pagination, string zyh, string sczt, DateTime jssj, string xmmc,string isnewyb) - { - var dto = _dischargeSettleDmnService.GetHospXmYpFeeVOList(pagination, zyh, OrganizeId, sczt, xmmc, null, jssj, isnewyb); - var data = new - { - rows = dto, - total = pagination.total, - page = pagination.page, - records = pagination.records, - }; - return Content(data.ToJson()); - } - - public ActionResult GetHospPreSettInfo(string zyh, DateTime jzsj) - { - var InpatObj = _dischargeSettleDmnService.GetHospPreInfo(zyh, this.OrganizeId, jzsj); - //var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetailsV2(zyh, this.OrganizeId); - var data = new - { - zje = InpatObj.zje, - cyrq = InpatObj.cyrq.ToString("yyyy-MM-dd"), - ybzje = InpatObj.ybzje - }; - return Content(data.ToJson()); - } - #endregion - /// - /// 选择出院日期 - /// - /// - public ActionResult SettSelectCyrq() - { - return View(); - } - - /// - /// 保存结算 - /// - /// - /// - /// - /// 金额及支付信息 - /// 医保相关费用信息 - /// 支付交易号 - /// - [HttpPost] - [HandlerAjaxOnly] - public ActionResult SaveSettle(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRelatedDTO feeRelated - , CQZyjs05Dto ybfeeRelated, S13OtherResponseDTO xnhfeeRelated, string jslx - , string outTradeNo) - { - if (string.IsNullOrEmpty(zyh)) - { - throw new FailedCodeException("HOSP_ZYH_IS_EMPTY"); - } - - if (string.IsNullOrEmpty(jslx)) - { - return Error("结算类型不能为空,请联系his运维处理!"); - } - S14OutResponseDTO S14OutRes = null; - if (jslx == "8" && xnhfeeRelated != null) - { - S14OutRes = new S14OutResponseDTO(); - InpatientSettXnhPatInfoVO patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); - if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) - { - return Error("获取新农合患者住院补偿序号inpId为空,请联系his运维处理"); - } - S14RequestDTO S14ReqDTO = new S14RequestDTO() - { - inpId = patinfo.inpId - }; - Response S14ResDto = HospitalizationProxy.GetInstance(OrganizeId).S14(S14ReqDTO); - if (!S14ResDto.state) - { - return Error("住院结算失败,调用农合接口S04返回错误:【" + S14ResDto.message + "】"); - } - - S14ResDto.data.MapperTo(S14OutRes); - S14OutRes.salvaQTCost = xnhfeeRelated.salvaQTCost; - S14OutRes.nhzje = xnhfeeRelated.nhzje; - S14OutRes.nhxjzf = xnhfeeRelated.nhxjzf; - } - - - int jsnm; - _dischargeSettleApp.SaveSett(zyh, expectedcyrq, fph, feeRelated, ybfeeRelated, S14OutRes, outTradeNo, jslx, out jsnm); + { + CqybSett05Entity entity = + _cqybSett05Repo.FindEntity(p => p.jsnm == jsnm && p.zt == "1" && p.OrganizeId == this.OrganizeId); + return Content(entity.ToJson()); + } + + /// + /// 获取结算信息 + /// + /// + /// + public ActionResult GetCQJsPatInfo(string zyh) + { + var data = _dischargeSettleDmnService.GetCQInpatientSettYbPatInfo(zyh, this.OrganizeId); + if (data == null) + { + return Error("入院办理信息未找到"); + } + return Content(data.ToJson()); + } + #endregion + + #region 贵安新农合 + + public ActionResult GuiAnXnhMnjs(string zyh) + { + try + { + bool isSuccess = true; + string message = string.Empty; + string state = "1"; + object retdata = null; + if (string.IsNullOrEmpty(zyh)) + { + isSuccess = false; + state = "0"; + message = "住院号不能为空,请重试!"; + } + + InpatientSettXnhPatInfoVO patinfo = null; + if (isSuccess) + { + patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); + if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) + { + isSuccess = false; + state = "0"; + message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; + } + } + + + if (isSuccess) + { + decimal nhfyzje; + S10RequestDTO S10ReqDto = _dischargeSettleDmnService.GetUploadXnhFeeDetails(zyh, this.OrganizeId, out nhfyzje); + if (S10ReqDto.list.Count == 0) + { + isSuccess = false; + state = "0"; + message = "该患者所产生的费用中,没有可报销的项目或药品,无法进行农合结算!请核对项目或药品配置是否有误,或将该患者转为自费结算!"; + } + + if (isSuccess) + { + string delMsg = ""; + //每次上传之前,先删除历史上传的明细 + if (GuiAnXnhDelFeeDetails(S10ReqDto.inpId, out delMsg)) + { + + //住院费用明细上传 + Response S10ResDto = HospitalizationProxy.GetInstance(OrganizeId).S10(S10ReqDto); + if (S10ResDto.state) + { + S13RequestDTO S13ReqDTO = new S13RequestDTO() + { + inpId = patinfo.inpId + }; + Response S13ResDto = HospitalizationProxy.GetInstance(OrganizeId).S13(S13ReqDTO); + if (S13ResDto.state) + { + S13OutResponseDTO S13Out = new S13OutResponseDTO(); + S13ResDto.data.MapperTo(S13Out); + S13Out.nhzje = nhfyzje; + S13Out.salvaQTCost = Convert.ToDecimal(S13Out.accidentRedeem) + + Convert.ToDecimal(S13Out.bottomSecondRedeem ?? "0.00") + + Convert.ToDecimal(S13Out.medicineCost ?? "0.00") + + Convert.ToDecimal(S13Out.trafficCost ?? "0.00") + + Convert.ToDecimal(S13Out.liveCost ?? "0.00") + + Convert.ToDecimal(S13Out.medicalCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaYFCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaCLCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaJKCost ?? "0.00") + + Convert.ToDecimal(S13Out.continentInsuranceCost ?? "0.00") + + Convert.ToDecimal(S13Out.nurseCost ?? "0.00") + + Convert.ToDecimal(S13Out.cwAccountCost ?? "0.00") + + Convert.ToDecimal(S13Out.specialPovertyCost ?? "0.00") + + Convert.ToDecimal(S13Out.medicalAssistanceCost ?? "0.00"); + S13Out.nhxjzf = Convert.ToDecimal(S13Out.totalCost) - + Convert.ToDecimal(S13Out.compensateCost ?? "0.00") - + Convert.ToDecimal(S13Out.insureCost ?? "0.00") - + Convert.ToDecimal(S13Out.civilCost ?? "0.00") - + Convert.ToDecimal(S13Out.salvaJSCost ?? "0.00") - + Convert.ToDecimal(S13Out.bottomRedeem ?? "0.00") - + S13Out.salvaQTCost; + + retdata = S13Out; + } + else + { + isSuccess = false; + state = "0"; + message = "模拟结算失败,农保返回信息为:【" + S13ResDto.message + "】请重试!"; + } + } + if (!S10ResDto.state) + { + isSuccess = false; + state = "0"; + message = "新农合患者住院费用明细上传失败:" + S10ResDto.message; + } + } + else + { + isSuccess = false; + state = "0"; + message = "新农合住院患者,删除已经上传的明细失败【" + delMsg + "】"; + } + } + + } + var data = new + { + state = state, + message = message, + Data = retdata + }; + return Content(data.ToJson()); + + } + catch (Exception ex) + { + var data = new + { + state = "0", + message = ex.Message, + Data = "" + }; + return Content(data.ToJson()); + } + } + + /// + /// 贵安新农合结算 + /// + /// + /// + /// + public ActionResult GuiAnXnhSettlement(string zyh) + { + try + { + bool isSuccess = true; + string message = string.Empty; + string state = "1"; + object retdata = null; + if (string.IsNullOrEmpty(zyh)) + { + isSuccess = false; + state = "0"; + message = "住院号不能为空,请重试!"; + } + + InpatientSettXnhPatInfoVO patinfo = null; + if (isSuccess) + { + patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); + if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) + { + isSuccess = false; + state = "0"; + message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; + } + } + + + if (isSuccess) + { + decimal nhfyzje; + S10RequestDTO S10ReqDto = _dischargeSettleDmnService.GetUploadXnhFeeDetails(zyh, this.OrganizeId, out nhfyzje); + if (S10ReqDto.list.Count == 0) + { + isSuccess = false; + state = "0"; + message = "该患者所产生的费用中,没有可报销的项目或药品,无法进行农合结算!请核对项目或药品配置是否有误,或将该患者转为自费结算!"; + } + string delMsg = ""; + if (isSuccess) + { + //每次上传之前,先删除历史上传的明细 + if (GuiAnXnhDelFeeDetails(S10ReqDto.inpId, out delMsg)) + { + //住院费用明细上传 + Response S10ResDto = HospitalizationProxy.GetInstance(OrganizeId).S10(S10ReqDto); + if (S10ResDto.state) + { + S07RequestDTO S07ReqDto = + _dischargeSettleDmnService.GetXnhS07RequestDTO(zyh, this.OrganizeId); + if (S07ReqDto != null && !string.IsNullOrEmpty(S07ReqDto.inpId) && !string.IsNullOrEmpty(S07ReqDto.dischargeDate) && !string.IsNullOrEmpty(S07ReqDto.dischargeDepartments) && !string.IsNullOrEmpty(S07ReqDto.dischargeStatus)) + { + //患者出院办理 + Response S07ResDto = HospitalizationProxy.GetInstance(OrganizeId).S07(S07ReqDto); + if (S07ResDto.state) + { + S13RequestDTO S13ReqDTO = new S13RequestDTO() + { + inpId = patinfo.inpId + }; + Response S13ResDto = HospitalizationProxy.GetInstance(OrganizeId).S13(S13ReqDTO); + if (S13ResDto.state) + { + S13OutResponseDTO S13Out = new S13OutResponseDTO(); + S13ResDto.data.MapperTo(S13Out); + S13Out.nhzje = nhfyzje; + S13Out.salvaQTCost = Convert.ToDecimal(S13Out.accidentRedeem) + + Convert.ToDecimal(S13Out.bottomSecondRedeem ?? "0.00") + + Convert.ToDecimal(S13Out.medicineCost ?? "0.00") + + Convert.ToDecimal(S13Out.trafficCost ?? "0.00") + + Convert.ToDecimal(S13Out.liveCost ?? "0.00") + + Convert.ToDecimal(S13Out.medicalCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaYFCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaCLCost ?? "0.00") + + Convert.ToDecimal(S13Out.salvaJKCost ?? "0.00") + + Convert.ToDecimal(S13Out.continentInsuranceCost ?? "0.00") + + Convert.ToDecimal(S13Out.nurseCost ?? "0.00") + + Convert.ToDecimal(S13Out.cwAccountCost ?? "0.00") + + Convert.ToDecimal(S13Out.specialPovertyCost ?? "0.00") + + Convert.ToDecimal(S13Out.medicalAssistanceCost ?? "0.00"); + S13Out.nhxjzf = Convert.ToDecimal(S13Out.totalCost) - + Convert.ToDecimal(S13Out.compensateCost ?? "0.00") - + Convert.ToDecimal(S13Out.insureCost ?? "0.00") - + Convert.ToDecimal(S13Out.civilCost ?? "0.00") - + Convert.ToDecimal(S13Out.salvaJSCost ?? "0.00") - + Convert.ToDecimal(S13Out.bottomRedeem ?? "0.00") - + S13Out.salvaQTCost; + + retdata = S13Out; + } + else + { + S08RequestDTO S08ReqDTO = new S08RequestDTO() + { + inpId = patinfo.inpId, + areaCode = "", + isTransProvincial = "0", + reason = "" + }; + Response S08ResDto = HospitalizationProxy.GetInstance(OrganizeId).S08(S08ReqDTO); + if (S08ResDto.state) + { + isSuccess = false; + state = "0"; + message = "新农合患者结算失败,农保返回信息为:【" + S13ResDto.message + "】请重试!"; + } + else + { + isSuccess = false; + state = "0"; + message = "新农合患者结算失败,农保返回信息为:【" + S07ResDto.message + "】" + "新农合患者出院办理回退失败,农保返回信息为:【" + S08ResDto.message + "】"; + } + } + } + else + { + isSuccess = false; + state = "0"; + message = "新农合患者出院办理失败:" + S07ResDto.message; + } + } + else + { + isSuccess = false; + state = "0"; + message = "新农合患者出院办理失败:获取出院办理S07必填信息为空或失败"; + } + } + if (!S10ResDto.state) + { + isSuccess = false; + state = "0"; + message = "新农合患者住院费用明细上传失败:" + S10ResDto.message; + } + } + else + { + isSuccess = false; + state = "0"; + message = "新农合住院患者,删除已经上传的明细失败【" + delMsg + "】"; + } + } + + + } + var data = new + { + state = state, + message = message, + Data = retdata + }; + return Content(data.ToJson()); + + } + catch (Exception ex) + { + var data = new + { + state = "0", + message = ex.Message, + Data = "" + }; + return Content(data.ToJson()); + } + + } + + /// + /// 取消出院结算 + /// + /// + /// + public ActionResult GuiAnXnhSettCancel(string zyh) + { + try + { + bool isSuccess = true; + string message = string.Empty; + string state = "1"; + object retdata = null; + if (string.IsNullOrEmpty(zyh)) + { + isSuccess = false; + state = "0"; + message = "住院号不能为空,请重试!"; + } + + InpatientSettXnhPatInfoVO patinfo = null; + if (isSuccess) + { + patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); + if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) + { + isSuccess = false; + state = "0"; + message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; + } + + if (isSuccess) + { + S15RequestDTO S15ReqDTO = new S15RequestDTO() + { + inpId = patinfo.inpId, + areaCode = "", + isTransProvincial = "0" + }; + Response S15ResDto = HospitalizationProxy.GetInstance(OrganizeId).S15(S15ReqDTO); + if (S15ResDto.state) + { + S04RequestDTO S04ReqDTO = _inpatientApp.GetZfToXnhPatInfo(zyh); + if (S04ReqDTO == null || string.IsNullOrEmpty(S04ReqDTO.memberId) || string.IsNullOrEmpty(S04ReqDTO.inpatientNo) || string.IsNullOrEmpty(S04ReqDTO.admissionDate) || string.IsNullOrEmpty(S04ReqDTO.admissionDepartments)) + { + isSuccess = false; + state = "0"; + message = "入院办理缺少必须的值!"; + } + Response S04ResDto = HospitalizationProxy.GetInstance(OrganizeId).S04(S04ReqDTO); + if (!S04ResDto.state) + { + isSuccess = false; + state = "0"; + message = "入院办理失败,农保返回错误信息为:【" + S04ResDto.message + "】,请联系HIS运维解决"; + } + else + { + GuianXnhS04InfoEntity S04InfoEntity = new GuianXnhS04InfoEntity() + { + Id = Guid.NewGuid().ToString(), + inpId = S04ResDto.data.inpId, + zyh = zyh, + xnhgrbm = patinfo.memberNo, + xnhylzh = patinfo.bookNo, + OrganizeId = this.OrganizeId, + zt = "1" + }; + string msg = string.Empty; + if (!_patientBasicInfoDmnService.InpatXnhInsertS04data(S04InfoEntity, out msg)) + { + isSuccess = false; + state = "0"; + message = "新农合患者取消结算失败:【" + msg + "】"; + } + } + } + else + { + isSuccess = false; + state = "0"; + message = "新农合患者取消结算失败,农保返回信息为:【" + S15ResDto.message + "】"; + } + } + } + var data = new + { + state = state, + message = message + }; + return Content(data.ToJson()); + } + catch (Exception e) + { + var data = new + { + state = "0", + message = "取消出院结算失败:【" + e.Message + "】" + }; + return Content(data.ToJson()); + } + } + /// + /// 出院回退 + /// + /// + /// + public ActionResult GuiAnXnhCyblCancel(string zyh) + { + try + { + bool isSuccess = true; + string message = string.Empty; + string state = "1"; + object retdata = null; + if (string.IsNullOrEmpty(zyh)) + { + isSuccess = false; + state = "0"; + message = "住院号不能为空,请重试!"; + } + + InpatientSettXnhPatInfoVO patinfo = null; + if (isSuccess) + { + patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); + if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) + { + isSuccess = false; + state = "0"; + message = "获取新农合患者住院补偿序号inpId为空,请联系his处理"; + } + + if (isSuccess) + { + S08RequestDTO S08ReqDTO = new S08RequestDTO() + { + inpId = patinfo.inpId, + areaCode = "", + isTransProvincial = "0", + reason = "" + }; + Response S08ResDto = HospitalizationProxy.GetInstance(OrganizeId).S08(S08ReqDTO); + if (!S08ResDto.state) + { + isSuccess = false; + state = "0"; + message = "取消出院办理失败,农保返回错误信息为:【" + S08ResDto.message + "】"; + } + } + } + var data = new + { + state = state, + message = message + }; + return Content(data.ToJson()); + } + catch (Exception e) + { + var data = new + { + state = "0", + message = "取消出院结算失败:【" + e.Message + "】" + }; + return Content(data.ToJson()); + } + } + + + + /// + /// 删除住院患者已上传的费用明细信息 + /// + /// + /// + public bool GuiAnXnhDelFeeDetails(string inpId, out string delMsg) + { + S11RequestDTO S11ReqDTO = new S11RequestDTO() + { + inpId = inpId, + startDate = "", + endDate = "", + areaCode = "", + isTransProvincial = "0" + }; + Response> S11ResDTO = HospitalizationProxy.GetInstance(OrganizeId).S11(S11ReqDTO); + if (S11ResDTO.state) + { + if (S11ResDTO.data.Count == 0) + { + delMsg = ""; + return true; + } + List listStr = new List(); + foreach (var item in S11ResDTO.data) + { + listStr.Add(item.detailId); + } + S12RequestDTO S12ReqDTO = new S12RequestDTO() + { + inpId = inpId, + isTransProvincial = "0", + areaCode = "", + list = listStr + }; + Response S12ResDTO = HospitalizationProxy.GetInstance(OrganizeId).S12(S12ReqDTO); + if (!S12ResDTO.state) + { + delMsg = S12ResDTO.message; + return false; + } + } + else + { + delMsg = S11ResDTO.message; + return false; + } + delMsg = ""; + return true; + } + /// + /// 根据个人编码获取住院号(新农合) + /// + /// 个人编码 + /// 是否结算1已结 0 未结 + /// + public ActionResult GetZyhByGrbm(string xnhgrbm, string sfjs) + { + var zyh = _dischargeSettleDmnService.GetZyhByGrbm(xnhgrbm, sfjs, this.OrganizeId); + return Success(null, zyh); + } + + #endregion + + #region 出院结算//(无医保算法)//20190408改为有医保算法 + + /// + /// 住院号查询数据(包括病人信息和计费明细) zyh 或 kh +cardType 或 sfz +cardType + /// + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult GetInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) + { + if (!string.IsNullOrWhiteSpace(zyh)) + { + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 + } + var dto = _dischargeSettleApp.GetInpatientSettleStatusDetail(zyh, sfz, kh, cardType, jslx, ver); + return Success("", dto); + } + [HandlerAjaxOnly] + public ActionResult GetInpatientSettleStatusDetailbySfdl(Pagination pagination, string zyh, string dlCode) + { + var dto = _dischargeSettleDmnService.GetHospGroupFeeVOList(pagination, zyh, OrganizeId, dlCode); + var data = new + { + rows = dto, + total = pagination.total, + page = pagination.page, + records = pagination.records, + }; + return Content(data.ToJson()); + } + /// + /// 带模糊查询 + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult GetInpatientSettleStatusDetailbySfdlData(Pagination pagination, string zyh, string keyword) + { + var dto = _dischargeSettleDmnService.GetHospGroupFeeVOData(pagination, zyh, OrganizeId, keyword); + var data = new + { + rows = dto, + total = pagination.total, + page = pagination.page, + records = pagination.records, + }; + return Content(data.ToJson()); + } + /// + /// 查询项目明细 + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult GetDetailedQuery(Pagination pagination, string zyh, string sfxmCode, string zzfbz, decimal? dj) + { + var dto = _dischargeSettleDmnService.GetDetailedQuery(pagination, zyh, OrganizeId, sfxmCode, zzfbz, dj); + var data = new + { + rows = dto, + total = pagination.total, + page = pagination.page, + records = pagination.records, + }; + return Content(data.ToJson()); + } + /// + /// 查询住院费用账单 + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult GetZyDetailedQuery(Pagination pagination, string zyh, string sfxmCode, string zzfbz) + { + var dto = _dischargeSettleDmnService.GetFyzdDetailedQuery(pagination, zyh, OrganizeId, sfxmCode); + var data = new + { + rows = dto, + total = pagination.total, + page = pagination.page, + records = pagination.records, + }; + return Content(data.ToJson()); + } + #region 医保数据传输 + [HandlerAjaxOnly] + public ActionResult GetZybrInfo(string zyh, string jslx) + { + if (!string.IsNullOrWhiteSpace(zyh)) + { + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 + } + var dto = _dischargeSettleApp.GetZyUploadDetail(zyh, jslx); + return Success("", dto); + } + + public ActionResult GetZyUploadDetailJe(string zyh, string sczt, DateTime jssj, string xmmc) + { + var dto = _dischargeSettleApp.GetInpatientSettleJe(zyh, sczt, null, jssj, xmmc); + return Success("", dto); + } + + [HandlerAjaxOnly] + public ActionResult GetZyUploadDetail(Pagination pagination, string zyh, string sczt, DateTime jssj, string xmmc, string isnewyb) + { + var dto = _dischargeSettleDmnService.GetHospXmYpFeeVOList(pagination, zyh, OrganizeId, sczt, xmmc, null, jssj, isnewyb); + var data = new + { + rows = dto, + total = pagination.total, + page = pagination.page, + records = pagination.records, + }; + return Content(data.ToJson()); + } + + public ActionResult GetHospPreSettInfo(string zyh, DateTime jzsj) + { + var InpatObj = _dischargeSettleDmnService.GetHospPreInfo(zyh, this.OrganizeId, jzsj); + //var ybzje = _dischargeSettleDmnService.GetCQAlreadyUploadFeeDetailsV2(zyh, this.OrganizeId); + var data = new + { + zje = InpatObj.zje, + cyrq = InpatObj.cyrq.ToString("yyyy-MM-dd"), + ybzje = InpatObj.ybzje + }; + return Content(data.ToJson()); + } + #endregion + /// + /// 选择出院日期 + /// + /// + public ActionResult SettSelectCyrq() + { + return View(); + } + + /// + /// 保存结算 + /// + /// + /// + /// + /// 金额及支付信息 + /// 医保相关费用信息 + /// 支付交易号 + /// + [HttpPost] + [HandlerAjaxOnly] + public ActionResult SaveSettle(string zyh, DateTime expectedcyrq, string fph, InpatientSettFeeRelatedDTO feeRelated + , CQZyjs05Dto ybfeeRelated, S13OtherResponseDTO xnhfeeRelated, string jslx + , string outTradeNo) + { + if (string.IsNullOrEmpty(zyh)) + { + throw new FailedCodeException("HOSP_ZYH_IS_EMPTY"); + } + + if (string.IsNullOrEmpty(jslx)) + { + return Error("结算类型不能为空,请联系his运维处理!"); + } + S14OutResponseDTO S14OutRes = null; + if (jslx == "8" && xnhfeeRelated != null) + { + S14OutRes = new S14OutResponseDTO(); + InpatientSettXnhPatInfoVO patinfo = _dischargeSettleDmnService.GetInpatientSettXnhPatInfo(zyh, this.OrganizeId); + if (patinfo == null || string.IsNullOrEmpty(patinfo.inpId)) + { + return Error("获取新农合患者住院补偿序号inpId为空,请联系his运维处理"); + } + S14RequestDTO S14ReqDTO = new S14RequestDTO() + { + inpId = patinfo.inpId + }; + Response S14ResDto = HospitalizationProxy.GetInstance(OrganizeId).S14(S14ReqDTO); + if (!S14ResDto.state) + { + return Error("住院结算失败,调用农合接口S04返回错误:【" + S14ResDto.message + "】"); + } + + S14ResDto.data.MapperTo(S14OutRes); + S14OutRes.salvaQTCost = xnhfeeRelated.salvaQTCost; + S14OutRes.nhzje = xnhfeeRelated.nhzje; + S14OutRes.nhxjzf = xnhfeeRelated.nhxjzf; + } + + + int jsnm; + _dischargeSettleApp.SaveSett(zyh, expectedcyrq, fph, feeRelated, ybfeeRelated, S14OutRes, outTradeNo, jslx, out jsnm); _hospdrugbillingRepo.Updatezy_brxxexpand(this.OrganizeId, zyh); if (_sysConfigRepo.GetBoolValueByCode("HOSP_INTERFACE_WITH_CPOE", this.OrganizeId) == true) - { - //同步zybz 已出院给CIS - SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() - { - zyh = zyh, - zybz = ((int)EnumZYBZ.Ycy).ToString(), - }); - } - - var res = new - { - jsnm = jsnm - }; - return Success(null, res); - } - - /// - /// 获取医保结算 构造入参 - /// - /// - /// - public ActionResult GetInpatientSettYbPatInfo(string zyh) - { - var data = _dischargeSettleDmnService.GetInpatientSettYbPatInfo(zyh, this.OrganizeId); - if (data == null) - { - return Error("入院办理信息未找到"); - } - return Success(null, data); - } - - public ActionResult upLoadReturnData(IList upReturnData, string patzyh) - { - if (upReturnData != null && upReturnData.Count > 0) - { - foreach (var feeEntity in upReturnData) - { - feeEntity.Create(true); - feeEntity.OrganizeId = this.OrganizeId; - feeEntity.zt = "1"; - feeEntity.zyh = patzyh; - _hospSettlementGAYBZYMXXRFeeRepo.Insert(feeEntity); - } - } - - return Success(); - } - - /// - /// 模拟结算 保存结果 - /// - /// - /// - public ActionResult SubmitSimulateSettlementResult(HospSimulateSettlementGAYBFeeEntity feeEntity) - { - feeEntity.Create(true); - feeEntity.OrganizeId = this.OrganizeId; - feeEntity.zt = "1"; - _hospSimulateSettlementGAYBFeeRepo.Insert(feeEntity); - return Success(); - } - - #endregion - - #region 取消出院结算//(无医保算法)//20190408改为有医保算法 - - /// - /// 取消结算查询 - /// - /// - /// - [HttpPost] - [HandlerAjaxOnly] - public ActionResult GetCancelSettleStatusDetail(string zyh, string sfz, string kh, string cardType) - { - var dto = _dischargeSettleApp.GetCancelSettleStatusDetail(zyh, sfz, kh, cardType); - return Success(null, dto); - } - - /// - /// 取消结算 - /// - /// - /// - /// - /// - [HttpPost] - [HandlerAjaxOnly] - public ActionResult DoCancel(string zyh, int expectedjsnm, string cancelReason,string cancelyblsh) - { - string outTradeNo; - decimal refundAmount; - _dischargeSettleApp.DoCancel(zyh, expectedjsnm, cancelReason, cancelyblsh, out outTradeNo, out refundAmount); - - if (_sysConfigRepo.GetBoolValueByCode("HOSP_INTERFACE_WITH_CPOE", this.OrganizeId) == true) - { - //同步zybz 待结账给CIS - SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() - { - zyh = zyh, - zybz = ((int)EnumZYBZ.Djz).ToString(), - }); - } - - bool? isTradeRefundError = null; - if (!string.IsNullOrWhiteSpace(outTradeNo) && refundAmount > 0) //需要原路退回 - { - string errorMsg; - var refundReuslt = _payApp.TradeRefund(outTradeNo, refundAmount, "门诊退费", "", out errorMsg); - isTradeRefundError = refundReuslt == (int)EnumRefundStatus.Failed || refundReuslt == (int)EnumRefundStatus.UnKnown; //失败 或 未知 - } + { + //同步zybz 已出院给CIS + SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() + { + zyh = zyh, + zybz = ((int)EnumZYBZ.Ycy).ToString(), + }); + } + + var res = new + { + jsnm = jsnm + }; + return Success(null, res); + } + + /// + /// 获取医保结算 构造入参 + /// + /// + /// + public ActionResult GetInpatientSettYbPatInfo(string zyh) + { + var data = _dischargeSettleDmnService.GetInpatientSettYbPatInfo(zyh, this.OrganizeId); + if (data == null) + { + return Error("入院办理信息未找到"); + } + return Success(null, data); + } + + public ActionResult upLoadReturnData(IList upReturnData, string patzyh) + { + if (upReturnData != null && upReturnData.Count > 0) + { + foreach (var feeEntity in upReturnData) + { + feeEntity.Create(true); + feeEntity.OrganizeId = this.OrganizeId; + feeEntity.zt = "1"; + feeEntity.zyh = patzyh; + _hospSettlementGAYBZYMXXRFeeRepo.Insert(feeEntity); + } + } + + return Success(); + } + + /// + /// 模拟结算 保存结果 + /// + /// + /// + public ActionResult SubmitSimulateSettlementResult(HospSimulateSettlementGAYBFeeEntity feeEntity) + { + feeEntity.Create(true); + feeEntity.OrganizeId = this.OrganizeId; + feeEntity.zt = "1"; + _hospSimulateSettlementGAYBFeeRepo.Insert(feeEntity); + return Success(); + } + + #endregion + + #region 取消出院结算//(无医保算法)//20190408改为有医保算法 + + /// + /// 取消结算查询 + /// + /// + /// + [HttpPost] + [HandlerAjaxOnly] + public ActionResult GetCancelSettleStatusDetail(string zyh, string sfz, string kh, string cardType) + { + var dto = _dischargeSettleApp.GetCancelSettleStatusDetail(zyh, sfz, kh, cardType); + return Success(null, dto); + } + + /// + /// 取消结算 + /// + /// + /// + /// + /// + [HttpPost] + [HandlerAjaxOnly] + public ActionResult DoCancel(string zyh, int expectedjsnm, string cancelReason, string cancelyblsh) + { + string outTradeNo; + decimal refundAmount; + _dischargeSettleApp.DoCancel(zyh, expectedjsnm, cancelReason, cancelyblsh, out outTradeNo, out refundAmount); + + if (_sysConfigRepo.GetBoolValueByCode("HOSP_INTERFACE_WITH_CPOE", this.OrganizeId) == true) + { + //同步zybz 待结账给CIS + SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() + { + zyh = zyh, + zybz = ((int)EnumZYBZ.Djz).ToString(), + }); + } + + bool? isTradeRefundError = null; + if (!string.IsNullOrWhiteSpace(outTradeNo) && refundAmount > 0) //需要原路退回 + { + string errorMsg; + var refundReuslt = _payApp.TradeRefund(outTradeNo, refundAmount, "门诊退费", "", out errorMsg); + isTradeRefundError = refundReuslt == (int)EnumRefundStatus.Failed || refundReuslt == (int)EnumRefundStatus.UnKnown; //失败 或 未知 + } _hospdrugbillingRepo.Updatezy_brxxexpand(this.OrganizeId, zyh); - var msg = "保存成功"; - if (isTradeRefundError.HasValue) - { - if (!isTradeRefundError.Value) - { - msg = "保存成功,应退金额已原路退回"; - } - else - { - msg = "HIS保存成功,但应退金额退回失败,请人工核查"; - } - } - - return Success(msg); - } - #endregion - - #region 模拟结算(GA) - - /// - /// 模拟结算 - /// - /// - public ActionResult SimulateIndex() - { - return View(); - } - - /// - /// 模拟结算 显示医保返回结果 - /// - /// - public ActionResult SimulateForm() - { - return View(); - } - public ActionResult SimulateForm2021() - { - return View(); - } + var msg = "保存成功"; + if (isTradeRefundError.HasValue) + { + if (!isTradeRefundError.Value) + { + msg = "保存成功,应退金额已原路退回"; + } + else + { + msg = "HIS保存成功,但应退金额退回失败,请人工核查"; + } + } + return Success(msg); + } + #endregion + + #region 模拟结算(GA) + + /// + /// 模拟结算 + /// + /// + public ActionResult SimulateIndex() + { + return View(); + } + + /// + /// 模拟结算 显示医保返回结果 + /// + /// + public ActionResult SimulateForm() + { + return View(); + } + public ActionResult SimulateForm2021() + { + return View(); + } public ActionResult SimulateFormShyb2023() { return View(); @@ -1143,280 +1145,291 @@ public ActionResult SimulateFormShyb2023() /// /// [HttpPost] - public ActionResult SimulateSettSubmit() - { - return Success(); - } - - #endregion - - #region private methods - - /// - /// 获取返回内容中的flag值 - /// - /// - /// - private string resp_GetResultAttr(string xml, string attrName) - { - var dt = getDataTableFromXml(xml, "result"); - if (dt != null && dt.Rows.Count == 1) - { - var flagRow = dt.Rows[0][attrName]; - if (flagRow != null) - { - return flagRow.ToString().Trim(); - } - } - return null; - } - - /// - /// 从xml中提取tableName的DataTable - /// - /// - /// - private DataTable getDataTableFromXml(string xml, string tableName) - { - if (string.IsNullOrWhiteSpace(xml)) - { - return null; - } - if (string.IsNullOrWhiteSpace(tableName)) - { - return null; - } - var ds = XmlToDtUntility.XmlToDataSet(xml); - for (int i = 0; i < ds.Tables.Count; i++) - { - if (ds.Tables[i].TableName.Equals(tableName)) - { - return ds.Tables[i]; - } - } - return null; - } - - #endregion - - - #region 中途结算 - public ActionResult PartialSettleIndex() - { - return View(); - } - public ActionResult PartialSettleIndex2021() - { - return View(); - } - - /// - /// 中途结算 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [HttpPost] - [HandlerAjaxOnly] - public ActionResult PartialSettleSave(string zyh, DateTime startTime, DateTime endTime, string fph, InpatientSettFeeRelatedDTO feeRelated - , CQZyjs05Dto ybfeeRelated, string jslx - , string outTradeNo) - { - if (string.IsNullOrEmpty(zyh)) - { - throw new FailedCodeException("HOSP_ZYH_IS_EMPTY"); - } - - if (string.IsNullOrEmpty(jslx)) - { - return Error("结算类型不能为空,请联系his运维处理!"); - } - - - int jsnm; - _dischargeSettleApp.SavePartialSettle(zyh, startTime, endTime, fph, feeRelated, ybfeeRelated, outTradeNo, jslx, out jsnm); + public ActionResult SimulateSettSubmit() + { + return Success(); + } + + #endregion + + #region private methods + + /// + /// 获取返回内容中的flag值 + /// + /// + /// + private string resp_GetResultAttr(string xml, string attrName) + { + var dt = getDataTableFromXml(xml, "result"); + if (dt != null && dt.Rows.Count == 1) + { + var flagRow = dt.Rows[0][attrName]; + if (flagRow != null) + { + return flagRow.ToString().Trim(); + } + } + return null; + } + + /// + /// 从xml中提取tableName的DataTable + /// + /// + /// + private DataTable getDataTableFromXml(string xml, string tableName) + { + if (string.IsNullOrWhiteSpace(xml)) + { + return null; + } + if (string.IsNullOrWhiteSpace(tableName)) + { + return null; + } + var ds = XmlToDtUntility.XmlToDataSet(xml); + for (int i = 0; i < ds.Tables.Count; i++) + { + if (ds.Tables[i].TableName.Equals(tableName)) + { + return ds.Tables[i]; + } + } + return null; + } + + #endregion + + + #region 中途结算 + public ActionResult PartialSettleIndex() + { + return View(); + } + public ActionResult PartialSettleIndex2021() + { + return View(); + } + + /// + /// 中途结算 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [HttpPost] + [HandlerAjaxOnly] + public ActionResult PartialSettleSave(string zyh, DateTime startTime, DateTime endTime, string fph, InpatientSettFeeRelatedDTO feeRelated + , CQZyjs05Dto ybfeeRelated, string jslx + , string outTradeNo) + { + if (string.IsNullOrEmpty(zyh)) + { + throw new FailedCodeException("HOSP_ZYH_IS_EMPTY"); + } + + if (string.IsNullOrEmpty(jslx)) + { + return Error("结算类型不能为空,请联系his运维处理!"); + } + + + int jsnm; + _dischargeSettleApp.SavePartialSettle(zyh, startTime, endTime, fph, feeRelated, ybfeeRelated, outTradeNo, jslx, out jsnm); _hospdrugbillingRepo.Updatezy_brxxexpand(this.OrganizeId, zyh); var res = new - { - jsnm = jsnm - }; - return Success(null, res); - } - /// - /// 中途结算后需处理掉上传明细的记录 避免出院时医保端取值不准 - /// - /// - /// - public ActionResult ExecPartialSettleDeatil(string zyh, string jsnm, string czlx) - { - _hospdrugbillingRepo.ExecPartialSettleFeeDetail(zyh, jsnm, czlx); - return Success(); - } - /// - /// 住院号查询数据(包括病人信息和计费明细) zyh 或 kh +cardType 或 sfz +cardType - /// - /// - /// - /// - /// - /// - [HandlerAjaxOnly] - public ActionResult GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) - { - if (!string.IsNullOrWhiteSpace(zyh)) - { - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 - _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 - } - var dto = _dischargeSettleApp.GetPartialInpatientSettleStatusDetail(zyh, sfz, kh, cardType, jslx, ver); - return Success("", dto); - } - - /// - /// 转出院结算 - /// - /// - /// - public ActionResult TransfertoCYsettle(string zyh) - { - var data = _dischargeSettleApp.PreCYsettle(zyh); - - SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() - { - zyh = zyh, - zybz = ((int)EnumZYBZ.Ycy).ToString(), - }); - return Success("", data); - } - - - public ActionResult CancelPartialConfirmForm() - { - return View(); - } - /// - /// 获取退费金额 - /// - /// - public ActionResult Getrefunds_available(int jsnm) - { - if (jsnm == 0) - { - throw new FailedException("缺少结算内码"); - } - var jsentity = _hospSettlementRepo.IQueryable().FirstOrDefault(p => p.jsnm == jsnm && p.OrganizeId == OrganizeId && p.zt == "1" && p.jszt == "1"); - return Success("", jsentity.xjzf); - //db.IQueryable(p => p.zyh == zyh && p.OrganizeId == orgId && p.zt == "1" && p.jszt == "2").Select(p => p.cxjsnm); - } - #endregion - - #region 取消出院结算 - public ActionResult GetCQLastjsnm(string zyh) - { - var data = _dischargeSettleDmnService.GetCQLastJsnm(zyh, this.OrganizeId); - return Content(data.ToString()); - } - - public ActionResult GetCQLastLsh(int jsnm) - { - var data = _dischargeSettleDmnService.GetCQLastLsh(jsnm, this.OrganizeId); - return Success("", data); - } - public ActionResult GetCancelSettInfo(int jsnm) - { - var data = _dischargeSettleDmnService.GetCancelSettInfo(jsnm, this.OrganizeId); - data.operatorId = this.UserIdentity.rygh; - data.operatorName = this.UserIdentity.UserName; - return Content(data.ToJson()); - } - #endregion - - #region 医保未审批 - public ActionResult GetCYZD(string zyh) - { - if (string.IsNullOrWhiteSpace(zyh)) - { - throw new FailedException("缺少病人信息"); - } - - var DiseaseInfo = _hospMultiDiagnosisRepo.SelectData(zyh, this.OrganizeId); - var zdmc = DiseaseInfo.Select(p => p.zdmc + ","); - return Success("", zdmc); - } - - - public ActionResult GetUnapproveddetails(string cfmxlshstr, string zyh) - { - var data = _dischargeSettleDmnService.sweep_expired_approvals(cfmxlshstr, this.OrganizeId, zyh); - return Content(data.ToJson()); - } - - public ActionResult updatespbz(string cfhstr) - { - _dischargeSettleDmnService.updatespbz(cfhstr, OrganizeId, this.UserIdentity.UserCode); - return Success(); - } - - public ActionResult GetCurrentpatientcharge(string zyh) - { - if (string.IsNullOrWhiteSpace(zyh)) - { - throw new FailedException("缺少住院号"); - } - IList sfxm = _hospFeeDmnService.GetItemFeeDetailVOList(zyh, this.OrganizeId).ToList(); - IList yp = _hospFeeDmnService.GetMedicinFeeDetailVOList(zyh, this.OrganizeId).ToList(); - return Content(sfxm.Union(yp).ToList().ToJson()); - } - - public ActionResult MedicalInsuranceApprovalIndex() - { - return View(); - } - #endregion - - #region 医保预结算落地 - public ActionResult subybyjsld(CqybSett2303Entity YuJieSuan) - { - DateTime dateTime = DateTime.Now; - YuJieSuan.prejs_id = Guid.NewGuid().ToString(); - YuJieSuan.czrq = dateTime; - YuJieSuan.czydm = this.UserIdentity.UserCode; - YuJieSuan.zt = 1; - YuJieSuan.zt_czy = this.UserIdentity.UserCode; - YuJieSuan.zt_rq = dateTime; - _dischargeSettleDmnService.SaveSett2303(YuJieSuan); - return Success(); - } - - #endregion - } - - /// - /// - /// - class InpatientDischargeStatus - { - /// - /// 住院号 - /// - public string admsNum { get; set; } - - /// - /// 状态 - /// - public string dischargeStatus { get; set; } - - } + { + jsnm = jsnm + }; + return Success(null, res); + } + /// + /// 中途结算后需处理掉上传明细的记录 避免出院时医保端取值不准 + /// + /// + /// + public ActionResult ExecPartialSettleDeatil(string zyh, string jsnm, string czlx) + { + _hospdrugbillingRepo.ExecPartialSettleFeeDetail(zyh, jsnm, czlx); + return Success(); + } + /// + /// 住院号查询数据(包括病人信息和计费明细) zyh 或 kh +cardType 或 sfz +cardType + /// + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult GetPartialInpatientSettleStatusDetail(string zyh, string sfz, string kh, string cardType, string jslx, string ver) + { + if (!string.IsNullOrWhiteSpace(zyh)) + { + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 0);//同步项目费用 + _hospFeeDmnService.SyncPatFee(OrganizeId, zyh, 1);//同步药品费用 + } + var dto = _dischargeSettleApp.GetPartialInpatientSettleStatusDetail(zyh, sfz, kh, cardType, jslx, ver); + return Success("", dto); + } + /// + /// 转出院结算 + /// + /// + /// + public ActionResult TransfertoCYsettle(string zyh) + { + var data = _dischargeSettleApp.PreCYsettle(zyh); + + SiteCISAPIHelper.UpdateInpatientBasicInfo(new InpatientPatientInfoDTO() + { + zyh = zyh, + zybz = ((int)EnumZYBZ.Ycy).ToString(), + }); + return Success("", data); + } + public ActionResult CancelPartialConfirmForm() + { + return View(); + } + /// + /// 获取退费金额 + /// + /// + public ActionResult Getrefunds_available(int jsnm) + { + if (jsnm == 0) + { + throw new FailedException("缺少结算内码"); + } + var jsentity = _hospSettlementRepo.IQueryable().FirstOrDefault(p => p.jsnm == jsnm && p.OrganizeId == OrganizeId && p.zt == "1" && p.jszt == "1"); + return Success("", jsentity.xjzf); + //db.IQueryable(p => p.zyh == zyh && p.OrganizeId == orgId && p.zt == "1" && p.jszt == "2").Select(p => p.cxjsnm); + } + #endregion + + #region 取消出院结算 + public ActionResult GetCQLastjsnm(string zyh) + { + var data = _dischargeSettleDmnService.GetCQLastJsnm(zyh, this.OrganizeId); + return Content(data.ToString()); + } + + public ActionResult GetCQLastLsh(int jsnm) + { + var data = _dischargeSettleDmnService.GetCQLastLsh(jsnm, this.OrganizeId); + return Success("", data); + } + public ActionResult GetCancelSettInfo(int jsnm) + { + var data = _dischargeSettleDmnService.GetCancelSettInfo(jsnm, this.OrganizeId); + data.operatorId = this.UserIdentity.rygh; + data.operatorName = this.UserIdentity.UserName; + return Content(data.ToJson()); + } + #endregion + + #region 医保未审批 + public ActionResult GetCYZD(string zyh) + { + if (string.IsNullOrWhiteSpace(zyh)) + { + throw new FailedException("缺少病人信息"); + } + + var DiseaseInfo = _hospMultiDiagnosisRepo.SelectData(zyh, this.OrganizeId); + var zdmc = DiseaseInfo.Select(p => p.zdmc + ","); + return Success("", zdmc); + } + + + public ActionResult GetUnapproveddetails(string cfmxlshstr, string zyh) + { + var data = _dischargeSettleDmnService.sweep_expired_approvals(cfmxlshstr, this.OrganizeId, zyh); + return Content(data.ToJson()); + } + + public ActionResult updatespbz(string cfhstr) + { + _dischargeSettleDmnService.updatespbz(cfhstr, OrganizeId, this.UserIdentity.UserCode); + return Success(); + } + + public ActionResult GetCurrentpatientcharge(string zyh) + { + if (string.IsNullOrWhiteSpace(zyh)) + { + throw new FailedException("缺少住院号"); + } + IList sfxm = _hospFeeDmnService.GetItemFeeDetailVOList(zyh, this.OrganizeId).ToList(); + IList yp = _hospFeeDmnService.GetMedicinFeeDetailVOList(zyh, this.OrganizeId).ToList(); + return Content(sfxm.Union(yp).ToList().ToJson()); + } + + public ActionResult MedicalInsuranceApprovalIndex() + { + return View(); + } + #endregion + + #region 医保预结算落地 + public ActionResult subybyjsld(CqybSett2303Entity YuJieSuan) + { + DateTime dateTime = DateTime.Now; + YuJieSuan.prejs_id = Guid.NewGuid().ToString(); + YuJieSuan.czrq = dateTime; + YuJieSuan.czydm = this.UserIdentity.UserCode; + YuJieSuan.zt = 1; + YuJieSuan.zt_czy = this.UserIdentity.UserCode; + YuJieSuan.zt_rq = dateTime; + _dischargeSettleDmnService.SaveSett2303(YuJieSuan); + return Success(); + } + + #endregion + + public ActionResult QualityControlIndex() + { + return View(); + } + + public ActionResult CountLisIncompletezy(string zyh) + { + var num = _dischargeSettleDmnService.CountLisIncompletezy(OrganizeId, zyh); + var data = new + { + num = num + }; + return Content(data.ToJson()); + } + } + + /// + /// + /// + class InpatientDischargeStatus + { + /// + /// 住院号 + /// + public string admsNum { get; set; } + + /// + /// 状态 + /// + public string dischargeStatus { get; set; } + } } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/SettlementController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/SettlementController.cs index 62df8d8d..dda58b8b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/SettlementController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Controllers/SettlementController.cs @@ -182,6 +182,25 @@ public ActionResult GetPaginationSettlementList(Pagination pagination, string ke }; return Content(data.ToJson()); } + /// + /// 待上传的自费结算病人信息 + /// + /// + /// + /// + /// + /// + public ActionResult GetPaginationZFSettlementList(Pagination pagination, string keyword, DateTime? jsksrq, DateTime? jsjsrq) + { + var data = new + { + rows = _hospSettDmnService.GetPaginationZFSettlementList(pagination, OrganizeId, keyword, jsksrq, jsjsrq), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(data.ToJson()); + } /// /// @@ -206,7 +225,7 @@ public ActionResult GetSettlementItems() /// /// /// - public ActionResult GetSettleItemFrom(Pagination pagination, string zyh, string dlCode,string jsnms, string mc) + public ActionResult GetSettleItemFrom(Pagination pagination, string zyh, string dlCode, string jsnms, string mc) { var dto = _hospSettDmnService.SettlementDetailsItemsQuery(pagination, zyh, OrganizeId, dlCode, jsnms, mc); var data = new @@ -231,6 +250,5 @@ public ActionResult UpdateSettInvoiceNo(int jsnm, string fph) _hospSettDmnService.UpdateSettInvoiceNo(OrganizeId, jsnm, fph); return Success(); } - } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/BookkeepInHos/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/BookkeepInHos/Index.cshtml index d0b4e6d1..4426daf9 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/BookkeepInHos/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/BookkeepInHos/Index.cshtml @@ -77,7 +77,18 @@
      @@ -111,7 +122,7 @@ *收费项目: - - - - + - + + + + + + - - - - - - - - @@ -85,7 +82,7 @@
      - + @@ -252,7 +263,7 @@ function gridListData() { var $gridList = $("#gridList"); $gridList.newtouchLocalDataGrid({ - height: $(window).height() - 330, + height: $(window).height() - 340, unwritten: false, colModel: [ { label: "主键", name: "newid", hidden: true, key: true }, @@ -317,25 +328,28 @@ } }); } + $("#sfxmmc").sfxmFloatingSelector({ + djDecimalPlaces: 4, + searchType:"sfxm,yp.kc", + ajaxparameters: function ($thisinput) { + //收费项目 浮层 - //加载收费项目,医生下拉框的值 - function initControl() { - $("#jzrq").val($.getDate()); - //收费项目 浮层 - var searchType = "sfxm"; var dllb = '2'; - if ('@(isacountingPageMayMedicine ? "true" : "")' == 'true') { - searchType += ',yp'; - dllb += ",1"; - if ('@(isMedicineSearchRelatedKC ? "true" : "")' == 'true') { - searchType += '.kc'; - } + var parameters = ""; + if ($("#cl").prop("checked") == true) { + if ('@(isacountingPageMayMedicine ? "true" : "")' == 'true') { + dllb += ",1"; + parameters += "mzzybz=2" + "&dlCode=18&sfdllx=WM"; + parameters += "&dllb=" + dllb + } + }; + @*if ('@(isMedicineSearchRelatedKC ? "true" : "")' == 'true') { + + }*@ + if (parameters=="") { + parameters += "mzzybz=2" + "&dllb=" + dllb; } - $("#sfxmmc").sfxmFloatingSelector({ - djDecimalPlaces: 4, - searchType: searchType, - ajaxparameters: function ($thisinput) { - return "mzzybz=2&dllb=" + dllb + "&keyword=" + $thisinput.val(); + return parameters+"&keyword=" + $thisinput.val(); }, itemdbclickhandler: function ($thistr) { if (!selectedZyh) { @@ -356,11 +370,15 @@ if ($("#yzlx").val() == "1") //若为药品则默认药房为执行科室 { $("#zxks").val(""); - + } return; } }); + //加载收费项目,医生下拉框的值 + function initControl() { + $("#jzrq").val($.getDate()); + $('#jzks').newtouchFloatingSelector({ width: 400, @@ -460,11 +478,11 @@ $("#zxks").val('@ViewBag.staffDeptName'); $("#zxks").attr("data-label", '@ViewBag.staffDept'); } - + //保存操作 function btn_Save() { - debugger + debugger if (!selectedZyh) { $.modalAlert("病人基本信息不能为空", 'warning'); return; @@ -575,7 +593,7 @@ } function newtouch_event_f2() { - debugger + debugger var newRowData = getEditRowData(); if (!(checkEditingRowData(newRowData))) { //数据是否完善,检查必填项 @@ -588,7 +606,7 @@ fillDataToGrid(); clearJZInfo(); - setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); + //setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); } $('#sl').keydownEnterEvent(function (event) { @@ -685,7 +703,7 @@ bottomButtonsReset(); - setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); + //setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); } if (data && (parseFloat(data.dj) < '0' || parseFloat(data.dj) == '0')) { $.modalConfirm("单价为0,确认是否修改", function (flag) { @@ -790,7 +808,7 @@ } else if (!((/^[0-9]+([.]{1}[0-9]{1,2})?$/).test(rowData.sl)) || rowData.sl < 0) { $.modalAlert("数量为整数或小数点后两位", 'warning'); - } + } else { return true; } @@ -815,7 +833,7 @@ bottomButtonsReset(); - setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); + //setTimeout("$('#sfxmmc').trigger('focus');$('#sfxmmc').trigger('click');", 100); } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/CancelIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/CancelIndex.cshtml index 3b0533c5..8b002976 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/CancelIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/CancelIndex.cshtml @@ -244,11 +244,11 @@ zyh = null; jsnm = null ybjsh = null; - if (!obj || (!obj.zyh && !obj.kh)) { - isLoadingIIII = false; - $.modalAlert("请输入住院号,或先读卡!", 'warning'); - return false; - } + //if (!obj || (!obj.zyh && !obj.kh)) { + // isLoadingIIII = false; + // $.modalAlert("请输入住院号,或先读卡!", 'warning'); + // return false; + //} $.najax({ type: "POST", url: "/HospitalizationManage/DischargeSettle/GetCancelSettleStatusDetail", @@ -257,7 +257,7 @@ success: function (ajaxresp) { //住院病人信息 patModel = ajaxresp.data.InpatientSettPatInfo; - isYbjyjz = openYbSett && patModel.brxz == '1'; + isYbjyjz = openYbSett && patModel.brxz != '0'; isXnhjyjz = openXnhSett && patModel.brxz == '8' && @@ -367,7 +367,6 @@ } }); if (DenySettleReturn.xxfhm === "P001") { - debugger; shybhisSubmit(DenySettleReturn.xxnr.translsh); } else { $.modalAlert('住院结算冲正失败:' + DenySettleReturn.fhxx + '【此时医保已经结算成功,请联系his开发商处理】', 'success'); @@ -446,9 +445,8 @@ } }); } - - $.modalAlert(data.message, 'success'); - funcDoPageClear(); + //广西医保特有 + // refundPrintInvoiceReq(zyh, jsnm); } }); } @@ -459,12 +457,40 @@ data: { zyh: zyh, expectedjsnm: jsnm, cancelReason: $.trim($('#txtCancelReason').val()), cancelyblsh: cancelyblsh }, //期望的结算内码 防止过程中变更 type: "POST", success: function (data) { - $.modalAlert(data.message, 'success'); - funcDoPageClear(); + //广西医保特有 + //refundPrintInvoiceReq(zyh, jsnm); + } + }); + } + //票据冲红 + function refundPrintInvoiceReq(mzh, jsnm) { + var requestJson = { "BusinessName": "发票冲红", "paySerialNo": mzh, "paySettlementNo": jsnm, "Operator": "@(opr.UserName)", "Reason": "出院结算取消冲红" }; + $.ajax({ + type: "POST", + url: "http://127.0.0.1:33333/api/YiBao/InvoicePost", + dataType: "json", + data: requestJson, + async: false, + success: function (data) { + if (data.code == "0") { + $.modalAlert("电子票冲红成功", 'success'); + funcDoPageClear(); + } + else { + $.loading(false); + isuccer = false; + $.modalAlert("电子票冲红失败[" + data.mes + "]", 'error'); + return; + } + }, + error: function (request, error, ex) { + $.loading(false); + isuccer = false; + $.modalAlert('电子票冲红异常[' + ex + ']', 'error'); + return; } }); } - \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/Index2021.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/Index2021.cshtml index b27ddf22..9c9bf884 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/Index2021.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/Index2021.cshtml @@ -631,7 +631,7 @@ payoptype.mdtrt_cert_type = cqPatInfo.ybklx; payoptype.orgId = "@opr.OrganizeId"; cqPatInfo.grbh = payoptype.psn_no; - var jzxx = { mdtrt_id: payoptype.mdtrt_id, med_type: payoptype.med_type, djxx: payoptype }; + var jzxx = { mdtrt_id: payoptype.mdtrt_id, med_type: payoptype.med_type, djxx: payoptype, orgId: '@(opr.OrganizeId)' }; funcSuccCallback(jzxx); //$.ajax({ // type: "POST", @@ -824,6 +824,7 @@ insuplc_admdvs: cqPatInfo.xzqh, operatorId: '@(opr.rygh)', operatorName: '@(opr.UserName)', + orgId: '@(opr.OrganizeId)', hisId: patModel.zyh, acct_used_flag: "1", dscgTime: ajaxresp.cyrq @@ -1215,7 +1216,18 @@ } var ybklx = $('#readCardCardType').val(); cardInfo1 = yibaoCardInfo.output.baseinfo; //医保基本信息 - cardInfo2 = yibaoCardInfo.output.insuinfo[0];//参保信息 + if (yibaoCardInfo.output.insuinfo.length > 1) { + for (var i = 0; i < yibaoCardInfo.output.insuinfo.length; i++) { + if (yibaoCardInfo.output.insuinfo[i].paus_insu_date) + continue; + else { + cardInfo2 = yibaoCardInfo.output.insuinfo[i]; + break; + } + } + } else + cardInfo2 = yibaoCardInfo.output.insuinfo[0];//参保信息 + //cardInfo2 = yibaoCardInfo.output.insuinfo[0];//参保信息 if (ybklx !== "02") { cardInfo3 = yibaoCardInfo.output.cardecinfo;//卡信息 cqPatInfo.ecToken = cardInfo3.ecToken; diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/PartialSettleIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/PartialSettleIndex.cshtml index 74a873e8..420e89a8 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/PartialSettleIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/HospitalizationManage/Views/DischargeSettle/PartialSettleIndex.cshtml @@ -31,24 +31,30 @@ + + @if (openYbSett == true) { @Html.Partial("YibaoRedCardCommon") } 开始时间: + 开始时间: 结束时间: +
      姓名: @@ -57,15 +63,6 @@
      -
      + @*
      *@
      +
      + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGTradUpload/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGTradUpload/Index.cshtml new file mode 100644 index 00000000..a2ecb6ab --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGTradUpload/Index.cshtml @@ -0,0 +1,460 @@ + +@{ + Layout = "~/Views/Shared/_Index.cshtml"; + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + +} + + + +
      +
      + + + + + + + + + + @* + *@ + + * + + + + +
      开始时间: + + + + 上传情况: + + 交易类型: + + 住院号: + + + + + + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGUpload/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGUpload/Index.cshtml new file mode 100644 index 00000000..4944a4fc --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/JGUpload/Index.cshtml @@ -0,0 +1,227 @@ + +@{ + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + +
      +
      + + + + + + + + + + + + + + + +
      结算时间: + + + + 上传情况: + + 姓名: + + + + + + + +
      +
      +
      +
      +
      +
      +
      + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/Web.config b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/Web.config new file mode 100644 index 00000000..7c528d96 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/JGManage/Views/Web.config @@ -0,0 +1,58 @@ + + + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutBookController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutBookController.cs index 3bed79e3..0b704f4e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutBookController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutBookController.cs @@ -46,8 +46,7 @@ public ActionResult TimeForm() return View(); } - public ActionResult Create() - { + public ActionResult Create() { return View(); } public ActionResult PatOutBookManage() @@ -55,13 +54,13 @@ public ActionResult PatOutBookManage() return View(); } - public ActionResult GetPagintionList(Pagination pagination, string orgId, string keyword) + public ActionResult GetPagintionList(Pagination pagination,string orgId, string keyword) { if (orgId == null) { orgId = OrganizeId; } - var oplist = _OutBookDmnService.GetPagintionList(pagination, orgId, keyword); + var oplist = _OutBookDmnService.GetPagintionList(pagination, orgId,keyword); //for (int i = 0; i < oplist.Count; i++) //{ // var ghList = _OutBookRepo.getStaffByKs(oplist[i].ks);//根据科室获取医生工号列表 @@ -80,8 +79,7 @@ public ActionResult GetPagintionList(Pagination pagination, string orgId, string }; return Content(data.ToJson()); } - public ActionResult GetStaffList(string orgId) - { + public ActionResult GetStaffList(string orgId) { if (orgId == null) { orgId = OrganizeId; @@ -89,18 +87,16 @@ public ActionResult GetStaffList(string orgId) var result = _OutBookDmnService.GetStaffList(orgId); return Content(result.ToJson()); } - public ActionResult GetMzpbZlxmzhList(string zhcode, string keyword) - { - var result = _OutBookDmnService.GetMzpbZlxmzh(zhcode, keyword, OrganizeId); + public ActionResult GetMzpbZlxmzhList(string zhcode,string keyword) { + var result = _OutBookDmnService.GetMzpbZlxmzh(zhcode,keyword,OrganizeId); return Content(result.ToJson()); } - public ActionResult UpdateForm(int keyValue, string ks, string gh) - { + public ActionResult UpdateForm(int keyValue,string ks, string gh) { var orgId = OrganizeId; - var CreateCode = UserIdentity.UserName; + var CreateCode=UserIdentity.UserName; var CreateTime = DateTime.Now; - _OutBookRepo.UpdateForm(keyValue, orgId, ks, gh, CreateCode, CreateTime); + _OutBookRepo.UpdateForm(keyValue, orgId,ks, gh, CreateCode, CreateTime); return Success("操作成功。"); } @@ -110,7 +106,7 @@ public ActionResult SubmitForm(string ks, List ghList) var CreateCode = UserIdentity.UserName; var CreateTime = DateTime.Now; //设置该科室下状态为0 - _OutBookRepo.updateZt(ks, CreateCode, CreateTime); + _OutBookRepo.updateZt(ks, CreateCode, CreateTime,OrganizeId); foreach (var gh in ghList) { //新增 更新 @@ -119,8 +115,7 @@ public ActionResult SubmitForm(string ks, List ghList) return Success("操作成功。"); } - public ActionResult getArrangeInfo(int ghpbId) - { + public ActionResult getArrangeInfo(int ghpbId) { if (ghpbId == 0) { //新增 @@ -128,8 +123,8 @@ public ActionResult getArrangeInfo(int ghpbId) } else { - var result = _OutBookDmnService.getArrangeInfo(ghpbId); - var ghList = _OutBookRepo.getStaffByKs(result.ks);//根据科室获取医生工号列表 + var result = _OutBookDmnService.getArrangeInfo(ghpbId,OrganizeId); + var ghList = _OutBookRepo.getStaffByKs(result.ks,OrganizeId);//根据科室获取医生工号列表 //if (result != null && result.mjzbz != ((int)EnumOutPatientType.expertOutpat).ToString()) //{ // result.ys = getStaffGh(ghList);//拼接以逗号分割的医生工号 @@ -144,22 +139,19 @@ public ActionResult getDateInfo(int ghpbId) var result = _OutBookDmnService.getDateInfo(orgId, ghpbId); return Content(result.ToJson()); } - public ActionResult getDateTimeInfo(int ghpbId, string timeslot) + public ActionResult getDateTimeInfo(int ghpbId,string timeslot) { var orgId = OrganizeId; var result = _OutBookDmnService.getDateTimeInfo(orgId, ghpbId, timeslot); return Content(result.ToJson()); } //将医生工号列表转换成以逗号分割的医生姓名 - public string getStaffName(IList ghList) - { - if (ghList == null) - { + public string getStaffName(IList ghList) { + if (ghList == null) { return null; } var strName = ""; - foreach (var gh in ghList) - { + foreach (var gh in ghList) { strName += _OutBookDmnService.getStaffName(gh) + ","; } if (strName.Contains(",")) @@ -170,8 +162,7 @@ public string getStaffName(IList ghList) } //将医生工号列表转换成以逗号分割的字符串 - public string getStaffGh(IList ghList) - { + public string getStaffGh(IList ghList) { if (ghList == null) { return null; @@ -179,7 +170,7 @@ public string getStaffGh(IList ghList) var strGh = ""; foreach (var gh in ghList) { - strGh += gh + ","; + strGh += gh+","; } if (strGh.Contains(",")) { @@ -192,7 +183,7 @@ public ActionResult DeleteArrange(int ghpbId) _OutBookDmnService.DeleteArrange(ghpbId, this.OrganizeId); return Success("操作成功。"); } - public ActionResult SubmitArrange(OutBookArrangeVO entity, int ghpbId) + public ActionResult SubmitArrange(OutBookArrangeVO entity, int ghpbId) { var orgId = OrganizeId; var User = UserIdentity.UserName; @@ -219,7 +210,7 @@ public ActionResult SubmitArrange(OutBookArrangeVO entity, int ghpbId) for (int i = 1; i <= 7; i++) { //新增 更新排班时间 [mz_ghpb_date] - _OutBookDateRepo.UpdateDate(entity, ghpbId, i.ToString(), orgId, User, Time, 0); + _OutBookDateRepo.UpdateDate(entity, ghpbId, i.ToString(), orgId, User, Time,0); } return Success("操作成功。"); } @@ -247,10 +238,10 @@ public ActionResult SaveDataPbhy(List pbList) /// 修改出诊或者停诊状态 /// /// - public ActionResult SaveDatatzcz(Decimal ScheduId, string czzt, string tzyy) + public ActionResult SaveDatatzcz(Decimal ScheduId,string czzt,string tzyy) { string orgId = this.OrganizeId; - _OutBookDmnService.SaveDatatzcz(ScheduId, czzt, orgId, tzyy); + _OutBookDmnService.SaveDatatzcz(ScheduId, czzt, orgId,tzyy); return Success(); } public ActionResult getDateInfosjd() @@ -263,7 +254,7 @@ public ActionResult getDateInfosjd() public ActionResult getDateInfosjdcount(int ghpbId) { string orgId = OrganizeId; - IList result = _OutBookDmnService.getDateInfosjdcount(ghpbId, orgId); + IList result = _OutBookDmnService.getDateInfosjdcount(ghpbId,orgId); return Content(result.ToJson()); } @@ -274,22 +265,20 @@ public ActionResult SubmitghpbTime(string timestr) var Time = DateTime.Now; for (int i = 0; i < timestr.Split(',').Length; i++) { - _OutBookDmnService.InsertghpbTime(timestr.Split(',')[i].Split('-')[0], timestr.Split(',')[i].Split('-')[1], orgId, User, Time, i + 1); + _OutBookDmnService.InsertghpbTime(timestr.Split(',')[i].Split('-')[0], timestr.Split(',')[i].Split('-')[1], orgId, User, Time,i+1); } return Success("操作成功。"); } - public ActionResult getStaffByKs(string ks) - { + public ActionResult getStaffByKs(string ks) { string orgId = OrganizeId; - IList result = _OutBookDmnService.getStaffListByKs(ks, orgId); + IList result= _OutBookDmnService.getStaffListByKs(ks, orgId); return Content(result.ToJson()); //return Content(staffName); } - public ActionResult CreateSchedule(Pagination pagination, string time) - { - + public ActionResult CreateSchedule(Pagination pagination,string time) { + var orgId = OrganizeId; var Time = Convert.ToDateTime(time); //执行存储过程 @@ -302,13 +291,13 @@ public ActionResult CreateSchedule(Pagination pagination, string time) { _OutBookScheduleRepo.ExecSchedule(); } - + //获取列表 - var list = _OutBookScheduleRepo.GetPagintionList(pagination, orgId, Time); + var list= _OutBookScheduleRepo.GetPagintionList(pagination,orgId, Time); var oplist = new List(); for (int i = 0; i < list.Count; i++) { - var ghList = _OutBookRepo.getStaffByKs(list[i].czks);//根据科室获取医生工号列表 + var ghList = _OutBookRepo.getStaffByKs(list[i].czks,OrganizeId);//根据科室获取医生工号列表 list[i].ysgh = getStaffGh(ghList); list[i].ysxm = getStaffName(ghList);//将医生工号列表转换成以逗号分割的医生姓名 } @@ -322,12 +311,12 @@ public ActionResult CreateSchedule(Pagination pagination, string time) }; return Content(data.ToJson()); } - public ActionResult GetSchedule(string kssj, string jssj, string ys, string czztcx, string ScheduId, string ks, string lx) + public ActionResult GetSchedule(string kssj,string jssj,string ys,string czztcx,string ScheduId,string ks,string lx) { var orgId = OrganizeId; //获取列表 - var list = _OutBookScheduleRepo.GetPagintionListTime(orgId, kssj, jssj, ys, czztcx, ScheduId, ks, lx,""); + var list = _OutBookScheduleRepo.GetPagintionListTime(orgId, kssj, jssj, ys, czztcx, ScheduId, ks, lx); var oplist = new List(); var data = new { @@ -337,9 +326,9 @@ public ActionResult GetSchedule(string kssj, string jssj, string ys, string czzt } #region HIS 预约/取消预约 - public ActionResult PatBookGh(string cardNo, int ScheduId, string brxz, string Doctor, DateTime OutDate) + public ActionResult PatBookGh(string cardNo,int ScheduId, string brxz, string Doctor, DateTime OutDate) { - var bookId = _OutBookDmnService.PatBookGh(cardNo, ScheduId, brxz, Doctor, OutDate, this.OrganizeId); + var bookId = _OutBookDmnService.PatBookGh(cardNo,ScheduId, brxz, Doctor, OutDate,this.OrganizeId); return Success(); } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatChargeController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatChargeController.cs index 066a224a..5463669d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatChargeController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatChargeController.cs @@ -33,7 +33,9 @@ using System.Net; using System.Security.Cryptography.X509Certificates; using System.Net.Security; -using Aop.Api.Domain; +using Newtouch.Infrastructure.Model; +using System.Configuration; +using Newtouch.HIS.DomainServices; namespace Newtouch.HIS.Web.Areas.OutpatientManage.Controllers { @@ -53,12 +55,13 @@ public class OutpatChargeController : ControllerBase private readonly IGuiAnOutpatientXnhApp _guiAnOutpatientXnhApp; private readonly ISysPatientBasicInfoRepo _sysPatientBasicInfoRepo; private readonly IPhysicalexamDmnService _iphysicalexamDmnService; - private readonly ICqybUploadPresList04Repo _iCqybUploadPresList04Repo; - private readonly ICqybMedicalReg02Repo _cqybMedicalReg02Repo; + private readonly ICqybUploadPresList04Repo _iCqybUploadPresList04Repo; + private readonly ICqybMedicalReg02Repo _cqybMedicalReg02Repo; private readonly ICqybMedicalInPut02Repo _cqybMedicalinput02Repo; - private readonly ICqybSett05Repo _cqybSett05Repo; + private readonly ICqybSett05Repo _cqybSett05Repo; private readonly ICqybSett23Repo _cqybSett23Repo; private readonly ICqybUpdateMedicalInput03Repo _cqybupdatemedicalInput03Repo; + private readonly IPatientBasicInfoDmnService _PatientBasicInfoDmnService; #region view /// @@ -266,9 +269,6 @@ public ActionResult Index2018() ViewBag.ReportServerHOST = ConfigurationHelper.GetAppConfigValue("ReportServer.HOST"); ViewBag.OrgId = this.OrganizeId; ViewBag.isOpenQfyj = _sysConfigRepo.GetBoolValueByCode("Outpatient_Charge_Open_Qfyj", this.OrganizeId); - //开关:预约挂号 - ViewBag.ISOpenBespeakRegister = (bool)_sysConfigRepo.GetBoolValueByCode("BespeakRegisterSwitch", OrganizeId, false) ? "true" : "false"; - return View(); } @@ -289,9 +289,9 @@ public ActionResult OutpatAccListView() /// /// /// - public ActionResult GetpatientAccountList(DateTime kssj, DateTime jssj, string kh, string zjh, string cardType) + public ActionResult GetpatientAccountList(DateTime kssj, DateTime jssj, string kh,string zjh, string cardType) { - return Content(_outChargeDmnService.GetpatientAccountList(kssj, jssj, kh, zjh, cardType, OrganizeId).ToJson()); + return Content(_outChargeDmnService.GetpatientAccountList(kssj, jssj, kh,zjh, cardType, OrganizeId).ToJson()); } /// @@ -302,16 +302,16 @@ public ActionResult GetpatientAccountList(DateTime kssj, DateTime jssj, string k /// /// 是否是来自退费 /// - public ActionResult GetpatientAccountInfo(string mzh, string kh, string zjh, string cardType, bool? isTF) + public ActionResult GetpatientAccountInfo(string mzh, string kh,string zjh, string cardType, bool? isTF) { - if (string.IsNullOrWhiteSpace(mzh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType)) && string.IsNullOrWhiteSpace(zjh)) + if (string.IsNullOrWhiteSpace(mzh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType))&& string.IsNullOrWhiteSpace(zjh)) { throw new FailedException("缺少查询参数:门诊号或卡号"); } var resultDto = new OutpatOptimAccInfoDto { OutpatAccInfoDto = null, - OutpatAccListDto = _outChargeDmnService.GetOutpatChargePatInfoInAcc(mzh, kh, zjh, cardType, this.OrganizeId) + OutpatAccListDto = _outChargeDmnService.GetOutpatChargePatInfoInAcc(mzh, kh,zjh, cardType, this.OrganizeId) }; if (resultDto.OutpatAccListDto.Count == 1) { @@ -341,12 +341,45 @@ public ActionResult GetpatientAccountInfo(string mzh, string kh, string zjh, str resultDto.OutpatAccInfoDto = theInfo; return Success(null, resultDto); } - + public ActionResult GetpatientAccountInfobykh(string mzh, string kh, string zjh, string cardType, bool? isTF) + { + if (string.IsNullOrWhiteSpace(mzh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType)) && string.IsNullOrWhiteSpace(zjh)) + { + throw new FailedException("缺少查询参数:门诊号或卡号"); + } + var OutpatAccListDtoList = _outChargeDmnService.GetOutpatChargePatInfoInAcc(mzh, kh, zjh, cardType, this.OrganizeId); + var datadsf = _outChargeDmnService.GetPatientGridJson(OrganizeId);//获取待收费门诊号来筛选病人信息 + var data = datadsf.Serialize().ToObject>() ?? new List(); + List patlist = new List(); + foreach (var item in data) + { + var mhzlist = OutpatAccListDtoList.Where(p => p.mzh == item.mzh).FirstOrDefault(); + if (mhzlist!=null) + { + patlist.Add(mhzlist); + } + } + if (patlist.Count < 1) return Error("查询失败"); + var resultDto = new OutpatOptimAccInfoDto + { + OutpatAccInfoDto = null, + OutpatAccListDto = patlist + }; + if (patlist.Count == 1) + { + resultDto.OutpatAccInfoDto = patlist.FirstOrDefault(); + return Success(null, resultDto); + } + return Success(null, resultDto); + } public ActionResult ChoosePrescription() { return View(); } - + public ActionResult ChooseMzh() + { + return View(); + } public ActionResult GetPatientGridJson() { var data = _outChargeDmnService.GetPatientGridJson(OrganizeId); @@ -385,46 +418,16 @@ public ActionResult GetLastSettleRecord(string xnhgrbm) /// /// //public ActionResult GetPatientkh(string xnhgrbm) - // { - //var brxx = _sysPatientBasicInfoRepo.FindEntity(p => p.xnhgrbm == xnhgrbm - // && p.OrganizeId == OrganizeId - // && p.zt == "1") ?? new SysPatientBasicInfoEntity(); - //var ghxx = _outpatientRegistRepo.IQueryable(p => - // p.blh == brxx.blh && p.OrganizeId == brxx.OrganizeId - // && p.ghzt == "1" && p.zt == "1").OrderByDescending(o => o.CreateTime).FirstOrDefault(); - //return Content(new { kh = ghxx.kh, cardType = ghxx.CardType }.ToJson()); + // { + //var brxx = _sysPatientBasicInfoRepo.FindEntity(p => p.xnhgrbm == xnhgrbm + // && p.OrganizeId == OrganizeId + // && p.zt == "1") ?? new SysPatientBasicInfoEntity(); + //var ghxx = _outpatientRegistRepo.IQueryable(p => + // p.blh == brxx.blh && p.OrganizeId == brxx.OrganizeId + // && p.ghzt == "1" && p.zt == "1").OrderByDescending(o => o.CreateTime).FirstOrDefault(); + //return Content(new { kh = ghxx.kh, cardType = ghxx.CardType }.ToJson()); //} - public ActionResult GetpatientAccountInfobykh(string mzh, string kh, string zjh, string cardType, bool? isTF) - { - if (string.IsNullOrWhiteSpace(mzh) && (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(cardType)) && string.IsNullOrWhiteSpace(zjh)) - { - throw new FailedException("缺少查询参数:门诊号或卡号"); - } - var OutpatAccListDtoList = _outChargeDmnService.GetOutpatChargePatInfoInAcc(mzh, kh, zjh, cardType, this.OrganizeId); - var datadsf = _outChargeDmnService.GetPatientGridJson(OrganizeId);//获取待收费门诊号来筛选病人信息 - var data = datadsf.Serialize().ToObject>() ?? new List(); - List patlist = new List(); - foreach (var item in data) - { - var mhzlist = OutpatAccListDtoList.Where(p => p.mzh == item.mzh).FirstOrDefault(); - if (mhzlist != null) - { - patlist.Add(mhzlist); - } - } - if (patlist.Count < 1) return Error("查询失败"); - var resultDto = new OutpatOptimAccInfoDto - { - OutpatAccInfoDto = null, - OutpatAccListDto = patlist - }; - if (patlist.Count == 1) - { - resultDto.OutpatAccInfoDto = patlist.FirstOrDefault(); - return Success(null, resultDto); - } - return Success(null, resultDto); - } + public ActionResult GetUnSettedPrescriptionBymzh(string mzh) { var cfList = _outChargeDmnService.GetPrescriptionBymzh(mzh, OrganizeId); @@ -476,12 +479,6 @@ public ActionResult GetAllUnSettedListByMzh(string mzh) return Content(data.ToJson()); } - public ActionResult GetUnSettGhfByMzh(string mzh) - { - var data = _outChargeDmnService.GetUnSettGhfByMzh(mzh, OrganizeId); - return Content(data.ToJson()); - } - /// /// 未结明细上传 /// @@ -513,61 +510,61 @@ public ActionResult GetGuiAnDetailsMzjsYbTfh(string jsnm, Dictionary - /// 门诊就诊登记修改获取 - /// - /// - /// - public ActionResult GetCQjzdjInfo(string mzh) - { - Input_2203A model = _outChargeDmnService.GetCQjzdjInfo(mzh, this.OrganizeId); - return Content(model.ToJson()); - } - /// - /// 获取患者就诊登记的交易流水号 - /// - /// - /// - public ActionResult GetCQjzdjDataInfo(string zymzh) - { - - CqybMedicalReg02Entity entity = - _cqybMedicalReg02Repo.FindEntity(p => p.zymzh == zymzh && p.zt == "1" && p.OrganizeId == this.OrganizeId); - return Content(entity.ToJson()); - } - /// - /// 获取门诊结算时明细上传明细(ybzje总金额,zfzje为所有自费金额) - /// - /// - /// - /// - public ActionResult GetChongQingDetailsMzjsYb(string mzh, string cfnm) - { + #region 重庆医保 + /// + /// 门诊就诊登记修改获取 + /// + /// + /// + public ActionResult GetCQjzdjInfo(string mzh) + { + Input_2203A model = _outChargeDmnService.GetCQjzdjInfo(mzh, this.OrganizeId); + return Content(model.ToJson()); + } + /// + /// 获取患者就诊登记的交易流水号 + /// + /// + /// + public ActionResult GetCQjzdjDataInfo(string zymzh) + { + + CqybMedicalReg02Entity entity = + _cqybMedicalReg02Repo.FindEntity(p => p.zymzh == zymzh && p.zt == "1" && p.OrganizeId == this.OrganizeId); + return Content(entity.ToJson()); + } + /// + /// 获取门诊结算时明细上传明细(ybzje总金额,zfzje为所有自费金额) + /// + /// + /// + /// + public ActionResult GetChongQingDetailsMzjsYb(string mzh, string cfnm) + { if (string.IsNullOrWhiteSpace(cfnm)) { return Error("处方内码(cfnm)参数未传递或值为空"); } - decimal ybzje = Convert.ToDecimal(0.0000); - decimal zfzje = Convert.ToDecimal(0.0000); + decimal ybzje = Convert.ToDecimal(0.0000); + decimal zfzje = Convert.ToDecimal(0.0000); _outPatChargeApp.GetChongQingMainOfMzjs(mzh, cfnm, out ybzje, out zfzje); - var data = new - { - ybzje = ybzje, - zfzje = zfzje, - zje = ybzje + zfzje, + var data = new + { + ybzje = ybzje, + zfzje= zfzje, + zje= ybzje+zfzje, }; - return Success(null, data); - } - - public ActionResult SaveChongQingUploadPrescriptions(List entityList, List cflist, string zymzh, string jytype) - { - _iCqybUploadPresList04Repo.SaveCqybUploadPresList(entityList, jytype, zymzh, this.OrganizeId); - //上传的处方也落地,保存处方号,为了退方 - _outPatChargeApp.SaveCqybUploadInPres(cflist, zymzh, jytype); + return Success(null, data); + } + + public ActionResult SaveChongQingUploadPrescriptions(List entityList, List cflist,string zymzh,string jytype) + { + _iCqybUploadPresList04Repo.SaveCqybUploadPresList(entityList, jytype, zymzh,this.OrganizeId); + //上传的处方也落地,保存处方号,为了退方 + _outPatChargeApp.SaveCqybUploadInPres(cflist, zymzh, jytype); return Success(); - } + } public ActionResult SaveUploadPch(string zymzh, string jytype, string cfh, string pch) { _outPatChargeApp.SaveCqybUploadInPres(zymzh, jytype, cfh, pch); @@ -623,12 +620,11 @@ public ActionResult UpDateUploadPch(string zymzh, string cfh, string pch) /// /// /// - public ActionResult SaveChongQing99HQ(Output_2207VO entity, string jslb) - { - if (entity != null) + public ActionResult SaveChongQing99HQ(Output_2207VO entity,string jslb) + { + if (entity!=null) { - try - { + try { CqybSett05Entity ybentity = new CqybSett05Entity(); ybentity.jylsh = entity.setl_id; ybentity.OrganizeId = this.OrganizeId; @@ -644,100 +640,99 @@ public ActionResult SaveChongQing99HQ(Output_2207VO entity, string jslb) ybentity.pch = entity.pch; ybentity.yllb = entity.yllb; _cqybSett05Repo.SaveCqybSett(ybentity, null); - } - catch (Exception e) + } catch (Exception e) { } } - - return Success(); - } - public ActionResult GetCqyb10Data(string zymzh, string type) - { - var data = _outPatChargeApp.GetCqyb10Data(zymzh, type); + + return Success(); + } + public ActionResult GetCqyb10Data(string zymzh,string type) + { + var data= _outPatChargeApp.GetCqyb10Data(zymzh,type); + return Success(null, data); + } + + public ActionResult GetCqybMxCxData(string zymzh, string type,string ybver) + { + var data = _outPatChargeApp.GetCqybMxCxData(zymzh, type,ybver); return Success(null, data); } - - public ActionResult GetCqybMxCxData(string zymzh, string type, string ybver) - { - var data = _outPatChargeApp.GetCqybMxCxData(zymzh, type, ybver); - return Success(null, data); - } - + /// /// 获取退费后,重庆医保上传所需数据 /// /// /// public ActionResult GetCQDetailsMzjsYbTfh(string mzh, string jsnm, Dictionary tjsxmDict) - { - decimal ybzje = Convert.ToDecimal(0.0000); - decimal zfzje = Convert.ToDecimal(0.0000); - decimal tfzje = Convert.ToDecimal(0.0000); - var ybUpList = _outPatChargeApp.GetCQDetailsMzjsYbTfh(mzh, jsnm, tjsxmDict, out ybzje, out zfzje, - out tfzje); + { + decimal ybzje = Convert.ToDecimal(0.0000); + decimal zfzje = Convert.ToDecimal(0.0000); + decimal tfzje = Convert.ToDecimal(0.0000); + var ybUpList = _outPatChargeApp.GetCQDetailsMzjsYbTfh(mzh, jsnm, tjsxmDict, out ybzje, out zfzje, + out tfzje); var model = _outChargeDmnService.GetCQjzdjInfo(mzh, this.OrganizeId); //var entity = // _cqybupdatemedicalInput03Repo.FindEntity(p => p.zymzh == mzh && p.zt == "1" && p.OrganizeId == this.OrganizeId); var data = new - { - ybzje = ybzje, - zfzje = zfzje, - tfzje = tfzje, - jzid = model.mdtrt_id, - yllb = model.med_type, - rybh = model.psn_no, + { + ybzje = ybzje, + zfzje = zfzje, + tfzje=tfzje, + jzid=model.mdtrt_id, + yllb=model.med_type, + rybh=model.psn_no, cfh = ybUpList.cflist.Count > 0 ? ybUpList.cflist[0].cfh : "" }; - return Content(data.ToJson()); - } - - public ActionResult ZFToYBForm(string mzh) - { - return View(); - } - - public ActionResult ZFToYB_Step_1(string mzh) - { - System.Threading.Thread.Sleep(1000 * 3); - var data = _outPatChargeApp.ZFToYB_Step_1(mzh); - return Success(null, data); - } - - public ActionResult ZFToYB_Step_3(string mzh, string sbbh, string xm) - { - var data = _outPatChargeApp.ZFToYB_Step_3(mzh, sbbh, xm); - return Success(null, data); - } - - /// - /// - /// - /// - /// - /// - /// 医保卡信息 - /// - public ActionResult ZFToYB_Step_6(string mzh, int patid, ZYToYBDto patCardInfo) - { - var data = _outPatChargeApp.ZFToYB_Step_6(mzh, patid, patCardInfo); - return Success(null, data); - } - - /// - /// - /// - /// - /// - public ActionResult ZFToYB_Step_8(string mzh) - { - var data = _outPatChargeApp.ZFToYB_Step_8(mzh); - return Success(null, data); - } + return Content(data.ToJson()); + } + + public ActionResult ZFToYBForm(string mzh) + { + return View(); + } + + public ActionResult ZFToYB_Step_1(string mzh) + { + System.Threading.Thread.Sleep(1000 * 3); + var data = _outPatChargeApp.ZFToYB_Step_1(mzh); + return Success(null, data); + } + + public ActionResult ZFToYB_Step_3(string mzh, string sbbh, string xm) + { + var data = _outPatChargeApp.ZFToYB_Step_3(mzh, sbbh, xm); + return Success(null, data); + } + + /// + /// + /// + /// + /// + /// + /// 医保卡信息 + /// + public ActionResult ZFToYB_Step_6(string mzh, int patid, ZYToYBDto patCardInfo) + { + var data = _outPatChargeApp.ZFToYB_Step_6(mzh, patid, patCardInfo); + return Success(null, data); + } + + /// + /// + /// + /// + /// + public ActionResult ZFToYB_Step_8(string mzh) + { + var data = _outPatChargeApp.ZFToYB_Step_8(mzh); + return Success(null, data); + } public ActionResult SaveCqS23(CqybSett23Entity entity) { entity.OrganizeId = this.OrganizeId; - _cqybSett23Repo.SaveCqybS23Sett(entity, ""); + _cqybSett23Repo.SaveCqybS23Sett(entity,""); return Success(); } @@ -758,18 +753,17 @@ public ActionResult GetMzbzml(string mllx) /// 库中尚无 /// /// 历史已提交(库中已有) - /// 挂号费未结算,单独结算 /// 支付交易号 /// public ActionResult SubmitForm(BasicInfoDto2018 bacDto , OutpatientSettFeeRelatedDTO feeRelated , CQMzjs05Dto ybfeeRelated , string isXnhjyjz - , List xmList, IList cfnmList, IList extxmnmList, IList ghxmnmList - , string outTradeNo, List deletelist) + , List xmList, IList cfnmList, IList extxmnmList + , string outTradeNo,List deletelist) { var accDto = _outPatChargeApp.togetherData(xmList); - if (!(accDto != null || (cfnmList != null && cfnmList.Count > 0) || (extxmnmList != null && extxmnmList.Count > 0) || (ghxmnmList != null && ghxmnmList.Count > 0))) + if (!(accDto != null || (cfnmList != null && cfnmList.Count > 0) || (extxmnmList != null && extxmnmList.Count > 0))) { return Error("收费失败,缺少计费明细"); } @@ -789,7 +783,7 @@ public ActionResult SubmitForm(BasicInfoDto2018 bacDto } #region 新农合结算 - + var xnhybfeeRelated = new S25ResponseDTO(); var outpId = ""; if ("1".Equals(isXnhjyjz ?? "0")) @@ -806,28 +800,11 @@ public ActionResult SubmitForm(BasicInfoDto2018 bacDto try { - if (deletelist != null) + if (deletelist!=null) { _outPatientUniversalDmnService.UpdateYPcfxm(deletelist, this.OrganizeId, this.UserIdentity.UserCode); } - if (ghxmnmList != null && ghxmnmList.Count>0) - { - // 如果存在需要结算的挂号信息,单独进行结算 - var ghjsnm = _outPatChargeApp.submitOutpatGhCharge(this.OrganizeId, bacDto.fph, bacDto.sfrq, feeRelated, ghxmnmList); - if (!(accDto != null || (cfnmList != null && cfnmList.Count > 0) || (extxmnmList != null && extxmnmList.Count > 0))) - { - if (ghjsnm == 0) - { - return Error("挂号收费失败"); - } - var ghjs = new - { - jsnm = ghjsnm - }; - // 如果只有挂号费,收取之后直接返回 - return Success("挂号收费成功", ghjs); - } - } + int isOpenBill = -1; string openMsg = ""; var resultnewjs = _outPatChargeApp.submitOutpatCharge(bacDto, feeRelated, ybfeeRelated, xnhybfeeRelated, accDto, OrganizeId, cfnmList, out jsnmList, extxmnmList, outTradeNo); if (!resultnewjs) return Success(bacDto.isQfyj ? "欠费预结操作成功" : "成功收费"); //门诊收费的处方收费成功之后是否同步收费状态至CIS @@ -874,12 +851,12 @@ public ActionResult SubmitForm(BasicInfoDto2018 bacDto var res = new { jsnm = jsnmList[0] - }; - + }; //异步推送处方收费成功的通知给药房药库 notifyPDS(jsnmList[0], bacDto.sfrq ?? DateTime.Now, cfnmList, bacDto.fph); _outpatientRegistRepo.RecordOutpId(bacDto.mzh, "", UserIdentity.UserCode, OrganizeId); - return Success("成功收费", res); + + return Success(null, res); } catch (Exception e) { @@ -888,7 +865,7 @@ public ActionResult SubmitForm(BasicInfoDto2018 bacDto throw; } } - + ///// ///// 新农合门诊结算 ///// @@ -962,6 +939,31 @@ public ActionResult UpdatePatBrxzInfo(string mzh) _outpatientRegistRepo.updatePatBrxzInfo(this.OrganizeId, mzh, "0"); return Success("操作成功"); } + /// + /// 门诊挂号不进行医保登记 收费时进行登记跟新自费卡为医保卡 + /// + /// + /// + /// + /// + /// + public ActionResult UpdateChargeMzghInfo(string mzh,string kh,string cardtype,string brxz,string zjh,string status) + { + _outpatientRegistRepo.UpdateChargeMzghInfo(this.OrganizeId, mzh,kh,cardtype,brxz,zjh, status); + return Success("操作成功"); + } + /// + /// 更新挂号医保就诊id流水号 + /// + /// + /// + /// + /// + public ActionResult UpdateChargeMzghJzid(string mzh, string jzid, string jzpzlx) + { + _outpatientRegistRepo.updateYbghjzId(this.OrganizeId, mzh,jzid,jzpzlx); + return Success("操作成功"); + } #endregion @@ -1028,7 +1030,7 @@ private void notifyPDS(int jsnm, DateTime sfrq, IList cfnmList, string Fph) TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")//, //Token = token }; - var apiResp = SitePDSAPIHelper.Request("api/ResourcesOperate/OutpatientCommit", reqObj, autoAppendToken: false, httpContext: context); + var apiResp = SitePDSAPIHelper.Request("api/ResourcesOperate/OutpatientCommit", reqObj, autoAppendToken: false,httpContext: context); LogCore.Info("OutpatientCommit response", apiResp.ToJson()); AppLogger.Info(apiResp != null @@ -1177,130 +1179,132 @@ public ActionResult pushApplicationform(BasicInfoDto2018 bacDto, IList cfnm return Success("无数据"); } var uri = ConfigurationHelper.GetAppConfigValue("pacsUrl"); - List datalist = new List(); - if (cfnmList != null) - { - foreach (var item in cfnmList) - { - var data = _outPatientUniversalDmnService.pushApplicationform(bacDto, item, this.OrganizeId, "Y"); - if (data != null) - { - datalist.Add(data); - } - - } - } + List datalist = new List(); + if (cfnmList!=null) + { + foreach (var item in cfnmList) + { + var data = _outPatientUniversalDmnService.pushApplicationform(bacDto, item, this.OrganizeId, "Y"); + if (data != null) + { + datalist.Add(data); + } + + } + } + if (datalist == null) - { - return Success("无数据"); - } - var mesagssjson = ""; - var url = uri + "URISService/services/interface/requestorder"; - foreach (var data in datalist) - { - string datajson = Tools.Json.ToJson(data); - try - { - System.Net.HttpWebRequest request = null; - System.Net.WebResponse response = null; - - request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url); - if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase)) - { - ServicePointManager.ServerCertificateValidationCallback = CheckValidationResult; - } - request.ProtocolVersion = System.Net.HttpVersion.Version10; - request.Method = "POST"; - request.ContentType = "application/json"; - request.CookieContainer = null;//获取验证码时候获取到的cookie会附加在这个容器里面 - request.AllowAutoRedirect = true; - request.KeepAlive = true;//建立持久性连接 - //request.ContentLength = cs.Length; - request.Host = "192.168.0.101"; - //request.UserAgent = "PostmanRuntime/7.29.2"; - request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"; - request.Accept = "*/*"; - byte[] datas = System.Text.Encoding.UTF8.GetBytes(datajson); - using (System.IO.Stream stream = request.GetRequestStream()) - { - stream.Write(datas, 0, datas.Length); - } - - response = (System.Net.HttpWebResponse)request.GetResponse(); - string outputText = string.Empty; - using (System.IO.Stream responseStm = response.GetResponseStream()) - { - System.IO.StreamReader redStm = new System.IO.StreamReader(responseStm, System.Text.Encoding.UTF8); - outputText = redStm.ReadToEnd(); - } - var apiresp = JavaScriptJsonSerializerHelper.Deserialize(outputText); - - if (apiresp != null && apiresp.status != "Success") - { - mesagssjson = apiresp.errorCode; - AppLogger.Info(string.Format("Pacs检查申请单入参:{0},出参结果:{1}", datajson, outputText)); - } - else if (apiresp != null && apiresp.status == "Success") - { - //pacs申请单成功后改变mz_cf表sqdzt为0 - _outPatientUniversalDmnService.pushApplicationformRef(data.Patient.Request.Reqno, this.OrganizeId, 0); - } - var refdatalist = new - { - mesagssjsosn = mesagssjson, - jsonref = datajson - }; - } - catch (Exception e) - { - - throw; - } - } - return Success(""); + { + return Success("无数据"); + } + var mesagssjson = ""; + var url = uri+"URISService/services/interface/requestorder"; + foreach (var data in datalist) + { + string datajson = Tools.Json.ToJson(data); + try + { + System.Net.HttpWebRequest request = null; + System.Net.WebResponse response = null; + + request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url); + if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase)) + { + ServicePointManager.ServerCertificateValidationCallback = CheckValidationResult; + } + request.ProtocolVersion = System.Net.HttpVersion.Version10; + request.Method = "POST"; + request.ContentType = "application/json"; + request.CookieContainer = null;//获取验证码时候获取到的cookie会附加在这个容器里面 + request.AllowAutoRedirect = true; + request.KeepAlive = true;//建立持久性连接 + //request.ContentLength = cs.Length; + request.Host = "192.168.0.101"; + //request.UserAgent = "PostmanRuntime/7.29.2"; + request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"; + request.Accept = "*/*"; + request.Timeout = 5; + byte[] datas = System.Text.Encoding.UTF8.GetBytes(datajson); + using (System.IO.Stream stream = request.GetRequestStream()) + { + stream.Write(datas, 0, datas.Length); + } + + response = (System.Net.HttpWebResponse)request.GetResponse(); + string outputText = string.Empty; + using (System.IO.Stream responseStm = response.GetResponseStream()) + { + System.IO.StreamReader redStm = new System.IO.StreamReader(responseStm, System.Text.Encoding.UTF8); + outputText = redStm.ReadToEnd(); + } + var apiresp = JavaScriptJsonSerializerHelper.Deserialize(outputText); + + if (apiresp != null && apiresp.status != "Success") + { + mesagssjson = apiresp.errorCode; + AppLogger.Info(string.Format("Pacs检查申请单入参:{0},出参结果:{1}", datajson, outputText)); + } + else if (apiresp != null && apiresp.status == "Success") + { + //pacs申请单成功后改变mz_cf表sqdzt为0 + _outPatientUniversalDmnService.pushApplicationformRef(data.Patient.Request.Reqno, this.OrganizeId, 0); + } + var refdatalist = new + { + mesagssjsosn = mesagssjson, + jsonref = datajson + }; + } + catch (Exception e) + { - } + throw; + } + } + return Success(""); - #endregion + } - #region 挂号弹框 + #endregion - /// - /// 挂号弹框视图 - /// - /// - public ActionResult GhLayer(string blh) - { - return View("OutpatientRegLayer"); - } - - #endregion - /// + /// /// 开立物资项目扣减库存数量 扣减冻结数量 /// /// public ActionResult Sumwzdj(string[] cfh) - { - var list = _outPatientUniversalDmnService.Sumwzdj(cfh, OrganizeId, UserIdentity.rygh); - var data = new - { - row = list - }; - return Content(data.ToJson()); - } + { + var list = _outPatientUniversalDmnService.Sumwzdj(cfh, OrganizeId, UserIdentity.rygh); + var data = new + { + row = list + }; + return Content(data.ToJson()); + } + + /// + /// 开立物资项目冻结库存数量 + /// + /// + public ActionResult TuiHuiwzdj(string[] cfh) + { + var list = _outPatientUniversalDmnService.TuiHuiwzdj(cfh, OrganizeId, UserIdentity.rygh); + var data = new + { + row = list + }; + return Content(data.ToJson()); + } + /// - /// 开立物资项目冻结库存数量 + /// 获取患者就诊登记的交易流水号秦皇岛 /// + /// /// - public ActionResult TuiHuiwzdj(string[] cfh) + public ActionResult GetQHDjzdjDataInfo(string zyh) { - var list = _outPatientUniversalDmnService.TuiHuiwzdj(cfh, OrganizeId, UserIdentity.rygh); - var data = new - { - row = list - }; - return Content(data.ToJson()); + var medicalReg = _PatientBasicInfoDmnService.GetQHDjzdjInfo(zyh, OrganizeId); + return Content(medicalReg.ToJson()); } } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientAccountingController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientAccountingController.cs index b1b34a54..0e4a5cb6 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientAccountingController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientAccountingController.cs @@ -147,11 +147,11 @@ public ActionResult SaveAcountInfo(OutpatAccBasicInfoDto bacDto, List /// [HandlerAjaxOnly] - public ActionResult SelectRegChargeQuery(Pagination pagination, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd, string kh = "", string fph = "",string jsfph="", string xm = "", string syy = "",string zxlsh="") + public ActionResult SelectRegChargeQuery(Pagination pagination, DateTime? createTimestart, DateTime? createTimeEnd, DateTime? sfrqTimestart, DateTime? sfrqTimeEnd, string kh = "", string fph = "", string jsfph = "", string xm = "", string syy = "", string zxlsh = "") + { + IList list; + var chargeQueryList = new + { + rows = (list = _outPatienChargeQueryDmnService.RegChargeQuery(pagination, kh, fph, jsfph, xm, syy, createTimestart, createTimeEnd, sfrqTimestart, sfrqTimeEnd, zxlsh)), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + + var jsnms = string.Join(",", list.Select(p => p.jsnm).Distinct()); + if (!string.IsNullOrWhiteSpace(jsnms)) + { + var zffsList = _outPatienChargeQueryDmnService.GetSettZffsResultList(this.OrganizeId, jsnms); + foreach (var js in list) + { + js.zffsmcstr = string.Join(",", zffsList.Where(p => p.jsnm == js.jsnm).Select(p => p.xjzffsmc)); + } + } + + return Content(chargeQueryList.ToJson()); + } + + /// + /// 待上传的门诊自费病人结算信息 + /// + /// + /// + /// + /// + /// + [HandlerAjaxOnly] + public ActionResult SelectZFRegChargeQuery(Pagination pagination, DateTime? createTimestart, DateTime? createTimeEnd, string xm = "") { IList list; var chargeQueryList = new { - rows = (list = _outPatienChargeQueryDmnService.RegChargeQuery(pagination, kh, fph,jsfph, xm, syy, createTimestart, createTimeEnd, sfrqTimestart, sfrqTimeEnd,zxlsh)), + rows = (list = _outPatienChargeQueryDmnService.ZFRegChargeQuery(pagination, xm, createTimestart, createTimeEnd)), total = pagination.total, page = pagination.page, records = pagination.records diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRefundController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRefundController.cs index 0702cc7d..15c870ca 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRefundController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRefundController.cs @@ -24,6 +24,8 @@ using Newtouch.Tools; using Newtouch.HIS.Domain.IRepository.OutpatientManage; using Newtouch.HIS.Domain.DTO.InputDto; +using Newtouch.Infrastructure.Model; +using System.Configuration; namespace Newtouch.HIS.Web.Areas.OutpatientManage.Controllers { @@ -41,7 +43,7 @@ public class OutpatientRefundController : ControllerBase private readonly IOutpatientSettlementGAYBFeeRepo _outpatientSettlementGAYBFeeRepo; private readonly IGuiAnOutpatientXnhApp _guiAnOutpatientXnhApp; private readonly IOutpatientRegistRepo _outpatientRegistRepo; - private readonly ICqybSett05Repo _cqybSett05Repo; + private readonly ICqybSett05Repo _cqybSett05Repo; private readonly IOutpatientItemRepo _outpatientItemRepo; #region 页面初始化 @@ -70,12 +72,12 @@ public ActionResult SysPatEntitiesReView(string from = "") /// [HttpGet] [HandlerAjaxOnly] - public ActionResult PatSearchInfo(Pagination pagination, string blh, string mzh, string xm,string kssj,string jssj + public ActionResult PatSearchInfo(Pagination pagination, string blh, string mzh, string xm, string kssj, string jssj , bool curUserCreate = false, string jiuzhenbiaozhi = null) { var data = new { - rows = _refundService.GetBasicInfoSearchList(pagination, blh, mzh, xm,kssj,jssj, OrganizeId + rows = _refundService.GetBasicInfoSearchList(pagination, blh, mzh, xm, kssj, jssj, OrganizeId , curUserCreate ? UserIdentity.UserCode : "", jiuzhenbiaozhi), total = pagination.total, page = pagination.page, @@ -177,61 +179,61 @@ public ActionResult RefundableDetailQuery(int jsnm = 0) return null; } var list = _refundService.RefundableQuery(this.OrganizeId, jsnm); - var ztlist = list.Where(p => p.ztId != null && p.ztId!="").ToList(); - var flag = true; - string flagstr = _sysConfigRepo.GetValueByCode("sfxmztbs", this.OrganizeId); - if (flagstr=="false") - { - flag = false; - } - if (flag) - { - //收费项目组套合并 - if (ztlist.Count() > 0) - { - ztlist = list.Where(p => p.ztId != null && p.ztId != "").ToList() - .GroupBy(m => new { m.ghnm, m.jslx, m.feeType, m.cfh, m.ztmc, m.ztId, m.ztsl, m.cfnm, m.ks, m.ys, m.ysmc, m.sfmb, m.sqdzt, m.cflxmc }).Select(p => - new OutPatientRefundableVO - { - ghnm = p.Key.ghnm, - jsmxnm = p.Max(m => m.jsmxnm), - jslx = p.Key.jslx, - sl = p.Max(m => m.sl), - ktsl = p.Max(m => m.ktsl), - tsl = p.Max(m => m.tsl), - jsmxje = p.Sum(m => m.jsmxje), - dj = Math.Round(Convert.ToDecimal(p.Sum(m => m.dj)), 2, MidpointRounding.AwayFromZero), - feeType = p.Key.feeType, - dw = "套", - cfh = p.Key.cfh, - mc = p.Key.ztmc, - ztmc = p.Key.ztmc, - ztId = p.Key.ztId, - ztsl = p.Key.ztsl, - sfmb = p.Key.sfmb, - dlmc = p.Key.ztmc, - czh = "", - cfnm = p.Key.cfnm, - sfxmCode = p.Key.sfmb, - sfdlCode = "", - zfbl = null, - zfxz = null, - xmnm = null, - cfmxId = null, - ks = p.Key.ks, - ys = p.Key.ys, - ysmc = p.Key.ysmc, - klsj = p.Max(m => m.klsj), - zljhwzx = null, - cflxmc = p.Key.cflxmc, - sqdzt = p.Key.sqdzt - } - ).ToList(); - } - } - - - list= list.Where(p => p.ztId == null ||p.ztId=="").ToList().Concat(ztlist).ToList(); + var ztlist = list.Where(p => p.ztId != null && p.ztId != "").ToList(); + var flag = true; + string flagstr = _sysConfigRepo.GetValueByCode("sfxmztbs", this.OrganizeId); + if (flagstr == "false") + { + flag = false; + } + if (flag) + { + //收费项目组套合并 + if (ztlist.Count() > 0) + { + ztlist = list.Where(p => p.ztId != null && p.ztId != "").ToList() + .GroupBy(m => new { m.ghnm, m.jslx, m.feeType, m.cfh, m.ztmc, m.ztId, m.ztsl, m.cfnm, m.ks, m.ys, m.ysmc, m.sfmb, m.sqdzt, m.cflxmc }).Select(p => + new OutPatientRefundableVO + { + ghnm = p.Key.ghnm, + jsmxnm = p.Max(m => m.jsmxnm), + jslx = p.Key.jslx, + sl = p.Max(m => m.sl), + ktsl = p.Max(m => m.ktsl), + tsl = p.Max(m => m.tsl), + jsmxje = p.Sum(m => m.jsmxje), + dj = Math.Round(Convert.ToDecimal(p.Sum(m => m.dj)), 2, MidpointRounding.AwayFromZero), + feeType = p.Key.feeType, + dw = "套", + cfh = p.Key.cfh, + mc = p.Key.ztmc, + ztmc = p.Key.ztmc, + ztId = p.Key.ztId, + ztsl = p.Key.ztsl, + sfmb = p.Key.sfmb, + dlmc = p.Key.ztmc, + czh = "", + cfnm = p.Key.cfnm, + sfxmCode = p.Key.sfmb, + sfdlCode = "", + zfbl = null, + zfxz = null, + xmnm = null, + cfmxId = null, + ks = p.Key.ks, + ys = p.Key.ys, + ysmc = p.Key.ysmc, + klsj = p.Max(m => m.klsj), + zljhwzx = null, + cflxmc = p.Key.cflxmc, + sqdzt = p.Key.sqdzt + } + ).ToList(); + } + } + + + list = list.Where(p => p.ztId == null || p.ztId == "").ToList().Concat(ztlist).ToList(); return Content(list.ToJson()); } @@ -258,13 +260,13 @@ public ActionResult DetailConfirmForm() /// public ActionResult RefundSettlement(string mzh, int jsnm , Dictionary tjsxmDict, decimal expectedTmxZje - , string newfph, Dictionary tjsxmDictZt, decimal expectedTmxZjeZt,string cfnmArray) + , string newfph, Dictionary tjsxmDictZt, decimal expectedTmxZjeZt, string cfnmArray) { return handleRefund(mzh, jsnm , tjsxmDict, expectedTmxZje, null, null , null , null - , newfph, tjsxmDictZt,expectedTmxZjeZt, cfnmArray); + , newfph, tjsxmDictZt, expectedTmxZjeZt, cfnmArray); } /// @@ -330,12 +332,12 @@ public ActionResult YbRefundSettlement(string mzh, int jsnm , OutpatientSettYbFeeRelatedDTO newybfeeRelated) { string newfph = ""; - decimal ztje =Convert.ToDecimal(0.00); + decimal ztje = Convert.ToDecimal(0.00); return handleRefund(mzh, jsnm , tjsxmDict, expectedTmxZje, hcybjsh, newwjybjsh , hcybfeeRelated , newybfeeRelated - , newfph,null, ztje,null); + , newfph, null, ztje, null); } #endregion @@ -435,29 +437,29 @@ private ActionResult handleRefund(string mzh, int jsnm , Dictionary tjsxmDict, decimal expectedTmxZje, string hcybjsh, string newwjybjsh , CQMzjs05Dto hcybfeeRelated , OutpatientSettYbFeeRelatedDTO newybfeeRelated - , string newfph, Dictionary tjsxmDictZt, decimal expectedTmxZjeZt,string cfnmArray) + , string newfph, Dictionary tjsxmDictZt, decimal expectedTmxZjeZt, string cfnmArray) { var newDict = new Dictionary(); - if(expectedTmxZje<=0)tjsxmDict = null; + if (expectedTmxZje <= 0) tjsxmDict = null; if (expectedTmxZjeZt <= 0) tjsxmDictZt = null; - if (tjsxmDict!=null) + if (tjsxmDict != null) { foreach (var item in tjsxmDict) { newDict.Add(Convert.ToInt32(item.Key), item.Value); } } - - if (tjsxmDictZt!=null) + + if (tjsxmDictZt != null) { var tmzxmlist = _outPatientUniversalDmnService.RefundZtDetail(cfnmArray, OrganizeId); - foreach(var items in tjsxmDictZt) + foreach (var items in tjsxmDictZt) { foreach (var m in tmzxmlist) { - if (items.Key==m.ztId) //还需加cfnm 多个处方可能有相同组套 + if (items.Key == m.ztId) //还需加cfnm 多个处方可能有相同组套 { - newDict.Add(m.jsmxnm,Math.Round(items.Value*m.sl,2, MidpointRounding.AwayFromZero)); + newDict.Add(m.jsmxnm, Math.Round(items.Value * m.sl, 2, MidpointRounding.AwayFromZero)); } } } @@ -468,7 +470,7 @@ private ActionResult handleRefund(string mzh, int jsnm string outTradeNo; decimal refundAmount; _outPatientUniversalDmnService.RefundSettlement(this.OrganizeId, jsnm, newDict, expectedTmxZje, newfph, out newJszbInfo, out outTradeNo, out refundAmount, hcybjsh, newwjybjsh, hcybfeeRelated, newybfeeRelated, null, null); - + if (!string.IsNullOrWhiteSpace(mzh)) { refundFeeNotify(mzh, newDict); @@ -482,18 +484,37 @@ private ActionResult handleRefund(string mzh, int jsnm isTradeRefundError = refundReuslt == (int)EnumRefundStatus.Failed || refundReuslt == (int)EnumRefundStatus.UnKnown; //失败 或 未知 } - var msg = "退费成功"; + var msg = "退费成功"; if (!isTradeRefundError.HasValue) return Success(msg, newJszbInfo); msg = !isTradeRefundError.Value ? "退费成功,应退金额已原路退回" : "HIS退费成功,但应退金额退回失败,请人工核查"; - return Success(msg, newJszbInfo); + + return Success(msg , newJszbInfo); } + /// - /// 更新CIS退标志 + /// 更新CIS退标志和退还药房冻结库存 /// /// - public void UpdateChargeTbz(List tcfh) + public void UpdateChargeTbz(List tcfh, List typcfh) { + foreach (var cfh in typcfh) + { + //接口内容 + var cancalreqObj = new + { + cfh = cfh, + OrganizeId = OrganizeId, + CreatorCode = this.UserIdentity.UserCode, + }; + var apiRespPush = SitePDSAPIHelper.Request( + "/api/ResourcesOperate/OutpatientCancelDjYpReturn", cancalreqObj); + if (apiRespPush.code != APIRequestHelper.ResponseResultCode.SUCCESS) + { + AppLogger.Info(string.Format("处方退费返还冻结库存更新API同步至PDS,处方号:{0},结果:{1}、{2}", tcfh, apiRespPush.code, apiRespPush.sub_code)); + } + } + var reqObj = new { cfList = tcfh, @@ -586,18 +607,18 @@ public ActionResult guianhandleRefund(string mzh, int jsnm _outpatientRegistRepo.RecordOutpId(mzh, "", UserIdentity.UserCode, OrganizeId); return Success(msg, newJszbInfo); } - #endregion - - #region 重庆医保退费 - public ActionResult RefundableChongQingQuery(DateTime? kssj, DateTime? jssj, string mzh) - { - if (string.IsNullOrEmpty(mzh) || !kssj.HasValue || !jssj.HasValue) - { - return null; - } - var list = _refundService.RefundableChongQingQuery(this.OrganizeId, kssj, jssj, mzh); - return Content(list.ToJson()); - } + #endregion + + #region 重庆医保退费 + public ActionResult RefundableChongQingQuery(DateTime? kssj, DateTime? jssj, string mzh) + { + if (string.IsNullOrEmpty(mzh) || !kssj.HasValue || !jssj.HasValue) + { + return null; + } + var list = _refundService.RefundableChongQingQuery(this.OrganizeId, kssj, jssj, mzh); + return Content(list.ToJson()); + } #endregion @@ -607,14 +628,14 @@ public ActionResult retApplicationform(string mzh, List cfhList) List datalist = new List(); foreach (var item in cfhList) { - if (item!="") + if (item != "") { var data = _outPatientUniversalDmnService.retApplicationform(mzh, item, this.OrganizeId, "N"); - if (data!=null) + if (data != null) { datalist.Add(data); } - + } } //var data = _outPatientUniversalDmnService.retApplicationform(mzh, cfnmList, this.OrganizeId, "N"); @@ -635,7 +656,7 @@ public ActionResult retApplicationform(string mzh, List cfhList) request.ProtocolVersion = System.Net.HttpVersion.Version10; request.Method = "POST"; - request.ContentType = "application/json"; + request.ContentType = "application/json"; request.CookieContainer = null;//获取验证码时候获取到的cookie会附加在这个容器里面 request.AllowAutoRedirect = true; request.KeepAlive = true;//建立持久性连接 @@ -656,17 +677,17 @@ public ActionResult retApplicationform(string mzh, List cfhList) outputText = redStm.ReadToEnd(); } var apiresp = JavaScriptJsonSerializerHelper.Deserialize(outputText); - if (apiresp != null&& apiresp.status!= "Success") + if (apiresp != null && apiresp.status != "Success") { AppLogger.Info(string.Format("Pacs检查申请单入参:{0},出参结果:{1}", datajson, outputText)); } - else if(apiresp != null && apiresp.status == "Success") + else if (apiresp != null && apiresp.status == "Success") { //pacs申请单退成功后改变mz_cf表sqdzt为4 取消 - _outPatientUniversalDmnService.pushApplicationformRef(data.Patient.CardID, this.OrganizeId,4); + _outPatientUniversalDmnService.pushApplicationformRef(data.Patient.CardID, this.OrganizeId, 4); } - - + + } catch (Exception e) { diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRegController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRegController.cs index 24f3b189..48f07bd2 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRegController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Controllers/OutpatientRegController.cs @@ -3,8 +3,11 @@ using FrameworkBase.MultiOrg.Domain.IRepository; using Newtouch.Common.Operator; using Newtouch.Core.Common.Utils; +using Newtouch.HIS.Application.Implementation.OutpatientManage.MzBespeakRegisterProcess; using Newtouch.HIS.Application.Interface; using Newtouch.HIS.Domain.DTO; +using Newtouch.HIS.Domain.DTO.InputDto; +using Newtouch.HIS.Domain.DTO.OutputDto.OutpatientManage; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IDomainServices.OutpatientManage; @@ -34,38 +37,25 @@ public class OutpatientRegController : ControllerBase private readonly IRefundDmnService _refundDmnService; private readonly ISysConfigRepo _sysConfigRepo; private readonly IprintOutpatientChargeBillDmnService _iprintOutpatientChargeBillDmnService; - private readonly ICqybMedicalReg02Repo _iCqybMedicalReg02Repo; - private readonly ICqybUploadInPres04Repo _iCqybUploadInPres04Repo; - private readonly IOutPatChargeDmnService _iOutPatChargeDmnService; + private readonly ICqybMedicalReg02Repo _iCqybMedicalReg02Repo; + private readonly ICqybUploadInPres04Repo _iCqybUploadInPres04Repo; + private readonly IOutPatChargeDmnService _iOutPatChargeDmnService; private readonly IOutPatientDmnService _iOutPatientDmnService; private readonly IMzghbookRepo _iMzghBookRepo; private readonly ICqybMedicalInPut02Repo _cqybmedicalInput02Repo; - #region 挂号排班 - - /// - /// 挂号排班List - /// - /// 科室/医生 - /// 门诊类型 普通门诊/急症/专家门诊 - /// - /// - [HttpPost] + #region 挂号排班 + /// + /// 挂号排班List + /// + /// 科室/医生 + /// 门诊类型 普通门诊/急症/专家门诊 + /// + [HttpPost] [HandlerAjaxOnly] - public JsonResult GetRegScheduleList(string keyword, string mzlx, bool? withFees) + public JsonResult GetRegScheduleList(string keyword, string mzlx) { var data = _outpatientRegApp.GetRegScheduleList(keyword, mzlx); - if (withFees != null && data != null) - { - if (withFees.Value) - { - data = data.FindAll(p => (p.sfxmdj + p.zlxmdj) > 0).ToList(); - } - else - { - data = data.FindAll(p => (p.sfxmdj + p.zlxmdj) <= 0).ToList(); - } - } return Json(data); } @@ -77,24 +67,13 @@ public JsonResult GetRegScheduleList(string keyword, string mzlx, bool? withFees /// public JsonResult GetNewRegScheduleList(string keyword, string mzlx) { - var data = _iOutPatientDmnService.GetNewRegScheduleList(keyword, mzlx, this.OrganizeId); + var data = _iOutPatientDmnService.GetNewRegScheduleList(keyword,mzlx,this.OrganizeId); return Json(data); } - - public ActionResult GetNewRegSchedulebyGroupList(string keyword, string pbks, string mzlx, DateTime? OutDate, string ys, bool? withFees) + + public ActionResult GetNewRegSchedulebyGroupList(string keyword, string pbks, string mzlx,DateTime? OutDate,string ys) { - var data = _iOutPatientDmnService.GetRegScheduleListbyGroup(keyword, mzlx, pbks, this.OrganizeId, OutDate, ys); - if (withFees != null && data != null) - { - if (withFees.Value) - { - data = data.FindAll(p => p.RegFee > 0).ToList(); - } - else - { - data = data.FindAll(p => p.RegFee <= 0).ToList(); - } - } + var data = _iOutPatientDmnService.GetRegScheduleListbyGroup(keyword,mzlx,pbks,this.OrganizeId, OutDate, ys); return Content(data.ToJson()); } /// @@ -104,19 +83,19 @@ public ActionResult GetNewRegSchedulebyGroupList(string keyword, string pbks, st /// /// [HandlerAjaxOnly] - public ActionResult GetIsMzghBook(Pagination pagination, string mzlx, string patid, string isfeegroup, string yyzt, string ghly, string keyValue, string ks, + public ActionResult GetIsMzghBook(Pagination pagination,string mzlx,string patid,string isfeegroup, string yyzt, string ghly, string keyValue,string ks, DateTime? yykssj = null, DateTime? yyjssj = null) { - if (pagination.sidx == null) + if (pagination.sidx==null) { pagination.sidx = "Outdate"; pagination.sord = "desc"; pagination.rows = 20; pagination.page = 1; - var record = _iOutPatientDmnService.GetIsMzghBookSchedule(pagination, mzlx, patid, this.OrganizeId, isfeegroup, yyzt, ghly, keyValue, ks, yykssj, yyjssj); + var record= _iOutPatientDmnService.GetIsMzghBookSchedule(pagination, mzlx, patid, this.OrganizeId, isfeegroup, yyzt, ghly, keyValue,ks, yykssj, yyjssj); return Content(record.ToJson()); } - var list = _iOutPatientDmnService.GetIsMzghBookSchedule(pagination, mzlx, patid, this.OrganizeId, isfeegroup, yyzt, ghly, keyValue, ks, yykssj, yyjssj); + var list = _iOutPatientDmnService.GetIsMzghBookSchedule(pagination,mzlx,patid,this.OrganizeId,isfeegroup,yyzt,ghly,keyValue,ks,yykssj,yyjssj); var data = new { rows = list, @@ -153,11 +132,18 @@ public ActionResult OutpatientAppointment(string from = "") /// /// /// - public ActionResult UpdateMzGhBook(string jsnm, string mzh, string patid, string ks, string zje, string outdate, string mzlx, string ghf) + public ActionResult UpdateMzGhBook(string jsnm,string mzh,string patid,string ks,string zje,string outdate,string mzlx,string ghf) { - _iMzghBookRepo.UpdateMzGhAppointment(jsnm, mzh, Convert.ToInt32(patid), ks, zje, "His", this.OrganizeId, outdate, mzlx, ghf); + _iMzghBookRepo.UpdateMzGhAppointment(jsnm, mzh, Convert.ToInt32(patid), ks, zje, "His",this.OrganizeId,outdate,mzlx,ghf); return Success(); } + + public ActionResult FZsjTB() + { + string ghrq = DateTime.Now.ToString("yyyy-MM-dd"); + _iMzghBookRepo.FZsjTB(ghrq,this.UserIdentity.rygh,this.OrganizeId); + return Success(); + } /// /// 预约挂号签到 /// @@ -245,54 +231,26 @@ public ActionResult OutpatientReg2018() return View(); } - /// - /// 门诊挂号页面---先挂号后结算页面,供cis调用 + /// 判断是否重复挂号 /// + /// /// - public ActionResult OutpatientRegForCis2018(string mzh) - { - ViewBag.ReportServerHOST = ConfigurationHelper.GetAppConfigValue("ReportServer.HOST"); - ViewBag.OrgId = this.OrganizeId; - //开关:预约挂号 - var brSwitch = (bool)_sysConfigRepo.GetBoolValueByCode("BespeakRegisterSwitch", OrganizeId, false); - ViewBag.ISOpenBespeakRegister = brSwitch ? "true" : "false"; - var userInfoModel = _outpatientRegistRepo.GetBasicInfoPatInfoInRegister(mzh, OrganizeId); - return View(userInfoModel); - } - - - /// - /// 转诊 - /// - public ActionResult ReferralForm(string mzh) - { - ViewBag.ReportServerHOST = ConfigurationHelper.GetAppConfigValue("ReportServer.HOST"); - ViewBag.OrgId = this.OrganizeId; - //开关:预约挂号 - var brSwitch = (bool)_sysConfigRepo.GetBoolValueByCode("BespeakRegisterSwitch", OrganizeId, false); - ViewBag.ISOpenBespeakRegister = brSwitch ? "true" : "false"; - var userInfoModel = _outpatientRegistRepo.GetBasicInfoPatInfoInRegister(mzh, OrganizeId); - return View(userInfoModel); - } - - public ActionResult submitReferralForm(int patid, string ks, string ys, int ghnm, string mzh, string zzyy,string ghpbId) + public ActionResult AllowRegh(string blh) { - _outPatientSettleDmnService.submitReferralForm(patid, ks, ys, OrganizeId, this.UserIdentity.UserCode, ghnm, mzh, zzyy, ghpbId); - return Success(null); + var result = _outpatientRegistRepo.AllowRegh(blh, OrganizeId); + return Content(result.ToJson()); } - /// - /// 判断是否重复挂号 + /// 修改手机号 /// /// /// - public ActionResult AllowRegh(string blh) + public ActionResult UpdatePatPhone(string patid,string phone) { - var result = _outpatientRegistRepo.AllowRegh(blh, OrganizeId); + var result = _outpatientRegistRepo.UpdatePatPhone(patid, phone,UserIdentity.rygh, OrganizeId); return Content(result.ToJson()); } - /// /// 病人查询浮层 /// @@ -335,7 +293,7 @@ public ActionResult GetMzhJzxh(int patid, string ghpbId, string ks, string ys) /// /// 预约就诊序号 /// - public ActionResult GetNewMzhJzxh(int patid, string ghpbId, string ks, string ys, string mjzbz, string QueueNo, string OutDate, bool isybjy) + public ActionResult GetNewMzhJzxh(int patid,string ghpbId,string ks,string ys,string mjzbz,string QueueNo,string OutDate,bool isybjy) { var ysxx = new CqybGjbmInfoVo(); if (patid <= 0 || string.IsNullOrWhiteSpace(ghpbId) || string.IsNullOrWhiteSpace(ks)) @@ -351,7 +309,20 @@ public ActionResult GetNewMzhJzxh(int patid, string ghpbId, string ks, string ys { jzxh = mzhjzxh.Item1, mzh = mzhjzxh.Item2, - ysxx = ysxx, + ysxx= ysxx, + }; + return Success(null,data); + } + /// + /// 获取医保就诊登记所需信息 + /// + /// + /// + public ActionResult GetYbjzdjVo(string mzh) + { + var data = new + { + ysxx = _outPatientSettleDmnService.GetYbjzdjVo(mzh,this.OrganizeId) }; return Success(null, data); } @@ -382,7 +353,7 @@ public ActionResult GetNewMzhJzxh(int patid, string ghpbId, string ks, string ys /// 前置就诊序号 /// 前置门诊号 /// - //[HandlerAjaxOnly] + [HandlerAjaxOnly] public ActionResult Save(int patid, string kh, string ghly, string mjzbz, string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm , int ghpbId @@ -393,7 +364,7 @@ public ActionResult Save(int patid, string kh, string ghly, string mjzbz, , string ybjsh , short? qzjzxh , string qzmzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc + , string jzyy,string jzid,string jzlx,string bzbm,string bzmc,string isjm ) { try @@ -407,7 +378,7 @@ public ActionResult Save(int patid, string kh, string ghly, string mjzbz, } object newJszbInfo; _outpatientRegApp.Save(patid, kh, ghly, mjzbz, - ks, ys, ksmc, ysmc, ghxm, zlxm, fph, sfrq, isCkf, isGbf, ghpbId, feeRelated, brxz, ybjsh, Request.Params["mzyyghId"], ref qzjzxh, ref qzmzh, jzyy, jzid, jzlx, bzbm, bzmc, out newJszbInfo); + ks, ys, ksmc, ysmc, ghxm, zlxm, fph, sfrq, isCkf, isGbf, ghpbId, feeRelated, brxz, ybjsh, Request.Params["mzyyghId"], ref qzjzxh, ref qzmzh, jzyy,jzid, jzlx, bzbm, bzmc, isjm, out newJszbInfo); return Success(null, newJszbInfo); } @@ -417,39 +388,8 @@ public ActionResult Save(int patid, string kh, string ghly, string mjzbz, { //医保端已挂号,HIS挂号失败,得取消医保端的挂号,提示其重新挂 //20181018在Client调 - } - throw ex; - } - } - [HandlerAjaxOnly] - public ActionResult UnSettSave(int patid, string kh, string ghly, string mjzbz, - string ks, string ys, string ksmc, string ysmc, string ghxm, string zlxm - , int ghpbId - , bool isCkf, bool isGbf - , string brxz - , string ybjsh - , short? qzjzxh - , string qzmzh - , string jzyy, string jzid, string jzlx, string bzbm, string bzmc - ) - { - try - { - if (string.IsNullOrWhiteSpace(kh) || string.IsNullOrWhiteSpace(mjzbz) || string.IsNullOrWhiteSpace(ks) || string.IsNullOrWhiteSpace(ksmc) || ghpbId < 0 - || string.IsNullOrWhiteSpace(brxz)) - { - //181008必须得传brxz - //zje可以等于0,但不能小于0 - return Error("请求数据不完整"); - } - object newJszbInfo; - _outpatientRegApp.UnSettSave(patid, kh, ghly, mjzbz, - ks, ys, ksmc, ysmc, ghxm, zlxm, isCkf, isGbf, ghpbId, brxz, ybjsh, ref qzjzxh, ref qzmzh, jzyy, jzid, jzlx, bzbm, bzmc, out newJszbInfo); - return Success(null, newJszbInfo); - } - catch (Exception ex) - { + } throw ex; } } @@ -467,6 +407,28 @@ public ActionResult UnSettedRegBackNum(string mzh) #endregion + /// + /// 预约挂号 + /// + /// + /// + /// + /// + public ActionResult BespeakRegister(int? zjlx, string zjh, string blh, string ksCode, int mzlx, string ysgh) + { + var param = new BespeakRegisterParamDTO + { + blh = blh, + ksCode = ksCode, + mzlx = mzlx, + ysgh = ysgh, + zjh = zjh, + zjlx = zjlx + }; + var result = new MzBespeakRegisterProcess(param).Process(); + return result.IsSucceed ? Success("", result.Data) : Error(result.ResultMsg); + } + #endregion public ActionResult OutpatientRegSearch() { @@ -531,13 +493,13 @@ public ActionResult printCqOutpatientChargeBill(string jsnm) #region 重庆医保 public ActionResult SaveCqybMedicalReg(CqybMedicalReg02Entity entity, CqybMedicalInPut02Entity medicalInList) { - - if (entity != null) - { - entity.OrganizeId = this.OrganizeId; - entity.zt = "1"; + + if (entity!=null) + { + entity.OrganizeId = this.OrganizeId; + entity.zt = "1"; _iCqybMedicalReg02Repo.SaveCqybMedicalReg(entity, null); - } + } var jytype = entity.jytype; if (medicalInList != null) @@ -549,48 +511,53 @@ public ActionResult SaveCqybMedicalReg(CqybMedicalReg02Entity entity, CqybMedica } return Success(); - } - /// - /// 获取挂号费用 - /// - /// - /// - /// - /// - /// - public ActionResult GetOutpatientGhFees(string ghlx, string zlxm, bool isCkf, bool isGbf, string qzmzh, string yszjh, string ksbm, string ksbmmc, string gjysdm) - { - var ghdata = _iOutPatChargeDmnService.GetChongQingGHMzjs(ghlx, zlxm, isCkf, isGbf, this.OrganizeId); - decimal ybje = Convert.ToDecimal(0.0000); - decimal zfje = Convert.ToDecimal(0.0000); - foreach (var item in ghdata) - { - //判断项目是医保项目还是自费项目,此处因为sypc肯定为null,故查询时先以此字段作为医保标志字段赋值,可以不再添加新字段 - if (item.issc == 1) - { - ybje += Convert.ToDecimal(item.je); - } - else - { - zfje += Convert.ToDecimal(item.je); - } - } - var retData = new - { - ybzje = ybje, - zfzje = zfje - }; - return Content(retData.ToJson()); - } + } + /// + /// 获取挂号费用 + /// + /// + /// + /// + /// + /// + public ActionResult GetOutpatientGhFees(string ghlx, string zlxm, bool isCkf, bool isGbf,string qzmzh,string yszjh,string ksbm,string ksbmmc,string gjysdm) + { + var ghdata = _iOutPatChargeDmnService.GetChongQingGHMzjs(ghlx, zlxm, isCkf, isGbf, this.OrganizeId); + decimal ybje = Convert.ToDecimal(0.0000); + decimal zfje = Convert.ToDecimal(0.0000); + foreach (var item in ghdata) + { + //判断项目是医保项目还是自费项目,此处因为sypc肯定为null,故查询时先以此字段作为医保标志字段赋值,可以不再添加新字段 + if (item.issc==1) + { + ybje += Convert.ToDecimal(item.je); + } + else + { + zfje += Convert.ToDecimal(item.je); + } + } + var retData = new + { + ybzje = ybje, + zfzje = zfje + }; + return Content(retData.ToJson()); + } #endregion - + public ActionResult OutPatientSbkhInput(string from = "") { ViewBag.from = from; return View(); } + public ActionResult OutPatientSfzhInput(string from = "") + { + ViewBag.from = from; + return View(); + } /// /// 导出挂号查询条件查询 /// @@ -682,15 +649,5 @@ public ActionResult SelectRegChargeQueryExcel(DateTime? ksrq, DateTime? jsrq, st return Content("文件导出失败,请返回列表页重试"); } } - /// - /// 修改手机号 - /// - /// - /// - public ActionResult UpdatePatPhone(string patid, string phone) - { - var result = _outpatientRegistRepo.UpdatePatPhone(patid, phone, UserIdentity.rygh, OrganizeId); - return Content(result.ToJson()); - } } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/Form.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/Form.cshtml index 84e207c4..9a312917 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/Form.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/Form.cshtml @@ -108,7 +108,8 @@ 周日 - + + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/TimeForm.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/TimeForm.cshtml index 72fc7b37..f9447ff2 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/TimeForm.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutBook/TimeForm.cshtml @@ -9,24 +9,25 @@
      - - - - - - - - - - - -
      时间段选择: - -
      开始时间 : - - 结束时间 : - -
      + + + + + + + + + + + +
      时间段选择: + +
      开始时间 : + + 结束时间 : + +
      +
      \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatCharge/dkfsxz_mz.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatCharge/dkfsxz_mz.cshtml index 45a016fb..d3131643 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatCharge/dkfsxz_mz.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatCharge/dkfsxz_mz.cshtml @@ -2,38 +2,109 @@ @{ ViewBag.Title = "读卡方式"; Layout = "~/Views/Shared/_Form.cshtml"; + var medicalInsurance = SysConfigReader.String("Outpatient_MedicalInsurance"); } @Html.Partial("_YibaoCommonView")
      -
      - -
      - -
      - + @*
      + +
      + +
      + *@ + +
      +
      +
      + +
      +
      \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientAccounting/SysPatEntitiesblhView.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientAccounting/SysPatEntitiesblhView.cshtml index 0bce98a1..619ea8a5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientAccounting/SysPatEntitiesblhView.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientAccounting/SysPatEntitiesblhView.cshtml @@ -18,15 +18,19 @@ @*
      -
      - @*
      -
      *@ +
      + @*
      + *@ + } @if (invoicePrintMethod == "ActiveX") { diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientRefund/SysPatEntitiesReView.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientRefund/SysPatEntitiesReView.cshtml index 950513b8..c40f4884 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientRefund/SysPatEntitiesReView.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientRefund/SysPatEntitiesReView.cshtml @@ -40,11 +40,7 @@ - - @if ("outpatcharge" == ViewBag.fromName) - { - - } + @@ -59,7 +55,6 @@ \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientReg/OutpatientReg2018.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientReg/OutpatientReg2018.cshtml index 9639e4a9..ad24fe3f 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientReg/OutpatientReg2018.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/OutpatientManage/Views/OutpatientReg/OutpatientReg2018.cshtml @@ -27,9 +27,13 @@ var IsOpenSfzYbJz = SysConfigReader.String("IsOpenSfzYbJz"); //是否开启排队叫号newzlf var IsOpenPdjhxt = SysConfigReader.Bool("IsOpenPdjhxt"); + //医保挂号后是否进行后续医保交易 + var IsOpenybghjs= SysConfigReader.Bool("Outpatient_Mzghjsopen"); + //挂号时是否进行医保登记交易 + var IsOpenYbgh= SysConfigReader.Bool("Outpatient_Mzghopen"); var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); } -
      - -
      - - - - - - - - - - - - - - - - - - - -
      类型: - @Html.DropDownList("sel_rptype", EnumYbQuery.rydyxs.ToDescSelectList(), new { @class = "form-control form-an" }) - 开始日期: - - 结束日期: - - - - - @if (openYbSett == true || openXnhSett == true) - { -
      - - - -
      - } -
      医疗类别: - @Html.DropDownList("sel_yllb", Enumyllb.ptmz.ToDescSelectList(), new { @class = "form-control form-an" }) - - 结算ID: - - 就诊ID: - -
      + +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      类型: + @Html.DropDownList("sel_rptype", EnumYbQuery.rydyxs.ToDescSelectList(), new { @class = "form-control form-an" }) + 开始日期: + + 结束日期: + + + + + @Html.Partial("YibaoRedCardCommon") +
      医疗类别: + @Html.DropDownList("sel_yllb", Enumyllb.ptmz.ToDescSelectList(), new { @class = "form-control form-an" }) + + 结算ID: + + 就诊ID: + + 报告单号: + + + +
      当前页数: + + + 本页数据量: + +
      + +
      +
      +
      + +
      + + + + + + + + + + + @* + *@ + + + + + + + + + + +
      人员编号: + + 证件号码: + + 姓名: + + 性别: + + 民族: + +
      出生日期: + + 年龄: + +
      +
      +
      +
      + +
      +
      +
      + @*
      *@ +
      +
      +
      +
      -
      -
      - -
      - - - - - - - - - - - @* - *@ - - - - - - - - - - -
      人员编号: - - 证件号码: - - 姓名: - - 性别: - - 民族: - -
      出生日期: - - 年龄: - -
      -
      -
      -
      - -
      -
      -
      - @*
      *@ + @* 医疗结构信息查询 tap *@ +
      +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      类型: + @Html.DropDownList("sel_jgcxtype", EnumYbJGQuery.jgxx.ToDescSelectList(), new { @class = "form-control form-an" }) + 医药机构名称: + + 医药机构编号: + + 开始日期: + + 结束日期: + + *当前页数: + + + *本页数据量: + + + +
      医药机构目录编码: + + 定点医药机构批次流水号: + + 医疗目录编码: + + 就诊ID: + + *结算年月: + + 结算ID: + +
      +
      - +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + //-----------------------------医疗机构信息查询页面 end---------------------------// + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/HospiterRes/YibaoInterfaceCancel.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/HospiterRes/YibaoInterfaceCancel.cshtml index e3772938..3978710b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/HospiterRes/YibaoInterfaceCancel.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/HospiterRes/YibaoInterfaceCancel.cshtml @@ -223,7 +223,7 @@ } break; case "HIS单边": - debugger; + var tmx; var tjscfh = []; $.najax({ diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/InPatientQueryIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/InPatientQueryIndex.cshtml index 1cfe1999..5d82fb8a 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/InPatientQueryIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/InPatientQueryIndex.cshtml @@ -11,12 +11,17 @@ //医保所属地,区分系统将执行何处医保逻辑 var medicalInsurance = SysConfigReader.String("Inpatient_MedicalInsurance"); var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); - //就诊凭证类型是否从医保端获取 + //就诊凭证类型是否从医保端获取 var YB_Jzpzl = SysConfigReader.String("YB_Jzpzl"); }
      @@ -26,7 +31,7 @@
      - + - - @* - *@ - - - - + + + + + + + + @**@ +
      在院状态:在院状态: 入院病区: +
      - - - - - - - - - 新住院号: @if (isZFtoYB) { @@ -103,10 +94,39 @@ } - + + +
      + + + + + + + + + + + + + + + + + + +
      @@ -114,14 +134,13 @@
      - + + + + @if (isZFtoYB || isYBtoZF) { -} \ No newline at end of file +} diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/PatientUploadYbIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/PatientUploadYbIndex.cshtml new file mode 100644 index 00000000..f76afc42 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/PatientUploadYbIndex.cshtml @@ -0,0 +1,728 @@ +@{ + Layout = "~/Views/Shared/_Index.cshtml"; + + //医保所属地,区分系统将执行何处医保逻辑 + var medicalInsurance = SysConfigReader.String("Inpatient_MedicalInsurance"); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); +} + + + + +
      + @*医保病人数据上传 *@ +
      +
      + + + + + + + + + + + + + + + + + + + + + +
      在院状态: + + 关键字: + + 入院日期: + + + +
      入院科室: + + 入院病区: + + 上传类型: + + + + +
      +
      +
      +
      +
      +
      +
      + @*自费病人数据上传 *@ +
      +
      + + + + + + + + + + + + + + +
      + + 关键字: + + 结算日期: + + + + 上传类型: + + + + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/QuerySettlementResultFrom.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/QuerySettlementResultFrom.cshtml new file mode 100644 index 00000000..0ecaf37a --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/QuerySettlementResultFrom.cshtml @@ -0,0 +1,114 @@ +@using Newtouch.Infrastructure; +@{ + ViewBag.Title = "SettlementListResultFrom"; + Layout = "~/Views/Shared/_Index.cshtml"; + var brzybzType = ((int)EnumZYBZ.Djz).ToString(); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); +} +
      +
      + + + + + + + +
      查询日期: + + + + + +
      +
      + +
      +
      +
      +
      +
      + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListResultFrom.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListResultFrom.cshtml new file mode 100644 index 00000000..5830bc47 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListResultFrom.cshtml @@ -0,0 +1,125 @@ +@using Newtouch.Infrastructure; +@{ + ViewBag.Title = "SettlementListResultFrom"; + Layout = "~/Views/Shared/_Index.cshtml"; + var brzybzType = ((int)EnumZYBZ.Djz).ToString(); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); +} +
      +
      +
      + @*
      *@ +
      +
      +
      + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListUpload.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListUpload.cshtml new file mode 100644 index 00000000..74176d98 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/SettlementListUpload.cshtml @@ -0,0 +1,461 @@ +@using Newtouch.Infrastructure; +@{ + Layout = "~/Views/Shared/_Index.cshtml"; + + var isZFtoYB = SysConfigReader.Bool("Inpatient_Open_ZF_to_YB", false).Value; + var isYBtoZF = SysConfigReader.Bool("Inpatient_Open_YB_to_ZF", false).Value; + + //是否和医保交易 + var openYbSett = SysConfigReader.Bool("Inpatient_Sett_OpenYbSett"); + //是否和新农合交易 + var openXnhSett = SysConfigReader.Bool("Inpatient_Sett_OpenXnhSett"); + //医保所属地,区分系统将执行何处医保逻辑 + var medicalInsurance = SysConfigReader.String("Inpatient_MedicalInsurance"); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + var openManualinputCard = SysConfigReader.Bool("Inpatient_Open_ManualinputCard", false).Value; + var reportUrl = SysConfigReader.OrgReportLink("Settlementlist"); +} + +
      +
      + + + + + + + + + + + + + + + + + + + + +
      关键字: + + 出院日期: + + + + 上传状态: + + 提交状态: + + + +
      + + + + + + + + +
      +
      +
      +
      +
      +
      +
      + + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/YBToZFForm.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/YBToZFForm.cshtml index 2e39bf4a..154a830d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/YBToZFForm.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/YBToZFForm.cshtml @@ -167,9 +167,11 @@ } function funcStep4(nextStepCallback) { - $.loading(true, '正在医保入院办理回退...'); - var bkbz =cardxx.accountattr ? cardxx.accountattr.substr(11, 1):""; + + $.loading(true, '正在医保入院办理回退...'); + var bkbz =cardxx.accountattr ? cardxx.accountattr.substr(11, 1):""; var gbbz =cardxx.accountattr ? cardxx.accountattr.substr(1, 1):"";//干保 1 + if (bkbz == "G" || bkbz == "A" || gbbz == "1") { var jzlx = "1"; var payoptype = { diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/ZFToYBForm.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/ZFToYBForm.cshtml index ce4e743a..8f54bf40 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/ZFToYBForm.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/ZFToYBForm.cshtml @@ -33,13 +33,13 @@ margin-left: 10px; } - li i.passing { - color: #0FA74F; - } + li i.passing { + color: #0FA74F; + } - li i.failed { - color: red; - } + li i.failed { + color: red; + }
        @@ -111,6 +111,8 @@ var newzyh = $.request('newzyh'); var zffs = $.request('zffs'); var khxx = $.request('khxx'); + var patName = $.request('patName'); + var patsfz = $.request('patsfz'); var jzh = ""; var _psn_cert_type = ""; var _mdtrt_cert_no = ""; @@ -134,6 +136,7 @@ var cardInfo2; var cardInfo3; var yibaoCardInfo; + var brxzobj = { brxz: "1", brxzmc: "普通医保" }; var cqPatInfo = {};//患者读卡信息 //入院办理信息(医保接口返回) var ryblInfo; @@ -274,7 +277,9 @@ return; } + function funcStep4(nextStepCallback) { + debugger; $.loading(true, '正在医保入院办理...'); setTimeout(function () { if(cqPatInfo.ybVer == "shanghaiV5") { @@ -338,7 +343,7 @@ dise_codg: "", dise_name: "" }; - debugger; + $.ajax({ type: "POST", url: "http://127.0.0.1:33333/api/YiBao/HospitaMdtrtinfo_2401", @@ -541,11 +546,32 @@ } function gjyb() { + debugger; var res = { "success": "true", "msg": "" }; - setTimeout(function () { - var url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1161";; - var payoptype = { "mdtrt_cert_type": "03", "operatorId": '@(opr.rygh)', "operatorName": '@(opr.UserName)', "businessType": "01101", "officeId": "0201", "officeName": "内科" }; - if ('@YB_Jzpzl' != 'ON') { + // setTimeout(function () { + var url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1161"; + var payoptype = { "mdtrt_cert_type": "03", "mdtrt_cert_no": patsfz, "operatorId": '@(opr.rygh)', "operatorName": '@(opr.UserName)', "businessType": "01101", "officeId": "0201", "officeName": "内科" }; + if (zffs === "sm")//电子凭证 + { + payoptype.mdtrt_cert_type = "01"; + url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1162"; + } + if (zffs === "sfz") {//身份证 + payoptype.mdtrt_cert_type = "02"; + payoptype.mdtrt_cert_no = patsfz; + payoptype.psn_name = patName; + url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1163"; + } + if (zffs === "ck") {//医保磁卡 + payoptype.mdtrt_cert_type = "00"; + payoptype.mdtrt_cert_no = patsfz; + url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1101"; + } + if (zffs === "sl") {//刷脸 + payoptype.mdtrt_cert_type = "02"; + url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1164"; + } + @*if ('@YB_Jzpzl' != 'ON') { if (zffs === "sm") { url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1162"; } @@ -559,7 +585,7 @@ payoptype.mdtrt_cert_no = khxx; url = "http://127.0.0.1:33333/api/YiBao/CardecInfo_1101"; } - } + }*@ $.ajax({ type: "POST", url: url, @@ -571,8 +597,9 @@ } }); $.loading(false); + debugger; if (yibaoCardInfo) { - if (yibaoCardInfo.infcode == "0") { + if (yibaoCardInfo.infcode == "0" || yibaoCardInfo.infcode == 0) { if ('@YB_Jzpzl' === 'ON') { var cardecinfo = yibaoCardInfo.output.cardecinfo; switch (cardecinfo.mdtrt_cert_type) { @@ -592,14 +619,29 @@ } } cardInfo1 = yibaoCardInfo.output.baseinfo; //医保基本信息 - cardInfo2 = yibaoCardInfo.output.insuinfo[0];//参保信息 + if (yibaoCardInfo.output.insuinfo.length > 1) { + for (var i = 0; i < yibaoCardInfo.output.insuinfo.length; i++) { + if (yibaoCardInfo.output.insuinfo[i].paus_insu_date) + continue; + else { + cardInfo2 = yibaoCardInfo.output.insuinfo[i]; + break; + } + } + } else + cardInfo2 = yibaoCardInfo.output.insuinfo[0];//参保信息 if (zffs !== "3") { cardInfo3 = yibaoCardInfo.output.cardecinfo;//卡信息 cqPatInfo.sbkh = cardInfo3.cardno; } if (zffs == "3") { + cardInfo3 = yibaoCardInfo.output.cardecinfo;//卡信息 cqPatInfo.ecToken = cardInfo3.ecToken; } + getbrxz(cardInfo2.insutype); + yibaoCardInfo.brxzdm = brxzobj.brxz; + yibaoCardInfo.brxzmc = brxzobj.brxzmc; + cqPatInfo.xm = cardInfo1.psn_name; cqPatInfo.sfzh = cardInfo1.certno; cqPatInfo.xzqh = cardInfo2.insuplc_admdvs; @@ -608,8 +650,11 @@ cqPatInfo.grbh = cardInfo1.psn_no; cqPatInfo.jzlx = zffs; cqPatInfo.ybVer = "gjyb"; + cqPatInfo.mdtrt_cert_type = payoptype.mdtrt_cert_type; + cqPatInfo.mdtrt_cert_no = cqPatInfo.ecToken; yibaoCardInfo.readCardCardType = payoptype.mdtrt_cert_type; + //yibaoCardInfo.kh = jzpzlx != "3" ? sbkobj.sbkh : null; yibaoCardInfo.kh = payoptype.mdtrt_cert_type == "01" ? cardInfo3.ecToken : (payoptype.mdtrt_cert_type == "02" ? cardInfo1.certno : cardInfo3.cardno); yibaoCardInfo.qtjz = zffs != "2" ? cardInfo1.certno : null; yibaoCardInfo.ybVer = "gjyb"; @@ -642,18 +687,43 @@ // dataType: "json", // }); //} - + return res; } else { res.success = false; - res.msg = "刷卡失败:" + yibaoCardInfo.err_ms; + res.msg = "医保服务【1101】(获取医保病人信息失败):" + yibaoCardInfo.err_msg; + return res; } } else { res.success = false; res.msg = "刷卡获取医保信息失败!失败原因:医保中心无信息返回,请重试!"; + return res; } - }, 50); + // }, 50); - return res; + } + function getbrxz(brlx) { + $.ajax({ + url: "/PatientManage/HospiterRes/GetBrxzbyxzlx", + data: { xzlx: brlx }, + dataType: "json", + async: false, + cache: false, + success: function (data) { + if (!!data) { + $.each(data, function (idx, val) { + if (val.insutype && val.insutype == brlx) { + brxzobj.brxz = val.brxz; + brxzobj.brxzmc = val.brxzmc; + } + }); + } + return brxzobj; + }, + error: function (request, error, ex) { + return brxzobj; + } + }); + } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/dkfsxz.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/dkfsxz.cshtml index d0e9d666..12c0015f 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/dkfsxz.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/Inpatient/dkfsxz.cshtml @@ -9,6 +9,8 @@

        +
        +

        @@ -20,6 +22,7 @@ var newzyh = $.request('newzyh'); var medicalInsurance = '@medicalInsurance'; var zffs; + //医保卡 function skOnClick(patid) { debugger; zffs = "sk" @@ -37,23 +40,57 @@ }); }; + //刷脸 + function slOnClick(patid) { + debugger; + zffs = "sl" + $.modalOpen({ + id: "ZFToYBForm", + title: "自费转医保", + url: "/PatientManage/Inpatient/ZFToYBForm?zyh=" + zyh + "&ryfs=" + ryfs + "&ydsfz=" + ydsfz + "&newzyh=" + newzyh + "&zffs=" + zffs, + width: "550px", + height: "380px", + btn: ['', '关闭'], + btnclass: ['', 'btn btn-danger'], + success: function (iframeId) { + $.modalClose(); + } + }); + }; + //电子凭证 function smOnClick(patid) { + debugger; zffs = "sm"; $.modalOpen({ - id: "sbkhInput", - title: "卡号输入", - url: "/OutpatientManage/OutpatientReg/OutPatientSbkhInput?t=" + Math.random() + "&medicalInsurance=" + medicalInsurance, - width: "300px", - height: "150px", - callBack: function (iframeId) { - top.frames[iframeId].PatSbkhData(); + id: "ZFToYBForm", + title: "自费转医保", + url: "/PatientManage/Inpatient/ZFToYBForm?zyh=" + zyh + "&ryfs=" + ryfs + "&ydsfz=" + ydsfz + "&newzyh=" + newzyh + "&zffs=" + zffs, + width: "550px", + height: "380px", + btn: ['', '关闭'], + btnclass: ['', 'btn btn-danger'], + success: function (iframeId) { + $.modalClose(); } + }); + //$.modalOpen({ + // id: "sbkhInput", + // title: "卡号输入", + // url: "/OutpatientManage/OutpatientReg/OutPatientSbkhInput?t=" + Math.random() + "&medicalInsurance=" + medicalInsurance, + // width: "300px", + // height: "150px", + // callBack: function (iframeId) { + // top.frames[iframeId].PatSbkhData(); + // } + //}); //openform(); }; + //医保磁卡 function ckOnClick(patid) { + debugger; zffs = "ck"; $.modalOpen({ id: "sbkhInput", @@ -67,11 +104,29 @@ }); //openform(); }; + //身份证读卡 + function sfzOnClick(patid) { + debugger; + zffs = "sfz"; + $.modalOpen({ + id: "sfzhInput", + title: "身份证号输入", + url: "/OutpatientManage/OutpatientReg/OutPatientSfzhInput?t=" + Math.random() + "&medicalInsurance=" + medicalInsurance + "&topform=" + "1", + width: "300px", + height: "150px", + callBack: function (iframeId) { + top.frames[iframeId].PatSfzhData(); + } + }); + //openform(); + }; + function openform(khxx) { + debugger; $.modalOpen({ id: "ZFToYBForm", title: "自费转医保", - url: "/PatientManage/Inpatient/ZFToYBForm?zyh=" + zyh + "&ryfs=" + ryfs + "&ydsfz=" + ydsfz + "&newzyh=" + newzyh + "&zffs=" + zffs + "&khxx=" + khxx, + url: "/PatientManage/Inpatient/ZFToYBForm?zyh=" + zyh + "&ryfs=" + ryfs + "&ydsfz=" + ydsfz + "&newzyh=" + newzyh + "&zffs=" + zffs + "&patsfz=" + khxx.sfzh + "&patName=" + khxx.name, width: "550px", height: "380px", btn: ['', '关闭'], @@ -81,7 +136,12 @@ } }); } + function GetReadCardInfo(khxx) { + debugger; + openform(khxx); + } function readCard(khxx) { + debugger; switch (medicalInsurance) { case "shanghai": openform(khxx.sbkh); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/HospFeeInfo.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/HospFeeInfo.cshtml index e733ae85..0dddfde5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/HospFeeInfo.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/HospFeeInfo.cshtml @@ -76,7 +76,7 @@ getItemsbySfdl(rowIndex); }, gridComplete: function () { - getHospFeeZje(); + getFeeZje(); }, caption: captionCon @@ -104,8 +104,8 @@ } } - //总金额 - function getHospFeeZje() { + function getFeeZje() { + //总金额 var zje = 0; var ids = $("#gridFeeInfoList").getDataIDs();//返回数据表的ID数组["66","39"..] for (var i = 0; i < ids.length; i++) { diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/Index.cshtml index 45ac19b4..bb1f68d5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PatientManage/Views/PatientCenter/Index.cshtml @@ -4,22 +4,21 @@ }
        -
        +
        @@ -62,7 +61,7 @@ - + 3个月 职工医保 @@ -72,24 +71,24 @@
        @*
        *@ -
        +
        @* - - *@ + + *@ @* - - - - - *@ + + + + + *@ @@ -132,12 +131,11 @@
        卡     号:AF00000008
        总 费 用: 1999.98
        总 费 用: 1999.98
        账户余额:1000
        已结费用:0
        待缴费用:-999.98
        已结费用:0
        待缴费用:-999.98
        科 室:儿童康复科
        -
        +
        -
        - @Html.Partial("HospFeeSearch") -
        @@ -190,7 +185,8 @@ dataType: "json", success: function (data) { if (data != null && !!data.zyh) { - GetPatQueryAjax({ patid: data.patid, zyh: data.zyh }); + debugger + GetPatQueryAjax({ patid: data.patid, zyh: data.zyh }); } else { $.modalAlert("患者信息异常,请重新选择", 'warning'); @@ -207,70 +203,54 @@ //tab初始化 function tabInit() { $('a[data-toggle="tab"]').on('show.bs.tab', function (e) { - DefaultTab(this); + switch ($(this).attr('href')) { + case "#linkfee": + $("#dv_fee").show(); + $("#dv_account").hide(); + $("#dv_zd").hide(); + $("#dv_yb").hide(); + $("#dv_sett").hide(); + FeeListGrid("","1"); + break; + case "#linkzd": + $("#dv_fee").hide(); + $("#dv_zd").show(); + $("#dv_account").hide(); + $("#dv_yb").hide(); + $("#dv_sett").hide(); + ZdListGrid($("#zyh").text()); + break; + case "#linkaccount": + $("#dv_fee").hide(); + $("#dv_zd").hide(); + $("#dv_account").show(); + $("#dv_yb").hide(); + $("#dv_sett").hide(); + gridListAccount($("#zyh").text()); + break; + case "#linkybinfo": + $("#dv_fee").hide(); + $("#dv_account").hide(); + $("#dv_zd").hide(); + $("#dv_yb").show(); + $("#dv_sett").hide(); + gridListPresett($("#zyh").text()); + break; + case "#linksett": + $("#dv_fee").hide(); + $("#dv_account").hide(); + $("#dv_zd").hide(); + $("#dv_yb").hide(); + $("#dv_sett").show(); + gridListSett($("#zyh").text()); + break; + } + }); $('#myTab a:first').trigger('click'); } - function DefaultTab(obj) { - switch ($(obj).attr('href')) { - case "#linkfeesearch": - $("#dv_feesearch").show(); - $("#dv_fee").hide(); - $("#dv_account").hide(); - $("#dv_zd").hide(); - $("#dv_yb").hide(); - $("#dv_sett").hide(); - FeeGrid($("#zyh").text()); - break; - case "#linkfee": - $("#dv_feesearch").hide(); - $("#dv_fee").show(); - $("#dv_account").hide(); - $("#dv_zd").hide(); - $("#dv_yb").hide(); - $("#dv_sett").hide(); - FeeListGrid("", "1"); - break; - case "#linkzd": - $("#dv_feesearch").hide(); - $("#dv_fee").hide(); - $("#dv_zd").show(); - $("#dv_account").hide(); - $("#dv_yb").hide(); - $("#dv_sett").hide(); - ZdListGrid($("#zyh").text()); - break; - case "#linkaccount": - $("#dv_feesearch").hide(); - $("#dv_fee").hide(); - $("#dv_zd").hide(); - $("#dv_account").show(); - $("#dv_yb").hide(); - $("#dv_sett").hide(); - gridListAccount($("#zyh").text()); - break; - case "#linkybinfo": - $("#dv_feesearch").hide(); - $("#dv_fee").hide(); - $("#dv_account").hide(); - $("#dv_zd").hide(); - $("#dv_yb").show(); - $("#dv_sett").hide(); - gridListPresett($("#zyh").text()); - break; - case "#linksett": - $("#dv_feesearch").hide(); - $("#dv_fee").hide(); - $("#dv_account").hide(); - $("#dv_zd").hide(); - $("#dv_yb").hide(); - $("#dv_sett").show(); - gridListSett($("#zyh").text()); - break; - } - } //人员查询 function GetPatSerarchView(blh) { @@ -298,7 +278,7 @@ if (data != null) { for (var e in data) { if (!!$("#" + e) && data[e] != null) { - if (e == "xb") { + if (e == "xb") { $("#" + e).html($.enum.getDescByValue("EnumSex", data[e])); } else if (e == "zybz") { @@ -322,9 +302,9 @@ $("#" + e).html(data[e]); } } - } + } } - + } }); @@ -340,9 +320,9 @@ postData: { zyh: obj.zyh,group:"1" } }).trigger('reloadGrid'); - DefaultTab($('#myTab a:first')); - //$('#myTab a:first').trigger('click'); + $('#myTab a:first').trigger('click'); } + } function PatinfoClear() { diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Controllers/MicroPayController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Controllers/MicroPayController.cs index d0bd9f5d..306673a2 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Controllers/MicroPayController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Controllers/MicroPayController.cs @@ -3,6 +3,7 @@ using System.Web.Mvc; using Newtouch.Core.Common; using Newtouch.HIS.Application.Interface; +using Newtouch.HIS.Domain; using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices.PayManage; using Newtouch.HIS.Domain.IRepository; @@ -48,53 +49,138 @@ public ActionResult TradeRefund() } /// - /// + /// 条码支付(扫码付) /// /// /// /// /// /// - public ActionResult MicroPaySubmit(string out_trade_no, string subject, string total_amount, string auth_code) + public ActionResult MicroPaySubmit(string out_trade_no, string subject, string total_amount, string auth_code, string djjesszffs, string patid) { - PayResultModel payresult = TradeHelper.Pay(out_trade_no,subject,total_amount,auth_code); + out_trade_no = this.UserIdentity.UserCode + "_" + out_trade_no; + if (djjesszffs == "13") + { + var auth_codedata = new + { + OutTradeNo = out_trade_no, + BarCode = auth_code, + TotalAmount = total_amount, + Subject = subject, + Body = subject, + Terminal = this.UserIdentity.UserCode, + PatientName = patid, + IDCardNo = "", + PatientID = patid, + Operation = subject, + PayType = 5, + StoreId = "", + SellerName = "隆安县城厢卫生院", + FacePay = false, + TxnTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + }; + string datajson = Newtonsoft.Json.JsonConvert.SerializeObject(auth_codedata); - OrderPayInfoEntity ety = new OrderPayInfoEntity(); - ety.OutTradeNo = out_trade_no; - ety.Amount = Convert.ToDecimal(total_amount); - ety.TradeDesc = subject; + CommmHelper commm = new CommmHelper(); + string nxresult = commm.NxPost(Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("NxPay") + "qrpay/qr-barcode-pay-request", datajson); - if (payresult != null) - { - if (payresult.code == ResponseResultCode.SUCCESS) + + if (!string.IsNullOrEmpty(nxresult)) { - ety.TradeNo = payresult.TradeNo; - ety.PayStatus = (int)EnumPayStatus.Success; - ety.OrderDate = Convert.ToDateTime(payresult.GmtTime); - ety.PayType = Convert.ToInt32(payresult.PayType) ; - ety.Memo = payresult.TradeStatus; - ety.PayAccount = payresult.PayAccount; - ety.OrganizeId = this.OrganizeId; - - _OrderPayInfoRepo.SubmitInfo(ety); - - var data = new + var nxpaymodel = Newtonsoft.Json.JsonConvert.DeserializeObject(nxresult); + + if (nxpaymodel.Result == "0") { - outTradeNo = out_trade_no, //商户订单号 - tradeNo = DateTime.Now.Ticks, //第三方交易号 - payType = payresult.PayType, //支付方式 - }; + PayResultModel payresult = new PayResultModel(); + payresult.code = ResponseResultCode.SUCCESS; + payresult.TradeNo = nxpaymodel.tradeNo; + payresult.GmtTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + payresult.PayType = "2"; + payresult.TradeStatus = "0"; + payresult.PayAccount = total_amount; + + OrderPayInfoEntity ety = new OrderPayInfoEntity(); + ety.OutTradeNo = out_trade_no; + ety.Amount = Convert.ToDecimal(total_amount); + ety.TradeDesc = subject; - return Success(null, data); + if (payresult != null) + { + if (payresult.code == ResponseResultCode.SUCCESS) + { + ety.TradeNo = payresult.TradeNo; + ety.PayStatus = (int)EnumPayStatus.Success; + ety.OrderDate = Convert.ToDateTime(payresult.GmtTime); + ety.PayType = Convert.ToInt32(djjesszffs); + ety.Memo = payresult.TradeStatus; + ety.PayAccount = payresult.PayAccount; + ety.OrganizeId = this.OrganizeId; + + _OrderPayInfoRepo.SubmitInfo(ety); + + var data = new + { + outTradeNo = out_trade_no, //商户订单号 + tradeNo = payresult.TradeNo, //第三方交易号 + payType = payresult.PayType, //支付方式 + }; + + return Success(null, data); + } + else + { + ety.PayStatus = (int)EnumPayStatus.Failed; + ety.Memo = payresult.TradeStatus + ";" + payresult.sub_msg; + _OrderPayInfoRepo.SubmitInfo(ety); + return Error(payresult.msg + "," + payresult.sub_msg); + } + } + } } - else + + } + else + { + PayResultModel payresult = TradeHelper.Pay(out_trade_no, subject, total_amount, auth_code); + + OrderPayInfoEntity ety = new OrderPayInfoEntity(); + ety.OutTradeNo = out_trade_no; + ety.Amount = Convert.ToDecimal(total_amount); + ety.TradeDesc = subject; + + if (payresult != null) { - ety.PayStatus = (int)EnumPayStatus.Failed; - ety.Memo = payresult.TradeStatus+";"+payresult.sub_msg; - _OrderPayInfoRepo.SubmitInfo(ety); - return Error(payresult.msg+","+payresult.sub_msg); + if (payresult.code == ResponseResultCode.SUCCESS) + { + ety.TradeNo = payresult.TradeNo; + ety.PayStatus = (int)EnumPayStatus.Success; + ety.OrderDate = Convert.ToDateTime(payresult.GmtTime); + ety.PayType = Convert.ToInt32(payresult.PayType); + ety.Memo = payresult.TradeStatus; + ety.PayAccount = payresult.PayAccount; + ety.OrganizeId = this.OrganizeId; + + _OrderPayInfoRepo.SubmitInfo(ety); + + var data = new + { + outTradeNo = out_trade_no, //商户订单号 + tradeNo = DateTime.Now.Ticks, //第三方交易号 + payType = payresult.PayType, //支付方式 + }; + + return Success(null, data); + } + else + { + ety.PayStatus = (int)EnumPayStatus.Failed; + ety.Memo = payresult.TradeStatus + ";" + payresult.sub_msg; + _OrderPayInfoRepo.SubmitInfo(ety); + return Error(payresult.msg + "," + payresult.sub_msg); + } + + } - } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Views/MicroPay/MicroPay.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Views/MicroPay/MicroPay.cshtml index fe6fa59f..1d74e848 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Views/MicroPay/MicroPay.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/PayManage/Views/MicroPay/MicroPay.cshtml @@ -31,6 +31,8 @@ var out_trade_no = $.request("out_trade_no"); var subject = $.request("subject"); var total_amount = $.request("total_amount"); + var djjesszffs = $.request("djjesszffs"); + var patid = $.request("patid"); $(function () { initControl(); @@ -62,6 +64,8 @@ subject: subject, total_amount: total_amount, auth_code: auth_code, + djjesszffs: djjesszffs, + patid: patid, }; $.najax({ url: "/PayManage/MicroPay/MicroPaySubmit", diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Controllers/ReportController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Controllers/ReportController.cs index 760ef8ae..5a4d8ce7 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Controllers/ReportController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Controllers/ReportController.cs @@ -1,6 +1,7 @@ using DotNetDBF; using FrameworkBase.MultiOrg.Domain.IDomainServices; using Newtouch.Common; +using Newtouch.Core.Common; using Newtouch.Core.Common.Exceptions; using Newtouch.Core.Common.Utils; using Newtouch.HIS.Domain.Entity; @@ -15,6 +16,7 @@ using System.Data; using System.IO; using System.Net; +using System.Text; using System.Web; using System.Web.Mvc; @@ -418,13 +420,18 @@ public ActionResult OutpatientTreatmentInfo() ReportingServiceCom(); return View(); } - #endregion + #endregion - /// - /// 服务代码盈利 - /// - /// - public ActionResult RevenueDetailesReport() + public ActionResult HosOutpatientFees() + { + return View(); + } + + /// + /// 服务代码盈利 + /// + /// + public ActionResult RevenueDetailesReport() { ReportingServiceCom(); @@ -870,6 +877,7 @@ public ActionResult MonthlyFeeDetails() return View(); } + /// /// 获取大类名称 /// @@ -1203,7 +1211,128 @@ public ActionResult DCQuery_dbf(string types, string ksrq, string jsrq) return Content(refdata.ToJson()); } - #endregion + #endregion + #region 获取收费项目 + /// + /// 获取大类名称 + /// + /// + public ActionResult Getsfxm(Pagination pagination, string xzstr,string py,string sfdl) + { + var list = new + { + rows = _reportCommonDmnService.Getsfxm(pagination, xzstr, py, sfdl, this.OrganizeId), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(list.ToJson()); + } + #endregion 医保上报报表 + #region + /// + /// 总页面 + /// + /// + public ActionResult YBXXQueryUpload() + { + ReportingServiceCom(); + + return View(); + } + /// + /// 交易记录库 + /// + /// + public ActionResult JYJLQueryUpload() + { + ReportingServiceCom(); + + return View(); + } + /// + /// 门急诊大病挂号库 + /// + /// + public ActionResult DBGHQueryUpload() + { + ReportingServiceCom(); + + return View(); + } + /// + /// 门急诊家床收费库 + /// + /// + public ActionResult JCSFQueryUpload() + { + ReportingServiceCom(); - } + return View(); + } + /// + /// 获取交易记录信息 + /// + /// + public ActionResult GetJyjlData(Pagination pagination, string ksrq, string jsrq) + { + var list = new + { + rows = _reportCommonDmnService.GetJyjlData(pagination, ksrq, jsrq,this.OrganizeId), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(list.ToJson()); + } + public ActionResult Ybsjsctotxt(string ksrq, string jsrq) + { + StringBuilder sb = new StringBuilder(); + var rows = _reportCommonDmnService.GetJyjlDatatotxt(ksrq, jsrq, this.OrganizeId); + return Content(rows.ToJson()); + } + /// + /// 获取门急诊大病挂号库 + /// + /// + public ActionResult GetMjzdbghData(Pagination pagination, string ksrq, string jsrq) + { + var list = new + { + rows = _reportCommonDmnService.GetMjzdbghData(pagination, ksrq, jsrq, this.OrganizeId), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(list.ToJson()); + } + public ActionResult YbMjzdbghtxt(string ksrq, string jsrq) + { + StringBuilder sb = new StringBuilder(); + var rows = _reportCommonDmnService.GetYbMjzdbghtxt(ksrq, jsrq, this.OrganizeId); + return Content(rows.ToJson()); + } + /// + /// 获取门急诊大病加床收费数据 + /// + /// + public ActionResult GetMjzjcsfData(Pagination pagination, string ksrq, string jsrq) + { + var list = new + { + rows = _reportCommonDmnService.GetMjzjcsfData(pagination, ksrq, jsrq, this.OrganizeId), + total = pagination.total, + page = pagination.page, + records = pagination.records + }; + return Content(list.ToJson()); + } + public ActionResult GetMjzjcsfDatatxt(string ksrq, string jsrq) + { + StringBuilder sb = new StringBuilder(); + var rows = _reportCommonDmnService.GetMjzjcsfDatatxt(ksrq, jsrq, this.OrganizeId); + return Content(rows.ToJson()); + } + #endregion + } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/AllMedicineInsuranceQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/AllMedicineInsuranceQuery.cshtml index 168dc360..e2143fe8 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/AllMedicineInsuranceQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/AllMedicineInsuranceQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "OutpatientQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -87,7 +87,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1225" + "&hospitalCode=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&yblb=" + $('#yblb').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1225" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&hospitalCode=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&yblb=" + $('#yblb').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/ChargeTypeQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/ChargeTypeQuery.cshtml index 21a9bd35..8f540ae5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/ChargeTypeQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/ChargeTypeQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "ChargeTypeQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -88,7 +88,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1021" + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&querytype=" + $('#querytype').val() + "&sfdl=" + $('#sfdl').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1021" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&querytype=" + $('#querytype').val() + "&sfdl=" + $('#sfdl').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/DBGHQueryUpload.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/DBGHQueryUpload.cshtml new file mode 100644 index 00000000..876cc073 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/DBGHQueryUpload.cshtml @@ -0,0 +1,116 @@ + +@{ + ViewBag.Title = "DBGHQueryUpload"; + Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); +} + +
        +
        + + + + + + + + + +
        开始日期: + + 结束日期: + + + + +
        +
        +
        +
        +
        +
        +
        +
        +
        + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/FYXMMXQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/FYXMMXQuery.cshtml index 7c3e2c18..9d8ab201 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/FYXMMXQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/FYXMMXQuery.cshtml @@ -3,9 +3,18 @@ ViewBag.Title = "FYXMMXQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); } - +
        @@ -37,43 +46,173 @@ - - - + + + + + + - - - + + - + + +
        医生: - - -
        + + + + 项目检索: 医生: - 大类名称: - - 项目: - -
        大类名称: + +
        - -
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        - \ No newline at end of file + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosAcceptingGold.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosAcceptingGold.cshtml index 5ccd3516..17f75b28 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosAcceptingGold.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosAcceptingGold.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = ""; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -45,7 +45,7 @@ } //var url = getUrl(); - var url = '@Html.Raw(reportUrl)' + "?tempCode=1010" + "&systemCode=" + '@reportSystemCode'; + var url = '@Html.Raw(reportUrl)' + "?tempCode=1010" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; var usercode = '@ViewBag.CurUserCode'; url += " &hospitalCode=" + orgId; url += "&jzrq=" + $('#jzrq').val(); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosFeeSettSummry.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosFeeSettSummry.cshtml index 9dc1faa8..7803af74 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosFeeSettSummry.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosFeeSettSummry.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = ""; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -59,7 +59,7 @@ return; } - var url = '@Html.Raw(reportUrl)' + "?tempCode=10" + "&systemCode=" + '@reportSystemCode'; + var url = '@Html.Raw(reportUrl)' + "?tempCode=10" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; var usercode = '@ViewBag.CurUserCode'; url += "&kssj=" + $('#kssj').val(); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosOutpatientFees.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosOutpatientFees.cshtml new file mode 100644 index 00000000..ae9b126e --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/HosOutpatientFees.cshtml @@ -0,0 +1,83 @@ +@{ + ViewBag.Title = ""; + Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); +} + +
        +
        + + + + + + + + +
        开始日期: + + 结束日期: + + + +
        +
        +
        + +
        + +
        + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationclassification.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationclassification.cshtml index b7e75d23..a26e6bc1 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationclassification.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationclassification.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "住院费用分类清单"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -124,7 +124,7 @@ // } //}) - var url = '@Html.Raw(reportUrl)' + "?tempCode=1219" + "&systemCode=" + '@reportSystemCode'; + var url = '@Html.Raw(reportUrl)' + "?tempCode=1219" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; url += " &zyh=" + $('#zyh').val(); url += " &orgId=" + OrgId; url += " &kssj=" + $('#ksrq').val(); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationcost.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationcost.cshtml index 5fc7afe8..0e6f77ab 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationcost.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/Hospitalizationcost.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "住院费用明细"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -79,6 +79,7 @@ // $('#jsrq').val($.getDate()); //} $('#zyh').val($thistr.attr('data-zyh')); + $('#ksrq').val($thistr.attr('data-ryrq')); //submit(); } }, @@ -144,7 +145,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1218" + "&orgId=" + OrgId + "&zyh=" + $('#zyh').val() + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&doctor=" + curUserCode + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1218" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&zyh=" + $('#zyh').val() + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&doctor=" + curUserCode; return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JCSFQueryUpload.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JCSFQueryUpload.cshtml new file mode 100644 index 00000000..56f4d5e2 --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JCSFQueryUpload.cshtml @@ -0,0 +1,138 @@ + +@{ + ViewBag.Title = "JCSFQueryUpload"; + Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); +} +
        +
        + + + + + + + + + +
        开始日期: + + 结束日期: + + + + +
        +
        +
        +
        +
        +
        +
        +
        +
        + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JYJLQueryUpload.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JYJLQueryUpload.cshtml new file mode 100644 index 00000000..1ee4f72c --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/JYJLQueryUpload.cshtml @@ -0,0 +1,257 @@ + +@{ + ViewBag.Title = "JYJLQueryUpload"; + Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); +} +
        +
        + + + + + + + + + +
        开始日期: + + 结束日期: + + + + + +
        +
        +
        +
        +
        +
        +
        +
        +
        + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZCBFYFX.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZCBFYFX.cshtml index c37ae1ba..c5abcb1d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZCBFYFX.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZCBFYFX.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "MZCBFYFX"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -71,7 +71,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1222" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1222" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZFYRBHZ_Query.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZFYRBHZ_Query.cshtml index e2df8723..d3989312 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZFYRBHZ_Query.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZFYRBHZ_Query.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "MZFYRBHZ_Query"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -78,7 +78,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1246" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1246" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZJBFYFX.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZJBFYFX.cshtml index 5598b922..d8d1f92d 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZJBFYFX.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MZJBFYFX.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "MZJBFYFX"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -71,7 +71,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1247" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1247" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MonthlyFeeDetails.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MonthlyFeeDetails.cshtml index 1346fd12..6776868e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MonthlyFeeDetails.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/MonthlyFeeDetails.cshtml @@ -3,6 +3,7 @@ ViewBag.Title = "MonthlyFeeDetails"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -71,7 +72,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1258" + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1258" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/NormalMedicineInsuranceQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/NormalMedicineInsuranceQuery.cshtml index 0e6efd8c..d51f7ec5 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/NormalMedicineInsuranceQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/NormalMedicineInsuranceQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "OutpatientQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -77,7 +77,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1224" + "&hospitalCode=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1224" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&hospitalCode=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpWorkStacDeptReport.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpWorkStacDeptReport.cshtml index d8ba8be6..32db6a4c 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpWorkStacDeptReport.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpWorkStacDeptReport.cshtml @@ -1,7 +1,10 @@ - +@using Newtouch.Infrastructure; @{ ViewBag.Title = "Outform"; Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var opr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); }
        @@ -13,35 +16,36 @@ - + 结束日期: - - @*科室: + + 挂号科室: - - *@ + + @*操作员: - -
        -
        - + +
        +
        + +
        +
        + +
        -
        - -
        -
        - *@ + *@ - + - + + + +
        @@ -59,11 +63,11 @@ var orgId = '@(ViewBag.OrgId)'; var isHospAdministrator = '@(ViewBag.IsHospAdministrator)'; var curUserCode = '@(ViewBag.CurUserCode)'; - + console.info(orgId); //var uri = 'ReportServer/Pages/ReportViewer.aspx?%2FHIS.Report.1%2F%E9%97%A8%E8%AF%8A%E6%94%B6%E8%B4%B9%E5%91%98%E5%B7%A5%E4%BD%9C%E9%87%8F%E7%BB%9F%E8%AE%A1&rs:Command=Render'; - + var uri = 'ReportServer/Pages/ReportViewer.aspx?%2fHIS.Report.1%2f科室工作量统计表&rs:Command=Render'; @@ -84,14 +88,9 @@ return; } var url = getUrl(); - - url += "&kssj=" + $('#kssj').val(); - url += "&jssj=" + $('#jssj').val(); - //url += "&sfry=" + $("#txtsyy").val(); - url += "&gh=" + curUserCode; - console.info(url.trim()); setTimeout("$.loading(true, '正在请求报表页面...');", 10); - $("#iframerightiframerightiframerightttt").attr('src', url.trim()); + $("#iframerightiframerightiframerightttt").attr('src', url); + } $("#iframerightiframerightiframerightttt").load(function () { @@ -107,30 +106,11 @@ }); function getUrl() { - if (uri.StartWith('/')) { - uri = uri.substr(1); - } - var srcUrl = uri; - srcUrl = reportServerHOST + srcUrl; - - //获取自定义样式 - if (true) { - if (srcUrl.indexOf('&rc:') == -1) { - srcUrl += "&rc:Stylesheet=MyStyleSheet"; - } - } - if (true) { - if (srcUrl.indexOf('&rs:') == -1) { - srcUrl += "&rs:"; - } - else { - srcUrl += "&"; - } - srcUrl += "orgId="; - srcUrl += orgId; - - } - return srcUrl; + var ksrq = $("#kssj").val() + " 00:00:00"; + var jsrq = $("#jssj").val() + " 23:59:59"; + var ks = $("#txttjksmc").val() != "" ? $("#txttjksmc").attr("data-label") : ""; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1249" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + '@(opr.OrganizeId)' + "&ksrq=" + ksrq + "&jsrq=" + jsrq + "&ks=" + ks; + return srcUrl2; } @@ -158,5 +138,47 @@ } } + var kszdlist; + $.ajax({ + type: "POST", + url: "/PatientManage/HospiterRes/Getzdinfo", + dataType: "json", + async: false, + success: function (data) { + kszdlist = data; + + } + }); + //科室 + $("#txttjksmc").newtouchBatchFloatingSelector({ + height: 200, + width: 300, + clickautotrigger: true, + //url: '/OutpatientManage/OutpatientReg/GetCurrentDayRegListJson', + filter: function (keyword) { + //遍历数据源,用keyword来筛选出结果 + var resultObjArr = new Array(); + $.each(kszdlist, function (idx, val) { + if ((val.py && val.py.toLowerCase().indexOf(keyword) >= 0) + || (val.Name && val.Name.indexOf(keyword) >= 0) + || keyword.trim() == "") { + resultObjArr.push(val); + } + }); + return resultObjArr; + + }, + caption: "科室", + colModel: [ + { label: '编号', name: 'code', widthratio: 30 }, + { label: '名称', name: 'name', widthratio: 50 }, + { label: '拼音', name: 'py', hidden: true } + ], + itemdbclickhandler: function ($thistr) { + $("#txttjksmc").attr("data-label", $thistr.find("td:eq(0)").html()); + $("#txttjksmc").val($thistr.find('td:eq(1)').html()); + return; + }, + }); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientDailyFee.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientDailyFee.cshtml index 21bfa570..5dd70767 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientDailyFee.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientDailyFee.cshtml @@ -4,7 +4,7 @@ //报表链接 //var reportUrl = SysConfigReader.OrgReportLink("OutpatientDailyFee"); var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -148,7 +148,7 @@ function getUrl() { var srcUrl = '@Html.Raw(reportUrl)'; - srcUrl += "?tempCode=31" + "&systemCode=" + '@reportSystemCode'; + srcUrl += "?tempCode=31" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; return srcUrl; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientQuery.cshtml index 34af7a2e..f8427c64 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "OutpatientQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -88,7 +88,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1223" + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1223" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientSituationQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientSituationQuery.cshtml index fa5d0ba6..8525aabc 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientSituationQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientSituationQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "OutpatientSituationQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -88,7 +88,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1227" + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1227" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientWorkloadQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientWorkloadQuery.cshtml index 90eba03d..6e60b2bb 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientWorkloadQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/OutpatientWorkloadQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "OutpatientWorkloadQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -88,7 +88,7 @@ } function getUrl() { - var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1221" + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1221" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val(); return srcUrl2; } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/PrintReport.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/PrintReport.cshtml index c01bffa4..29c4b5aa 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/PrintReport.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/PrintReport.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "费用一日清"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -28,14 +28,18 @@ onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', onpicked: function () { refReport(); } })" value="@DateTime.Now.ToString("yyyy-MM-dd")" /> - + 入院日期: +

        + + + - + + - - +

        @@ -58,7 +62,7 @@ //治疗项目选择浮层绑定 $('#zyh').newtouchBatchFloatingSelector({ - width: 500, + width: 520, height: 200, caption: "选择患者", clickautotrigger: true, @@ -71,7 +75,7 @@ itemdbclickhandler: function ($thistr, $thisinput) { if (!!$thistr.attr('data-zyh')) { //if ($thistr.attr('data-ryrq') !== "" && $thistr.attr('data-ryrq') !== undefined && $thistr.attr('data-ryrq') !== null) { - // $('#ksrq').val($.getDate({ date: $thistr.attr('data-ryrq') })); + $('#ryrq').html($thistr.attr('data-ryrq')); //} //if ($thistr.attr('data-cyrq') !== "" && $thistr.attr('data-cyrq') !== undefined && $thistr.attr('data-cyrq') !== null) { // $('#jsrq').val($.getDate({ date: $thistr.attr('data-cyrq') })); @@ -83,22 +87,25 @@ } }, colModel: [ + //hidden 是否隐藏 { label: '住院号', name: 'zyh', width: 100 }, { label: 'cyrq', name: 'cyrq', hidden: true }, { label: 'ryrq', name: 'ryrq', hidden: true }, - { label: '在院标志', name: 'zybz', width: 100, align: 'left' }, - { label: '姓名', name: 'xm', width: 120, align: 'left' }, - { label: '出生年月', name: 'csny', hidden: true, width: 100, align: 'left' }, + { label: '在院标志', name: 'zybz', width: 100, align: 'Center' }, + { label: '姓名', name: 'xm', width: 120, align: 'Center' }, + { label: '出生年月', name: 'csny', hidden: true, width: 100, align: 'Center' }, { - label: '性别', name: 'xb', width: 50, align: 'left', formatter: function (cellvalue) { + label: '性别', name: 'xb', width: 50, align: 'Center', formatter: function (cellvalue) { return $.getGender(cellvalue); } }, { - label: '年龄', name: 'nlshow', width: 50, align: 'left', formatter: function (cellvalue, a, b) { + label: '年龄', name: 'nlshow', width: 50, align: 'Center', formatter: function (cellvalue, a, b) { return getAgeFromBirthTime({ begin: b.csny }).text; } - } + }, + { label: '床号', name: 'cw', width: 50, align: 'Center' }, + { label: '入院日期', name: 'ryrq', hidden: true, width: 100, align: 'Center' } ] }); @@ -112,9 +119,9 @@ $.modalAlert("请选择时间范围", "error"); return; } - + // var url = getUrl(); - var url = '@Html.Raw(reportUrl)' + "?tempCode=1218" + "&systemCode=" + '@reportSystemCode'; + var url = '@Html.Raw(reportUrl)' + "?tempCode=1218" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; url += " &zyh=" + $('#zyh').val(); url += " &orgId=" + OrgId; url += " &kssj=" + $('#ksrq').val(); @@ -122,7 +129,22 @@ setTimeout("$.loading(true, '正在请求报表页面...');", 10); $("#iframerightiframerightiframerightttt").attr('src', url); } - + function summary() + { + if ($('#zyh').val().length == 0) { + $.modalAlert("缺少住院号", "error"); + return; + } + // var url = getUrl(); + var url = '@Html.Raw(reportUrl)' + "?tempCode=1305" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'; + url += " &zyh=" + $('#zyh').val(); + url += " &orgId=" + OrgId; + url += " &kssj=" + $('#ryrq').html(); + url += " &jssj=" + $('#jsrq').val(); + url += " &hospitalCode=" + OrgId; + setTimeout("$.loading(true, '正在请求报表页面...');", 10); + $("#iframerightiframerightiframerightttt").attr('src', url); + } $("#iframerightiframerightiframerightttt").load(function () { $.loading(false); }); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBHZQDQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBHZQDQuery.cshtml index ddee0f9c..94199b09 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBHZQDQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBHZQDQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "YBSBHZQDQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -72,12 +72,12 @@ if (tabaction == "1") { $("#yj").hide(); $("#newyj").show(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1228" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1228" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttt").attr('src', uri); } else { $("#newyj").hide(); $("#yj").show(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1231" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1231" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttts").attr('src', uri); } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_HZBKQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_HZBKQuery.cshtml index 527c4d66..c02efb9e 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_HZBKQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_HZBKQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "YBSBSC_HZBKQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -61,7 +61,7 @@ $.modalAlert("请选择时间范围", "error"); return; } - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1237" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1237" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttt").attr('src', uri); DCQuery(tabaction); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_JMQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_JMQuery.cshtml index f6fa5299..74095268 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_JMQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_JMQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "YBSBSC_JMQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -74,13 +74,13 @@ case "Q": $("#mjz").show(); $("#zy").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1235" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1235" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttt").attr('src', uri); break; case "R": $("#mjz").hide(); $("#zy").show(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1238" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1238" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerighttttsc").attr('src', uri); break; default: diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_YDQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_YDQuery.cshtml index 5240fa05..4cba5897 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_YDQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_YDQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "YBSBSC_YDQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -74,13 +74,13 @@ case "W": $("#mjz").show(); $("#zy").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1241" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1241" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttt").attr('src', uri); break; case "E": $("#mjz").hide(); $("#zy").show(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1242" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&systemCode=" + '@reportSystemCode'; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1242" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerighttttsc").attr('src', uri); break; default: diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_ZGQuery.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_ZGQuery.cshtml index 60428b43..402a9f38 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_ZGQuery.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBSBSC_ZGQuery.cshtml @@ -3,7 +3,7 @@ ViewBag.Title = "YBSBSC_ZGQuery"; Layout = "~/Views/Shared/_Form.cshtml"; var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -92,7 +92,7 @@ $("#zy").hide(); $("#mzts").hide(); $("#zyts").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1232" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1232" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttt").attr('src', uri); break; case "2": @@ -101,7 +101,7 @@ $("#zy").hide(); $("#mzts").hide(); $("#zyts").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1234" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1234" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerightttts").attr('src', uri); break; case "3": @@ -110,7 +110,7 @@ $("#zy").show(); $("#mzts").hide(); $("#zyts").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1233" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1233" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerighttttsc").attr('src', uri); break; case "4": @@ -119,7 +119,7 @@ $("#zy").hide(); $("#mzts").show(); $("#zyts").hide(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1239" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1239" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerighttttmzts").attr('src', uri); break; case "5": @@ -128,7 +128,7 @@ $("#zy").hide(); $("#mzts").hide(); $("#zyts").show(); - var uri = '@Html.Raw(reportUrl)' + "?tempCode=1240" + "&systemCode=" + '@reportSystemCode' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); + var uri = '@Html.Raw(reportUrl)' + "?tempCode=1240" + "&systemCode=" + '@Html.Raw(ReportSystemCode)' + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val(); $("#iframerightiframerightiframerighttttzyts").attr('src', uri); break; default: diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBXXQueryUpload.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBXXQueryUpload.cshtml new file mode 100644 index 00000000..214e1d6d --- /dev/null +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/ReportManage/Views/Report/YBXXQueryUpload.cshtml @@ -0,0 +1,68 @@ + +@{ + ViewBag.Title = "YBXXQueryUpload"; + Layout = "~/Views/Shared/_Form.cshtml"; + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); +} + +
        + +
        + @Html.Partial("~/Areas/ReportManage/Views/Report/JYJLQueryUpload.cshtml") +
        +
        + @Html.Partial("~/Areas/ReportManage/Views/Report/DBGHQueryUpload.cshtml") +
        +
        + @Html.Partial("~/Areas/ReportManage/Views/Report/JCSFQueryUpload.cshtml") +
        +
        + + \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/FinancialInvoiceController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/FinancialInvoiceController.cs index eda1e7f7..7972b715 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/FinancialInvoiceController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/FinancialInvoiceController.cs @@ -1,10 +1,7 @@ using Newtouch.HIS.Domain.Entity; using Newtouch.HIS.Domain.IDomainServices; using Newtouch.HIS.Domain.IRepository; -using Newtouch.Infrastructure; using Newtouch.Tools; -using System; -using System.Diagnostics; using System.Web.Mvc; namespace Newtouch.HIS.Web.Areas.SystemManage.Controllers @@ -22,6 +19,11 @@ public ActionResult FinanicalInvoiceIndex() return View(); } + public ActionResult InvoiceQuery() + { + return View(); + } + //[HandlerAuthorize] public override ActionResult Form() { @@ -38,20 +40,9 @@ public ActionResult GetFinancialInvoiceList(string keyword) var data = _financialInvoiceRepo.GetFinancialInvoiceList(keyword, this.OrganizeId); return Content(data.ToJson()); } - - /// - /// GetCwfpList - /// - /// - /// public ActionResult GetCwfpList(string keyword) { - var lyry = ""; - if (!UserIdentity.IsAdministrator && !UserIdentity.IsHospAdministrator) - { - lyry = UserIdentity.UserCode; - } - var data = _sysFinancialDmnService.GetCwfpList(keyword, lyry, OrganizeId); + var data = _sysFinancialDmnService.GetCwfpList(keyword, this.OrganizeId); return Content(data.ToJson()); } @@ -75,12 +66,8 @@ public ActionResult GetFormJson(string fpdm) public ActionResult SubmitForm(FinancialInvoiceEntity financialInvoiceEntity, string fpdm) { financialInvoiceEntity.zt = financialInvoiceEntity.zt == "true" ? "1" : "0"; - if (financialInvoiceEntity.is_del == 1) - { - financialInvoiceEntity.zt = "0"; - } financialInvoiceEntity.OrganizeId = this.OrganizeId; - _financialInvoiceRepo.VlidateRepeat(financialInvoiceEntity, OrganizeId, fpdm); + _financialInvoiceRepo.VlidateRepeat(financialInvoiceEntity, OrganizeId,fpdm); _financialInvoiceRepo.SubmitForm(financialInvoiceEntity, fpdm); return Success("操作成功。"); } @@ -95,26 +82,5 @@ public ActionResult DeleteForm(string fpdm) _financialInvoiceRepo.DeleteForm(fpdm, this.OrganizeId); return Success("操作成功。"); } - - - public ActionResult InvoiceQuery() - { - return View(); - } - - /// - /// 查询发票列表 - /// - /// - /// - /// - public ActionResult InvoiceQueryList(DateTime? kssj, DateTime? jssj) - { - kssj = kssj == null ? DateTime.Now.AddDays(-7) : kssj; - jssj = jssj == null ? DateTime.Now : jssj; - - var data = _sysFinancialDmnService.InvoiceQueryList((DateTime)kssj, (DateTime)jssj, OrganizeId, UserIdentity.UserCode); - return Content(data.ToJson()); - } } } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/InpatientAccountManageController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/InpatientAccountManageController.cs index 4cf7e469..61c3aee3 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/InpatientAccountManageController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/InpatientAccountManageController.cs @@ -15,6 +15,7 @@ using Newtouch.HIS.Domain.DTO.OutputDto.HospitalizationManage; using Newtouch.HIS.Domain.ValueObjects.HospitalizationManage; using System.Collections.Generic; +using Newtouch.HIS.Application.Interface; namespace Newtouch.HIS.Web.Areas.SystemManage.Controllers { @@ -24,6 +25,8 @@ public class InpatientAccountManageController : OrgControllerBase private readonly IInpatientAccountRepo _inpatientAccountRepo; private readonly ISysConfigRepo _sysConfigRepo; + private readonly IPayApp _payApp; + public static string accountConfig = ""; public InpatientAccountManageController() { @@ -161,8 +164,18 @@ public ActionResult ReturnDepositPost(DeposDto depDto) /// public ActionResult RefundAccount(DeposDto depDto) { - _accountApp.RefundAccount(depDto); - return Success(); + bool flag = _accountApp.RefundAccount(depDto); + string errorMsg = ""; + if (depDto.zffsbh == 13) + { + if (flag) + { + var refundReuslt = _payApp.TradeRefund(depDto.outTradeNo, depDto.zfje, "预交金全退", "", out errorMsg); + if (refundReuslt != 0) + errorMsg = "原路退费失败," + errorMsg; + } + } + return Success(errorMsg, flag); } #endregion } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/SysDepartmentBindingController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/SysDepartmentBindingController.cs index 162d2afb..2d8f4f91 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/SysDepartmentBindingController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/SysDepartmentBindingController.cs @@ -57,7 +57,7 @@ public ActionResult SubmitForm(SysDepartmentBindingEntity sysDepartmentBindgEnti { sysDepartmentBindgEntity.zt = sysDepartmentBindgEntity.zt == "true" ? "1" : "0"; sysDepartmentBindgEntity.OrganizeId = this.OrganizeId; - var Screen = _sysDepartmentBindingRepo.FindEntity(o => o.ks == sysDepartmentBindgEntity.ks); + var Screen = _sysDepartmentBindingRepo.FindEntity(o => o.ks == sysDepartmentBindgEntity.ks && o.OrganizeId==OrganizeId && o.zt=="1"); if (Screen!=null && !string.IsNullOrEmpty(Screen.bddm)) { return Error("请一一对应,不能绑定多个!"); diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/UserController.cs b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/UserController.cs index 7bddf76e..788eff9f 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/UserController.cs +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Controllers/UserController.cs @@ -156,10 +156,12 @@ protected internal ActionResult f_GetSysUserSelectorTreeQ(string keyword = null, } #region 补充父节点 start + // by haijiang.mo 修复搜索二级以下的子部门用户,因无法构建出树结构,而搜索失败 var parentDeptList = new HashSet(); // 控制总计算深度,防止因为数据错误,找不到父节点死循环 var totalReFindParent = 10; - do { + do + { totalReFindParent--; parentDeptList = new HashSet(); // 找出treeList 中没有parentId 的 diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/AccoutManage/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/AccoutManage/Index.cshtml index fa5869a7..469138d2 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/AccoutManage/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/AccoutManage/Index.cshtml @@ -6,7 +6,7 @@ var yjjReportUrl = SysConfigReader.OrgReportLink("yjjsjdy"); var curOpr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); }
        @@ -412,7 +412,7 @@ var reqzhxz=$.request("zhxz")=='zy'?'住院':'门诊' var orgId = '@curOpr.OrganizeId'; //var uri = '@Html.Raw(yjjReportUrl)' + "&patId=" + patid +"&szid="+resdata.data.szId; - var uri = '@reportUrl' + "?tempCode=03" + "&systemCode=" + '@reportSystemCode'+ "&hospitalCode=" + orgId + "&szId=" + resdata.data.szId; + var uri = '@reportUrl' + "?tempCode=03" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'+ "&hospitalCode=" + orgId + "&szId=" + resdata.data.szId; window.open(uri, "_blank", "height=500, width=1195,top=100, left=50, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no"); } }, errorCallback: function (rtnval) { @@ -487,7 +487,7 @@ //var reqzhxz=$.request("zhxz")=='zy'?'住院':'门诊' var orgId = '@curOpr.OrganizeId'; //var uri = '@Html.Raw(yjjReportUrl)'+"&patId=" + patid + "&szid="+gridId;//+"&type=" + reqzhxz - var uri = '@reportUrl' + "?tempCode=03" + "&systemCode=" + '@reportSystemCode'+ "&hospitalCode=" + orgId + "&szId=" + gridId; + var uri = '@reportUrl' + "?tempCode=03" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'+ "&hospitalCode=" + orgId + "&szId=" + gridId; window.open(uri, "_blank", "height=500, width=1195,top=100, left=50, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no"); } diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/FinancialInvoice/FinanicalInvoiceIndex.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/FinancialInvoice/FinanicalInvoiceIndex.cshtml index 21f3f304..8fb96370 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/FinancialInvoice/FinanicalInvoiceIndex.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/FinancialInvoice/FinanicalInvoiceIndex.cshtml @@ -33,17 +33,17 @@
        + diff --git "a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index - \345\244\215\345\210\266.cshtml" "b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index - \345\244\215\345\210\266.cshtml" new file mode 100644 index 00000000..ba61f7d6 --- /dev/null +++ "b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index - \345\244\215\345\210\266.cshtml" @@ -0,0 +1,634 @@ +@using Newtouch.Infrastructure; +@{ + ViewBag.Title = "预交金管理"; + Layout = "~/Views/Shared/_Index.cshtml"; + //预交金充值收据报表链接 + //var yjjReportUrl = SysConfigReader.OrgReportLink("yjjsjxdy"); + var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); + var curOpr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); + + //预交金退款是否使用凭证号 + var openRefundpzh = SysConfigReader.Bool("Account_Refund_pzh"); +} + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + +
        * + + + 姓名: + + + 性别: + + 年龄: + + + + + + +
        手机:报警额(¥) + + + + + + +
        +
        +
        + + +
        +
        +
        +
        +
        + +
        + +
        + + + + + + + + + + + +
        支付方式: + + *金额: + + 凭证号: + + 凭证号 + 备注:
        +
        +
        +
        +
        +
        + + + + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index.cshtml index 97de269a..ecb3b4ad 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/InpatientAccountManage/Index.cshtml @@ -5,7 +5,7 @@ //预交金充值收据报表链接 //var yjjReportUrl = SysConfigReader.OrgReportLink("yjjsjxdy"); var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl"); - var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); + var ReportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode"); var curOpr = Newtouch.Common.Operator.OperatorProvider.GetCurrent(); //预交金退款是否使用凭证号 @@ -330,6 +330,7 @@ { label: '支付/退款方式', name: 'xjzffsmc', width: 105, align: 'center' }, { label: '收支日期', name: 'CreateTime', width: 125, align: 'center', formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } }, { label: '备注', name: 'memo', width: 105, align: 'center' }, + { label: '订单号', name: 'outTradeNo', width: 125, align: 'center' }, { label: '收支性质', name: 'szxz', width: 105, align: 'center', formatter: function (val) { @@ -410,12 +411,18 @@ return false; } if (CheckDeposit()) { - PayDepositPost(zffsbh, zffsmc, zfmoney, pzh, patid, zh, zhxz); + if ($('#ddlzffs option:selected').val() == '13') { + if (CheckPayOK()) { + + } + } else { + PayDepositPost(zffsbh, zffsmc, zfmoney, pzh, patid, zh, zhxz); + } } } //预交金充值 - function PayDepositPost(zffsbh, zffsmc, zfmoney, pzh, patid,zh, zhxz) { + function PayDepositPost(zffsbh, zffsmc, zfmoney, pzh, patid, zh, zhxz, outTradeNo) { $.loading(true, "正在请求数据..."); $.najax({ type: "POST", @@ -423,7 +430,7 @@ data: { zffsbh: zffsbh, zffsmc: zffsmc,zyh:zyh, zfje: zfmoney, pzh: pzh, zh: zh, - zhxz: zhxz, patid: patid, szxz:@Html.Raw((int)EnumSZXZ.cz), memo: $("#memo").val() + zhxz: zhxz, patid: patid, szxz:@Html.Raw((int)EnumSZXZ.cz), memo: $("#memo").val(), outTradeNo: outTradeNo }, dataType: "json", cache: false, @@ -436,7 +443,7 @@ var reqzhxz=$.request("zhxz")=='zy'?'住院':'门诊' var orgId = '@curOpr.OrganizeId'; - var uri = '@Html.Raw(reportUrl)' + "?tempCode=04" + "&systemCode=" + '@reportSystemCode'+ "&szid=" + resdata.data.szId + "&patId=" + patid + "&orgId=" + orgId; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=04" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'+ "&szid=" + resdata.data.szId + "&patId=" + patid + "&orgId=" + orgId; window.open(uri, "_blank", "height=500, width=1195,top=100, left=50, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no"); } }, errorCallback: function (rtnval) { @@ -484,11 +491,13 @@ var gridIMoney = "";//当前选中的收支金额 var gridIpzh = ""; //当前选中的凭证号 var gridId = "";//当前选中的Id,是否已退的根据 + var RefundOutTradeNo = ""; //当前选中的订单号 //点击事件 function btn_edit() { var szje = $("#gridList").jqGridRowValue().szje; var pzh = $("#gridList").jqGridRowValue().pzh; gridId = $("#gridList").jqGridRowValue().Id; + RefundOutTradeNo = $("#gridList").jqGridRowValue().outTradeNo; gridIMoney = szje; gridIpzh = pzh; if (parseFloat(gridIMoney) > 0) { @@ -510,7 +519,7 @@ var reqzhxz=$.request("zhxz")=='zy'?'住院':'门诊' var orgId = '@curOpr.OrganizeId'; - var uri = '@Html.Raw(reportUrl)' + "?tempCode=04"+ "&systemCode=" + '@reportSystemCode' + "&szid=" + gridId + "&patId=" + patid + "&orgId=" + orgId; + var uri = '@Html.Raw(reportUrl)' + "?tempCode=04" + "&systemCode=" + '@Html.Raw(ReportSystemCode)'+ "&szid=" + gridId + "&patId=" + patid + "&orgId=" + orgId; window.open(uri, "_blank", "height=500, width=1195,top=100, left=50, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no"); } @@ -580,7 +589,8 @@ return false; } var reg = /^(-?\d+)(\.\d+)?$/; - zfmoney = "-" +$("#zhye").val(); + //zfmoney = "-" +$("#zhye").val(); + zfmoney = $("#txtmoney").val(); var ddlzffs = $("#ddlzffs option:selected");//获取选中的项 zffsbh = ddlzffs.val();//拿到选中项的值 zffsmc = ddlzffs.text();//拿到选中项的文本 @@ -594,12 +604,12 @@ url: "/SystemManage/InpatientAccountManage/RefundAccount", data: { zffsbh: zffsbh, zffsmc: zffsmc, zfje: zfmoney,zyh:$("#zyh").val(), - zh: zh, patid: patid, szxz:@Html.Raw(((int)EnumSZXZ.tye)), memo: $("#memo").val() + zh: zh, patid: patid, szxz:@Html.Raw(((int)EnumSZXZ.tye)), memo: $("#memo").val(), outTradeNo: RefundOutTradeNo }, dataType: "json", cache: false, success: function (resdata) { - if (resdata != null) { + if (resdata != null && resdata.data) { $.loading(false); ClearMoney(); //调用账户收支清单 @@ -633,3 +643,80 @@ } + + + + diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/PatientCharacteristics/Form.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/PatientCharacteristics/Form.cshtml index 7567376d..d169a532 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/PatientCharacteristics/Form.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/PatientCharacteristics/Form.cshtml @@ -26,12 +26,12 @@ *性质类别(卡): - - - + + 医保险种类型: @@ -45,20 +45,20 @@ @*医保特殊待遇: - - - *@ + + + *@ @* - 上级: - - - - *@ + 上级: + + + + *@ *门诊住院标志: @@ -67,12 +67,12 @@ @*凭证标志: - -
        - -
        - *@ - + +
        + +
        + *@ + *状态: diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/SysConfig/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/SysConfig/Index.cshtml index 76217790..753746ac 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/SysConfig/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Areas/SystemManage/Views/SysConfig/Index.cshtml @@ -16,7 +16,7 @@ { }
        @@ -26,6 +26,9 @@ +
        + 同步 +
        @Html.Partial("_IndexHeaderNav") + @*
        diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Views/Login/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Views/Login/Index.cshtml index cdf66f60..864a77ee 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Views/Login/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Views/Login/Index.cshtml @@ -1,5 +1,7 @@ @{ var isCheckChkCode = (ViewBag.IsCheckChkCode as bool?) ?? true; + var loginybshowcode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("loginybshowcode"); + var loginybshowname = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("loginybshowname"); } \ No newline at end of file diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/AForm.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/AForm.cshtml index c63ac59e..cb69dd9b 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/AForm.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/AForm.cshtml @@ -3,223 +3,125 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
        -
        - @*
        -
          -
        • 相关信息
        • -
        • 2功能权限 action="~/Treatment/AForm" method="post"
        • -
        *@ -
        -
        -
        - @*
        - - 请填写相应信息! -
        *@ -
        - @*
        -

        表单信息

        -
        *@ -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        *组织机构: - -
        *诊疗组合名称: - -
        *诊疗组合编码: - -
        明细项目排序: - -
        诊疗明细项目名称: - - -
        -
        -
        -
        - - - -

        - - - @**@ - -

        - - @*保存*@ -
        -
        -
        -
        -
        -
        -
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        *组织机构: + +
        *诊疗组合名称: + +
        *诊疗组合编码: + +
        明细项目排序: + +
        诊疗明细项目名称: + + +
        +
        +
        +

        + + +

        - @**@
        diff --git a/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/Index.cshtml b/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/Index.cshtml index 61a03954..ea33dff3 100644 --- a/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/Index.cshtml +++ b/Newtouch.HIS.Sett/Newtouch.Web/Views/Treatment/Index.cshtml @@ -17,10 +17,6 @@ - @*
        - 角色用户 - -
        *@
      '; + html += fillHtml; + html += prevNextHtml; + html += ''; + + self.dom.head.innerHTML = html; + self.dom.dateSet.className = 'dc_years'; + + self.dom.main.insertAdjacentElement('beforeend', self.dom.dateSet); + self.dom.wrapperBody.insertAdjacentElement('beforeend', self.dom.main); + self.dom.wrapperBody.insertAdjacentElement('afterbegin', self.dom.head); + self.dom.wrapper.insertAdjacentElement('afterbegin', self.dom.wrapperBody); + self.buildFlipFunc(); + + self.gotoDate(self.cacheApi.defDate.year); + } + + self.buildActs(); + }; + + // 构建操作按钮 + theTool.buildActs = function () { + const self = this; + const nowDate = new Date(); + const nowTime = nowDate.getTime(); + const list = []; + + if (self.cacheApi.settings.button.today !== false && self.cacheApi.settings.mode !== 'range' && self.cacheApi.minDate.time <= nowTime && self.cacheApi.maxDate.time >= nowTime) { + list.push('dc_today'); + } + if (self.cacheApi.settings.button.clear !== false) { + list.push('dc_clear'); + } + if (self.cacheApi.settings.mode === 'range' || ['datetime', 'time', 'date'].indexOf(self.cacheApi.settings.type) >= 0) { + list.push('dc_confirm'); + } + let html = ''; + + for (let x of list) { + html += ''; + } + if (html.length) { + self.dom.acts.innerHTML = html; + self.dom.panel.insertAdjacentElement('beforeend', self.dom.acts); + + } else if (self.dom.panel.contains(self.dom.acts)) { + self.dom.panel.removeChild(self.dom.acts); + } + }; + + // 重新构建月份选项 + theTool.rebuildMonthSelect = function () { + const self = this; + const values = {}; + const selects = self.getSelects(['year', 'month'], values); + let start = 1; + let end = 12; + + if (values.year === self.cacheApi.minDate.year && values.year === self.cacheApi.maxDate.year) { + start = self.cacheApi.minDate.month; + end = self.cacheApi.maxDate.month; + } else if (values.year === self.cacheApi.minDate.year) { + start = self.cacheApi.minDate.month; + } else if (values.year === self.cacheApi.maxDate.year) { + end = self.cacheApi.maxDate.month; + } + let html = ''; + + for (let i = start; i <= end; i++) { + html += '` + ); + } + // 横向纵向的点击事件 + dcPanelBody.find(".dc_radioBtn").on("click", function () { + jQuery(this).find(".dc_selected").show(); + jQuery(this).siblings(".dc_radioBtn").find(".dc_selected").hide(); + }); + // 页面大小的切换事件 + PaperKind_node.on("change", function () { + var _option = jQuery(this).find("option:selected"); + if (_option.attr("dataWidth")) { + PaperWidth_node.val(_option.attr("dataWidth")); + } + if (_option.attr("dataHeight")) { + PaperHeight_node.val(_option.attr("dataHeight")); + } + if (_option.val() != "Custom") { + PaperWidth_node.attr("disabled", "disabled"); + PaperHeight_node.attr("disabled", "disabled"); + } else { + PaperWidth_node.removeAttr("disabled"); + PaperHeight_node.removeAttr("disabled"); + } + }); + options = { + ...options, + PaperHeightInCM: options.PaperHeightInCM.toFixed(4), + PaperWidthInCM: options.PaperWidthInCM.toFixed(4), + TopMarginInCM: options.TopMarginInCM.toFixed(2), + BottomMarginInCM: options.BottomMarginInCM.toFixed(2), + LeftMarginInCM: options.LeftMarginInCM.toFixed(2), + RightMarginInCM: options.RightMarginInCM.toFixed(2), + }; + console.log("当前页面设置==>", options); + jQuery(ctl).find('#DCHeaderFooterDifferentFirstPage').attr("checked", options.HeaderFooterDifferentFirstPage);//首页页眉页脚不同 + jQuery(ctl).find('#DCPageIndexsForHideHeaderFooter').val(options.PageIndexsForHideHeaderFooter);//隐藏页眉页脚的页码 + PageSettingsData(options); + function PageSettingsData(data) { + var isChange = typeof data == "object"; //是否是修改数据 + var obj = {}; + // 横向纵向 + var flag = dcPanelBody.find(".dc_select-right").is(":hidden"); //true 横向 | false 纵向 + obj.Landscape = flag; + if (isChange) { + if (data.Landscape == true) { + // 横向 + dcPanelBody.find(".dc_select-left").show(); + dcPanelBody.find(".dc_select-right").hide(); + } else { + dcPanelBody.find(".dc_select-left").hide(); + dcPanelBody.find(".dc_select-right").show(); + } + } + // 页面大小 + obj.PaperKind = PaperKind_node.val(); + if (isChange && Object.hasOwnProperty.call(data, "PaperKind")) { + let PaperKindName = ""; + if (data.PaperKind || data.PaperKind === 0) { + selectList.map((item) => { + if ( + item.pageName == data.PaperKind || + item.name == data.PaperKind + ) { + PaperKindName = item.name; + } + }); + } + PaperKind_node.val(PaperKindName); + if (data.PaperKind != "Custom") { + PaperWidth_node.attr("disabled", "disabled"); + PaperHeight_node.attr("disabled", "disabled"); + } + } + // 数据 + dcPanelBody.find("[data]").each(function () { + var _data = jQuery(this).attr("data"); + + obj[_data] = jQuery(this).val(); + if (jQuery(this).attr("type") == "number") { + obj[_data] -= 0; + } + if (isChange && Object.hasOwnProperty.call(data, _data)) { + jQuery(this).val(data[_data]); + } + }); + if (isChange) { + return true; + } else { + return obj; + } + } + //赋值启用页眉页脚 + if (options && options.EnableHeaderFooter) { + jQuery(ctl).find('#DCEnableHeaderFooter').attr("checked", options.EnableHeaderFooter === 'True' ? true : false); + DCSetEnableHeaderFooterControl(options.EnableHeaderFooter); + } + //根据是否启用页眉页脚,控制页眉页脚表单的禁用状态 + function DCSetEnableHeaderFooterControl(control) { + var DCEnableHeaderFooterControl = jQuery(ctl).find('#DCEnableHeaderFooterControl').find('input'); + if (DCEnableHeaderFooterControl && DCEnableHeaderFooterControl.length) { + for (var i = 0; i < DCEnableHeaderFooterControl.length; i++) { + var item = DCEnableHeaderFooterControl[i]; + jQuery(item).attr("disabled", control === 'False' ? true : false); + } + } + } + //监听启用页眉页脚的勾选事件 + jQuery(ctl).find('#DCEnableHeaderFooter').change(function () { + DCSetEnableHeaderFooterControl(jQuery(this).is(':checked') ? 'True' : 'False'); + }); + + function successFun() { + var _data = PageSettingsData(); + var HeaderFooterDifferentFirstPage = jQuery(ctl).find('#DCHeaderFooterDifferentFirstPage')[0].checked;//首页页眉页脚不同 + var PageIndexsForHideHeaderFooter = jQuery(ctl).find('#DCPageIndexsForHideHeaderFooter')[0].value;//隐藏页眉页脚的页码 + var EnableHeaderFooter = jQuery(ctl).find('#DCEnableHeaderFooter')[0].checked;//启用页眉页脚功能 + _data = { + ..._data, + EnableHeaderFooter, + HeaderFooterDifferentFirstPage, + PageIndexsForHideHeaderFooter + }; + ctl.ChangeDocumentSettings(_data); + ctl.RefreshDocument(); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetDocumentPageSettings(); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + }, + /** + * 创建文档网格线设置对话框 + * @param options 文档网格线属性 + * @param ctl 编辑器元素 + */ + DocumentGridLineDialog: function (options, ctl) { + if (!options || typeof options != "object") { + // 当未传入值时,获取当前的文档网格线数据 + options = ctl.GetDocumentGridLine(); + } + options = keysToLowerCase(options); + var opts = { + Visible: "", + ColorValue: "", + LineStyle: "", + GridNumInOnePage: "", + AlignToGridLine: "", + Printable: "", + }; + for (var i in opts) { + var low_i = i.toLowerCase(); + if (Object.hasOwnProperty.call(options, low_i)) { + opts[i] = options[low_i]; + } + } + var DocumentGridLineHtml = ` +
      + +
      +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + `; + var dialogOptions = { + title: "文档网格线设置", + bodyClass: "DocumentGridLine", + bodyHtml: DocumentGridLineHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + var LineStyle_node = dcPanelBody.find("#dc_LineStyle"); + let that = this; + + for (var i = 0; i < DASHSTYLE.length; i++) { + var _DashStyle = DASHSTYLE[i]; + LineStyle_node.append( + "" + ); + } + var DocumentGridLine_form = dcPanelBody.find( + "form#dc_DocumentGridLine_form" + )[0]; + // 是否绘制网格线点击事件 + dcPanelBody.find("input[data-text=Visible]").on("click", function () { + var isVisible = jQuery(this).is(":checked"); + that.changeFormDisable(DocumentGridLine_form, !isVisible); + }); + + function DocumentGridLineData(data) { + var isChange = typeof data == "object"; + var obj = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + if (this.type == "checkbox") { + obj[_txt] = _el.is(":checked"); + if (isChange) { + _el.prop("checked", data[_txt]); + if (_txt == "Visible") { + //是否绘制网格线 + that.changeFormDisable(DocumentGridLine_form, !data[_txt]); + } + } + } else { + obj[_txt] = _el.val(); + if (this.type == "number") { + obj[_txt] -= 0; + } + if (isChange) { + _el.val(data[_txt]); + } + } + }); + if (isChange) { + return true; + } else { + return obj; + } + } + // console.log("当前文档网格线设置值=>", opts) + // 添加值 + DocumentGridLineData(opts); + function successFun() { + var _data = DocumentGridLineData(); + ctl.SetDocumentGridLine(_data); + ctl.RefreshDocument(); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetDocumentGridLine(); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + }, + + /** + * 创建文档装订线设置对话框 + * @param options 文档装订线属性 + * @param ctl 编辑器元素 + */ + DocumentGutterDialog: function (options, ctl) { + if (!options || typeof options != "object") { + // 当未传入值时,获取当前的文档装订线数据 + options = ctl.GetDocumentGutter(); + } + options = keysToLowerCase(options); + var opts = { + ShowGutterLine: "", + GutterPosition: "", + SwapGutter: "", + GutterStyle: "", + }; + for (var i in opts) { + var low_i = i.toLowerCase(); + if (Object.hasOwnProperty.call(options, low_i)) { + opts[i] = options[low_i]; + } + } + var DocumentGutterHtml = `
      + +
      +
      + +
      +
      + +
      +
      + 位置 + + + +
      `; + var dialogOptions = { + title: "文档装订线设置", + bodyClass: "DocumentGutter", + bodyHtml: DocumentGutterHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + GetOrChangeData(dcPanelBody, opts); + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + // console.log("successFun -> _data", _data) + ctl.SetDocumentGutter(_data); + ctl.RefreshDocument(); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetDocumentGutter(); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + }, + + /** + * 创建单复选框属性对话框 + * @param options 单复选框属性 + * @param ctl 编辑器元素 + */ + CheckboxAndRadioDialog: function (options, ctl, ele) { + var typename = ctl.GetCurrentElementTypeName();//当前元素的类型名称 + if (!options || typeof options != "object" || JSON.stringify(options) === '{}') { + if (ele) { + options = ctl.GetElementProperties(ele); + } else if (['xtextradioboxelement', 'xtextcheckboxelement'].includes(typename)) { + options = ctl.GetElementProperties(ctl.CurrentElement(typename)); + } + } + if (!options) { + return false; + } + var backupCaptionFlowLayout = options.CaptionFlowLayout; + var backupParent = options.Parent; + //wyc20231019:防止数据丢失做一个转换 + if (options.VisualStyle === "SystemDefault") { + options.VisualStyle = "Default"; + } + if (options.VisualStyle === "SystemCheckBox") { + options.VisualStyle = "CheckBox"; + } + if (options.VisualStyle === "SystemRadioBox") { + options.VisualStyle = "RadioBox"; + } + + var checkboxAndRadioHTML = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      + +
      +
      + + + + + + + +
      +
      +
      +
      可见性配置
      +
      + + + + + +
      +
      +
      +
      自定义属性
      +
      +
      + `; + var dialogOptions = { + title: (typename === 'xtextradioboxelement' ? "单" : "复") + "选框属性", + bodyHeight: 455, + bodyClass: "CheckboxAndRadio", + bodyHtml: checkboxAndRadioHTML, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + this.attributeComponents( + "#dc_attr-box", + (options && options.Attributes) || {}, + ctl + ); + WriterControl_Dialog.appendValueBindingDiv(dcPanelBody); + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + GetOrChangeData(dcPanelBody, opts); + + //[DUWRITER5_0-3387]20240820 lxy 增加可见性配置 + var allCheckboxVisibility = dcPanelBody.find("#dc_CheckboxVisibility input[data-value]"); + if (options.CheckboxVisibility) { + let checkValue = options.CheckboxVisibility.toLowerCase(); + for (var i = 0; i < allCheckboxVisibility.length; i++) { + let itemValue = allCheckboxVisibility[i].getAttribute('data-value'); + itemValue = itemValue.toLowerCase().trim(); + if (checkValue.indexOf(itemValue) > -1) { + allCheckboxVisibility[i].checked = true; + } else { + allCheckboxVisibility[i].checked = false; + } + } + + } + + + + //[DUWRITER5_0-3748] 20241025 lxy 新增属性表达式功能 + //属性表达式值回填 + var inputValue = ''; + var propertyExpressionObject = {}; + var propertyShowInput = ctl.ownerDocument.getElementById('dc_PropertyExpressions_show_input'); + var propertyKeyArr = (options.PropertyExpressions && Object.keys(options.PropertyExpressions)) || []; + RADIOCHECKPROPERTYEXPRESSIONSARRAY.forEach(item => { + if (propertyKeyArr.length && propertyKeyArr.indexOf && propertyKeyArr.indexOf(item) > -1) { + propertyExpressionObject[item] = options.PropertyExpressions[item]; + //展示文本 + if (options.PropertyExpressions[item] !== '') { + inputValue += `${inputValue === '' ? '' : ','}${item}:${options.PropertyExpressions[item]}`; + } + } else { + propertyExpressionObject[item] = ''; + } + }); + + propertyShowInput.value = inputValue; + + //属性表达式操作对话框 + + var propertyExpressionsButton = jQuery(ctl).find("#dc_PropertyExpressionsButton"); + propertyExpressionsButton.click(function () { + + // //判断是否已经存在修改过的属性表达式 + // if (!propertyExpressionObject || Object.keys(propertyExpressionObject).length === 0) { + // RADIOCHECKPROPERTYEXPRESSIONSARRAY.forEach(item => { + // propertyExpressionObject[item] = ''; + // }); + // } + + that.PropertyExpressionsDialog(propertyExpressionObject, ctl, function (changedPropertyExpressions) { + //获取修改后的属性表达式 + propertyExpressionObject = JSON.parse(JSON.stringify(changedPropertyExpressions)); + //更新属性表达式的显示 + var inputValue = ''; + for (let key in changedPropertyExpressions) { + if (changedPropertyExpressions[key] !== '' && key !== 'Visible') { + inputValue += `${inputValue === '' ? '' : ','}${key}:${changedPropertyExpressions[key]}`; + } + } + propertyShowInput.value = inputValue; + }); + }); + + + + //成功的回调函数 + let that = this; + function successFun() { + let dcAttrBox = dcPanelBody.find('#dc_attr-box'); + let Attributes = that.attributeComponents_getAttributeObj(dcAttrBox); + var _data = GetOrChangeData(dcPanelBody); + _data["Attributes"] = Attributes; + let CheckboxVisibility = []; + allCheckboxVisibility.each(function () { + if (this.checked) { + CheckboxVisibility.push(this.getAttribute('data-value')); + } + }); + _data["CheckboxVisibility"] = CheckboxVisibility.join(","); + + // [DUWRITER5_0-3748] 20241025 lxy 新增属性表达式功能 + _data['PropertyExpressions'] = {}; + for (var key in propertyExpressionObject) { + if (propertyExpressionObject[key] !== '') { + _data['PropertyExpressions'][key] = propertyExpressionObject[key]; + } + } + + //可见性表达式赋值 + if (_data && _data.VisibleExpression && _data.VisibleExpression.trim() !== '') { + _data['PropertyExpressions']['Visible'] = _data.VisibleExpression; + } + + ctl.SetElementProperties(ele, _data, true); + //wyc20231019:更改流式排版属性会导致排版错乱,在此追加一个对父容器的刷新 + if (_data.CaptionFlowLayout !== backupCaptionFlowLayout) { + ctl.EditorRefreshContainerView(backupParent); + } + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement()); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + }, + + /** + * 创建插入多个单选框/复选框对话框 + * @param options 单复选框属性 + * @param ctl 编辑器元素 + */ + InsertMultipleCheckBoxOrRadioDialog: function (options, ctl) { + if (!options || typeof options != "object") { + // 当未传入值时, + options = {}; + } + console.log(options, '========options'); + var InsertMultipleCheckBoxOrRadioHtml = ` +
      + + +
      +
      +
      +
      类型
      +
      + + +
      +
      +
      +
      + +
      +
      +
      + + + + + +
      +
      +
      +
      赋值属性:
      +
      + + +
      +
      +
      +
      +
      项目
      + + + + + + + + + + + + + + + + +
      编号文本数值操作
      ×
      +
      +
      + `; + var dialogOptions = { + title: "插入多个单选框/复选框", + bodyHeight: 500, + bodyClass: "InsertMultipleCheckBoxOrRadio", + bodyHtml: InsertMultipleCheckBoxOrRadioHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + // 增加接口 + dcPanelBody + .find("#dc_ListItems") + .on("input", "input[data-arraytext]", function () { + var input = jQuery(this); + var tr = input.parents("tr"); + if (tr.nextAll("tr").length == 0) { + var ListItems_item = input + .parents("table") + .find("template.dc_template_item")[0]; + tr.after(ListItems_item.content.cloneNode(true)); + } + }); + dcPanelBody.find("#dc_ListItems").on("click", "td.dc_delete", function () { + var tr = jQuery(this).parents("tr"); + if (tr.nextAll("tr").length > 0) { + tr.remove(); + } + }); + // 给数据源绑定赋值 + if (options && options.ValueBinding) { + dcPanelBody + .find("#dc_DataSource") + .val(options.ValueBinding.DataSource || ""); + dcPanelBody + .find("#dc_BindingPath") + .val(options.ValueBinding.BindingPath || ""); + } + GetOrChangeData(dcPanelBody, opts); + + function successFun() { + let { + Type, + Name, + ListItems, + VisualStyle, + Deleteable, + CheckAlignLeft, + Multiline, + Requried, + VisibleExpression, + CaptionFlowLayout + } = GetOrChangeData(dcPanelBody); + let DataSource = dcPanelBody.find("#dc_DataSource").val(); + let BindingPath = dcPanelBody.find("#dc_BindingPath").val(); + var listItemsOptions = { + Multiline, + VisualStyle, + Deleteable, + CheckAlignLeft, + Requried, + VisibleExpression, + CaptionFlowLayout + }; + if (ListItems && ListItems.length) { + //如果没有原始数据,则直接进行添加 + for (var j = 0; j < ListItems.length; j++) { + ListItems[j] = Object.assign(ListItems[j], listItemsOptions); + ListItems[j]['ValueBinding'] = { + DataSource, + BindingPath, + }; + } + } + // 如果插入时设置了一些对话框中没有的属性,则进行一次数据保留 + if (options && options.ListItems && options.ListItems.length) { + for (var i = 0; i < options.ListItems.length; i++) { + var item = options.ListItems[i]; + for (var j = 0; j < ListItems.length; j++) { + if (item.ID === ListItems[j].ID) { + ListItems[j] = Object.assign(item, ListItems[j]); + } + } + } + } + + var newData = { + ...options, + Type, + Name, + ListItems + }; + var result = ctl.DCExecuteCommand("insertcheckboxorradio", false, newData); + if (result) { + //DUWRITER5_0-3877 20241121 lxy 新增插入多个单选框/复选框后触发事件 + if (ctl.EventInsertMultipleCheckBoxOrRadioAfter && typeof ctl.EventInsertMultipleCheckBoxOrRadioAfter === 'function') { + ctl.EventInsertMultipleCheckBoxOrRadioAfter(newData); + } + } + + } + }, + + /** + * 创建文本标签属性对话框 + * @param options 文本标签属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + LabelDialog: function (options, ctl, isInsertMode, ele) { + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtextlabelelement"); + if (ele == null) { + return false; + } + options = ctl.GetElementProperties(ele); + if (options == null) { + return false; + } + } + } + if (!options) { + return false; + } + if (Object.hasOwnProperty.call(options, "Text") == false) { + // 当数据中不包含Text时,赋值默认 + options.Text = "标签文本"; + } + var LabelHtml = ` +
      + +
      +
      + +
      +
      + +
      + +
      +
      + + + + +
      +
      +
      +
      +
      连接模式设置
      +
      + +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      + `; + var dialogOptions = { + title: "文本标签元素", + bodyHeight: 475, + bodyClass: "labelElement", + bodyHtml: LabelHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + GetOrChangeData(dcPanelBody, opts); + //处理设置后无效的属性 + let checkList = dcPanelBody.find('input[type="checkbox"]'); + let optionKeys = Object.keys(options); + for (var i = 0; i < checkList.length; i++) { + let item = checkList[i]; + if (optionKeys.indexOf(item.name) !== -1) { + if (options[item.name]) { + item.setAttribute("checked", true); + } else { + jQuery(item).removeAttr("checked"); + } + } else { + jQuery(item).removeAttr("checked"); + } + } + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + console.log("successFun -> _data", { + ...options, + ..._data + }); + if (isInsertMode == true) { + ctl.DCExecuteCommand("InsertLabelElement", false, { + ...options, + ..._data + }); + } else { + ctl.SetElementProperties(ele, _data, true); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement("xtextlabelelement")); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + + } + }, + + /** + * 创建水平线/分割线属性对话框 + * @param options 水平线/分割线属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + HorizontalLineDialog: function (options, ctl, isInsertMode, ele) { + console.log(options, '=========options'); + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtexthorizontallineelement"); + if (ele == null) { + return false; + } + options = ctl.GetElementProperties(ele); + } + } + if (options == null) { + return false; + } + var HorizontalLineHtml = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      + `; + var dialogOptions = { + title: "水平分割线属性", + bodyHeight: 220, + bodyClass: "HorizontalLineElement", + bodyHtml: HorizontalLineHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + // GetOrChangeData(dcPanelBody, options); + Object.keys(options).forEach(item => { + dcPanelBody.find(`[data-text="${item}"]`).val(options[item]); + }); + + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + // console.log("successFun -> _data", _data) + options = { + ...options, + ..._data + }; + if (isInsertMode == true) { + ctl.DCExecuteCommand("InsertHorizontalLine", false, options); + } else { + ctl.SetElementProperties(ele, options); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement("xtexthorizontallineelement")); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + } + }, + + /** + * 创建页码属性对话框 + * @param options 页码属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + PageNumberDialog: function (options, ctl, isInsertMode, ele) { + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtextpageinfoelement"); + options = ctl.GetElementProperties(ele); + } + } + if (options == null) { + return false; + } + var PageNumberHtml = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + 内容: + +
        +
      • 页码
      • +
      • 总页码
      • +
      • 本地页码
      • +
      • 本地总页码
      • +
      +
      + +
      + +
      +
      + +
      + `; + var dialogOptions = { + title: "页码属性对话框", + bodyHeight: 400, + bodyClass: "HorizontalLineElement", + bodyHtml: PageNumberHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + var ValueTypeInput = dcPanelBody.find("[data-text=ValueType]"); + var lis = dcPanelBody.find("#dc_ValueType li"); + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + GetOrChangeData(dcPanelBody, opts); + lis.removeClass("dc_active"); + lis + .filter("[data-value='" + ValueTypeInput.val() + "']") + .addClass("dc_active"); + if (lis.filter(".dc_active").length == 0) { + lis.eq(0).addClass("dc_active"); + } + // 页码内容选择 + lis.on("click", function () { + jQuery(this).siblings("li").removeClass("dc_active"); + jQuery(this).addClass("dc_active"); + ValueTypeInput.val(jQuery(this).attr("data-value")); + }); + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + // console.log("successFun -> _data", _data) + if (isInsertMode == true) { + ctl.DCExecuteCommand("InsertPageInfoElement", false, _data); + } else { + ctl.SetElementProperties(ele, _data, true); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement("xtextpageinfoelement")); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + } + }, + + /** + * 创建按钮属性对话框 + * @param options 按钮属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + ButtonDialog: function (options, ctl, isInsertMode, ele) { + let that = this; + // ctl.CurrentElement('xtextbuttonelement'); + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtextbuttonelement"); + if (ele == null) { + return false; + } + options = ctl.GetElementProperties(ele); + } + } + if (options == null) { + return false; + } + console.log(options, "==========options"); + var ButtonHtml = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      + + + + +
      +
      +
      + +
      +
      + +
      +
      + +
      + +
      注:下面图片使用png格式图片
      +
      + +
      +
      + +
      +
      + +
      +
      +
      颜色设置:
      +
      +
      + 背景颜色: + +
      +
      + 文字颜色: + +
      +
      +
      +
      +
      按钮字体设置:
      +
      +
      + 字体名称: + +
      +
      + 字体大小: + +
      +
      + 加粗: + +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      自定义属性
      +
      +
      + `; + var dialogOptions = { + title: "按钮属性", + bodyHeight: 400, + bodyClass: "ButtonElement", + bodyHtml: ButtonHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + + + that.attributeComponents("#dc_attr-box", options.Attributes || {}, ctl); + + // 字体样式回填 + var arrFont = []; + if ( + window.WriterControl_SupportFontFamilys && + window.WriterControl_SupportFontFamilys.length + ) { + arrFont = window.WriterControl_SupportFontFamilys; + } else { + arrFont = window.WriterControl_SupportFontFamilys = + ctl.getSupportFontFamilys(); + } + var dc_fontFamily_button = dcPanelBody.find("#dc_button_style_fontname"); //字体样式 + var fontFamilyUlHtml = ""; + arrFont.length && arrFont.forEach(function (obj) { + if (obj) { + var styleStr = "font-family:" + obj + ";"; + fontFamilyUlHtml += + ""; + } + }); + dc_fontFamily_button.html(fontFamilyUlHtml); + + //字体大小回填 + var dc_fontSizeUl = dcPanelBody.find("#dc_button_style_fontsize"); //字体大小 + var fontSizeUlHtml = ""; + DATAFONTSIZE.forEach(function (value) { + if (value) { + fontSizeUlHtml += + ""; + } + }); + dc_fontSizeUl.html(fontSizeUlHtml); + + + //背景颜色值修改事件 + jQuery(ctl).find("#dc_button_style_backgroundcolorstring").change(function () { + var color = jQuery(this).val(); + var dc_backgroundcolorstring_box = dcPanelBody.find("#dc_backgroundcolorstring_box"); + dc_backgroundcolorstring_box.css("background-color", color); + dc_backgroundcolorstring_box.attr("data-value", color); + }); + //文本颜色值修改事件 + jQuery(ctl).find("#dc_button_style_colorstring").change(function () { + var color = jQuery(this).val(); + var dc_colorstring_box = dcPanelBody.find("#dc_colorstring_box"); + dc_colorstring_box.css("background-color", color); + dc_colorstring_box.attr("data-value", color); + }); + + //按钮的部分Style属性(目前弹框中可以修改的属性) + var buttonStyle = { + BackgroundColorString: null, + ColorString: null, + Bold: null, + FontName: null, + FontSize: null + }; + + //按钮样式属性值回填 + if (options && options.Style) { + Object.keys(options.Style).forEach((key) => { + var newKey = key.toLowerCase(); + switch (newKey) { + case "backgroundcolorstring": + //展示色块赋值 + var dc_backgroundcolorstring_box = dcPanelBody.find(`#dc_backgroundcolorstring_box`); + dc_backgroundcolorstring_box.css("background-color", options.Style[key]); + dc_backgroundcolorstring_box.attr("data-value", options.Style[key]); + // 颜色选择器赋值 + var dc_button_style_backgroundcolorstring = dcPanelBody.find(`#dc_button_style_backgroundcolorstring`); + dc_button_style_backgroundcolorstring.val(options.Style[key]); + break; + case "colorstring": + if (options.Style[key]) { + //展示色块赋值 + var dc_colorstring_box = dcPanelBody.find(`#dc_colorstring_box`); + dc_colorstring_box.css("background-color", options.Style[key]); + dc_colorstring_box.attr("data-value", options.Style[key]); + // 颜色选择器赋值 + var dc_button_style_colorstring = dcPanelBody.find(`#dc_button_style_colorstring`); + dc_button_style_colorstring.val(options.Style[key]); + } + break; + case "fontname": + case "fontsize": + case "bold": + if (newKey === "bold") { + options.Style[key] = (options.Style[key] === true ? "true" : "false"); + } + dc_dialogContainer.find(`#dc_button_style_${newKey}`).val(options.Style[key]); + break; + } + }); + } else { + //如果是插入按钮,没有Style属性。则置空选择框 + Object.keys(buttonStyle).forEach((key) => { + var newKey = key.toLowerCase(); + var styleDom = ctl.ownerDocument.getElementById(`dc_button_style_${newKey}`); + if (styleDom.nodeName === "SELECT") { + styleDom.selectedIndex = -1; + } + }); + } + + + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + GetOrChangeData(dcPanelBody, opts); + // 图片的默认赋值 + dcPanelBody.find("[data-value='img']").each(function () { + var imgNode = jQuery(this).find("img"); + var _val = jQuery(this).val(); + if (_val) { + var str = _val; + if (_val.indexOf("base64,") == -1) { + str = "data:image/png;base64," + str; + jQuery(this).val(str); + } + imgNode.attr("src", str); + } else { + // 没有内容,隐藏 + imgNode.hide(); + } + }); + // 图片的提交 + dcPanelBody + .find("[data-value='img'] [type='file']") + .on("change", function () { + var files = this.files; + if (files.length == 0) { + return; + } + var btnNode = jQuery(this).parent(); + var imgNode = btnNode.find("img"); + if (files[0] && files[0].type.slice(0, 5) == "image") { + var fileinfo = files[0]; + var reader = new FileReader(); + reader.readAsDataURL(fileinfo); + reader.onload = function () { + var base64 = reader.result; + imgNode.attr("src", base64); + imgNode.show(); + // var str = base64.substr(base64.indexOf("base64,") + 7, base64.length); + btnNode.val(base64); + }; + reader.onerror = function (error) { + console.log(error); + }; + } + }); + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + + Object.keys(buttonStyle).forEach(key => { + var newKey = key.toLowerCase(); + var value = dc_dialogContainer.find(`#dc_button_style_${newKey}`).val(); + switch (newKey) { + case "backgroundcolorstring": + var colorstring = dcPanelBody.find(`#dc_backgroundcolorstring_box`).attr("data-value"); + buttonStyle[key] = colorstring; + break; + case "colorstring": + var colorstring = dcPanelBody.find(`#dc_colorstring_box`).attr("data-value"); + buttonStyle[key] = colorstring; + break; + case "bold": + buttonStyle[key] = value === "true"; + break; + default: + buttonStyle[key] = value; + break; + } + }); + _data['Style'] = { ...buttonStyle }; + var dcAttrBox = dcPanelBody.find("#dc_attr-box"); + let Attributes = that.attributeComponents_getAttributeObj(dcAttrBox); + _data['Attributes'] = Attributes; + console.log("successFun -> _data", _data); + if (isInsertMode == true) { + ctl.DCExecuteCommand("InsertButton", false, { ...options, ..._data }); + } else { + ctl.SetElementProperties(ele, _data, true); + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement("xtextbuttonelement")); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + } + }, + + /** + * 创建二维码属性对话框 + * @param options 二维码属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + QRCodeDialog: function (options, ctl, isInsertMode, ele) { + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtexttdbarcodeelement"); + if (ele == null) { + return false; + } + options = ctl.GetElementProperties(ele); + } + } + + if (options == null) { + return false; + } + var QRCodeHtml = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      + `; + var dialogOptions = { + title: "二维码属性", + bodyHeight: 420, + bodyClass: "QRCodeElement", + bodyHtml: QRCodeHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + WriterControl_Dialog.appendValueBindingDiv(dcPanelBody); + var opts = {}; + dcPanelBody.find("[data-text]").each(function () { + var _el = jQuery(this); + var _txt = _el.attr("data-text"); + var low_txt = _txt.toLowerCase(); + var _value = getDown(options, low_txt); + if (_value == undefined) { + _value = ""; + } + getDown(opts, _txt, _value); + }); + + GetOrChangeData(dcPanelBody, opts); + function successFun() { + var _data = GetOrChangeData(dcPanelBody); + // console.log("successFun -> _data", _data) + if (isInsertMode == true) { + ctl.DCExecuteCommand("InsertTDBarcodeElement", false, _data); + } else { + ctl.SetElementProperties(ele, _data, true); + } + //[DUWRITER5_0-3762] 20241101 lxy 修改EventDialogChangeProperties事件在插入时也触发 + if (ctl.EventDialogChangeProperties && typeof ctl.EventDialogChangeProperties === 'function') { + var changedOptions = ctl.GetElementProperties(ctl.CurrentElement()); + ctl.EventDialogChangeProperties(changedOptions); + }; + } + }, + + /** + * 创建条形码属性对话框 + * @param options 条形码属性 + * @param ctl 编辑器元素 + * @param isInsertMode 是否是插入模式 + */ + BarCodeDialog: function (options, ctl, isInsertMode, ele) { + if (!options || typeof options != "object") { + // 当未传入值时 + if (isInsertMode == true) { + options = {}; + } else { + ele = ctl.CurrentElement("xtextnewbarcodeelement"); + if (ele == null) { + return false; + } + options = ctl.GetElementProperties(ele); + } + } + if (options == null) { + return false; + } + console.log(options, '===========options'); + + var BarCodeHtml = ` +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      + `; + var dialogOptions = { + title: "条形码属性", + bodyHeight: 360, + bodyClass: "BarcodeElement", + bodyHtml: BarCodeHtml, + }; + this.pageAppendDialog(ctl, successFun, dialogOptions); + //获取对话框元素 + var dc_dialogContainer = jQuery(ctl).children("#dc_dialogContainer"); + var dcPanelBody = jQuery(dc_dialogContainer).find("#dcPanelBody"); + var BarcodeStyleSelect = dcPanelBody.find("select#dc_BarcodeStyle"); + WriterControl_Dialog.appendValueBindingDiv(dcPanelBody); + var BarcodeStyleArr = [ + { Text: "UPCA" }, + { Text: "UPCE" }, + { Text: "SUPP2" }, + { Text: "SUPP5" }, + { Text: "EAN13" }, + { Text: "EAN8" }, + { Text: "Interleaved2of5" }, + { Text: "I2of5" }, + { Text: "Standard2of5" }, + { Text: "Code39" }, + { Text: "Code39Extended" }, + { Text: "Code93" }, + { Text: "Codabar" }, + { Text: "PostNet" }, + { Text: "BOOKLAND" }, + { Text: "ISBN" }, + { Text: "JAN13" }, + { Text: "MSI_Mod10" }, + { Text: "MSI_2Mod10" }, + { Text: "MSI_Mod11" }, + { Text: "MSI_Mod11_Mod10" }, + { Text: "Modified_Plessey" }, + { Text: "CODE11" }, + { Text: "USD8" }, + { Text: "UCC12" }, + { Text: "UCC13" }, + { Text: "LOGMARS" }, + { Text: "Code128A" }, + { Text: "Code128B" }, + { Text: "Code128C", Selected: true }, + ]; + var BarcodeStyleSelectHtml = ""; + for (var i = 0; i < BarcodeStyleArr.length; i++) { + var style_txt = BarcodeStyleArr[i].Text; + var optHtml = "