|
|
@@ -100,9 +100,9 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
@ApiResponses({
|
|
|
@ApiResponse(code = 200,message = "0 病人中未出现重复,非0 病人中出现重复"),
|
|
|
})
|
|
|
- public R<Long> judgeRepeat(@RequestBody List<String> patientCode){
|
|
|
- log.info("判断所给病号中是否出现了绑定设备重复,【{}】",patientCode);
|
|
|
- return R.success(patientService.count(new QueryWrapper<BusPatientEntity>().lambda().in(BusPatientEntity::getCode,patientCode).eq(BusPatientEntity::getAlarm,PatientAlarmEnum.DEVICE_REPEAT)));
|
|
|
+ public R<Long> judgeRepeat(@RequestBody List<String> patientIds){
|
|
|
+ log.info("判断所给病号中是否出现了绑定设备重复,【{}】",patientIds);
|
|
|
+ return R.success(patientService.count(new QueryWrapper<BusPatientEntity>().lambda().in(BusPatientEntity::getId,patientIds).eq(BusPatientEntity::getAlarm,PatientAlarmEnum.DEVICE_REPEAT)));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/judge/finished")
|
|
|
@@ -111,13 +111,13 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
@ApiResponse(code = 500,message = "没有选择病号"),
|
|
|
@ApiResponse(code =200 ,message = "若存在不可以结束的临床信息,返回1",response = BusDeviceRunningEntity.class)
|
|
|
})
|
|
|
- public R<Boolean> judgeFinished(@RequestBody List<String> patientCodes){
|
|
|
- log.info("判断给定病号中是否可以结束临床管理,【{}】",patientCodes);
|
|
|
- if(CollUtil.isEmpty(patientCodes)){
|
|
|
+ public R<Boolean> judgeFinished(@RequestBody List<String> patientIds){
|
|
|
+ log.info("判断给定病号中是否可以结束临床管理,【{}】",patientIds);
|
|
|
+ if(CollUtil.isEmpty(patientIds)){
|
|
|
throw new CustomException("请选择一个病患");
|
|
|
}
|
|
|
List<BusPatientEntity> patients = patientService.list(new QueryWrapper<BusPatientEntity>()
|
|
|
- .lambda().in(BusPatientEntity::getCode, patientCodes));
|
|
|
+ .lambda().in(BusPatientEntity::getId, patientIds));
|
|
|
if(CollUtil.isEmpty(patients)){
|
|
|
throw new CustomException("病号不存在,请刷新后重试");
|
|
|
}
|
|
|
@@ -157,20 +157,20 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
* @return R
|
|
|
*/
|
|
|
private R<Boolean> monitorFinished(MonitorFinishedVo monitorFinishedVo, String tenantId){
|
|
|
- List<String> patientCodes = monitorFinishedVo.getPatientCodes();
|
|
|
- if(CollUtil.isEmpty(patientCodes)){
|
|
|
+ List<String> patientIds = monitorFinishedVo.getPatientIds();
|
|
|
+ if(CollUtil.isEmpty(patientIds)){
|
|
|
List<String> clinicIds = monitorFinishedVo.getClinicIds();
|
|
|
if (CollUtil.isEmpty(clinicIds)) {
|
|
|
throw new CustomException("未选择临床信息");
|
|
|
}
|
|
|
}
|
|
|
- List<BusPatientEntity> patients = patientService.list(new QueryWrapper<BusPatientEntity>().lambda().in(BusPatientEntity::getCode, patientCodes));
|
|
|
+ List<BusPatientEntity> patients = patientService.list(new QueryWrapper<BusPatientEntity>().lambda().in(BusPatientEntity::getId, patientIds));
|
|
|
List<ManualUndoConfig> undoConfigs=new ArrayList<>();
|
|
|
for (BusPatientEntity patient : patients) {
|
|
|
undoConfigs.add(
|
|
|
ManualUndoConfig.of(
|
|
|
Collections.singletonList(patient.getInfusionId()),
|
|
|
- patient.getCode(),
|
|
|
+ patient.getId(),
|
|
|
patient.getClinicId(),
|
|
|
tenantId,
|
|
|
true,
|
|
|
@@ -239,13 +239,13 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
public R shift(@RequestBody@Validated ManualUndoConfig undoConfig, @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId){
|
|
|
log.info("批量撤泵,【{}】",JSONUtil.toJsonStr(undoConfig));
|
|
|
undoConfig.setTenantId(tenantId);
|
|
|
- BusPatientEntity patient = patientService.findByFormatCode( undoConfig.getPatientCode());
|
|
|
+ BusPatientEntity patient = patientService.getById( undoConfig.getPatientId());
|
|
|
if(patient==null){
|
|
|
- throw new CustomException(String.format("病号【%s】不存在,请刷新后重试",undoConfig.getPatientCode()));
|
|
|
+ return R.success();
|
|
|
}
|
|
|
//泵切换完成后,对病号报警解除
|
|
|
infusionService.undo(undoConfig,false);
|
|
|
- PatientOperator operator = patientRegistry.getOperator(undoConfig.getTenantId(), undoConfig.getPatientCode());
|
|
|
+ PatientOperator operator = patientRegistry.getOperator(undoConfig.getTenantId(), patient.getOriginCode());
|
|
|
//判断当前病号下是否还存在副泵
|
|
|
long count = infusionService.count(new QueryWrapper<BusInfusionHistoryEntity>().lambda()
|
|
|
.eq(BusInfusionHistoryEntity::getClinicId, operator.getClinicId())
|