增加死亡患者按需采集

docus-active-query-service_1.3
tan 1 year ago
parent 0e70b07482
commit fb362efd4d

@ -63,6 +63,7 @@
"collectOpen": "1",
// 1:af_collect_task 2:
"checkIntegrityType": "1",
"isDead" : "1",
//----------
//0 1

@ -74,14 +74,14 @@ public class MyScheduling {
* /
* 10
*/
@Scheduled(fixedRate = 1000 * 60 * 10)
public void collect() {
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
if ((!collectorid.equals(Codes.SMCODE.getCode())) && (!collectorid.equals(Codes.ZZCODE.getCode()))) {
return;
}
bgtsService.timerCollect();
}
// @Scheduled(fixedRate = 1000 * 60 * 10)
// public void collect() {
// String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
// if ((!collectorid.equals(Codes.SMCODE.getCode())) && (!collectorid.equals(Codes.ZZCODE.getCode()))) {
// return;
// }
// bgtsService.timerCollect();
// }
// // 时间
// private static List<String> date = new ArrayList<>();
@ -161,23 +161,23 @@ public class MyScheduling {
//
// }
// @Scheduled(cron ="0 0 0 * * ?")
// public void collect(){
// String intervalDayOpen = String.valueOf(FileUtils.getJsonByName("intervalDayOpen"));
// if (intervalDayOpen.equals("1")){
// try{
// String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
// int day = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("intervalDay")));
// logger.info("0点采集前"+day+"天出院数据");
// Map<String, String> dateCollectionTime = getDateCollectionTime(new Date(), day);
// logger.info("采集"+dateCollectionTime.get("startDate")+"至-------"+dateCollectionTime.get("endDate")+"数据");
// bgtsService.collectByDate(dateCollectionTime.get("startDate"),dateCollectionTime.get("endDate"),collectorid);
// }catch (Exception e) {
// logger.error("pacs二次采集出错---"+e.getMessage());
// }
//
// }
// }
@Scheduled(cron ="0 0 0 * * ?")
public void collect(){
String intervalDayOpen = String.valueOf(FileUtils.getJsonByName("intervalDayOpen"));
if (intervalDayOpen.equals("1")){
try{
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
int day = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("intervalDay")));
logger.info("0点采集前"+day+"天出院数据");
Map<String, String> dateCollectionTime = getDateCollectionTime(new Date(), day);
logger.info("采集"+dateCollectionTime.get("startDate")+"至-------"+dateCollectionTime.get("endDate")+"数据");
bgtsService.collectByDate(dateCollectionTime.get("startDate"),dateCollectionTime.get("endDate"),collectorid,String.valueOf(0));
}catch (Exception e) {
logger.error("pacs二次采集出错---"+e.getMessage());
}
}
}
/**

@ -220,4 +220,5 @@ public class BgtsController {
}

@ -44,6 +44,14 @@ public interface IAfCollectTaskService extends IService<AfCollectTask> {
*/
List<Map> getjzhByDate(String startDate,String endDate,int size,int current);
/**
* jzh
* @param startDate
* @param endDate
* @return
*/
List<Map> getjzhByDateAndIsDead(String startDate,String endDate,int size,int current);
/**
*
* @param patientIds

@ -65,7 +65,7 @@ public interface IBgtsService {
* @param endDate
* @param collectorId
*/
void collectByDate(String startDate,String endDate,String collectorId);
void collectByDate(String startDate,String endDate,String collectorId,String isDead);
/**
*

@ -41,6 +41,14 @@ public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
*/
List<Map> getjzhByDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @RequestParam("size") int size, @RequestParam("current") int current);
/**
* jzh
* @param startDate
* @param endDate
* @return
*/
List<Map> getjzhByDateAndIsDead(@Param("startDate") String startDate, @Param("endDate") String endDate, @RequestParam("size") int size, @RequestParam("current") int current);
/**
*
* @param patientIds

@ -201,6 +201,12 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
return patientIds;
}
@Override
public List<Map> getjzhByDateAndIsDead(String startDate, String endDate, int size, int current) {
List<Map> patientIds = afCollectTaskMapper.getjzhByDateAndIsDead(startDate, endDate,size,current);
return patientIds;
}
@Override
public List<String> getC1ByPatientId(List<String> patientIds, String collectorId) {
List<List<String>> batchPatientIds = Lists.partition(patientIds, MAX_SIZE_PER_TIME);

@ -437,10 +437,11 @@ public class BgtsServiceImpl implements IBgtsService {
String collectStartDate = String.valueOf(FileUtils.getJsonByName("collectStartDate"))+"\t00:00:00";
String collectEndDate = String.valueOf(FileUtils.getJsonByName("collectEndDate"))+"\t23:59:59";
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
String isDead = String.valueOf(FileUtils.getJsonByName("isDead"));
CountDownLatch countDownLatch = new CountDownLatch(1);
threadPoolExecutor.execute(() -> {
try {
collectByDate(collectStartDate, collectEndDate, collectorid);
collectByDate(collectStartDate, collectEndDate, collectorid,isDead);
}catch (Exception e) {
logger.info("按需采集出错{}",e.getMessage());
}
@ -480,7 +481,7 @@ public class BgtsServiceImpl implements IBgtsService {
}
@Override
public void collectByDate(String startDate, String endDate, String collectorId) {
public void collectByDate(String startDate, String endDate, String collectorId,String isDead) {
logger.info("按需采集开始----------开始时间---" + startDate + "------结束时间---" + endDate);
//页码
int startrow;
@ -490,7 +491,13 @@ public class BgtsServiceImpl implements IBgtsService {
try{
List<Map> patientIds;
for (startrow = 0; ; startrow += 10) {
patientIds = afCollectTaskService.getjzhByDate(startDate, endDate, startrow, endrow);
if (("1").equals(isDead)){
patientIds=afCollectTaskService.getjzhByDateAndIsDead(startDate, endDate, startrow, endrow);
logger.info("按需采集死亡患者----");
}else {
patientIds = afCollectTaskService.getjzhByDate(startDate, endDate, startrow, endrow);
}
if (null == patientIds || patientIds.size() <= 0) {
logger.info("未查询到按需采集患者!");
break;
@ -1142,11 +1149,20 @@ public class BgtsServiceImpl implements IBgtsService {
key = new String[2];
examNo = examInfo.element(String.valueOf(FileUtils.getJsonByName("examNo")));
List<Element> examItemInfo = examInfo.elements("ExamItemInfo");
for (Element element1 : examItemInfo) {
if (examNo != null) {
key[0] = examNo.getText();
if (examItemInfo.size()>1){
for (Element element1 : examItemInfo) {
if (examNo != null) {
key[0] = examNo.getText();
}
key[1] = element1.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText();
}
}else {
for (Element element1 : examItemInfo) {
if (examNo != null) {
key[0] = examNo.getText();
}
key[1] = element1.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText();
}
}
exams.add(key);
}

@ -128,6 +128,13 @@
and `admiss_times` = #{basic.admissTimes}
</if>
</select>
<select id="getjzhByDateAndIsDead" resultType="java.util.Map">
select inpatient_no,admiss_date,dis_date,admiss_times,jzh
from docus_medicalrecord.t_basic
where is_dead='1' and dis_date between #{startDate} and #{endDate}
order by dis_date
limit #{size},#{current}
</select>
<resultMap id="groupByJzh" type="com.docus.bgts.entity.JzhListSync">

Loading…
Cancel
Save