|
@@ -59,7 +59,9 @@ import org.springframework.stereotype.Component;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -455,7 +457,7 @@ public class ColumnResultManagementFacade {
|
|
|
public List<BehospitalInfo> getBehospitalInfos(Date startDate, Date endDate, Long hospitalId) {
|
|
|
return behospitalInfoFacade.getBaseMapper().selectList(new QueryWrapper<BehospitalInfo>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq(hospitalId!=null,"hospital_id", hospitalId)
|
|
|
+ .eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
.ge("behospital_date", startDate)
|
|
|
.le("behospital_date", endDate)
|
|
|
);
|
|
@@ -516,6 +518,8 @@ public class ColumnResultManagementFacade {
|
|
|
List<ColumnResult> addColumnResultList = new ArrayList<>();
|
|
|
//修改集合
|
|
|
List<ColumnResult> upColumnResultList = new ArrayList<>();
|
|
|
+ //删除集合
|
|
|
+ List<Map<Long, List<Long>>> judgeTableColumnInfoListMap = new ArrayList<>();
|
|
|
for (NonnullInfo nonnullInfo : nonnullInfos) {
|
|
|
Long columnId = nonnullInfo.getColumnId();
|
|
|
ColumnInfo columnInfo = columnInfoFacade.getBaseMapper().selectById(columnId);
|
|
@@ -530,6 +534,11 @@ public class ColumnResultManagementFacade {
|
|
|
String columnNumber = getColumnNumber(columnInfo.getTableCname());
|
|
|
getTableColumnInfoVO.setNumberColumnCname(columnNumber);
|
|
|
List<GetTableColumnInfoDTO> tableColumnVal = getTableColumnVal(getTableColumnInfoVO, recColumnTable);
|
|
|
+ //获取需要删除的结果表数据
|
|
|
+ Map<Long, List<Long>> judgeTableColumnInfoList = judgeNonnullList(tableColumnVal, nonnullResultList, nonnullInfo);
|
|
|
+ if (judgeTableColumnInfoList != null) {
|
|
|
+ judgeTableColumnInfoListMap.add(judgeTableColumnInfoList);
|
|
|
+ }
|
|
|
//枚举获取模块信息
|
|
|
String modeId = ModeEnum.valueOf(columnInfo.getTableEname()).getKey();
|
|
|
String modeName = ModeEnum.valueOf(columnInfo.getTableEname()).getName();
|
|
@@ -640,6 +649,40 @@ public class ColumnResultManagementFacade {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //调用删除接口
|
|
|
+ if (ListUtil.isNotEmpty(judgeTableColumnInfoListMap)) {
|
|
|
+ for (Map<Long, List<Long>> longListMap : judgeTableColumnInfoListMap) {
|
|
|
+ for (Map.Entry<Long, List<Long>> longListEntry : longListMap.entrySet()) {
|
|
|
+ Long key = longListEntry.getKey();
|
|
|
+ List<Long> value = longListEntry.getValue();
|
|
|
+ if (ListUtil.isNotEmpty(value)) {
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ List<NonnullResult> nonnullResults = nonnullResultFacade.getBaseMapper().selectList(new QueryWrapper<NonnullResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value));
|
|
|
+ if (ListUtil.isNotEmpty(nonnullResults)) {
|
|
|
+ nonnullResults.stream().forEach(nonnullResult -> {
|
|
|
+ ids.add(nonnullResult.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //删除
|
|
|
+ if (nonnullResultFacade.remove(new UpdateWrapper<NonnullResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value)
|
|
|
+ )) {
|
|
|
+ //删除总表
|
|
|
+ columnResultFacade.remove(new QueryWrapper<ColumnResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in(ListUtil.isNotEmpty(ids), "result_id", ids)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -663,6 +706,8 @@ public class ColumnResultManagementFacade {
|
|
|
List<ColumnResult> addColumnResultList = new ArrayList<>();
|
|
|
//修改集合
|
|
|
List<ColumnResult> upColumnResultList = new ArrayList<>();
|
|
|
+ //删除集合
|
|
|
+ List<Map<Long, List<Long>>> judgeTableColumnInfoListMap = new ArrayList<>();
|
|
|
for (GetRegular getRegular : regularMappings) {
|
|
|
Long columnId = getRegular.getColumnId();
|
|
|
ColumnInfo columnInfo = columnInfoFacade.getBaseMapper().selectById(columnId);
|
|
@@ -678,6 +723,11 @@ public class ColumnResultManagementFacade {
|
|
|
List<GetTableColumnInfoDTO> tableColumnVal = getTableColumnVal(getTableColumnInfoVO, recColumnTable);
|
|
|
String modeId = ModeEnum.valueOf(columnInfo.getTableEname()).getKey();
|
|
|
String modeName = ModeEnum.valueOf(columnInfo.getTableEname()).getName();
|
|
|
+ //获取需要删除的结果表数据
|
|
|
+ Map<Long, List<Long>> judgeTableColumnInfoList = judgeRegularList(tableColumnVal, regularResultList, getRegular);
|
|
|
+ if (judgeTableColumnInfoList != null) {
|
|
|
+ judgeTableColumnInfoListMap.add(judgeTableColumnInfoList);
|
|
|
+ }
|
|
|
String regular = getRegular.getVal();
|
|
|
for (GetTableColumnInfoDTO getTableColumnInfoDTO : tableColumnVal) {
|
|
|
getTableColumnInfoDTO.setModeId(Long.valueOf(modeId));
|
|
@@ -768,12 +818,46 @@ public class ColumnResultManagementFacade {
|
|
|
}
|
|
|
}
|
|
|
//调用新增接口
|
|
|
- if(ListUtil.isNotEmpty(addRegularResultList)) {
|
|
|
+ if (ListUtil.isNotEmpty(addRegularResultList)) {
|
|
|
if (regularResultServiceImpl.saveBatch(addRegularResultList)) {
|
|
|
if (ListUtil.isNotEmpty(addColumnResultList)) {
|
|
|
- addColumnResultList = saveColumnResultRegularResultId(addRegularResultList, addColumnResultList);
|
|
|
- //将id插入总表新增集合中
|
|
|
- columnResultServiceImpl.saveBatch(addColumnResultList);
|
|
|
+ addColumnResultList = saveColumnResultRegularResultId(addRegularResultList, addColumnResultList);
|
|
|
+ //将id插入总表新增集合中
|
|
|
+ columnResultServiceImpl.saveBatch(addColumnResultList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //调用删除接口
|
|
|
+ if (ListUtil.isNotEmpty(judgeTableColumnInfoListMap)) {
|
|
|
+ for (Map<Long, List<Long>> longListMap : judgeTableColumnInfoListMap) {
|
|
|
+ for (Map.Entry<Long, List<Long>> longListEntry : longListMap.entrySet()) {
|
|
|
+ Long key = longListEntry.getKey();
|
|
|
+ List<Long> value = longListEntry.getValue();
|
|
|
+ if (ListUtil.isNotEmpty(value)) {
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ List<RegularResult> regularResults = regularResultFacade.getBaseMapper().selectList(new QueryWrapper<RegularResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value));
|
|
|
+ if (ListUtil.isNotEmpty(regularResults)) {
|
|
|
+ regularResults.stream().forEach(regularResult -> {
|
|
|
+ ids.add(regularResult.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //删除
|
|
|
+ if (regularResultFacade.remove(new UpdateWrapper<RegularResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value)
|
|
|
+ )) {
|
|
|
+ //删除总表
|
|
|
+ columnResultFacade.remove(new QueryWrapper<ColumnResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in(ListUtil.isNotEmpty(ids), "result_id", ids)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -800,6 +884,8 @@ public class ColumnResultManagementFacade {
|
|
|
List<ColumnResult> addColumnResultList = new ArrayList<>();
|
|
|
//修改集合
|
|
|
List<ColumnResult> upColumnResultList = new ArrayList<>();
|
|
|
+ //删除集合
|
|
|
+ List<Map<Long, List<Long>>> judgeTableColumnInfoListMap = new ArrayList<>();
|
|
|
for (GetStandardvalueInfoDTO standardvalueInfo : standardvalueInfos) {
|
|
|
Long columnId = standardvalueInfo.getColumnId();
|
|
|
ColumnInfo columnInfo = columnInfoFacade.getBaseMapper().selectById(columnId);
|
|
@@ -816,19 +902,24 @@ public class ColumnResultManagementFacade {
|
|
|
String standardvalue = standardvalueInfo.getStandardvalue();
|
|
|
String modeId = ModeEnum.valueOf(columnInfo.getTableEname()).getKey();
|
|
|
String modeName = ModeEnum.valueOf(columnInfo.getTableEname()).getName();
|
|
|
+ //获取需要删除的结果表数据
|
|
|
+ Map<Long, List<Long>> judgeTableColumnInfoList = judgeStandardvalueList(tableColumnVal, standardvalueInfoList, standardvalueInfo);
|
|
|
+ if (judgeTableColumnInfoList != null) {
|
|
|
+ judgeTableColumnInfoListMap.add(judgeTableColumnInfoList);
|
|
|
+ }
|
|
|
for (GetTableColumnInfoDTO getTableColumnInfoDTO : tableColumnVal) {
|
|
|
getTableColumnInfoDTO.setModeId(Long.valueOf(modeId));
|
|
|
getTableColumnInfoDTO.setModeName(modeName);
|
|
|
String val = getTableColumnInfoDTO.getVal();
|
|
|
//是否存在于原本表中 返回库中原本数据
|
|
|
ColumnResult columnResult = judgeColumnResultList(columnResultList, getTableColumnInfoDTO, columnId);
|
|
|
- StandardvalueResult standardvalueResultU = judgeStandardvalueResultList(standardvalueInfoList,getTableColumnInfoDTO, columnId);
|
|
|
- ColumnResult columnResultUp=null;
|
|
|
- StandardvalueResult StandardvalueResultUp=null;
|
|
|
- if(columnResult!=null) {
|
|
|
+ StandardvalueResult standardvalueResultU = judgeStandardvalueResultList(standardvalueInfoList, getTableColumnInfoDTO, columnId);
|
|
|
+ ColumnResult columnResultUp = null;
|
|
|
+ StandardvalueResult StandardvalueResultUp = null;
|
|
|
+ if (columnResult != null) {
|
|
|
columnResultUp = upColumnResult(columnResult, getTableColumnInfoDTO, principleId);
|
|
|
}
|
|
|
- if(standardvalueResultU!=null) {
|
|
|
+ if (standardvalueResultU != null) {
|
|
|
StandardvalueResultUp = upStandardvalueResult(standardvalueResultU, getTableColumnInfoDTO, principleId);
|
|
|
}
|
|
|
//判断是否符合标准值
|
|
@@ -836,26 +927,26 @@ public class ColumnResultManagementFacade {
|
|
|
String standardvalueMapping = getStandardvalueMapping(standardvalue, hospitalId);
|
|
|
//符合标准值,直接跳过
|
|
|
if (contains) {
|
|
|
- if(columnResultUp!=null){
|
|
|
+ if (columnResultUp != null) {
|
|
|
columnResultUp.setIsSolved(SolvedStatusEnum.IS_SOLVED.getKey());
|
|
|
StandardvalueResultUp.setIsSolved(SolvedStatusEnum.IS_SOLVED.getKey());
|
|
|
//加入修改集合
|
|
|
upColumnResultList.add(columnResultUp);
|
|
|
upStandardvalueResultList.add(StandardvalueResultUp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
//不符合标准值 若原表存在则修改,若不存在则新增
|
|
|
if (!contains) {
|
|
|
//原本存在则修改否则新增
|
|
|
- if(columnResultUp!=null){
|
|
|
+ if (columnResultUp != null) {
|
|
|
columnResultUp.setIsSolved(SolvedStatusEnum.NOT_SOLVED.getKey());
|
|
|
StandardvalueResultUp.setIsSolved(SolvedStatusEnum.NOT_SOLVED.getKey());
|
|
|
//加入修改集合
|
|
|
upColumnResultList.add(columnResultUp);
|
|
|
upStandardvalueResultList.add(StandardvalueResultUp);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//加入校验结果表
|
|
|
StandardvalueResult standardvalueResult = new StandardvalueResult();
|
|
|
standardvalueResult.setHospitalId(getTableColumnInfoDTO.getHospitalId());
|
|
@@ -896,110 +987,147 @@ public class ColumnResultManagementFacade {
|
|
|
}
|
|
|
}
|
|
|
//调用修改接口
|
|
|
- if(ListUtil.isNotEmpty(upStandardvalueResultList)) {
|
|
|
+ if (ListUtil.isNotEmpty(upStandardvalueResultList)) {
|
|
|
if (standardvalueResultServiceImpl.saveOrUpdateBatch(upStandardvalueResultList)) {
|
|
|
if (ListUtil.isNotEmpty(upColumnResultList)) {
|
|
|
- columnResultServiceImpl.saveOrUpdateBatch(upColumnResultList);
|
|
|
+ columnResultServiceImpl.saveOrUpdateBatch(upColumnResultList);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//调用新增接口
|
|
|
- if(ListUtil.isNotEmpty(addStandardvalueResultList)) {
|
|
|
- if (standardvalueResultServiceImpl.saveBatch(addStandardvalueResultList)) {
|
|
|
- if (ListUtil.isNotEmpty(addColumnResultList)) {
|
|
|
- addColumnResultList = saveColumnResultStandardvalueResultId(addStandardvalueResultList, addColumnResultList);
|
|
|
- //将id插入总表新增集合中
|
|
|
- columnResultServiceImpl.saveBatch(addColumnResultList);
|
|
|
+ if (ListUtil.isNotEmpty(addStandardvalueResultList)) {
|
|
|
+ if (standardvalueResultServiceImpl.saveBatch(addStandardvalueResultList)) {
|
|
|
+ if (ListUtil.isNotEmpty(addColumnResultList)) {
|
|
|
+ addColumnResultList = saveColumnResultStandardvalueResultId(addStandardvalueResultList, addColumnResultList);
|
|
|
+ //将id插入总表新增集合中
|
|
|
+ columnResultServiceImpl.saveBatch(addColumnResultList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //调用删除接口
|
|
|
+ if (ListUtil.isNotEmpty(judgeTableColumnInfoListMap)) {
|
|
|
+ for (Map<Long, List<Long>> longListMap : judgeTableColumnInfoListMap) {
|
|
|
+ for (Map.Entry<Long, List<Long>> longListEntry : longListMap.entrySet()) {
|
|
|
+ Long key = longListEntry.getKey();
|
|
|
+ List<Long> value = longListEntry.getValue();
|
|
|
+ if (ListUtil.isNotEmpty(value)) {
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ List<StandardvalueResult> standardvalueResults = standardvalueResultFacade.getBaseMapper().selectList(new QueryWrapper<StandardvalueResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value));
|
|
|
+ if (ListUtil.isNotEmpty(standardvalueResults)) {
|
|
|
+ standardvalueResults.stream().forEach(standardvalueResult -> {
|
|
|
+ ids.add(standardvalueResult.getId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //删除
|
|
|
+ if (standardvalueResultFacade.remove(new UpdateWrapper<StandardvalueResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in("table_id", value)
|
|
|
+ )) {
|
|
|
+ //删除总表
|
|
|
+ columnResultFacade.remove(new QueryWrapper<ColumnResult>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("column_id", key)
|
|
|
+ .in(ListUtil.isNotEmpty(ids), "result_id", ids)
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *修改结果总表对象
|
|
|
+ * 修改结果总表对象
|
|
|
*
|
|
|
* @param columnResult
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param principleId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public ColumnResult upColumnResult(ColumnResult columnResult,GetTableColumnInfoDTO getTableColumnInfoDTO,Long principleId){
|
|
|
+ public ColumnResult upColumnResult(ColumnResult columnResult, GetTableColumnInfoDTO getTableColumnInfoDTO, Long principleId) {
|
|
|
columnResult.setSolveTime(new Date());
|
|
|
columnResult.setGmtModified(new Date());
|
|
|
- if(principleId!=null) {
|
|
|
+ if (principleId != null) {
|
|
|
columnResult.setModifier(principleId.toString());
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())){
|
|
|
+ if (StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())) {
|
|
|
columnResult.setTableVal(getTableColumnInfoDTO.getVal());
|
|
|
}
|
|
|
return columnResult;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *修改结果非空表对象
|
|
|
+ * 修改结果非空表对象
|
|
|
*
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param principleId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public NonnullResult upNonnullResult(NonnullResult nonnullResult,GetTableColumnInfoDTO getTableColumnInfoDTO,Long principleId){
|
|
|
+ public NonnullResult upNonnullResult(NonnullResult nonnullResult, GetTableColumnInfoDTO getTableColumnInfoDTO, Long principleId) {
|
|
|
nonnullResult.setSolveTime(new Date());
|
|
|
nonnullResult.setGmtModified(new Date());
|
|
|
- if(principleId!=null) {
|
|
|
+ if (principleId != null) {
|
|
|
nonnullResult.setModifier(principleId.toString());
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())){
|
|
|
+ if (StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())) {
|
|
|
nonnullResult.setTableVal(getTableColumnInfoDTO.getVal());
|
|
|
}
|
|
|
return nonnullResult;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *修改结果正则表对象
|
|
|
+ * 修改结果正则表对象
|
|
|
*
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param principleId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public RegularResult upRegularResult(RegularResult regularResult,GetTableColumnInfoDTO getTableColumnInfoDTO,Long principleId){
|
|
|
+ public RegularResult upRegularResult(RegularResult regularResult, GetTableColumnInfoDTO getTableColumnInfoDTO, Long principleId) {
|
|
|
regularResult.setSolveTime(new Date());
|
|
|
regularResult.setGmtModified(new Date());
|
|
|
- if(principleId!=null) {
|
|
|
+ if (principleId != null) {
|
|
|
regularResult.setModifier(principleId.toString());
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())){
|
|
|
+ if (StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())) {
|
|
|
regularResult.setTableVal(getTableColumnInfoDTO.getVal());
|
|
|
}
|
|
|
return regularResult;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *修改结果关键值表对象
|
|
|
+ * 修改结果关键值表对象
|
|
|
*
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param principleId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public StandardvalueResult upStandardvalueResult(StandardvalueResult standardvalueResult,GetTableColumnInfoDTO getTableColumnInfoDTO,Long principleId){
|
|
|
+ public StandardvalueResult upStandardvalueResult(StandardvalueResult standardvalueResult, GetTableColumnInfoDTO getTableColumnInfoDTO, Long principleId) {
|
|
|
standardvalueResult.setSolveTime(new Date());
|
|
|
standardvalueResult.setGmtModified(new Date());
|
|
|
- if(principleId!=null) {
|
|
|
+ if (principleId != null) {
|
|
|
standardvalueResult.setModifier(principleId.toString());
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())){
|
|
|
+ if (StringUtil.isNotEmpty(getTableColumnInfoDTO.getVal())) {
|
|
|
standardvalueResult.setTableVal(getTableColumnInfoDTO.getVal());
|
|
|
}
|
|
|
return standardvalueResult;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *查询出这段时间内病历总表所有的问题数据
|
|
|
+ * 查询出这段时间内病历总表所有的问题数据
|
|
|
*
|
|
|
* @param hospitalId
|
|
|
* @param behospitalCodeList
|
|
|
* @param type
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<ColumnResult> getColumnResultList(Long hospitalId, List<String> behospitalCodeList ,String type){
|
|
|
+ public List<ColumnResult> getColumnResultList(Long hospitalId, List<String> behospitalCodeList, String type) {
|
|
|
//查询出这段时间内病历所有的问题数据 behospitalCode+type
|
|
|
return columnResultFacade.getBaseMapper().selectList(new QueryWrapper<ColumnResult>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -1008,14 +1136,15 @@ public class ColumnResultManagementFacade {
|
|
|
.in(ListUtil.isNotEmpty(behospitalCodeList), "behospital_code", behospitalCodeList)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *查询出这段时间内病历非空表所有的问题数据
|
|
|
+ * 查询出这段时间内病历非空表所有的问题数据
|
|
|
*
|
|
|
* @param hospitalId
|
|
|
* @param behospitalCodeList
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<NonnullResult> getNonnullResultList(Long hospitalId, List<String> behospitalCodeList){
|
|
|
+ public List<NonnullResult> getNonnullResultList(Long hospitalId, List<String> behospitalCodeList) {
|
|
|
//查询出这段时间内病历所有的问题数据 behospitalCode+type
|
|
|
return nonnullResultFacade.getBaseMapper().selectList(new QueryWrapper<NonnullResult>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -1023,14 +1152,15 @@ public class ColumnResultManagementFacade {
|
|
|
.in(ListUtil.isNotEmpty(behospitalCodeList), "behospital_code", behospitalCodeList)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *查询出这段时间内病历正则表所有的问题数据
|
|
|
+ * 查询出这段时间内病历正则表所有的问题数据
|
|
|
*
|
|
|
* @param hospitalId
|
|
|
* @param behospitalCodeList
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<RegularResult> getRegularResultList(Long hospitalId, List<String> behospitalCodeList){
|
|
|
+ public List<RegularResult> getRegularResultList(Long hospitalId, List<String> behospitalCodeList) {
|
|
|
//查询出这段时间内病历所有的问题数据 behospitalCode+type
|
|
|
return regularResultFacade.getBaseMapper().selectList(new QueryWrapper<RegularResult>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -1038,14 +1168,15 @@ public class ColumnResultManagementFacade {
|
|
|
.in(ListUtil.isNotEmpty(behospitalCodeList), "behospital_code", behospitalCodeList)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *查询出这段时间内病历标准值表所有的问题数据
|
|
|
+ * 查询出这段时间内病历标准值表所有的问题数据
|
|
|
*
|
|
|
* @param hospitalId
|
|
|
* @param behospitalCodeList
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<StandardvalueResult> getStandardvalueResult(Long hospitalId, List<String> behospitalCodeList){
|
|
|
+ public List<StandardvalueResult> getStandardvalueResult(Long hospitalId, List<String> behospitalCodeList) {
|
|
|
//查询出这段时间内病历所有的问题数据 behospitalCode+type
|
|
|
return standardvalueResultFacade.getBaseMapper().selectList(new QueryWrapper<StandardvalueResult>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -1053,84 +1184,190 @@ public class ColumnResultManagementFacade {
|
|
|
.in(ListUtil.isNotEmpty(behospitalCodeList), "behospital_code", behospitalCodeList)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *判断总表是否存在该问题数据
|
|
|
+ * 判断总表是否存在该问题数据
|
|
|
*
|
|
|
* @param columnResultList
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param columnId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public ColumnResult judgeColumnResultList(List<ColumnResult> columnResultList , GetTableColumnInfoDTO getTableColumnInfoDTO,Long columnId){
|
|
|
- if(ListUtil.isEmpty(columnResultList)){
|
|
|
+ public ColumnResult judgeColumnResultList(List<ColumnResult> columnResultList, GetTableColumnInfoDTO getTableColumnInfoDTO, Long columnId) {
|
|
|
+ if (ListUtil.isEmpty(columnResultList)) {
|
|
|
return null;
|
|
|
}
|
|
|
for (ColumnResult columnResult : columnResultList) {
|
|
|
- if(columnResult.getColumnId().longValue()==columnId.longValue()){
|
|
|
- if((columnResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && columnResult.getTableId().longValue()==getTableColumnInfoDTO.getTableId().longValue()){
|
|
|
+ if (columnResult.getColumnId().longValue() == columnId.longValue()) {
|
|
|
+ if ((columnResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && columnResult.getTableId().longValue() == getTableColumnInfoDTO.getTableId().longValue()) {
|
|
|
return columnResult;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *获取非空表存在该问题的数据
|
|
|
+ * 判断全部数据是否存在该条非空数据
|
|
|
+ *
|
|
|
+ * @param tableColumnVal
|
|
|
+ * @param nonnullResultList
|
|
|
+ * @param nonnullInfo
|
|
|
+ * @return:
|
|
|
+ */
|
|
|
+ public Map<Long, List<Long>> judgeNonnullList(List<GetTableColumnInfoDTO> tableColumnVal, List<NonnullResult> nonnullResultList, NonnullInfo nonnullInfo) {
|
|
|
+ if (ListUtil.isEmpty(tableColumnVal) || ListUtil.isEmpty(nonnullResultList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<Long, List<Long>> longListMap = new HashMap<>();
|
|
|
+ List<Long> arrayList = new ArrayList<>();
|
|
|
+ //获取非空结果表属于该条规则的所有tableId
|
|
|
+ List<Long> nonnullTableIdList = new ArrayList<>();
|
|
|
+ List<Long> tableColumnValIdList = new ArrayList<>();
|
|
|
+ nonnullResultList.stream().filter(nonnullResult -> nonnullResult.getColumnId().longValue() == nonnullInfo.getColumnId().longValue()).forEach(nonnullResult ->
|
|
|
+ nonnullTableIdList.add(nonnullResult.getTableId()));
|
|
|
+ tableColumnVal.stream().forEach(tableColumn ->
|
|
|
+ tableColumnValIdList.add(tableColumn.getTableId()));
|
|
|
+ for (Long aLong : nonnullTableIdList) {
|
|
|
+ if (!tableColumnValIdList.contains(aLong)) {
|
|
|
+ //需要删除的TableId
|
|
|
+ arrayList.add(aLong);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ListUtil.isEmpty(arrayList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ longListMap.put(nonnullInfo.getColumnId(), arrayList);
|
|
|
+ return longListMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断全部数据是否存在该条正则数据
|
|
|
+ *
|
|
|
+ * @param tableColumnVal
|
|
|
+ * @param regularResultList
|
|
|
+ * @param getRegular
|
|
|
+ * @return:
|
|
|
+ */
|
|
|
+ public Map<Long, List<Long>> judgeRegularList(List<GetTableColumnInfoDTO> tableColumnVal, List<RegularResult> regularResultList, GetRegular getRegular) {
|
|
|
+ if (ListUtil.isEmpty(tableColumnVal) || ListUtil.isEmpty(regularResultList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<Long, List<Long>> longListMap = new HashMap<>();
|
|
|
+ List<Long> arrayList = new ArrayList<>();
|
|
|
+ //获取非空结果表属于该条规则的所有tableId
|
|
|
+ List<Long> regularResultIdList = new ArrayList<>();
|
|
|
+ List<Long> tableColumnValIdList = new ArrayList<>();
|
|
|
+ regularResultList.stream().filter(regularResult -> regularResult.getColumnId().longValue() == getRegular.getColumnId().longValue()).forEach(regularResult ->
|
|
|
+ regularResultIdList.add(regularResult.getTableId()));
|
|
|
+ tableColumnVal.stream().forEach(tableColumn ->
|
|
|
+ tableColumnValIdList.add(tableColumn.getTableId()));
|
|
|
+ for (Long aLong : regularResultIdList) {
|
|
|
+ if (!tableColumnValIdList.contains(aLong)) {
|
|
|
+ //需要删除的TableId
|
|
|
+ arrayList.add(aLong);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ListUtil.isEmpty(arrayList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ longListMap.put(getRegular.getColumnId(), arrayList);
|
|
|
+ return longListMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断全部数据是否存在该条标准值数据
|
|
|
+ *
|
|
|
+ * @param tableColumnVal
|
|
|
+ * @param standardvalueResultList
|
|
|
+ * @param standardvalueInfo
|
|
|
+ * @return:
|
|
|
+ */
|
|
|
+ public Map<Long, List<Long>> judgeStandardvalueList(List<GetTableColumnInfoDTO> tableColumnVal, List<StandardvalueResult> standardvalueResultList, GetStandardvalueInfoDTO standardvalueInfo) {
|
|
|
+ if (ListUtil.isEmpty(tableColumnVal) || ListUtil.isEmpty(standardvalueResultList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<Long, List<Long>> longListMap = new HashMap<>();
|
|
|
+ List<Long> arrayList = new ArrayList<>();
|
|
|
+ //获取非空结果表属于该条规则的所有tableId
|
|
|
+ List<Long> standardvalueResultIdList = new ArrayList<>();
|
|
|
+ List<Long> tableColumnValIdList = new ArrayList<>();
|
|
|
+ standardvalueResultList.stream().filter(standardvalueResult -> standardvalueResult.getColumnId().longValue() == standardvalueInfo.getColumnId().longValue()).forEach(standardvalueResult ->
|
|
|
+ standardvalueResultIdList.add(standardvalueResult.getTableId()));
|
|
|
+ tableColumnVal.stream().forEach(tableColumn ->
|
|
|
+ tableColumnValIdList.add(tableColumn.getTableId()));
|
|
|
+ for (Long aLong : standardvalueResultIdList) {
|
|
|
+ if (!tableColumnValIdList.contains(aLong)) {
|
|
|
+ //需要删除的TableId
|
|
|
+ arrayList.add(aLong);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ListUtil.isEmpty(arrayList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ longListMap.put(standardvalueInfo.getColumnId(), arrayList);
|
|
|
+ return longListMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取非空表存在该问题的数据
|
|
|
*
|
|
|
* @param nonnullResultList
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param columnId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public NonnullResult judgeNonnullResultList(List<NonnullResult> nonnullResultList , GetTableColumnInfoDTO getTableColumnInfoDTO,Long columnId ){
|
|
|
- if(ListUtil.isEmpty(nonnullResultList)){
|
|
|
+ public NonnullResult judgeNonnullResultList(List<NonnullResult> nonnullResultList, GetTableColumnInfoDTO getTableColumnInfoDTO, Long columnId) {
|
|
|
+ if (ListUtil.isEmpty(nonnullResultList)) {
|
|
|
return null;
|
|
|
}
|
|
|
for (NonnullResult nonnullResult : nonnullResultList) {
|
|
|
- if(nonnullResult.getColumnId().longValue()==columnId.longValue()){
|
|
|
- if((nonnullResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && nonnullResult.getTableId().longValue()==getTableColumnInfoDTO.getTableId().longValue()){
|
|
|
+ if (nonnullResult.getColumnId().longValue() == columnId.longValue()) {
|
|
|
+ if ((nonnullResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && nonnullResult.getTableId().longValue() == getTableColumnInfoDTO.getTableId().longValue()) {
|
|
|
return nonnullResult;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *获取正则表存在该问题的数据
|
|
|
+ * 获取正则表存在该问题的数据
|
|
|
*
|
|
|
* @param regularResultList
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param columnId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public RegularResult judgeRegularResultList(List<RegularResult> regularResultList , GetTableColumnInfoDTO getTableColumnInfoDTO,Long columnId ){
|
|
|
- if(ListUtil.isEmpty(regularResultList)){
|
|
|
+ public RegularResult judgeRegularResultList(List<RegularResult> regularResultList, GetTableColumnInfoDTO getTableColumnInfoDTO, Long columnId) {
|
|
|
+ if (ListUtil.isEmpty(regularResultList)) {
|
|
|
return null;
|
|
|
}
|
|
|
for (RegularResult regularResult : regularResultList) {
|
|
|
- if(regularResult.getColumnId().longValue()==columnId.longValue()){
|
|
|
- if((regularResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && regularResult.getTableId().longValue()==getTableColumnInfoDTO.getTableId().longValue()){
|
|
|
+ if (regularResult.getColumnId().longValue() == columnId.longValue()) {
|
|
|
+ if ((regularResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && regularResult.getTableId().longValue() == getTableColumnInfoDTO.getTableId().longValue()) {
|
|
|
return regularResult;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- *获取标准值表存在该问题的数据
|
|
|
+ * 获取标准值表存在该问题的数据
|
|
|
*
|
|
|
* @param standardvalueResultList
|
|
|
* @param getTableColumnInfoDTO
|
|
|
* @param columnId
|
|
|
* @return:
|
|
|
*/
|
|
|
- public StandardvalueResult judgeStandardvalueResultList(List<StandardvalueResult> standardvalueResultList , GetTableColumnInfoDTO getTableColumnInfoDTO,Long columnId ){
|
|
|
- if(ListUtil.isEmpty(standardvalueResultList)){
|
|
|
+ public StandardvalueResult judgeStandardvalueResultList(List<StandardvalueResult> standardvalueResultList, GetTableColumnInfoDTO getTableColumnInfoDTO, Long columnId) {
|
|
|
+ if (ListUtil.isEmpty(standardvalueResultList)) {
|
|
|
return null;
|
|
|
}
|
|
|
for (StandardvalueResult standardvalueResult : standardvalueResultList) {
|
|
|
- if(standardvalueResult.getColumnId().longValue()==columnId.longValue()){
|
|
|
- if((standardvalueResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && standardvalueResult.getTableId().longValue()==getTableColumnInfoDTO.getTableId().longValue()){
|
|
|
+ if (standardvalueResult.getColumnId().longValue() == columnId.longValue()) {
|
|
|
+ if ((standardvalueResult.getBehospitalCode().equals(getTableColumnInfoDTO.getBehospitalCode())) && standardvalueResult.getTableId().longValue() == getTableColumnInfoDTO.getTableId().longValue()) {
|
|
|
return standardvalueResult;
|
|
|
}
|
|
|
}
|
|
@@ -1143,12 +1380,13 @@ public class ColumnResultManagementFacade {
|
|
|
*
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<ColumnResult> saveColumnResultNonnullId(List<NonnullResult> addNonnullResultList ,List<ColumnResult> addColumnResultList) {
|
|
|
- ad:for (NonnullResult nonnullResult : addNonnullResultList) {
|
|
|
+ public List<ColumnResult> saveColumnResultNonnullId(List<NonnullResult> addNonnullResultList, List<ColumnResult> addColumnResultList) {
|
|
|
+ ad:
|
|
|
+ for (NonnullResult nonnullResult : addNonnullResultList) {
|
|
|
for (ColumnResult columnResult : addColumnResultList) {
|
|
|
- if((nonnullResult.getColumnId().longValue()==columnResult.getColumnId().longValue()) && (nonnullResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
- && (nonnullResult.getTableId().longValue()==columnResult.getTableId().longValue())
|
|
|
- ){
|
|
|
+ if ((nonnullResult.getColumnId().longValue() == columnResult.getColumnId().longValue()) && (nonnullResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
+ && (nonnullResult.getTableId().longValue() == columnResult.getTableId().longValue())
|
|
|
+ ) {
|
|
|
columnResult.setResultId(nonnullResult.getId());
|
|
|
continue ad;
|
|
|
}
|
|
@@ -1156,17 +1394,19 @@ public class ColumnResultManagementFacade {
|
|
|
}
|
|
|
return addColumnResultList;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 新增总表插入正则子表id
|
|
|
*
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<ColumnResult> saveColumnResultRegularResultId(List<RegularResult> addRegularResultList ,List<ColumnResult> addColumnResultList) {
|
|
|
- ad:for (RegularResult regularResult : addRegularResultList) {
|
|
|
+ public List<ColumnResult> saveColumnResultRegularResultId(List<RegularResult> addRegularResultList, List<ColumnResult> addColumnResultList) {
|
|
|
+ ad:
|
|
|
+ for (RegularResult regularResult : addRegularResultList) {
|
|
|
for (ColumnResult columnResult : addColumnResultList) {
|
|
|
- if((regularResult.getColumnId().longValue()==columnResult.getColumnId().longValue()) && (regularResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
- && (regularResult.getTableId().longValue()==columnResult.getTableId().longValue())
|
|
|
- ){
|
|
|
+ if ((regularResult.getColumnId().longValue() == columnResult.getColumnId().longValue()) && (regularResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
+ && (regularResult.getTableId().longValue() == columnResult.getTableId().longValue())
|
|
|
+ ) {
|
|
|
columnResult.setResultId(regularResult.getId());
|
|
|
continue ad;
|
|
|
}
|
|
@@ -1174,17 +1414,19 @@ public class ColumnResultManagementFacade {
|
|
|
}
|
|
|
return addColumnResultList;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 新增总表插入标准值子表id
|
|
|
*
|
|
|
* @return:
|
|
|
*/
|
|
|
- public List<ColumnResult> saveColumnResultStandardvalueResultId(List<StandardvalueResult> addStandardvalueResultList ,List<ColumnResult> addColumnResultList) {
|
|
|
- ad:for (StandardvalueResult standardvalueResult : addStandardvalueResultList) {
|
|
|
+ public List<ColumnResult> saveColumnResultStandardvalueResultId(List<StandardvalueResult> addStandardvalueResultList, List<ColumnResult> addColumnResultList) {
|
|
|
+ ad:
|
|
|
+ for (StandardvalueResult standardvalueResult : addStandardvalueResultList) {
|
|
|
for (ColumnResult columnResult : addColumnResultList) {
|
|
|
- if((standardvalueResult.getColumnId().longValue()==columnResult.getColumnId().longValue()) && (standardvalueResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
- && (standardvalueResult.getTableId().longValue()==columnResult.getTableId().longValue())
|
|
|
- ){
|
|
|
+ if ((standardvalueResult.getColumnId().longValue() == columnResult.getColumnId().longValue()) && (standardvalueResult.getBehospitalCode().equals(columnResult.getBehospitalCode()))
|
|
|
+ && (standardvalueResult.getTableId().longValue() == columnResult.getTableId().longValue())
|
|
|
+ ) {
|
|
|
columnResult.setResultId(standardvalueResult.getId());
|
|
|
continue ad;
|
|
|
}
|
|
@@ -1254,7 +1496,7 @@ public class ColumnResultManagementFacade {
|
|
|
* @param type
|
|
|
* @return:
|
|
|
*/
|
|
|
- public ColumnResult addColumnResult(GetTableColumnInfoDTO getTableColumnInfoDTO, ColumnInfo columnInfo, Long columnId,String type, Long principleId) {
|
|
|
+ public ColumnResult addColumnResult(GetTableColumnInfoDTO getTableColumnInfoDTO, ColumnInfo columnInfo, Long columnId, String type, Long principleId) {
|
|
|
ColumnResult columnResult = new ColumnResult();
|
|
|
columnResult.setHospitalId(getTableColumnInfoDTO.getHospitalId());
|
|
|
columnResult.setBehospitalCode(getTableColumnInfoDTO.getBehospitalCode());
|