|
|
|
@ -59,7 +59,7 @@ public class FsBusinessServiceImpl implements FsBusinessService {
|
|
|
|
|
@Resource
|
|
|
|
|
private CollectTaskService collectTaskService;
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean pushInfo(PushInfoVo pushInfoVo) {
|
|
|
|
|
public Boolean pushInfoEmr(PushInfoVo pushInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
CollectTaskConfig.TaskConfig taskConfig = CollectTaskConfig.getTaskConfig("WS_RECORD_SUBMIT");
|
|
|
|
|
if (taskConfig == null || Func.isEmpty(taskConfig.getCollectorIds())) {
|
|
|
|
@ -72,7 +72,7 @@ public class FsBusinessServiceImpl implements FsBusinessService {
|
|
|
|
|
throw new BaseException("住院流水号、住院号、患者姓名 不可全部为空!");
|
|
|
|
|
}
|
|
|
|
|
TbasicQrPreciseCondition condition = FsWsRecordSubmitMessageConvert.convert(dto);
|
|
|
|
|
List<String> patientIds = tBasicMapper.getGznkPatientIdByPreciseConditions(condition);
|
|
|
|
|
List<String> patientIds = tBasicMapper.getPatientIdByPreciseConditions(condition);
|
|
|
|
|
verifyPatientIds(patientIds);
|
|
|
|
|
|
|
|
|
|
String submitDate = dto.getSubmitDate();
|
|
|
|
@ -106,6 +106,45 @@ public class FsBusinessServiceImpl implements FsBusinessService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean pushInfoNurs(PushInfoVo pushInfoVo) {
|
|
|
|
|
try {
|
|
|
|
|
CollectTaskConfig.TaskConfig taskConfig = CollectTaskConfig.getTaskConfig("WS_NURS_SUBMIT");
|
|
|
|
|
if (taskConfig == null || Func.isEmpty(taskConfig.getCollectorIds())) {
|
|
|
|
|
throw new RuntimeException("任务配置未配置采集器id,WS_NURS_SUBMIT");
|
|
|
|
|
}
|
|
|
|
|
FsRecordSubmitDTO dto = FsWsRecordSubmitMessageConvert.convert(pushInfoVo);
|
|
|
|
|
if (Func.isBlank(dto.getJzh())
|
|
|
|
|
&& Func.isBlank(dto.getInpatientNo())
|
|
|
|
|
&& Func.isBlank(dto.getName())) {
|
|
|
|
|
throw new BaseException("住院流水号、住院号、患者姓名 不可全部为空!");
|
|
|
|
|
}
|
|
|
|
|
TbasicQrPreciseCondition condition = FsWsRecordSubmitMessageConvert.convert(dto);
|
|
|
|
|
List<String> patientIds = tBasicMapper.getPatientIdByPreciseConditions(condition);
|
|
|
|
|
verifyPatientIds(patientIds);
|
|
|
|
|
|
|
|
|
|
String submitDate = dto.getSubmitDate();
|
|
|
|
|
tBasicMapper.insertOrUpdateNurseSubmitTime(patientIds.get(0), Func.parseDate(submitDate, DateUtil.PATTERN_DATETIME));
|
|
|
|
|
|
|
|
|
|
compensateTask("护理提交",patientIds, taskConfig.getCollectorIds());
|
|
|
|
|
|
|
|
|
|
// 添加提交记录
|
|
|
|
|
HospitalSubmitNodeLogAddDTO nodeLogAddDTO = new HospitalSubmitNodeLogAddDTO();
|
|
|
|
|
nodeLogAddDTO.setPatientId(patientIds.get(0));
|
|
|
|
|
nodeLogAddDTO.setContent(new String[]{submitDate});
|
|
|
|
|
nodeLogAddDTO.setSubmitNodeEnum(HospitalSubmitNodeEnum.NURSE);
|
|
|
|
|
nodeLogAddDTO.setCreater("护理提交");
|
|
|
|
|
nodeLogAddDTO.setCreaterName("护理提交");
|
|
|
|
|
hospitalSubmitNodeServiceApi.addLog(nodeLogAddDTO);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
// 不可知的错误
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void compensateTask(String source,List<String> patientIds, List<String> collectorIds) {
|
|
|
|
|
log.info("{},补偿任务 patientIds:{} collectId:{}",source, patientIds, collectorIds);
|
|
|
|
|
CompensateTasRequest dto = new CompensateTasRequest();
|
|
|
|
|