|
|
@@ -0,0 +1,64 @@
|
|
|
+package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import thyyxxk.webserver.dao.his.zhuyuanyisheng.PatientInfoQueryDao;
|
|
|
+import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
+import thyyxxk.webserver.entity.inpatient.patient.Patient;
|
|
|
+import thyyxxk.webserver.entity.zhuyuanyisheng.PatInfoQuery.PatInfoQueryParam;
|
|
|
+import thyyxxk.webserver.utils.ListUtil;
|
|
|
+import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
+import thyyxxk.webserver.utils.StringUtil;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+public class PatientInfoQueryService {
|
|
|
+
|
|
|
+ private final PatientInfoQueryDao dao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public PatientInfoQueryService(PatientInfoQueryDao dao) {
|
|
|
+ this.dao = dao;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<List<GetDropdownBox>> getHospWardAndDept() {
|
|
|
+ return ResultVoUtil.success(dao.getHospWardAndDept());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public ResultVo<List<Patient>> getPatientInfo(PatInfoQueryParam param) {
|
|
|
+ log.info("查询患者信息:{}", JSON.toJSONString(param));
|
|
|
+ QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
+
|
|
|
+ if (StringUtil.notBlank(param.getPatNo())) {
|
|
|
+ qw.eq("inpatient_no", param.getPatNo());
|
|
|
+ }
|
|
|
+ if (StringUtil.notBlank(param.getName())) {
|
|
|
+ qw.like("name", param.getName());
|
|
|
+ }
|
|
|
+ if (ListUtil.notBlank(param.getAdmissionTime())) {
|
|
|
+ qw.ge("admiss_date", param.getAdmissionTime().get(0));
|
|
|
+ qw.le("admiss_date", param.getAdmissionTime().get(1));
|
|
|
+ }
|
|
|
+ if (ListUtil.notBlank(param.getDischargeTime())) {
|
|
|
+ qw.ge("dis_date", param.getAdmissionTime().get(0));
|
|
|
+ qw.le("dis_date", param.getAdmissionTime().get(1));
|
|
|
+ }
|
|
|
+ if (StringUtil.notBlank(param.getDept())) {
|
|
|
+ qw.eq("dept", param.getDept());
|
|
|
+ }
|
|
|
+ if (StringUtil.notBlank(param.getWard())) {
|
|
|
+ qw.eq("ward", param.getWard());
|
|
|
+ }
|
|
|
+ List<Patient> list = dao.getPatInfo(qw, param.getLeaveHospital() ? "zy_inactpatient" : "zy_actpatient");
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|