护理采集过滤文件,可配置

3.2.4.44
wyb 2 years ago
parent ace67cb33e
commit 8b1d1f8694

@ -0,0 +1,3 @@
{
"fileRemoveByFormName":["同意书","告知书"]
}

@ -50,4 +50,12 @@ public interface TBasicMapper{
List<TBasic> selectBasicListByPatientIds(@Param("patientIds") List<String> patientIds);
Integer getNurseFileCount(@Param("patientId")String patientId);
/**
*
* @param patientId
* @param removeCount
* @return db
*/
Integer saveNisRemoveFilesCount(@Param("patientId") String patientId,@Param("count") int removeCount);
}

@ -0,0 +1,30 @@
package com.docus.server.report.config;
import com.docus.server.report.util.TableJsonRead;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
*
* @author wyb
*/
@Data
public class SdRyCollectNurseInsertSugarConfig {
private final static String CONFIG_FILE_PATH="data-config";
private final static String CONFIG_FILE_NAME="sdry-collect-nurse-insert-sugar-config.json";
private List<String> fileRemoveByFormName=new ArrayList<>();
public static SdRyCollectNurseInsertSugarConfig getConfig(){
TableJsonRead jsonRead = new TableJsonRead();
SdRyCollectNurseInsertSugarConfig readObject = jsonRead.Read(CONFIG_FILE_PATH, CONFIG_FILE_NAME, SdRyCollectNurseInsertSugarConfig.class);
return Optional.ofNullable(readObject).orElse(new SdRyCollectNurseInsertSugarConfig());
}
public static void main(String[] args) {
System.out.println(getConfig());
}
}

@ -10,6 +10,7 @@ import com.docus.server.collection.mapper.TBasicMapper;
import com.docus.server.report.api.ShunDePeopleService;
import com.docus.server.report.api.TaskDistributeService;
import com.docus.server.report.api.dto.*;
import com.docus.server.report.config.SdRyCollectNurseInsertSugarConfig;
import com.docus.server.report.config.SdRyReportQueryConfig;
import com.docus.server.report.config.TaskValidateConfig;
import com.docus.server.report.config.ZdAssortConfig;
@ -170,8 +171,22 @@ public class ReportJob {
nurseFileCountError(inpatientNo, admissTimes);
return;
}
// 从配置获取需要过滤的文件名称
SdRyCollectNurseInsertSugarConfig config = SdRyCollectNurseInsertSugarConfig.getConfig();
List<String> fileRemoveByFormName = config.getFileRemoveByFormName();
List<SdNurseInsertSugarResponse.NisData> removeFiles = nurseInsertSugarReportList.stream()
.filter(item -> isCharacterContains(item.getForm_name(), fileRemoveByFormName))
.collect(Collectors.toList());
log.info("住院号:{},住院次数{},护理采集过滤文件: {} 共 {} 条", inpatientNo, admissTimes, fileRemoveByFormName, removeFiles.size());
tBasicMapper.saveNisRemoveFilesCount(patientId, removeFiles.size());
ReportDto reportDto;
int collectFileCount = 0;
for (SdNurseInsertSugarResponse.NisData nisReport : nurseInsertSugarReportList) {
// 从过滤配置中匹配,如果匹配则跳过本次循环
if (isCharacterContains(nisReport.getForm_name(), fileRemoveByFormName)) {
continue;
}
reportDto = new ReportDto();
reportDto.setSysFlag(reportQueryNurseInsertSugarCollectorId);
reportDto.setTaskId(reportDownTwoDto.getTasks().get(0).getTaskId());
@ -186,8 +201,22 @@ public class ReportJob {
reportDto.setFileSource("1");
reportDto.setFilestoragetype("1");
reportService.report(reportDto);
collectFileCount++;
}
log.info("住院号:{},住院次数{},护理采集文件: {} 条", inpatientNo, admissTimes, collectFileCount);
}
}
/**
* strtrue
*
*/
private static boolean isCharacterContains(String str, List<String> strList){
for (String e : strList) {
if(str.contains(e)){
return true;
}
}
return false;
}
private void nurseFileCountError(String inpatientNo, Integer admissTimes) {
@ -454,9 +483,6 @@ public class ReportJob {
}
}
public static void main(String[] args) {
System.out.println(createBase64SaveDir());
}
private List<ReportDto> parseQuerySdRyInspectReport(String respBody, TBasic tBasic, AtomicInteger reportTotalCount) {
JSONObject jsonObject = Func.readJson(respBody, JSONObject.class);

@ -28,6 +28,13 @@
VALUES
(#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName},#{tBasicExtend.sdryIndex})
</insert>
<insert id="saveNisRemoveFilesCount">
INSERT INTO `docus_medicalrecord`.`t_basic_extend`
(`patient_id`, `nurse_file_collect_remove_count`)
VALUES (#{patientId}, #{count})
on DUPLICATE KEY UPDATE
`nurse_file_collect_remove_count`=#{count};
</insert>
<update id="update">
UPDATE `docus_medicalrecord`.`t_basic`

Loading…
Cancel
Save