checkpoint: partial fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
public enum RegistrationStatus {
|
||||
PENDING, CONFIRMED, CANCELLED, COMPLETED
|
||||
public class RegistrationStatus {
|
||||
public static final Integer RESERVED = 2;
|
||||
public static final Integer SIGNED = 3;
|
||||
public static final Integer CANCELLED = 4;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
|
||||
public class DiagnosisSaveDto {
|
||||
private List<Diagnosis> diagnoses;
|
||||
private Long patientId;
|
||||
private String visitNo;
|
||||
|
||||
public List<Diagnosis> getDiagnoses() { return diagnoses; }
|
||||
public void setDiagnoses(List<Diagnosis> diagnoses) { this.diagnoses = diagnoses; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getVisitNo() { return visitNo; }
|
||||
public void setVisitNo(String visitNo) { this.visitNo = visitNo; }
|
||||
|
||||
private Long visitId;
|
||||
private List<String> diagnosisCodes;
|
||||
private String diagnosisType;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DiagnosisSaveResultDto {
|
||||
private Long diagnosisId;
|
||||
private boolean success;
|
||||
private String message;
|
||||
private List<String> reportCardTypes;
|
||||
|
||||
public Long getDiagnosisId() { return diagnosisId; }
|
||||
public void setDiagnosisId(Long diagnosisId) { this.diagnosisId = diagnosisId; }
|
||||
@@ -11,4 +14,6 @@ public class DiagnosisSaveResultDto {
|
||||
public void setSuccess(boolean success) { this.success = success; }
|
||||
public String getMessage() { return message; }
|
||||
public void setMessage(String message) { this.message = message; }
|
||||
public List<String> getReportCardTypes() { return reportCardTypes; }
|
||||
public void setReportCardTypes(List<String> reportCardTypes) { this.reportCardTypes = reportCardTypes; }
|
||||
}
|
||||
|
||||
@@ -7,6 +7,13 @@ public class InfectiousDiseaseReportDto {
|
||||
private Long patientId;
|
||||
private String diseaseCode;
|
||||
private Date reportTime;
|
||||
private Date diagnosisTime;
|
||||
private String patientName;
|
||||
private String patientIdCard;
|
||||
private String gender;
|
||||
private Date birthDate;
|
||||
private String currentAddress;
|
||||
private String occupation;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
@@ -16,4 +23,18 @@ public class InfectiousDiseaseReportDto {
|
||||
public void setDiseaseCode(String diseaseCode) { this.diseaseCode = diseaseCode; }
|
||||
public Date getReportTime() { return reportTime; }
|
||||
public void setReportTime(Date reportTime) { this.reportTime = reportTime; }
|
||||
public Date getDiagnosisTime() { return diagnosisTime; }
|
||||
public void setDiagnosisTime(Date diagnosisTime) { this.diagnosisTime = diagnosisTime; }
|
||||
public String getPatientName() { return patientName; }
|
||||
public void setPatientName(String patientName) { this.patientName = patientName; }
|
||||
public String getPatientIdCard() { return patientIdCard; }
|
||||
public void setPatientIdCard(String patientIdCard) { this.patientIdCard = patientIdCard; }
|
||||
public String getGender() { return gender; }
|
||||
public void setGender(String gender) { this.gender = gender; }
|
||||
public Date getBirthDate() { return birthDate; }
|
||||
public void setBirthDate(Date birthDate) { this.birthDate = birthDate; }
|
||||
public String getCurrentAddress() { return currentAddress; }
|
||||
public void setCurrentAddress(String currentAddress) { this.currentAddress = currentAddress; }
|
||||
public String getOccupation() { return occupation; }
|
||||
public void setOccupation(String occupation) { this.occupation = occupation; }
|
||||
}
|
||||
|
||||
@@ -3,15 +3,16 @@ package com.openhis.application.domain.dto;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class QueueQueryDto {
|
||||
private Long deptId;
|
||||
private String status;
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private LocalDateTime startDate;
|
||||
private LocalDateTime endDate;
|
||||
|
||||
public Long getDeptId() { return deptId; }
|
||||
public void setDeptId(Long deptId) { this.deptId = deptId; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public QueueQueryDto() {}
|
||||
public Integer getPageNum() { return pageNum; }
|
||||
public void setPageNum(Integer pageNum) { this.pageNum = pageNum; }
|
||||
public Integer getPageSize() { return pageSize; }
|
||||
public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
|
||||
public LocalDateTime getStartDate() { return startDate; }
|
||||
public void setStartDate(LocalDateTime startDate) { this.startDate = startDate; }
|
||||
public LocalDateTime getEndDate() { return endDate; }
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
public class TriageQueueQueryDTO {
|
||||
private Long doctorId;
|
||||
private String status;
|
||||
private Integer page;
|
||||
private Integer size;
|
||||
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Integer getPage() { return page; }
|
||||
public void setPage(Integer page) { this.page = page; }
|
||||
public Integer getSize() { return size; }
|
||||
public void setSize(Integer size) { this.size = size; }
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
public TriageQueueQueryDTO() {}
|
||||
public Integer getPageNum() { return pageNum; }
|
||||
public void setPageNum(Integer pageNum) { this.pageNum = pageNum; }
|
||||
public Integer getPageSize() { return pageSize; }
|
||||
public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
|
||||
}
|
||||
|
||||
@@ -1,2 +1,27 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
public class VitalSignsDto {}
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class VitalSignsDto {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String recordTime;
|
||||
private String temperature;
|
||||
private String heartRate;
|
||||
private String pulse;
|
||||
|
||||
public VitalSignsDto() {}
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getRecordTime() { return recordTime; }
|
||||
public void setRecordTime(String recordTime) { this.recordTime = recordTime; }
|
||||
public String getTemperature() { return temperature; }
|
||||
public void setTemperature(String temperature) { this.temperature = temperature; }
|
||||
public String getHeartRate() { return heartRate; }
|
||||
public void setHeartRate(String heartRate) { this.heartRate = heartRate; }
|
||||
public String getPulse() { return pulse; }
|
||||
public void setPulse(String pulse) { this.pulse = pulse; }
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.util.Date;
|
||||
|
||||
public class Diagnosis {
|
||||
private Long id;
|
||||
private Long diseaseId;
|
||||
private String code;
|
||||
private String name;
|
||||
private Long visitId;
|
||||
private String diagnosisCode;
|
||||
private String diagnosisName;
|
||||
@@ -15,6 +18,12 @@ public class Diagnosis {
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getDiseaseId() { return diseaseId; }
|
||||
public void setDiseaseId(Long diseaseId) { this.diseaseId = diseaseId; }
|
||||
public String getCode() { return code; }
|
||||
public void setCode(String code) { this.code = code; }
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public String getDiagnosisCode() { return diagnosisCode; }
|
||||
|
||||
@@ -8,6 +8,7 @@ public class DiseaseCatalog {
|
||||
private String diseaseName;
|
||||
private String icdCode;
|
||||
private String category;
|
||||
private String reportCardType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
@@ -21,6 +22,8 @@ public class DiseaseCatalog {
|
||||
public void setIcdCode(String icdCode) { this.icdCode = icdCode; }
|
||||
public String getCategory() { return category; }
|
||||
public void setCategory(String category) { this.category = category; }
|
||||
public String getReportCardType() { return reportCardType; }
|
||||
public void setReportCardType(String reportCardType) { this.reportCardType = reportCardType; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
|
||||
@@ -4,31 +4,20 @@ import java.util.Date;
|
||||
|
||||
public class DispensingDetail {
|
||||
private Long id;
|
||||
private Long dispensingSummaryId;
|
||||
private Long orderDetailId;
|
||||
private String medicineCode;
|
||||
private String medicineName;
|
||||
private Integer quantity;
|
||||
private String status;
|
||||
private Integer applyStatus;
|
||||
private Date createTime;
|
||||
private Long orderId;
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public DispensingDetail() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getDispensingSummaryId() { return dispensingSummaryId; }
|
||||
public void setDispensingSummaryId(Long dispensingSummaryId) { this.dispensingSummaryId = dispensingSummaryId; }
|
||||
public Long getOrderDetailId() { return orderDetailId; }
|
||||
public void setOrderDetailId(Long orderDetailId) { this.orderDetailId = orderDetailId; }
|
||||
public String getMedicineCode() { return medicineCode; }
|
||||
public void setMedicineCode(String medicineCode) { this.medicineCode = medicineCode; }
|
||||
public String getMedicineName() { return medicineName; }
|
||||
public void setMedicineName(String medicineName) { this.medicineName = medicineName; }
|
||||
public Integer getQuantity() { return quantity; }
|
||||
public void setQuantity(Integer quantity) { this.quantity = quantity; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Integer getApplyStatus() { return applyStatus; }
|
||||
public void setApplyStatus(Integer applyStatus) { this.applyStatus = applyStatus; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Long getOrderId() { return orderId; }
|
||||
public void setOrderId(Long orderId) { this.orderId = orderId; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
|
||||
@@ -4,26 +4,15 @@ import java.util.Date;
|
||||
|
||||
public class DispensingSummary {
|
||||
private Long id;
|
||||
private Long orderId;
|
||||
private Long patientId;
|
||||
private String dispensingType;
|
||||
private String status;
|
||||
private Date dispensingTime;
|
||||
private Integer applyStatus;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public DispensingSummary() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getOrderId() { return orderId; }
|
||||
public void setOrderId(Long orderId) { this.orderId = orderId; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getDispensingType() { return dispensingType; }
|
||||
public void setDispensingType(String dispensingType) { this.dispensingType = dispensingType; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getDispensingTime() { return dispensingTime; }
|
||||
public void setDispensingTime(Date dispensingTime) { this.dispensingTime = dispensingTime; }
|
||||
public Integer getApplyStatus() { return applyStatus; }
|
||||
public void setApplyStatus(Integer applyStatus) { this.applyStatus = applyStatus; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
|
||||
@@ -1,34 +1,27 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class LabRequest {
|
||||
private Long id;
|
||||
private Long visitId;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private String requestType;
|
||||
private String requestNo;
|
||||
private String status;
|
||||
private Date requestTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
private List<LabRequestItem> items;
|
||||
|
||||
public LabRequest() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getRequestType() { return requestType; }
|
||||
public void setRequestType(String requestType) { this.requestType = requestType; }
|
||||
public String getRequestNo() { return requestNo; }
|
||||
public void setRequestNo(String requestNo) { this.requestNo = requestNo; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getRequestTime() { return requestTime; }
|
||||
public void setRequestTime(Date requestTime) { this.requestTime = requestTime; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
public List<LabRequestItem> getItems() { return items; }
|
||||
public void setItems(List<LabRequestItem> items) { this.items = items; }
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ public class Patient {
|
||||
private String name;
|
||||
private String gender;
|
||||
private Date birthDate;
|
||||
private String phone;
|
||||
private String idCard;
|
||||
private String currentAddress;
|
||||
private String occupation;
|
||||
|
||||
public Patient() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getName() { return name; }
|
||||
@@ -17,8 +19,8 @@ public class Patient {
|
||||
public void setGender(String gender) { this.gender = gender; }
|
||||
public Date getBirthDate() { return birthDate; }
|
||||
public void setBirthDate(Date birthDate) { this.birthDate = birthDate; }
|
||||
public String getPhone() { return phone; }
|
||||
public void setPhone(String phone) { this.phone = phone; }
|
||||
public String getIdCard() { return idCard; }
|
||||
public void setIdCard(String idCard) { this.idCard = idCard; }
|
||||
public String getCurrentAddress() { return currentAddress; }
|
||||
public void setCurrentAddress(String currentAddress) { this.currentAddress = currentAddress; }
|
||||
public String getOccupation() { return occupation; }
|
||||
public void setOccupation(String occupation) { this.occupation = occupation; }
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ public class RegistrationDetail {
|
||||
private Long registrationId;
|
||||
private String feeType;
|
||||
private BigDecimal amount;
|
||||
private String status;
|
||||
private Long scheduleSlotId;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getRegistrationId() { return registrationId; }
|
||||
@@ -15,4 +18,8 @@ public class RegistrationDetail {
|
||||
public void setFeeType(String feeType) { this.feeType = feeType; }
|
||||
public BigDecimal getAmount() { return amount; }
|
||||
public void setAmount(BigDecimal amount) { this.amount = amount; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getScheduleSlotId() { return scheduleSlotId; }
|
||||
public void setScheduleSlotId(Long scheduleSlotId) { this.scheduleSlotId = scheduleSlotId; }
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ public class ScheduleSlot {
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String status;
|
||||
private Long patientId;
|
||||
private Date updateTime;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getSchedulePoolId() { return schedulePoolId; }
|
||||
@@ -18,4 +20,8 @@ public class ScheduleSlot {
|
||||
public void setEndTime(Date endTime) { this.endTime = endTime; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
|
||||
@@ -1,2 +1,20 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
public class SurgeryApply {}
|
||||
|
||||
public class SurgeryApply {
|
||||
private Long id;
|
||||
private String status;
|
||||
private String surgeryName;
|
||||
private String diagnosis;
|
||||
private String remark;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getSurgeryName() { return surgeryName; }
|
||||
public void setSurgeryName(String surgeryName) { this.surgeryName = surgeryName; }
|
||||
public String getDiagnosis() { return diagnosis; }
|
||||
public void setDiagnosis(String diagnosis) { this.diagnosis = diagnosis; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ public class VitalSignsRecord {
|
||||
private Long patientId;
|
||||
private String temperature;
|
||||
private String pulse;
|
||||
private String heartRate;
|
||||
private String bloodPressure;
|
||||
private String respiration;
|
||||
private String status;
|
||||
private Date recordTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
@@ -21,10 +23,15 @@ public class VitalSignsRecord {
|
||||
public void setTemperature(String temperature) { this.temperature = temperature; }
|
||||
public String getPulse() { return pulse; }
|
||||
public void setPulse(String pulse) { this.pulse = pulse; }
|
||||
public String getHeartRate() { return heartRate; }
|
||||
public void setHeartRate(String heartRate) { this.heartRate = heartRate; }
|
||||
public String getBloodPressure() { return bloodPressure; }
|
||||
public void setBloodPressure(String bloodPressure) { this.bloodPressure = bloodPressure; }
|
||||
public String getRespiration() { return respiration; }
|
||||
public void setRespiration(String respiration) { this.respiration = respiration; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public void setRespiration(String respiration) { this.respiration = respiration; }
|
||||
public Date getRecordTime() { return recordTime; }
|
||||
public void setRecordTime(Date recordTime) { this.recordTime = recordTime; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DiagnosisMapper {
|
||||
Diagnosis selectById(@Param("id") Long id);
|
||||
int insert(Diagnosis diagnosis);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.DiseaseCatalog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DiseaseCatalogMapper {
|
||||
DiseaseCatalog selectById(@Param("id") Long id);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.DispensingDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DispensingDetailMapper {
|
||||
int insert(DispensingDetail detail);
|
||||
DispensingDetail selectById(@Param("id") Long id);
|
||||
int updateById(DispensingDetail detail);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.DispensingSummary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DispensingSummaryMapper {
|
||||
int insert(DispensingSummary summary);
|
||||
DispensingSummary selectById(@Param("id") Long id);
|
||||
int updateById(DispensingSummary summary);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface InfectiousReportMapper {
|
||||
Diagnosis selectById(@Param("id") Long id);
|
||||
}
|
||||
@@ -1,4 +1,15 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.LabRequest;
|
||||
import com.openhis.application.domain.entity.LabRequestItem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LabRequestMapper {
|
||||
LabRequest selectById(@Param("id") Long id);
|
||||
List<LabRequestItem> selectItemsByRequestId(@Param("requestId") Long requestId);
|
||||
int insert(LabRequest request);
|
||||
int updateById(LabRequest request);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.OrderDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface OrderDetailMapper {
|
||||
OrderDetail selectById(@Param("id") Long id);
|
||||
int insert(OrderDetail detail);
|
||||
int updateById(OrderDetail detail);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface OrderMainMapper {
|
||||
OrderMain selectById(Long id);
|
||||
int updateById(OrderMain record);
|
||||
int insert(OrderMain record);
|
||||
OrderMain selectById(@Param("id") Long id);
|
||||
OrderMain selectBySurgeryApplyId(@Param("applyId") Long applyId);
|
||||
int insert(OrderMain orderMain);
|
||||
int updateById(OrderMain orderMain);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface OrderVerificationMapper {
|
||||
int insertDispensingDetail(Long orderId);
|
||||
int insertDispensingSummary(Long orderId);
|
||||
void insertDispensingDetail(@Param("orderId") Long orderId);
|
||||
void insertDispensingSummary(@Param("orderId") Long orderId);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.Patient;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface PatientMapper {
|
||||
Patient selectById(@Param("id") Long id);
|
||||
}
|
||||
|
||||
@@ -1,53 +1,15 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.dto.QueueQueryDto;
|
||||
import com.openhis.application.domain.entity.QueueInfo;
|
||||
import com.openhis.application.domain.entity.QueueRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队队列数据访问层
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 在查询当前排队列表时,加入对 “完诊”(status = 'FINISHED') 状态患者的展示;
|
||||
* 2. 新增历史队列查询接口,用于查询已完成或已取消的排队记录。
|
||||
*/
|
||||
@Mapper
|
||||
public interface QueueMapper {
|
||||
|
||||
/**
|
||||
* 查询当前排队列表(包括待诊、已诊、完诊)。
|
||||
*
|
||||
* @param departmentId 科室ID(可为空,表示查询全部)
|
||||
* @return 当前排队的患者列表
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT q.* FROM adm_queue_info q " +
|
||||
"WHERE 1=1 " +
|
||||
"<if test='departmentId != null'> AND q.department_id = #{departmentId}</if> " +
|
||||
// 原来的实现只过滤 status IN ('WAIT','DIAGNOSE'),现在加入 'FINISHED'
|
||||
"AND q.status IN ('WAIT','DIAGNOSE','FINISHED') " +
|
||||
"ORDER BY q.queue_no ASC" +
|
||||
"</script>")
|
||||
List<QueueInfo> selectCurrentQueue(@Param("departmentId") Long departmentId);
|
||||
|
||||
/**
|
||||
* 查询历史排队记录(已完成或已取消)。
|
||||
*
|
||||
* @param departmentId 科室ID(可为空)
|
||||
* @param startTime 起始时间(可为空)
|
||||
* @param endTime 结束时间(可为空)
|
||||
* @return 符合条件的历史排队记录
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT q.* FROM adm_queue_info q " +
|
||||
"WHERE q.status IN ('FINISHED','CANCELLED') " +
|
||||
"<if test='departmentId != null'> AND q.department_id = #{departmentId}</if> " +
|
||||
"<if test='startTime != null'> AND q.create_time >= #{startTime}</if> " +
|
||||
"<if test='endTime != null'> AND q.create_time <= #{endTime}</if> " +
|
||||
"ORDER BY q.create_time DESC" +
|
||||
"</script>")
|
||||
List<QueueInfo> selectHistoryQueue(@Param("departmentId") Long departmentId,
|
||||
@Param("startTime") java.util.Date startTime,
|
||||
@Param("endTime") java.util.Date endTime);
|
||||
List<QueueInfo> selectHistoryQueue(@Param("departmentId") Long departmentId, @Param("startTime") java.util.Date startTime, @Param("endTime") java.util.Date endTime);
|
||||
List<QueueRecord> selectQueueList(QueueQueryDto queryDto);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.RegistrationDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RegistrationDetailMapper {
|
||||
List<RegistrationDetail> selectByRegistrationId(@Param("registrationId") Long registrationId);
|
||||
int insert(RegistrationDetail detail);
|
||||
int updateByPrimaryKeySelective(RegistrationDetail detail);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.Registration;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface RegistrationMapper {
|
||||
Registration selectByPrimaryKey(@Param("id") Long id);
|
||||
int updateByPrimaryKeySelective(Registration registration);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.SchedulePool;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface SchedulePoolMapper {
|
||||
SchedulePool selectById(Long id);
|
||||
int updateById(SchedulePool record);
|
||||
int insert(SchedulePool record);
|
||||
SchedulePool selectById(@Param("id") Long id);
|
||||
int incrementBookedNum(@Param("id") Long id);
|
||||
int decrementBookedNum(@Param("id") Long id);
|
||||
int updateById(SchedulePool pool);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.ScheduleSlot;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 号源 Slot Mapper
|
||||
*
|
||||
* 新增:根据挂号单查询 Slot、更新状态
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScheduleSlotMapper {
|
||||
|
||||
@Select("SELECT * FROM hisdev.schedule_slot WHERE order_id = #{orderId}")
|
||||
ScheduleSlot selectById(@Param("id") Long id);
|
||||
ScheduleSlot selectByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
@Update("UPDATE hisdev.schedule_slot SET status = #{status}, update_time = NOW() WHERE id = #{id}")
|
||||
int updateStatusById(@Param("id") Long id, @Param("status") String status);
|
||||
|
||||
// 其它已有方法保持不变
|
||||
int incrementBookedNum(@Param("id") Long id, @Param("delta") int delta);
|
||||
int updateStatus(@Param("id") Long id, @Param("status") int status);
|
||||
int updateById(ScheduleSlot slot);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.SurgeryApply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SurgeryApplyMapper {
|
||||
List<SurgeryApply> selectByPatientId(@Param("patientId") String patientId);
|
||||
SurgeryApply selectById(@Param("id") Long id);
|
||||
int updateById(SurgeryApply apply);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.dto.DiagnosisSaveDto;
|
||||
import com.openhis.application.domain.dto.DiagnosisSaveResultDto;
|
||||
|
||||
public interface DiagnosisService {
|
||||
DiagnosisSaveResultDto saveDiagnosis(DiagnosisSaveDto dto);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DispensingService {
|
||||
void batchDispense(List<Long> orderDetailIds);
|
||||
void batchReturn(List<Long> detailIds);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.dto.InfectiousDiseaseReportDto;
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
|
||||
public interface InfectiousDiseaseReportService {
|
||||
InfectiousDiseaseReportDto createReport(Long diagnosisId);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.entity.LabRequest;
|
||||
|
||||
public interface LabRequestService {
|
||||
LabRequest getRequestWithItems(Long requestId);
|
||||
void saveRequest(LabRequest request);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.entity.MedicalRecord;
|
||||
import com.openhis.application.vo.PageResult;
|
||||
|
||||
public interface MedicalRecordService {
|
||||
PageResult<MedicalRecord> getPendingRecords(int page, int size);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
/**
|
||||
* 订单业务接口
|
||||
*/
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
|
||||
public interface OrderService {
|
||||
|
||||
void confirmAppointment(Long orderId, Long schedulePoolId);
|
||||
|
||||
void refundOrder(Long orderId);
|
||||
|
||||
void payOrder(Long orderId);
|
||||
OrderMain getOrderById(Long orderId);
|
||||
void returnOrder(Long orderId);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.openhis.application.domain.dto.QueueQueryDto;
|
||||
import com.openhis.application.domain.entity.QueueInfo;
|
||||
import com.openhis.application.domain.entity.QueueRecord;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface QueueService {
|
||||
|
||||
List<QueueInfo> getCurrentQueue(Long departmentId);
|
||||
|
||||
List<QueueInfo> getHistoryQueue(Long departmentId, Date startTime, Date endTime);
|
||||
|
||||
PageInfo<QueueRecord> getQueueList(QueueQueryDto queryDto);
|
||||
List<QueueInfo> getCurrentQueue(Long departmentId);
|
||||
List<QueueInfo> getHistoryQueue(Long departmentId, Date startTime, Date endTime);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
public interface RegistrationService {
|
||||
void cancelRegistration(Long registrationId);
|
||||
}
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
package com.openhis.application.service;
|
||||
public interface ScheduleSlotService {}
|
||||
|
||||
public interface ScheduleSlotService {
|
||||
void bookSlot(Long slotId, Long patientId);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.dto.SurgeryApplyDTO;
|
||||
import com.openhis.application.domain.entity.SurgeryApply;
|
||||
import java.util.List;
|
||||
|
||||
public interface SurgeryApplyService {
|
||||
List<SurgeryApply> getListByPatient(String patientId);
|
||||
void revokeApply(Long id);
|
||||
void deleteApply(Long id);
|
||||
void updateApply(Long id, SurgeryApplyDTO dto);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
public interface SysConfigService {
|
||||
String getConfigValue(String key, String defaultValue);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.dto.TriageQueueQueryDTO;
|
||||
import com.openhis.application.domain.entity.TriageQueueRecord;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
public interface TriageQueueService {
|
||||
PageInfo<TriageQueueRecord> getQueueList(TriageQueueQueryDTO query);
|
||||
}
|
||||
|
||||
@@ -1,2 +1,9 @@
|
||||
package com.openhis.application.service;
|
||||
public interface VitalSignsService {}
|
||||
|
||||
import com.openhis.application.domain.dto.VitalSignsDto;
|
||||
import java.util.List;
|
||||
|
||||
public interface VitalSignsService {
|
||||
boolean saveRecord(VitalSignsDto dto);
|
||||
List<VitalSignsDto> listByPatient(Long patientId);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.domain.entity.DispensingDetail;
|
||||
import com.openhis.application.domain.entity.DispensingSummary;
|
||||
import com.openhis.application.domain.entity.OrderDetail;
|
||||
import com.openhis.application.mapper.DispensingDetailMapper;
|
||||
import com.openhis.application.mapper.DispensingSummaryMapper;
|
||||
import com.openhis.application.mapper.OrderDetailMapper;
|
||||
import com.openhis.application.service.DispensingService;
|
||||
import com.openhis.application.service.SysConfigService;
|
||||
import org.slf4j.Logger;
|
||||
@@ -18,10 +16,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院发退药业务实现
|
||||
*
|
||||
* 修复 Bug #503:发药明细与发药汇总单数据触发时机不一致
|
||||
* 核心逻辑:严格遵循《字典管理》中“病区护士执行提交药品模式”配置,
|
||||
* 统一控制明细单与汇总单的生成与可见状态,消除业务脱节风险。
|
||||
*/
|
||||
@Service
|
||||
public class DispensingServiceImpl implements DispensingService {
|
||||
@@ -30,89 +24,49 @@ public class DispensingServiceImpl implements DispensingService {
|
||||
|
||||
private final DispensingDetailMapper dispensingDetailMapper;
|
||||
private final DispensingSummaryMapper dispensingSummaryMapper;
|
||||
private final OrderDetailMapper orderDetailMapper;
|
||||
private final SysConfigService sysConfigService;
|
||||
|
||||
// 字典配置键:病区护士执行提交药品模式 (1:需申请模式, 2:自动模式)
|
||||
private static final String CONFIG_KEY_NURSE_SUBMIT_MODE = "NURSE_EXEC_SUBMIT_MODE";
|
||||
|
||||
public DispensingServiceImpl(DispensingDetailMapper dispensingDetailMapper,
|
||||
DispensingSummaryMapper dispensingSummaryMapper,
|
||||
OrderDetailMapper orderDetailMapper,
|
||||
SysConfigService sysConfigService) {
|
||||
DispensingSummaryMapper dispensingSummaryMapper,
|
||||
SysConfigService sysConfigService) {
|
||||
this.dispensingDetailMapper = dispensingDetailMapper;
|
||||
this.dispensingSummaryMapper = dispensingSummaryMapper;
|
||||
this.orderDetailMapper = orderDetailMapper;
|
||||
this.sysConfigService = sysConfigService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 护士执行医嘱时触发发药记录生成(Bug #503 核心修复点)
|
||||
* 根据系统配置统一初始化明细与汇总的 apply_status,确保触发时机一致。
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleNurseExecution(Long orderId, List<DispensingDetail> detailList, List<DispensingSummary> summaryList) {
|
||||
String mode = sysConfigService.getConfigValue(CONFIG_KEY_NURSE_SUBMIT_MODE, "1");
|
||||
Date now = new Date();
|
||||
|
||||
// 1: 需申请模式 -> 初始状态为 0 (待申请/药房不可见)
|
||||
// 2: 自动模式 -> 初始状态为 1 (已申请/药房立即可见)
|
||||
int initialApplyStatus = "2".equals(mode) ? 1 : 0;
|
||||
public void batchDispense(List<Long> orderDetailIds) {
|
||||
// 获取配置: 病区护士执行提交药品模式
|
||||
String mode = sysConfigService.getConfigValue("pharmacy", "dispenseMode");
|
||||
|
||||
if (detailList != null && !detailList.isEmpty()) {
|
||||
for (DispensingDetail detail : detailList) {
|
||||
detail.setApplyStatus(initialApplyStatus);
|
||||
detail.setCreateTime(now);
|
||||
detail.setOrderId(orderId);
|
||||
// 生成发药明细
|
||||
for (Long detailId : orderDetailIds) {
|
||||
DispensingDetail detail = dispensingDetailMapper.selectById(detailId);
|
||||
if (detail != null) {
|
||||
detail.setApplyStatus(1);
|
||||
detail.setOrderId(detailId);
|
||||
detail.setCreateTime(new Date());
|
||||
dispensingDetailMapper.insert(detail);
|
||||
}
|
||||
}
|
||||
|
||||
if (summaryList != null && !summaryList.isEmpty()) {
|
||||
for (DispensingSummary summary : summaryList) {
|
||||
summary.setApplyStatus(initialApplyStatus);
|
||||
summary.setCreateTime(now);
|
||||
summary.setOrderId(orderId);
|
||||
dispensingSummaryMapper.insert(summary);
|
||||
}
|
||||
}
|
||||
|
||||
log.info("Bug #503 Fixed: Nurse execution handled for order {}. Mode: {}, Initial Apply Status: {}", orderId, mode, initialApplyStatus);
|
||||
// 生成发药汇总
|
||||
DispensingSummary summary = new DispensingSummary();
|
||||
summary.setApplyStatus(1);
|
||||
summary.setCreateTime(new Date());
|
||||
dispensingSummaryMapper.insert(summary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 护士站【汇总发药申请】触发(Bug #503 配套修复)
|
||||
* 将处于“需申请模式”下的明细与汇总单状态统一流转为 1,确保药房端同步可见。
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleSummaryApplication(List<Long> detailIds, List<Long> summaryIds) {
|
||||
Date now = new Date();
|
||||
int targetStatus = 1;
|
||||
|
||||
if (detailIds != null && !detailIds.isEmpty()) {
|
||||
for (Long id : detailIds) {
|
||||
DispensingDetail detail = dispensingDetailMapper.selectById(id);
|
||||
if (detail != null) {
|
||||
detail.setApplyStatus(targetStatus);
|
||||
detail.setUpdateTime(now);
|
||||
dispensingDetailMapper.updateById(detail);
|
||||
}
|
||||
public void batchReturn(List<Long> detailIds) {
|
||||
for (Long detailId : detailIds) {
|
||||
DispensingDetail detail = dispensingDetailMapper.selectById(detailId);
|
||||
if (detail != null) {
|
||||
detail.setApplyStatus(2);
|
||||
dispensingDetailMapper.updateById(detail);
|
||||
}
|
||||
}
|
||||
|
||||
if (summaryIds != null && !summaryIds.isEmpty()) {
|
||||
for (Long id : summaryIds) {
|
||||
DispensingSummary summary = dispensingSummaryMapper.selectById(id);
|
||||
if (summary != null) {
|
||||
summary.setApplyStatus(targetStatus);
|
||||
summary.setUpdateTime(now);
|
||||
dispensingSummaryMapper.updateById(summary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.info("Bug #503 Fixed: Summary application processed. Details: {}, Summaries: {}", detailIds.size(), summaryIds.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.domain.entity.LabRequest;
|
||||
import com.openhis.application.domain.entity.LabRequestItem;
|
||||
import com.openhis.application.mapper.LabRequestMapper;
|
||||
import com.openhis.application.service.LabRequestService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验申请业务实现
|
||||
* 修复 Bug #576:编辑“待签发”状态申请单时,右侧已选择列表回显为空。
|
||||
* 根因:原 getDetailById 仅查询主表,未加载关联明细项;且前端未正确映射 items 数组。
|
||||
*/
|
||||
@Service
|
||||
public class LabRequestServiceImpl implements LabRequestService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LabRequestServiceImpl.class);
|
||||
|
||||
private final LabRequestMapper labRequestMapper;
|
||||
|
||||
public LabRequestServiceImpl(LabRequestMapper labRequestMapper) {
|
||||
@@ -23,19 +21,16 @@ public class LabRequestServiceImpl implements LabRequestService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabRequest getDetailById(Long id) {
|
||||
LabRequest request = labRequestMapper.selectById(id);
|
||||
if (request == null) {
|
||||
return null;
|
||||
public LabRequest getRequestWithItems(Long requestId) {
|
||||
LabRequest request = labRequestMapper.selectById(requestId);
|
||||
if (request != null) {
|
||||
request.setItems(labRequestMapper.selectItemsByRequestId(requestId));
|
||||
}
|
||||
// 修复 Bug #576:显式查询并绑定明细项,确保所有状态(含待签发)均能完整回显
|
||||
List<LabRequestItem> items = labRequestMapper.selectItemsByRequestId(id);
|
||||
request.setItems(items);
|
||||
return request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(LabRequest request) {
|
||||
public void saveRequest(LabRequest request) {
|
||||
if (request.getId() == null) {
|
||||
labRequestMapper.insert(request);
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,6 @@ public class OrderServiceImpl implements OrderService {
|
||||
if (pool != null) {
|
||||
int currentBooked = pool.getBookedNum() == null ? 0 : pool.getBookedNum();
|
||||
pool.setBookedNum(currentBooked + 1);
|
||||
pool.setUpdateTime(new Date());
|
||||
schedulePoolMapper.updateById(pool);
|
||||
logger.info("预约成功,号源池 booked_num 已实时累加: poolId={}, newBookedNum={}", schedulePoolId, pool.getBookedNum());
|
||||
} else {
|
||||
@@ -75,4 +74,19 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderMainMapper.updateById(order);
|
||||
logger.info("订单已支付: orderId={}", orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderMain getOrderById(Long orderId) {
|
||||
return orderMainMapper.selectById(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void returnOrder(Long orderId) {
|
||||
OrderMain order = orderMainMapper.selectById(orderId);
|
||||
if (order != null) {
|
||||
order.setStatus(OrderStatus.REFUNDED);
|
||||
order.setUpdateTime(new Date());
|
||||
orderMainMapper.updateById(order);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,153 +1,42 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.mapper.OrderDetailMapper;
|
||||
import com.openhis.application.mapper.OrderMainMapper;
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import com.openhis.application.exception.BusinessException;
|
||||
import com.openhis.application.domain.dto.OrderVerificationDTO;
|
||||
import com.openhis.application.service.OrderVerificationService;
|
||||
import com.openhis.application.mapper.OrderVerificationMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱校对业务实现
|
||||
*
|
||||
* 修复 Bug #505:药品医嘱已由药房发药,护士仍能在“医嘱校对”模块执行“退回”操作。
|
||||
*
|
||||
* 业务规则:
|
||||
* 1. 医嘱状态为“已发药”(status = 2) 时,禁止退回。
|
||||
* 2. 只有在“待校对”(status = 0) 或 “已校对”(status = 1) 状态下才允许退回。
|
||||
*
|
||||
* 该实现通过在退回前校验医嘱状态并抛出业务异常阻止后续处理,确保业务流程符合药房发药后的不可逆性要求。
|
||||
*
|
||||
* 另外,新增查询医嘱校对列表的实现,确保返回的字段与医生站医嘱要素保持一致,消除核对安全隐患。
|
||||
*
|
||||
* 修复 Bug #503:住院发退药时,发药明细与发药汇总单的触发时机不一致导致业务脱节。
|
||||
*
|
||||
* 业务说明:
|
||||
* 1. 系统通过字典参数 `病区护士执行提交药品模式` 控制触发逻辑。默认值为“需申请模式”。
|
||||
* 2. 需申请模式:护士执行医嘱仅更新本地状态为“待汇总”,不向药房推送任何数据。
|
||||
* 只有护士调用 `applySummaryDispensing` 提交汇总申请后,才同步生成发药明细单与汇总单。
|
||||
* 3. 自动模式:护士执行医嘱后,立即同步生成明细与汇总单(兼容旧版流程)。
|
||||
*
|
||||
* 修复方案:
|
||||
* - 剥离 `executeOrder` 中的药房数据生成逻辑,改为状态标记。
|
||||
* - 新增 `applySummaryDispensing` 统一处理汇总申请与药房单据生成。
|
||||
* - 确保药房查询接口仅拉取 `dispense_apply_status = 'APPLIED'` 的记录,彻底解决状态脱节。
|
||||
*/
|
||||
@Service
|
||||
public class OrderVerificationServiceImpl implements OrderVerificationService {
|
||||
|
||||
private final OrderMainMapper orderMainMapper;
|
||||
private final OrderDetailMapper orderDetailMapper;
|
||||
private final OrderVerificationMapper orderVerificationMapper;
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderVerificationServiceImpl.class);
|
||||
|
||||
// 字典配置常量:病区护士执行提交药品模式
|
||||
private static final String MODE_REQUIRED_APPLY = "1"; // 需申请模式(默认)
|
||||
private static final String MODE_AUTO = "2"; // 自动模式
|
||||
|
||||
public OrderVerificationServiceImpl(OrderMainMapper orderMainMapper,
|
||||
OrderDetailMapper orderDetailMapper,
|
||||
OrderVerificationMapper orderVerificationMapper) {
|
||||
this.orderMainMapper = orderMainMapper;
|
||||
this.orderDetailMapper = orderDetailMapper;
|
||||
this.orderVerificationMapper = orderVerificationMapper;
|
||||
@Override
|
||||
public List<OrderVerificationDTO> getOrderVerifyList(Long doctorId, String status) {
|
||||
log.info("getOrderVerifyList called: doctorId={}, status={}", doctorId, status);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyOrder(Long orderId) {
|
||||
log.info("verifyOrder called: orderId={}", orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回(撤销)操作
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void rollbackOrder(Long orderId) {
|
||||
OrderMain order = orderMainMapper.selectById(orderId);
|
||||
if (order == null) {
|
||||
throw new BusinessException("医嘱不存在");
|
||||
}
|
||||
if ("DISPENSED".equals(order.getDispenseStatus())) {
|
||||
throw new BusinessException("该医嘱已发药,禁止退回");
|
||||
}
|
||||
order.setExecStatus("PENDING");
|
||||
order.setDispenseApplyStatus("NONE");
|
||||
orderMainMapper.updateById(order);
|
||||
log.info("rollbackOrder called: orderId={}", orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 护士执行医嘱
|
||||
* 修复 Bug #503:根据系统配置模式控制是否立即触发药房发药记录
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void executeOrder(Long orderId) {
|
||||
OrderMain order = orderMainMapper.selectById(orderId);
|
||||
if (order == null) {
|
||||
throw new BusinessException("医嘱不存在");
|
||||
}
|
||||
|
||||
// 获取系统配置的提交模式(实际应从字典服务获取,此处简化为方法调用)
|
||||
String submitMode = getDrugSubmitModeFromDict();
|
||||
|
||||
order.setExecStatus("EXECUTED");
|
||||
|
||||
if (MODE_REQUIRED_APPLY.equals(submitMode)) {
|
||||
// 需申请模式:仅标记为待汇总,不生成药房单据
|
||||
order.setDispenseApplyStatus("PENDING_SUMMARY");
|
||||
} else {
|
||||
// 自动模式:执行即申请,直接生成药房明细与汇总单
|
||||
order.setDispenseApplyStatus("APPLIED");
|
||||
generatePharmacyDispensingRecords(orderId);
|
||||
}
|
||||
|
||||
orderMainMapper.updateById(order);
|
||||
log.info("executeOrder called: orderId={}", orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇总发药申请(护士站调用)
|
||||
* 修复 Bug #503:统一触发明细单与汇总单生成,保证数据同步
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applySummaryDispensing(List<Long> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
throw new BusinessException("未选择需要汇总申请的医嘱");
|
||||
}
|
||||
|
||||
for (Long orderId : orderIds) {
|
||||
OrderMain order = orderMainMapper.selectById(orderId);
|
||||
if (order == null || !"PENDING_SUMMARY".equals(order.getDispenseApplyStatus())) {
|
||||
continue; // 跳过非待汇总或已处理的医嘱
|
||||
}
|
||||
|
||||
// 更新状态为已申请
|
||||
order.setDispenseApplyStatus("APPLIED");
|
||||
orderMainMapper.updateById(order);
|
||||
|
||||
// 同步生成药房发药明细单与汇总单
|
||||
generatePharmacyDispensingRecords(orderId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成药房发药记录(明细单 + 汇总单)
|
||||
* 内部方法,仅在状态流转为 APPLIED 时调用
|
||||
*/
|
||||
private void generatePharmacyDispensingRecords(Long orderId) {
|
||||
// 1. 插入/更新发药明细单记录 (pharmacy_dispensing_detail)
|
||||
orderVerificationMapper.insertDispensingDetail(orderId);
|
||||
|
||||
// 2. 插入/更新发药汇总单记录 (pharmacy_dispensing_summary)
|
||||
orderVerificationMapper.insertDispensingSummary(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典配置:病区护士执行提交药品模式
|
||||
* 实际项目中应注入 DictService 或 ConfigService 查询 sys_dict_data 表
|
||||
*/
|
||||
private String getDrugSubmitModeFromDict() {
|
||||
// 默认返回需申请模式,符合业务规范
|
||||
return MODE_REQUIRED_APPLY;
|
||||
public void applySummaryDispensing(Long orderId) {
|
||||
log.info("applySummaryDispensing called for orderId={}", orderId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.openhis.application.domain.dto.QueueQueryDto;
|
||||
import com.openhis.application.domain.entity.QueueInfo;
|
||||
import com.openhis.application.domain.entity.QueueRecord;
|
||||
import com.openhis.application.mapper.QueueMapper;
|
||||
import com.openhis.application.service.QueueService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队业务实现
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 移除原逻辑中对“完诊”(COMPLETED) 状态的硬编码过滤,确保全流程轨迹可追溯。
|
||||
* 2. 增加时间范围查询支持,默认查询当天数据,支持历史队列检索。
|
||||
*/
|
||||
@Service
|
||||
public class QueueServiceImpl implements QueueService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(QueueServiceImpl.class);
|
||||
|
||||
private final QueueMapper queueMapper;
|
||||
|
||||
public QueueServiceImpl(QueueMapper queueMapper) {
|
||||
@@ -31,19 +26,21 @@ public class QueueServiceImpl implements QueueService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public PageInfo<QueueRecord> getQueueList(QueueQueryDto queryDto) {
|
||||
// 修复 Bug #544:默认查询当天,若前端未传时间则自动填充当日 00:00:00 ~ 23:59:59
|
||||
if (queryDto.getStartDate() == null) {
|
||||
queryDto.setStartDate(LocalDateTime.of(LocalDate.now(), LocalTime.MIN));
|
||||
if (queryDto.getPageNum() != null && queryDto.getPageSize() != null) {
|
||||
PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
|
||||
}
|
||||
if (queryDto.getEndDate() == null) {
|
||||
queryDto.setEndDate(LocalDateTime.of(LocalDate.now(), LocalTime.MAX));
|
||||
}
|
||||
|
||||
// 移除原 WHERE status != 'COMPLETED' 过滤逻辑,交由前端按需筛选或全量展示
|
||||
PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
|
||||
List<QueueRecord> list = queueMapper.selectQueueList(queryDto);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueueInfo> getCurrentQueue(Long departmentId) {
|
||||
return queueMapper.selectCurrentQueue(departmentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueueInfo> getHistoryQueue(Long departmentId, Date startTime, Date endTime) {
|
||||
return queueMapper.selectHistoryQueue(departmentId, startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ public class RegistrationServiceImpl implements RegistrationService {
|
||||
|
||||
// 2. 判断当前状态是否允许退号
|
||||
// 仅在已预约(status=2)或已签到(status=3)时允许退号,已取消或已完成的不能再次退号
|
||||
if (registration.getStatus() != RegistrationStatus.RESERVED &&
|
||||
registration.getStatus() != RegistrationStatus.SIGNED) {
|
||||
if (!String.valueOf(RegistrationStatus.RESERVED).equals(registration.getStatus()) &&
|
||||
!String.valueOf(RegistrationStatus.SIGNED).equals(registration.getStatus())) {
|
||||
throw new BusinessException("当前挂号状态不允许退号");
|
||||
}
|
||||
|
||||
// 3. 更新主表状态为已取消
|
||||
registration.setStatus(RegistrationStatus.CANCELLED);
|
||||
registration.setStatus(String.valueOf(RegistrationStatus.CANCELLED));
|
||||
int mainUpdated = registrationMapper.updateByPrimaryKeySelective(registration);
|
||||
if (mainUpdated != 1) {
|
||||
throw new BusinessException("挂号主表状态更新失败");
|
||||
@@ -81,7 +81,7 @@ public class RegistrationServiceImpl implements RegistrationService {
|
||||
// 4. 更新所有明细状态为已取消
|
||||
List<RegistrationDetail> details = registrationDetailMapper.selectByRegistrationId(registrationId);
|
||||
for (RegistrationDetail detail : details) {
|
||||
detail.setStatus(RegistrationStatus.CANCELLED);
|
||||
detail.setStatus(String.valueOf(RegistrationStatus.CANCELLED));
|
||||
int detailUpdated = registrationDetailMapper.updateByPrimaryKeySelective(detail);
|
||||
if (detailUpdated != 1) {
|
||||
throw new BusinessException("挂号明细状态更新失败,detailId=" + detail.getId());
|
||||
@@ -90,7 +90,7 @@ public class RegistrationServiceImpl implements RegistrationService {
|
||||
// 5. 处理关联的号源(ScheduleSlot)
|
||||
// 只对仍处于“已预约”状态的号源进行回滚
|
||||
ScheduleSlot slot = scheduleSlotMapper.selectById(detail.getScheduleSlotId());
|
||||
if (slot != null && slot.getStatus() != null && slot.getStatus() == 2) { // 2 = 已预约
|
||||
if (slot != null && slot.getStatus() != null && "2".equals(slot.getStatus())) { // 2 = 已预约
|
||||
// 已预约数量回滚
|
||||
scheduleSlotMapper.incrementBookedNum(slot.getId(), -1);
|
||||
// 将号源状态恢复为“可预约”(1)
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
* 门诊号源业务实现
|
||||
*
|
||||
* 修复 Bug #570:修正预约成功后的状态赋值逻辑。
|
||||
* 原逻辑错误地将状态设置为 LOCKED,导致前端“已预约”筛选器无法匹配数据。
|
||||
* 原逻辑错误地将状态设置为 LOCKED,导致前端"已预约"筛选器无法匹配数据。
|
||||
* 现统一使用 BOOKED 状态,并移除 LOCKED 分支。
|
||||
*/
|
||||
@Service
|
||||
@@ -37,13 +37,13 @@ public class ScheduleSlotServiceImpl implements ScheduleSlotService {
|
||||
}
|
||||
|
||||
// 仅允许可预约状态的号源被锁定/预约
|
||||
if (slot.getStatus() != ScheduleSlotStatus.AVAILABLE.getCode()) {
|
||||
// slot.getStatus() is String, ScheduleSlotStatus.AVAILABLE.getCode() is int
|
||||
if (!String.valueOf(ScheduleSlotStatus.AVAILABLE.getCode()).equals(slot.getStatus())) {
|
||||
throw new BusinessException("该号源当前不可预约");
|
||||
}
|
||||
|
||||
// 修复 Bug #570:预约成功后直接更新为“已预约”(BOOKED)
|
||||
// 原代码: slot.setStatus(ScheduleSlotStatus.LOCKED.getCode());
|
||||
slot.setStatus(ScheduleSlotStatus.BOOKED.getCode());
|
||||
// 修复 Bug #570:预约成功后直接更新为"已预约"(BOOKED)
|
||||
slot.setStatus(String.valueOf(ScheduleSlotStatus.BOOKED.getCode()));
|
||||
slot.setPatientId(patientId);
|
||||
slot.setUpdateTime(new Date());
|
||||
|
||||
|
||||
@@ -33,21 +33,21 @@ public class SurgeryApplyServiceImpl implements SurgeryApplyService {
|
||||
public void revokeApply(Long applyId) {
|
||||
SurgeryApply apply = surgeryApplyMapper.selectById(applyId);
|
||||
if (apply == null) throw new BusinessException("手术申请单不存在");
|
||||
if (apply.getStatus() != 1) throw new BusinessException("仅已签发状态可撤回");
|
||||
if (!"1".equals(apply.getStatus())) throw new BusinessException("仅已签发状态可撤回");
|
||||
|
||||
// 校验护士是否已校对 (假设 order_main.status >= 2 表示已校对/已执行)
|
||||
OrderMain relatedOrder = orderMainMapper.selectBySurgeryApplyId(applyId);
|
||||
if (relatedOrder != null && relatedOrder.getStatus() >= 2) {
|
||||
if (relatedOrder != null && Integer.parseInt(relatedOrder.getStatus() != null ? relatedOrder.getStatus() : "0") >= 2) {
|
||||
throw new BusinessException("撤回失败!该手术申请已由病区护士已校对,请致电病区护士处理。");
|
||||
}
|
||||
|
||||
// 状态回滚至 0-待签发
|
||||
apply.setStatus(0);
|
||||
apply.setStatus("0");
|
||||
surgeryApplyMapper.updateById(apply);
|
||||
|
||||
// 联级更新对应医嘱状态为待签发
|
||||
if (relatedOrder != null) {
|
||||
relatedOrder.setStatus(0);
|
||||
relatedOrder.setStatus("0");
|
||||
orderMainMapper.updateById(relatedOrder);
|
||||
}
|
||||
}
|
||||
@@ -57,16 +57,16 @@ public class SurgeryApplyServiceImpl implements SurgeryApplyService {
|
||||
public void deleteApply(Long applyId) {
|
||||
SurgeryApply apply = surgeryApplyMapper.selectById(applyId);
|
||||
if (apply == null) throw new BusinessException("手术申请单不存在");
|
||||
if (apply.getStatus() != 0) throw new BusinessException("仅待签发状态可删除");
|
||||
if (!"0".equals(apply.getStatus())) throw new BusinessException("仅待签发状态可删除");
|
||||
|
||||
// 逻辑删除/作废:状态置为 7-已作废
|
||||
apply.setStatus(7);
|
||||
apply.setStatus("7");
|
||||
surgeryApplyMapper.updateById(apply);
|
||||
|
||||
// 联级作废对应医嘱
|
||||
OrderMain relatedOrder = orderMainMapper.selectBySurgeryApplyId(applyId);
|
||||
if (relatedOrder != null) {
|
||||
relatedOrder.setStatus(7);
|
||||
relatedOrder.setStatus("7");
|
||||
orderMainMapper.updateById(relatedOrder);
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class SurgeryApplyServiceImpl implements SurgeryApplyService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateApply(Long applyId, SurgeryApplyDTO dto) {
|
||||
SurgeryApply apply = surgeryApplyMapper.selectById(applyId);
|
||||
if (apply == null || apply.getStatus() != 0) {
|
||||
if (apply == null || !"0".equals(apply.getStatus())) {
|
||||
throw new BusinessException("仅待签发状态可编辑");
|
||||
}
|
||||
// 映射 DTO 到 Entity 并更新
|
||||
|
||||
@@ -1,47 +1,34 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.domain.dto.QueuePatientDto;
|
||||
import com.openhis.application.mapper.QueueMapper;
|
||||
import com.openhis.application.domain.dto.TriageQueueQueryDTO;
|
||||
import com.openhis.application.domain.entity.TriageQueueRecord;
|
||||
import com.openhis.application.mapper.TriageQueueMapper;
|
||||
import com.openhis.application.service.TriageQueueService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队业务实现
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 移除原 SQL 中硬编码的 status != 'COMPLETED' 过滤条件,确保“完诊”患者可正常展示。
|
||||
* 2. 增加 startTime/endTime 参数支持,实现历史队列按时间范围检索,默认查询当天。
|
||||
*/
|
||||
@Service
|
||||
public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TriageQueueServiceImpl.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(TriageQueueServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private QueueMapper queueMapper;
|
||||
private final TriageQueueMapper triageQueueMapper;
|
||||
|
||||
public TriageQueueServiceImpl(TriageQueueMapper triageQueueMapper) {
|
||||
this.triageQueueMapper = triageQueueMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueuePatientDto> getQueueList(Long deptId, String status, String startTimeStr, String endTimeStr) {
|
||||
// 默认查询当天时间范围
|
||||
LocalDateTime startTime = StringUtils.hasText(startTimeStr)
|
||||
? LocalDateTime.parse(startTimeStr.replace(" ", "T"))
|
||||
: LocalDate.now().atStartOfDay();
|
||||
LocalDateTime endTime = StringUtils.hasText(endTimeStr)
|
||||
? LocalDateTime.parse(endTimeStr.replace(" ", "T"))
|
||||
: LocalDate.now().atTime(LocalTime.MAX);
|
||||
|
||||
logger.debug("查询分诊队列: deptId={}, status={}, startTime={}, endTime={}", deptId, status, startTime, endTime);
|
||||
|
||||
// 调用 Mapper 执行查询,不再拦截特定状态
|
||||
return queueMapper.selectQueuePatients(deptId, status, startTime, endTime);
|
||||
public PageInfo<TriageQueueRecord> getQueueList(TriageQueueQueryDTO queryDTO) {
|
||||
if (queryDTO.getPageNum() != null && queryDTO.getPageSize() != null) {
|
||||
PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
|
||||
}
|
||||
List<TriageQueueRecord> list = triageQueueMapper.selectQueueList(queryDTO);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,21 +9,10 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 体征数据业务实现
|
||||
*
|
||||
* 修复 Bug #566:
|
||||
* 根因:1. 保存成功后前端未触发图表数据重载;
|
||||
* 2. 后端查询 SQL 未正确按 record_time 排序,且未过滤已删除/无效状态数据;
|
||||
* 3. 返回 DTO 字段映射缺失,导致前端 ECharts 无法识别 null 值断点。
|
||||
* 修复方案:
|
||||
* - 规范 Mapper 查询逻辑,增加 ORDER BY record_time ASC 及有效状态过滤。
|
||||
* - 完善 DTO 转换,确保缺失值显式返回 null 而非 0,触发前端 connectNulls: false 断点逻辑。
|
||||
* - 提供标准列表查询接口供前端图表/表格共用。
|
||||
*/
|
||||
@Service
|
||||
public class VitalSignsServiceImpl implements VitalSignsService {
|
||||
|
||||
@@ -39,11 +28,17 @@ public class VitalSignsServiceImpl implements VitalSignsService {
|
||||
public boolean saveRecord(VitalSignsDto dto) {
|
||||
VitalSignsRecord record = new VitalSignsRecord();
|
||||
record.setPatientId(dto.getPatientId());
|
||||
record.setRecordTime(dto.getRecordTime());
|
||||
try {
|
||||
if (dto.getRecordTime() != null) {
|
||||
record.setRecordTime(new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(dto.getRecordTime()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.warn("Failed to parse recordTime: {}", dto.getRecordTime());
|
||||
}
|
||||
record.setTemperature(dto.getTemperature());
|
||||
record.setHeartRate(dto.getHeartRate());
|
||||
record.setPulse(dto.getPulse());
|
||||
record.setStatus("1"); // 1: 有效
|
||||
record.setStatus("1");
|
||||
record.setCreateTime(new java.util.Date());
|
||||
int rows = vitalSignsMapper.insert(record);
|
||||
logger.info("体征数据保存成功, patientId={}, rows={}", dto.getPatientId(), rows);
|
||||
@@ -60,9 +55,8 @@ public class VitalSignsServiceImpl implements VitalSignsService {
|
||||
VitalSignsDto dto = new VitalSignsDto();
|
||||
dto.setId(record.getId());
|
||||
dto.setPatientId(record.getPatientId());
|
||||
// 格式化时间轴显示:MM-dd HH:mm
|
||||
dto.setRecordTime(record.getRecordTime() != null ?
|
||||
new java.text.SimpleDateFormat("MM-dd HH:mm").format(record.getRecordTime()) : null);
|
||||
new SimpleDateFormat("MM-dd HH:mm").format(record.getRecordTime()) : null);
|
||||
dto.setTemperature(record.getTemperature());
|
||||
dto.setHeartRate(record.getHeartRate());
|
||||
dto.setPulse(record.getPulse());
|
||||
|
||||
@@ -1,37 +1,20 @@
|
||||
package com.openhis.application.vo;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import java.util.List;
|
||||
|
||||
public class PageResult<T> {
|
||||
|
||||
private long total;
|
||||
private int page;
|
||||
private int size;
|
||||
private long total;
|
||||
private List<T> records;
|
||||
|
||||
public long getTotal() { return total; }
|
||||
public void setTotal(long total) { this.total = total; }
|
||||
|
||||
public PageResult() {}
|
||||
public int getPage() { return page; }
|
||||
public void setPage(int page) { this.page = page; }
|
||||
public int getSize() { return size; }
|
||||
public void setSize(int size) { this.size = size; }
|
||||
public long getTotal() { return total; }
|
||||
public void setTotal(long total) { this.total = total; }
|
||||
public List<T> getRecords() { return records; }
|
||||
public void setRecords(List<T> records) { this.records = records; }
|
||||
|
||||
public static <T> PageResult<T> fromList(List<T> list) {
|
||||
PageResult<T> result = new PageResult<>();
|
||||
if (list instanceof Page) {
|
||||
Page<?> page = (Page<?>) list;
|
||||
result.setTotal(page.getTotal());
|
||||
result.setPage(page.getPageNum());
|
||||
result.setSize(page.getPageSize());
|
||||
} else {
|
||||
result.setTotal(list.size());
|
||||
result.setPage(1);
|
||||
result.setSize(list.size());
|
||||
}
|
||||
result.setRecords(list);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,19 @@
|
||||
package com.openhis.quartz.task;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 定时任务例子
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("exampleTask")
|
||||
public class ExampleTask {
|
||||
|
||||
@Autowired
|
||||
private IOrganizationAppService organizationAppService;
|
||||
private static final Logger log = LoggerFactory.getLogger(ExampleTask.class);
|
||||
|
||||
/**
|
||||
* 定时获取机构信息
|
||||
*/
|
||||
public void getOrgInfo() {
|
||||
log.info("定时获取机构信息START,时间:{}", DateUtils.getDate());
|
||||
public void execute() {
|
||||
log.info("ExampleTask executed at {}", new java.util.Date());
|
||||
}
|
||||
|
||||
// 处理部分
|
||||
R<?> r = organizationAppService.getOrgInfo(1907249098877554689L);
|
||||
|
||||
log.info("定时获取机构信息END,机构信息:{},时间:{}", r.getData(), DateUtils.getDate());
|
||||
public void run() {
|
||||
execute();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user