Commit e553510f by lcx

补充科室信息修改

parent c2e1679c
......@@ -1831,7 +1831,7 @@
</member>
<member name="P:Performance.DtoModels.AccoungingRequest.Type">
<summary>
1 返回accounting列表 2 返回核算单元类型 3 返回核算单元
1 返回accounting列表 2 返回核算单元 3 返回核算单元类型
</summary>
</member>
<member name="P:Performance.DtoModels.AccoungingRequest.UnitType">
......
......@@ -2331,6 +2331,11 @@
只读 0、否 1、是
</summary>
</member>
<member name="P:Performance.EntityModels.ex_module.CheckScriptId">
<summary>
</summary>
</member>
<member name="T:Performance.EntityModels.ex_result">
<summary>
......
......@@ -770,68 +770,68 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin
List<cof_drugtype> drugTypeList = new List<cof_drugtype>();
string defaultSource = "住院", defauleUnittype = UnitType.医生组.ToString();
foreach (var conf in hosConfig)
{
foreach (var scr in scripts)
{
if (conf.Id != scr.ConfigId) continue;
var conf = hosConfig.FirstOrDefault(t => t.Id == scr.ConfigId);
if (conf == null)
continue;
var data = queryService.QueryData(conf, allot, scr.ExecScript);
if (data == null || !data.Any()) return null;
if (data == null || !data.Any()) continue;
if (deptDic != null || deptDic.Any())
foreach (var module in moduleSheet.Where(t => t.CheckScriptId == scr.Id))
{
var noExistedDepartment = data.Select(t => t.Department).Distinct().ToList();
var source = module.ModuleName.Contains(defaultSource) ? "住院" : "门诊";
if (deptDic != null && deptDic.Any(t => t.Source == source))
{
var source = moduleSheet.FirstOrDefault(t => t.CheckScriptId == scr.Id)?.ModuleName.Contains(defaultSource) == true ? "住院" : "门诊";
var deptDics = deptDic.Select(t => new { t.Department, t.Source });
var except = data.Where(c => deptDics.Select(t => t.Department).Distinct().Contains(c.Department) && deptDics.Select(t => t.Source).Distinct().Contains(source));
var noExistedDepartment = except.Select(t => t.Department+" "+source).Distinct();
if (!deptList.Any(t => noExistedDepartment.Contains(t.Department+" "+source) && t.Source == source))
var deptDics = deptDic.Where(t => t.Source == source).Select(t => t.HISDeptName);
noExistedDepartment = data.Select(t => t.Department).Except(deptDics).Distinct().ToList();
}
if (noExistedDepartment != null && noExistedDepartment.Any()) // 系统科室、标准科室唯一,门诊、住院核算单元可能不一致,因此数据可重复
{
var dept = noExistedDepartment.Select(t => new per_dept_dic
{
Department = t,
AccountingUnit = t,
HISDeptName = t,
UnitType = defauleUnittype,
Source = source,
HospitalId = allot.HospitalId,
IsVerify = 0,
VerifyMessage = "抽取前科室校验后补增科室",
CreateTime = DateTime.Now,
CreateUser = 1
});
deparmants.AddRange(noExistedDepartment);
}).ToList();
deparmants.AddRange(noExistedDepartment.Where(t => !deparmants.Contains(t)));
deptList.AddRange(dept);
}
}
if (drugTypes != null || drugTypes.Any())
{
var typeNames = drugTypes.Select(t => t.Charge).Distinct();
var noExistedTypename = data.Select(t => t.Category).Distinct().Except(typeNames);
if (!drugTypeList.Any(t => noExistedTypename.Contains(t.Charge)))
if (noExistedTypename != null && noExistedTypename.Any(t => !drugs.Contains(t)))
{
var drugType = noExistedTypename.Select(t => new cof_drugtype
var drugType = noExistedTypename.Where(t => !drugs.Contains(t)).Select(t => new cof_drugtype
{
HospitalId = allot.HospitalId,
AllotID = allot.ID,
Charge = t
});
drugs.AddRange(noExistedTypename);
}).ToList();
drugs.AddRange(noExistedTypename.Where(t => !drugs.Contains(t)));
drugTypeList.AddRange(drugType);
}
}
}
}
if (deparmants != null && deparmants.Any())
{
perdeptdicRepository.AddRange(deptList.ToArray());
stringBuilder.AppendLine($"新增科室:{string.Join(",", deparmants)}");
var distinctedDept = deptList.ToDistinct().ToList();
distinctedDept.ForEach(t => t.CreateTime = DateTime.Now); //在去重前添加时间,可能造成时间不一致,无法去重
perdeptdicRepository.AddRange(distinctedDept.ToArray());
stringBuilder.AppendLine($"新增科室:{string.Join(",", deparmants.Distinct())}");
}
if (drugs != null && drugs.Any())
{
cofdrugtypeRepository.AddRange(drugTypeList.ToArray());
stringBuilder.AppendLine($"新增费用类型:{string.Join(",", drugs)}");
cofdrugtypeRepository.AddRange(drugTypeList.ToDistinct().ToArray());
stringBuilder.AppendLine($"新增费用类型:{string.Join(",", drugs.Distinct())}");
}
paramtemers.Add("新增科室或费用类型", stringBuilder.ToString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment