Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
c2e1679c
Commit
c2e1679c
authored
Jun 01, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取前检查科室和费用类型
parent
4f68ede6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
1 deletions
+105
-1
performance/Performance.EntityModels/Entity/ex_module.cs
+5
-0
performance/Performance.Services/ExConfigService.cs
+100
-1
No files found.
performance/Performance.EntityModels/Entity/ex_module.cs
View file @
c2e1679c
...
...
@@ -55,5 +55,10 @@ public class ex_module
/// 只读 0、否 1、是
/// </summary>
public
Nullable
<
int
>
ReadOnly
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
CheckScriptId
{
get
;
set
;
}
}
}
performance/Performance.Services/ExConfigService.cs
View file @
c2e1679c
...
...
@@ -31,6 +31,8 @@ public class ExConfigService : IAutoInjection
private
readonly
PerforModdicRepository
moddicRepository
;
private
readonly
QueryService
queryService
;
private
readonly
ILogger
logger
;
private
readonly
PerforCofdrugtypeRepository
cofdrugtypeRepository
;
private
readonly
PerforPerdeptdicRepository
perdeptdicRepository
;
public
ExConfigService
(
PerforExtypeRepository
extypeRepository
,
PerforExscriptRepository
exscriptRepository
,
...
...
@@ -45,7 +47,9 @@ public class ExConfigService : IAutoInjection
PerforExtractRepository
extractRepository
,
PerforModdicRepository
moddicRepository
,
QueryService
queryService
,
ILogger
<
ExConfigService
>
logger
ILogger
<
ExConfigService
>
logger
,
PerforCofdrugtypeRepository
cofdrugtypeRepository
,
PerforPerdeptdicRepository
perdeptdicRepository
)
{
this
.
extypeRepository
=
extypeRepository
;
...
...
@@ -62,6 +66,8 @@ ILogger<ExConfigService> logger
this
.
moddicRepository
=
moddicRepository
;
this
.
queryService
=
queryService
;
this
.
logger
=
logger
;
this
.
cofdrugtypeRepository
=
cofdrugtypeRepository
;
this
.
perdeptdicRepository
=
perdeptdicRepository
;
}
#
region
Modules
...
...
@@ -689,6 +695,8 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin
public
Dictionary
<
string
,
object
>
CheckHasNewDepartmentOrCategory
(
int
allotId
)
{
#
region
改正
/*
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
var allotList = perallotRepository.GetEntities(t => t.HospitalId == allot.HospitalId && new int[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive }.Contains(t.States));
...
...
@@ -736,6 +744,97 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin
paramtemers.Add(dic.Remark, stringBuilder.ToString());
}
return paramtemers; */
#
endregion
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
drugTypes
=
cofdrugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
HospitalId
==
allot
.
HospitalId
);
var
deptDic
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
var
moduleSheet
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
SheetType
==
(
int
)
SheetType
.
Income
);
if
(
moduleSheet
==
null
||
!
moduleSheet
.
Any
())
return
null
;
var
moduleScript
=
moduleSheet
.
Select
(
t
=>
t
.
CheckScriptId
);
var
scripts
=
exscriptRepository
.
GetEntities
(
t
=>
moduleScript
.
Contains
(
t
.
Id
));
if
(
scripts
==
null
||
!
scripts
.
Any
())
return
null
;
var
scriptConfig
=
scripts
.
Select
(
t
=>
t
.
ConfigId
);
var
hosConfig
=
hospitalconfigRepository
.
GetEntities
(
t
=>
scriptConfig
.
Contains
(
t
.
Id
));
if
(
hosConfig
==
null
)
return
null
;
Dictionary
<
string
,
object
>
paramtemers
=
new
Dictionary
<
string
,
object
>();
StringBuilder
stringBuilder
=
new
StringBuilder
();
List
<
string
>
deparmants
=
new
List
<
string
>();
List
<
string
>
drugs
=
new
List
<
string
>();
List
<
per_dept_dic
>
deptList
=
new
List
<
per_dept_dic
>();
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
data
=
queryService
.
QueryData
(
conf
,
allot
,
scr
.
ExecScript
);
if
(
data
==
null
||
!
data
.
Any
())
return
null
;
if
(
deptDic
!=
null
||
deptDic
.
Any
())
{
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
dept
=
noExistedDepartment
.
Select
(
t
=>
new
per_dept_dic
{
Department
=
t
,
AccountingUnit
=
t
,
UnitType
=
defauleUnittype
,
Source
=
source
,
HospitalId
=
allot
.
HospitalId
,
IsVerify
=
0
,
VerifyMessage
=
"抽取前科室校验后补增科室"
,
CreateTime
=
DateTime
.
Now
,
CreateUser
=
1
});
deparmants
.
AddRange
(
noExistedDepartment
);
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
)))
{
var
drugType
=
noExistedTypename
.
Select
(
t
=>
new
cof_drugtype
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
});
drugs
.
AddRange
(
noExistedTypename
);
drugTypeList
.
AddRange
(
drugType
);
}
}
}
}
if
(
deparmants
!=
null
&&
deparmants
.
Any
())
{
perdeptdicRepository
.
AddRange
(
deptList
.
ToArray
());
stringBuilder
.
AppendLine
(
$"新增科室:
{
string
.
Join
(
","
,
deparmants
)}
"
);
}
if
(
drugs
!=
null
&&
drugs
.
Any
())
{
cofdrugtypeRepository
.
AddRange
(
drugTypeList
.
ToArray
());
stringBuilder
.
AppendLine
(
$"新增费用类型:
{
string
.
Join
(
","
,
drugs
)}
"
);
}
paramtemers
.
Add
(
"新增科室或费用类型"
,
stringBuilder
.
ToString
());
return
paramtemers
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment