|
|
@@ -0,0 +1,913 @@
|
|
|
+package org.thyy.threeone.service;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.date.DatePattern;
|
|
|
+import cn.hutool.core.date.DateUnit;
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import lombok.Getter;
|
|
|
+import lombok.Setter;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.thyy.threeone.dao.EmrPatientDao;
|
|
|
+import org.thyy.threeone.dao.InPatientDao;
|
|
|
+import org.thyy.threeone.entity.Insutype;
|
|
|
+import org.thyy.threeone.entity.PatientInfo;
|
|
|
+import org.thyy.threeone.entity.TReqSurgicalDiag;
|
|
|
+import org.thyy.threeone.entity.emr.EmrAuditDetail;
|
|
|
+import org.thyy.threeone.entity.emr.EmrPatientData;
|
|
|
+import org.thyy.threeone.entity.emr.EmrProgressNote;
|
|
|
+import org.thyy.threeone.entity.updateTrinity.*;
|
|
|
+import org.thyy.threeone.entity.yz.ZyZkList;
|
|
|
+import org.thyy.utils.DateUtil;
|
|
|
+import org.thyy.utils.StringUtil;
|
|
|
+import org.thyy.utils.emr.EmrJsonUtils;
|
|
|
+import org.thyy.utils.entity.CodeName;
|
|
|
+import org.thyy.threeone.entity.UserInfo;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
+import java.util.function.Consumer;
|
|
|
+
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+public class InPatientServer {
|
|
|
+
|
|
|
+ private final InPatientDao dao = SpringUtil.getBean(InPatientDao.class);
|
|
|
+ private final EmrPatientDao emrDao = SpringUtil.getBean(EmrPatientDao.class);
|
|
|
+
|
|
|
+ private final Map<String, UserInfo> userInfoMap = new HashMap<>();
|
|
|
+ private final Map<String, String> deptMap = new HashMap<>();
|
|
|
+
|
|
|
+ private static final String securityLevel = "000";
|
|
|
+ private static final String orgCode = "H43010500370";
|
|
|
+ private final String orgBatchNo = orgCode + "-" + DateUtil.format(new Date(), "yyyyMMdd") + "-01-1";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 住院使用患者的住院次数加住院号下划线拼接
|
|
|
+ */
|
|
|
+ @Setter
|
|
|
+ private List<String> patList;
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private String startDate = DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN);
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private String endDate = DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN);
|
|
|
+
|
|
|
+ private String patNo;
|
|
|
+ private Integer times;
|
|
|
+ private TbIpAdmissionRecord currentAdmissionRecord;
|
|
|
+
|
|
|
+
|
|
|
+ @Getter
|
|
|
+ private Map<String, Map<String, Object>> patData = new HashMap<>();
|
|
|
+
|
|
|
+ private PatientInfo patInfoCurrent;
|
|
|
+
|
|
|
+
|
|
|
+ private void getUserInfo(String key, Consumer<UserInfo> consumer) {
|
|
|
+ if (userInfoMap.containsKey(key)) {
|
|
|
+ if (userInfoMap.get(key) != null) {
|
|
|
+ consumer.accept(userInfoMap.get(key));
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ UserInfo info = dao.getUserInfo(key);
|
|
|
+ userInfoMap.put(key, info);
|
|
|
+ if (info != null) {
|
|
|
+ consumer.accept(info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private String getUserInfoName(String key) {
|
|
|
+ AtomicReference<String> name = new AtomicReference<>("");
|
|
|
+ getUserInfo(key, val -> {
|
|
|
+ name.set(val.getName());
|
|
|
+ });
|
|
|
+ return name.get();
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getDeptName(String key) {
|
|
|
+ if (deptMap.containsKey(key)) {
|
|
|
+ return deptMap.get(key);
|
|
|
+ }
|
|
|
+ String deptName = dao.getDeptName(key);
|
|
|
+ deptMap.put(key, deptName);
|
|
|
+ return deptName;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void init() {
|
|
|
+ currentAdmissionRecord = new TbIpAdmissionRecord();
|
|
|
+ patInfoCurrent = new PatientInfo();
|
|
|
+ patData = new HashMap<>();
|
|
|
+
|
|
|
+ for (String item : patList) {
|
|
|
+ String[] split = item.split("_");
|
|
|
+ patNo = split[0];
|
|
|
+ times = Convert.toInt(split[1]);
|
|
|
+ if (!patData.containsKey(item)) {
|
|
|
+ patData.put(item, new HashMap<>());
|
|
|
+ }
|
|
|
+ patInfoCurrent = dao.getPatientInfo(patNo, times);
|
|
|
+ if (patInfoCurrent == null) {
|
|
|
+ patInfoCurrent = new PatientInfo();
|
|
|
+ } else {
|
|
|
+ getUserInfo(patInfoCurrent.getReferPhysician(), val -> {
|
|
|
+ patInfoCurrent.setReferPhysician(val.getYbCode());
|
|
|
+ patInfoCurrent.setReferPhysicianName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(patInfoCurrent.getChiefDoctorCode(), val -> {
|
|
|
+ patInfoCurrent.setChiefDoctorCode(val.getYbCode());
|
|
|
+ patInfoCurrent.setChiefDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ patInfoCurrent.setDisDeptName(getDeptName(patInfoCurrent.getDisDept()));
|
|
|
+ }
|
|
|
+ currentAdmissionRecord = getTbIpAdmission();
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpAdmissionRecord", getTbIpAdmission());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpAdmissionRecord", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpFirstCourse", getTbIpFirstCourse());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpFirstCourse", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpDailyCourse", getTbIpDailyCourse());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpDailyCourse", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIp24hDischarge", getTbIp24hDischarge());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIp24hDischarge", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIp24hDeath", getTbIp24hDeath());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIp24hDeath", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpDischargeSummary", getTbIpDischargeSummary());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpDischargeSummary", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpTransfer", getTbIpTransfer());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpTransfer", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpDeathInfo", getTbIpDeathInfo());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpDeathInfo", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbIpSurgery", getTbIpSurgery());
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbIpSurgery", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ patData.get(item).put("TbDiagnosisDetail", getTbDiagnosisDetail());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("TbDiagnosisDetail", e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 入院记录表
|
|
|
+ */
|
|
|
+ public TbIpAdmissionRecord getTbIpAdmission() {
|
|
|
+ TbIpAdmissionRecord info = dao.getTbIpAdmissionRecord(patNo, times);
|
|
|
+ info.setAdmDeptName(getDeptName(info.getAdmDeptCode()));
|
|
|
+ info.setWardName(getDeptName(info.getWardNo()));
|
|
|
+
|
|
|
+ getUserInfo(info.getVisitingPhysicianCode(), (userInfo) -> {
|
|
|
+ info.setVisitingPhysicianCode(userInfo.getYbCode());
|
|
|
+ info.setVisitingPhysicianName(userInfo.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getResidentPhysicianCode(), (userInfo) -> {
|
|
|
+ info.setResidentPhysicianCode(userInfo.getYbCode());
|
|
|
+ info.setResidentPhysicianName(userInfo.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "ruyuanjiluzhuanyong");
|
|
|
+ if (emrData != null) {
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ json.getArr("入院诊断", (val) -> {
|
|
|
+ StringBuilder code = new StringBuilder();
|
|
|
+ StringBuilder name = new StringBuilder();
|
|
|
+ String codes = "";
|
|
|
+ for (CodeName codeName : val) {
|
|
|
+ code.append(codeName.getCode()).append("|");
|
|
|
+ name.append(codeName.getName()).append("|");
|
|
|
+ codes = "'" + codeName.getCode() + "',";
|
|
|
+ }
|
|
|
+ codes = codes.substring(0, codes.length() - 1);
|
|
|
+ info.setWesternDiagCode(code.substring(0, code.length() - 1));
|
|
|
+ info.setWesternDiagName(name.toString());
|
|
|
+ Integer infectious = dao.isInfectious(codes);
|
|
|
+ if (infectious > 0) {
|
|
|
+ info.setIsInfectious(0);
|
|
|
+ } else {
|
|
|
+ info.setIsInfectious(1);
|
|
|
+ }
|
|
|
+ patInfoCurrent.setAdmDiagnosisCode(val.getFirst().getCode());
|
|
|
+ patInfoCurrent.setAdmDiagnosisName(val.getFirst().getName());
|
|
|
+ });
|
|
|
+ getUserInfo(info.getDoctorCode(), userInfo -> {
|
|
|
+ info.setDoctorCode(userInfo.getYbCode());
|
|
|
+ info.setDoctorName(userInfo.getName());
|
|
|
+ });
|
|
|
+ json.setObjectByEmrBusiness(info);
|
|
|
+ info.setInpatientTimes(times);
|
|
|
+ info.setValiFlag(emrData.getDelFlag());
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ info.setDischargeDeptName(getDeptName(info.getDischargeDeptCode()));
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+ }
|
|
|
+ info.setIsInfectious(0);
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首次病程
|
|
|
+ */
|
|
|
+ public TbIpFirstCourse getTbIpFirstCourse() {
|
|
|
+ TbIpFirstCourse info = dao.getTbIpFirstCourse(patNo, times);
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "shoucibingchengjilu");
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ info.setRecordId(emrData.getEmrDocumentId());
|
|
|
+ info.setRecordCreateTime(emrData.getCreateDate());
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ info.setChiefComplaint(json.getStr("主诉"));
|
|
|
+ json.setObjectByEmrBusiness(info);
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setValiFlag(emrData.getDelFlag());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ info.setPresentIllnessHis(json.getStr("病例特点"));
|
|
|
+ info.setDiagnosisBasis(json.getStr("诊断依据"));
|
|
|
+ json.getFirstArr("入院诊断", val -> {
|
|
|
+ info.setWmInitalDiagnosisCode(val.getCode());
|
|
|
+ info.setWmInitalDiagnosisName(val.getName());
|
|
|
+ info.setWmDiffDiagnosisCode(val.getCode());
|
|
|
+ info.setWmDiffDiagnosisName(val.getName());
|
|
|
+ });
|
|
|
+ info.setTreatmentPlan(json.getStr("诊疗计划"));
|
|
|
+ getUserInfo(info.getResidentPhysicianId(), (val) -> {
|
|
|
+ info.setResidentPhysicianId(val.getYbCode());
|
|
|
+ info.setResidentPhysicianName(val.getName());
|
|
|
+ });
|
|
|
+ info.setSecurityLevel(securityLevel);
|
|
|
+ info.setValiFlag(1);
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 住院日常病程记录
|
|
|
+ */
|
|
|
+ public List<TbIpDailyCourse> getTbIpDailyCourse() {
|
|
|
+ List<TbIpDailyCourse> rst = new ArrayList<>();
|
|
|
+
|
|
|
+ List<EmrProgressNote> emrProgressNote = emrDao.getEmrProgressNote(patNo, times, startDate, endDate);
|
|
|
+
|
|
|
+ if (emrProgressNote == null || emrProgressNote.isEmpty()) {
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+ TbIpFirstCourse course = dao.getTbIpFirstCourse(patNo, times);
|
|
|
+ getUserInfo(course.getResidentPhysicianId(), (val) -> {
|
|
|
+ course.setResidentPhysicianId(val.getYbCode());
|
|
|
+ course.setResidentPhysicianName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ for (EmrProgressNote item : emrProgressNote) {
|
|
|
+ TbIpDailyCourse bean = BeanUtil.toBean(course, TbIpDailyCourse.class);
|
|
|
+ EmrProgressNote.NoteDataElement note = item.dateElementJson();
|
|
|
+
|
|
|
+ bean.setIdNumber(patInfoCurrent.getIdNumber());
|
|
|
+ bean.setOrgBatchNo(securityLevel);
|
|
|
+ bean.setSecurityLevel("000");
|
|
|
+ bean.setOrgCode(orgCode);
|
|
|
+ bean.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ bean.setPatientId(patNo);
|
|
|
+ bean.setRecordCreateTime(item.getCreationTime());
|
|
|
+ bean.setRecordIid(String.valueOf(item.getId()));
|
|
|
+ bean.setAdmCourse(note.getText());
|
|
|
+ bean.setOrderContent("");
|
|
|
+ bean.setOperationTime(item.getCreationTime());
|
|
|
+ bean.setOperatorId(item.getCreateId());
|
|
|
+ bean.setCreateTime(item.getCreationTime());
|
|
|
+ bean.setValiFlag(1);
|
|
|
+ bean.setUpdateTime(new Date());
|
|
|
+ rst.add(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TbIp24hDischarge getTbIp24hDischarge() {
|
|
|
+ if (patInfoCurrent.getDisDate() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ long between = DateUtil.between(patInfoCurrent.getAdmissDate(), patInfoCurrent.getDisDate(), DateUnit.HOUR);
|
|
|
+ if (between > 24) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
|
|
|
+
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TbIp24hDischarge info = dao.getTbIp24hDischarge(patNo, times);
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ Date birthByIdCard = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
|
|
|
+ info.setAgeYear(Convert.toStr(DateUtil.age(birthByIdCard, emrData.getCreateDate())));
|
|
|
+ info.setAgeMonth(Convert.toStr(DateUtil.getAgeInMonths(birthByIdCard)));
|
|
|
+ info.setMaritalStatusCode("90");
|
|
|
+ json.getFirstArr("婚姻", val -> {
|
|
|
+ switch (val.getCode()) {
|
|
|
+ case "1":
|
|
|
+ info.setMaritalStatusCode("10");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ info.setMaritalStatusCode("20");
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ info.setMaritalStatusCode("30");
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ info.setMaritalStatusCode("40");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ info.setMaritalStatusCode("90");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ info.setOccupationCode(patInfoCurrent.getOccupationCode());
|
|
|
+ info.setInformationReliableFlag(1);
|
|
|
+ info.setAdmissionTime(patInfoCurrent.getAdmissDate());
|
|
|
+ info.setDischargeTime(patInfoCurrent.getDisDate());
|
|
|
+ info.setDischargeOrder(json.getStr("出院医嘱"));
|
|
|
+
|
|
|
+ info.setAdmdiagWmCode(patInfoCurrent.getAdmDiagnosisCode());
|
|
|
+ info.setAdmdiagWmName(patInfoCurrent.getAdmDiagnosisName());
|
|
|
+
|
|
|
+ info.setInformantRelationCode("0");
|
|
|
+ info.setInformationReliableFlag(1);
|
|
|
+ info.setInformantName(info.getPatientName());
|
|
|
+
|
|
|
+
|
|
|
+ getUserInfo(info.getAdmittingDoctorCode(), (val) -> {
|
|
|
+ info.setAdmittingDoctorCode(val.getYbCode());
|
|
|
+ info.setAdmittingDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getResidentDoctorCode(), val -> {
|
|
|
+ info.setResidentDoctorCode(val.getYbCode());
|
|
|
+ info.setResidentDoctorName(val.getName());
|
|
|
+
|
|
|
+ info.setAttendingDoctorCode(val.getYbCode());
|
|
|
+ info.setAttendingDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getChiefDoctorCode(), val -> {
|
|
|
+ info.setChiefDoctorCode(val.getYbCode());
|
|
|
+ info.setChiefDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ json.getFirstArr("出院诊断", val -> {
|
|
|
+ info.setDischDiagWmCode(val.getCode());
|
|
|
+ info.setDischDiagWmName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ PatientInfo dischargeOrder = dao.getDischargeOrder(patNo, times);
|
|
|
+ if (dischargeOrder != null) {
|
|
|
+ getUserInfo(dischargeOrder.getDischargeOrderDoctorCode(), val -> {
|
|
|
+ info.setDischargeOrderDoctorCode(val.getYbCode());
|
|
|
+ info.setDischargeOrderDoctorName(val.getName());
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ getUserInfo(emrData.getCreateId(), val -> {
|
|
|
+ info.setDischargeOrderDoctorCode(val.getYbCode());
|
|
|
+ info.setDischargeOrderDoctorName(val.getName());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ info.setRecordId(emrData.getEmrDocumentId());
|
|
|
+ info.setDischargeOrderTime(json.getDate("出院时间"));
|
|
|
+ info.setDischargeTime(json.getDate("出院时间"));
|
|
|
+ info.setTcmObservation("-");
|
|
|
+ info.setTreatmentPrinciple("-");
|
|
|
+ info.setDischargeCondition("9");
|
|
|
+
|
|
|
+ info.setAdmdiagTcmDiseaseCode(currentAdmissionRecord.getWesternDiagCode());
|
|
|
+ info.setAdmdiagTcmDiseaseName(currentAdmissionRecord.getWesternDiagName());
|
|
|
+ info.setAdmdiagTcmSyndromeCode("-");
|
|
|
+ info.setAdmdiagTcmSyndromeName("-");
|
|
|
+ info.setTreatmentProcess(json.getStr("诊疗经过", "-"));
|
|
|
+ info.setDischDiagTcmDiseaseCode("-");
|
|
|
+ info.setDischDiagTcmDiseaseName("-");
|
|
|
+ info.setDischDiagTcmSyndromeCode("-");
|
|
|
+ info.setDischDiagTcmSyndromeName("-");
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate() == null ? new Date() : emrData.getModifyDate());
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setOperationTime(emrData.getCreateDate());
|
|
|
+ info.setValiFlag(emrData.getDelFlag());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ json.setObjectByEmrBusiness(info);
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 4.5.5 24H内入院死亡记录(TB_IP_24H_DEATH)
|
|
|
+ public TbIp24hDeath getTbIp24hDeath() {
|
|
|
+ if (patInfoCurrent.getDisDate() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ long between = DateUtil.between(patInfoCurrent.getAdmissDate(), patInfoCurrent.getDisDate(), DateUnit.HOUR);
|
|
|
+ if (between > 24) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "siwangjilu");
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TbIp24hDeath info = dao.getTbIp24hDeath(patNo, times);
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ info.setTreatmentProcess(json.getStr("诊疗经过"));
|
|
|
+ info.setCauseOfDeath(info.getTreatmentProcess());
|
|
|
+
|
|
|
+ Date birthByIdCard = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
|
|
|
+ info.setAgeYear(Convert.toStr(DateUtil.age(birthByIdCard, emrData.getCreateDate())));
|
|
|
+ info.setAgeMonth(Convert.toStr(DateUtil.getAgeInMonths(birthByIdCard)));
|
|
|
+ info.setMaritalStatus("90");
|
|
|
+ json.getFirstArr("婚姻", val -> {
|
|
|
+ switch (val.getCode()) {
|
|
|
+ case "1":
|
|
|
+ info.setMaritalStatus("10");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ info.setMaritalStatus("20");
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ info.setMaritalStatus("30");
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ info.setMaritalStatus("40");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ info.setMaritalStatus("90");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ json.getFirstArr("入院诊断", val -> {
|
|
|
+ info.setAdmdiagWmCode(val.getCode());
|
|
|
+ info.setAdmdiagWmName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ getUserInfo(info.getAdmittingDoctorCode(), (val) -> {
|
|
|
+ info.setAdmittingDoctorCode(val.getYbCode());
|
|
|
+ info.setAdmittingDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getResidentDoctorCode(), val -> {
|
|
|
+ info.setResidentDoctorCode(val.getYbCode());
|
|
|
+ info.setResidentDoctorName(val.getName());
|
|
|
+
|
|
|
+ info.setAttendingDoctorCode(val.getYbCode());
|
|
|
+ info.setAttendingDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getChiefDoctorCode(), val -> {
|
|
|
+ info.setChiefDoctorCode(val.getYbCode());
|
|
|
+ info.setChiefDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ json.getFirstArr("出院诊断", val -> {
|
|
|
+ info.setDeathWmCode(val.getCode());
|
|
|
+ info.setDeathWmName(val.getName());
|
|
|
+ });
|
|
|
+ info.setTreatmentProcess(json.getStr("诊疗经过"));
|
|
|
+ info.setCauseOfDeath(info.getTreatmentProcess());
|
|
|
+
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setOperatorTime(emrData.getCreateDate());
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setValiFlag(emrData.getDelFlag());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ info.setAdmissionCondition(json.getStr("入院情况"));
|
|
|
+ info.setRecordId(emrData.getEmrDocumentId());
|
|
|
+ info.setTcmObservation("-");
|
|
|
+ info.setTcmTreatment("-");
|
|
|
+ info.setAdmdiagTcmDiseaseCode("-");
|
|
|
+ info.setAdmdiagTcmDiseaseName("-");
|
|
|
+ info.setDeathTcmSyndromeCode("-");
|
|
|
+ info.setDeathTcmSyndromeName("-");
|
|
|
+ info.setAdmdiagTcmSyndromeCode("-");
|
|
|
+ info.setAdmdiagTcmSyndromeName("-");
|
|
|
+ info.setDeathTcmDiseaseCode("-");
|
|
|
+ info.setDeathTcmDiseaseName("-");
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TbIpDischargeSummary getTbIpDischargeSummary() {
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TbIpDischargeSummary info = dao.getTbIpDischargeSummary(patNo, times);
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ info.setHospitalInsuranceName(Insutype.getName(info.getInsuranceType()));
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ info.setDiagnosisCodeType(1);
|
|
|
+ json.getFirstArr("出院诊断", val -> {
|
|
|
+ info.setPrimaryDiagnosisCode(val.getCode());
|
|
|
+ info.setHospitalDiagnosisName(val.getName());
|
|
|
+ });
|
|
|
+ if (info.getDischargeTime() == null) {
|
|
|
+ info.setDischargeTime(new Date());
|
|
|
+ }
|
|
|
+ long between = DateUtil.between(info.getAdmissionTime(), info.getDischargeTime(), DateUnit.DAY);
|
|
|
+ info.setInpatientDay(Convert.toInt(between));
|
|
|
+ info.setIs24HrAdmDisch(between == 0 ? 1 : 0);
|
|
|
+ info.setDischargeMode(patInfoCurrent.getZyDismissWay());
|
|
|
+ if (info.getDischargeMode() == null) {
|
|
|
+ info.setDischargeMode("9");
|
|
|
+ }
|
|
|
+ String 住院经过 = json.getStr("住院经过");
|
|
|
+ info.setAdmSummery(住院经过);
|
|
|
+ info.setDischargeSummery(住院经过);
|
|
|
+ info.setAdmDiagnosisCode(patInfoCurrent.getAdmDiagnosisCode());
|
|
|
+ info.setAdmDiagnosisName(patInfoCurrent.getAdmDiagnosisName());
|
|
|
+ info.setAuxiliaryObservationResult(currentAdmissionRecord.getStudiesSumm());
|
|
|
+ info.setTreatmentDesc(住院经过);
|
|
|
+ info.setDischargeStatus("9");
|
|
|
+ info.setDischargeCondition(json.getStr("主诉"));
|
|
|
+ info.setOutOrder(json.getStr("出院医嘱"));
|
|
|
+
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setOperationTime(emrData.getCreateDate());
|
|
|
+ info.setValiFlag(emrData.getDelFlag());
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate());
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 11
|
|
|
+ public List<TbIpTransfer> getTbIpTransfer() {
|
|
|
+ List<TbIpTransfer> rst = new ArrayList<>();
|
|
|
+ List<TbIpTransfer> zkNote = dao.getZkNote(patNo, times, startDate, endDate);
|
|
|
+ List<ZyZkList> zkList = dao.getZkList(patNo, times);
|
|
|
+
|
|
|
+ for (int i = 0; i < zkNote.size(); i++) {
|
|
|
+ TbIpTransfer info = zkNote.get(i);
|
|
|
+ EmrProgressNote.NoteDataElement json = JSONUtil.toBean(info.getTreatNote(), EmrProgressNote.NoteDataElement.class);
|
|
|
+ String text = StringUtil.truncateString(json.getText(), 1800);
|
|
|
+
|
|
|
+ info.setCurrDiagWeDiagCode(patInfoCurrent.getAdmDiagnosisCode());
|
|
|
+ info.setCurrDiagWeDiagName(patInfoCurrent.getAdmDiagnosisName());
|
|
|
+
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setRecordId(info.getIptMdtrtSn() + "_" + i);
|
|
|
+ info.setPresentSituation(text);
|
|
|
+ info.setTreatNote(text);
|
|
|
+ info.setChangeMajorPurpose("病情需要");
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ info.setInDiagTreatPlan(text);
|
|
|
+ info.setTransferRecordType(1);
|
|
|
+
|
|
|
+ try {
|
|
|
+ ZyZkList item = zkList.get(i);
|
|
|
+ if (item.getReferPhysician() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ info.setRollOutDate(item.getOpTime());
|
|
|
+ info.setRollOutDeptCode(item.getDeptCode());
|
|
|
+ info.setRollOutDepName(getDeptName(item.getDeptCode()));
|
|
|
+ info.setIntoDeptCode(item.getFDeptCode());
|
|
|
+ info.setIntoDepName(getDeptName(item.getFDeptCode()));
|
|
|
+ info.setIntoDate(item.getOpTime());
|
|
|
+ info.setRollOutDocCode(item.getReferPhysician());
|
|
|
+ info.setRollOutDocName(getUserInfoName(item.getReferPhysician()));
|
|
|
+
|
|
|
+ info.setIntoDocCode(item.getOpId());
|
|
|
+ info.setIntoDocName(getUserInfoName(item.getOpId()));
|
|
|
+ info.setOperatorId(item.getOpId());
|
|
|
+ info.setOperatorTime(item.getOpTime());
|
|
|
+ info.setCreateTime(item.getOpTime());
|
|
|
+ } catch (Exception ignore) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ info.setValiFlag(1);
|
|
|
+
|
|
|
+ info.setUpdateTime(new Date());
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ rst.add(info);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TbIpDeathInfo getTbIpDeathInfo() {
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "siwangjilu");
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TbIpDeathInfo info = dao.getTbIpDeathInfo(patNo, times);
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ info.setTreatmentProcessDesc(json.getStr("病情摘要"));
|
|
|
+ Date deathDt = json.getDate("死亡时间");
|
|
|
+ info.setDeathDt(deathDt == null ? emrData.getCreateDate() : deathDt);
|
|
|
+ json.getFirstArr("出院诊断", val -> {
|
|
|
+ info.setDirectDeathCauseCode(val.getCode());
|
|
|
+ info.setDirectDeathCauseName(val.getName());
|
|
|
+
|
|
|
+ info.setDeathDiagnosisCode(val.getCode());
|
|
|
+ info.setDeathDiagnosisName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ getUserInfo(info.getAttendingDoctorCode(), val -> {
|
|
|
+ info.setAttendingDoctorCode(val.getYbCode());
|
|
|
+ info.setAttendingDoctor(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ info.setAttendingDoctor(currentAdmissionRecord.getDoctorCode());
|
|
|
+ info.setAttendingDoctor(currentAdmissionRecord.getDoctorName());
|
|
|
+ info.setChiefDoctorCode(patInfoCurrent.getChiefDoctorCode());
|
|
|
+ info.setChiefDoctor(patInfoCurrent.getChiefDoctorName());
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setOperationTime(emrData.getCreateDate());
|
|
|
+ info.setValiFlag(1);
|
|
|
+ info.setCreateTime(emrData.getCreateDate());
|
|
|
+ info.setUpdateTime(emrData.getModifyDate() == null ? new Date() : emrData.getModifyDate());
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TbIpSurgery> getTbIpSurgery() {
|
|
|
+ List<TbIpSurgery> rst = dao.getTbIpSurgery(patNo, times);
|
|
|
+ if (rst.isEmpty()) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ for (TbIpSurgery info : rst) {
|
|
|
+ getUserInfo(info.getIpdrCode(), val -> {
|
|
|
+ info.setIpdrName(val.getName());
|
|
|
+ info.setIpdrCode(val.getYbCode());
|
|
|
+ });
|
|
|
+ List<TReqSurgicalDiag> diag = dao.getTReqSurgicalDiag(info.getAppyNo());
|
|
|
+ info.setSelvFlag(getSelvFlag(info.getSelvFlag()));
|
|
|
+ info.setOprnType(getOprnType(info.getOprnType()));
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ if (!diag.isEmpty()) {
|
|
|
+ Optional<TReqSurgicalDiag> tReqSurgicalDiag = diag
|
|
|
+ .stream()
|
|
|
+ .findFirst()
|
|
|
+ .filter(i -> i.getType() == 1 && i.getSort() == 1);
|
|
|
+ if (tReqSurgicalDiag.isPresent()) {
|
|
|
+ info.setOprnOprtCode(tReqSurgicalDiag.get().getCode());
|
|
|
+ info.setOprnOprtName(tReqSurgicalDiag.get().getName());
|
|
|
+ }
|
|
|
+ Optional<TReqSurgicalDiag> firstDiag = diag
|
|
|
+ .stream()
|
|
|
+ .findFirst()
|
|
|
+ .filter(i -> i.getType() == 2 && i.getSort() == 1);
|
|
|
+ if (firstDiag.isPresent()) {
|
|
|
+ info.setBfpnDiagCode(firstDiag.get().getCode());
|
|
|
+ info.setBfpnDiagName(firstDiag.get().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TbDiagnosisDetail> getTbDiagnosisDetail() {
|
|
|
+ List<TbDiagnosisDetail> rst = dao.getTbDiagnosisDetail(patNo, times);
|
|
|
+ for (TbDiagnosisDetail info : rst) {
|
|
|
+
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ info.setRecordId(patNo + "_" + times + "_" + info.getDiagNo());
|
|
|
+
|
|
|
+ info.setDiagTime(new Date());
|
|
|
+ info.setMainDiagFlag("1".equals(info.getDiagNo()) ? 1 : 2);
|
|
|
+ info.setSuspectDiagFlag(0);
|
|
|
+ getUserInfo(info.getDiagDoctorCode(), (val) -> {
|
|
|
+ info.setOperatorId(info.getDiagDoctorCode());
|
|
|
+ info.setDiagDoctorCode(val.getYbCode());
|
|
|
+ info.setDiagDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ info.setInsuranceDiagCode("-");
|
|
|
+ info.setInsuranceDiagName("-");
|
|
|
+ info.setValiFlag(1);
|
|
|
+ info.setUpdateTime(new Date());
|
|
|
+ }
|
|
|
+
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public TbDischargeSummary getTbDischargeSummary() {
|
|
|
+ EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
|
|
|
+ if (emrData == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ EmrJsonUtils json = emrData.jsonUtils2();
|
|
|
+ TbDischargeSummary info = dao.getTbDischargeSummary(patNo, times);
|
|
|
+ Date birth = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
|
|
|
+ int age = DateUtil.age(birth, patInfoCurrent.getAdmissDate());
|
|
|
+ info.setAge(String.valueOf(age));
|
|
|
+ long between = DateUtil.between(info.getAdmissionTime(), info.getDischargeTime(), DateUnit.DAY);
|
|
|
+ info.setHospitalizationDays(between);
|
|
|
+ info.setOutpatientDiagnosisCode(patInfoCurrent.getAdmDiagnosisCode());
|
|
|
+ info.setOutpatientDiagnosisName(patInfoCurrent.getAdmDiagnosisName());
|
|
|
+ info.setAdmissionDiagnosisCode(currentAdmissionRecord.getWesternDiagCode());
|
|
|
+ info.setAdmissionDiagnosisName(currentAdmissionRecord.getWesternDiagName());
|
|
|
+ List<CodeName> disDiag = dao.getDisDiag(patNo, times);
|
|
|
+ if (!disDiag.isEmpty()) {
|
|
|
+ StringBuilder code = new StringBuilder();
|
|
|
+ StringBuilder name = new StringBuilder();
|
|
|
+ for (CodeName codeName : disDiag) {
|
|
|
+ code.append(codeName.getCode()).append("|");
|
|
|
+ name.append(codeName.getName()).append("|");
|
|
|
+ }
|
|
|
+ info.setDischargeDiagnosisCode(code.toString());
|
|
|
+ info.setDischargeDiagnosisName(name.toString());
|
|
|
+ }
|
|
|
+ info.setDischargeCondition(json.getStr("出院情况"));
|
|
|
+ info.setDischargeHpText(emrData.getEmrDataElementStr());
|
|
|
+ info.setDischargeOrders(json.getStr("出院医嘱"));
|
|
|
+
|
|
|
+ info.setAttendingDoctorCode(patInfoCurrent.getReferPhysician());
|
|
|
+ info.setAttendingDoctorName(patInfoCurrent.getReferPhysicianName());
|
|
|
+ info.setResidentDoctorCode(patInfoCurrent.getChiefDoctorCode());
|
|
|
+ info.setResidentDoctorName(patInfoCurrent.getChiefDoctorName());
|
|
|
+ info.setOccupationCode(patInfoCurrent.getOccupationCode());
|
|
|
+
|
|
|
+ info.setAnesthesiaCode("9");
|
|
|
+ info.setAnesthesiaName("其他麻醉方法");
|
|
|
+
|
|
|
+ info.setOutcomeCode("9");
|
|
|
+ info.setOutcomeName("其他");
|
|
|
+
|
|
|
+ info.setTcmFlag(0);
|
|
|
+ info.setSurgeryFlag(0);
|
|
|
+
|
|
|
+ info.setArchiveTime(new Date());
|
|
|
+ info.setOperatorId(emrData.getCreateId());
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setIptMdtrtSn(patNo + "_" + times);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<TbQualityEmr> getTbQualityEmr() {
|
|
|
+ List<EmrAuditDetail> emrAuditDetail = dao.getEmrAuditDetail(patNo, times, startDate, endDate);
|
|
|
+
|
|
|
+ if (emrAuditDetail.isEmpty()) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<TbQualityEmr> rst = new ArrayList<>();
|
|
|
+
|
|
|
+ for (EmrAuditDetail item : emrAuditDetail) {
|
|
|
+ TbQualityEmr info = new TbQualityEmr();
|
|
|
+ info.setSecurityLevel("000");
|
|
|
+ info.setOrgCode(orgCode);
|
|
|
+ info.setPatientId(patNo);
|
|
|
+ info.setOrgBatchNo(orgBatchNo);
|
|
|
+
|
|
|
+ info.setQcId(Convert.toStr(item.getId()));
|
|
|
+ info.setRecordId(item.getEmrDocumentId());
|
|
|
+ info.setCardNo(patInfoCurrent.getIdNumber());
|
|
|
+ info.setCardType("4");
|
|
|
+ info.setDeptCode(patInfoCurrent.getDept());
|
|
|
+ info.setDeptName(patInfoCurrent.getDeptName());
|
|
|
+ getUserInfo(item.getDoctor(), (val) -> {
|
|
|
+ info.setDoctorCode(val.getYbCode());
|
|
|
+ info.setDoctorName(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ info.setQcItemname(item.getName());
|
|
|
+ info.setQcItemcode(item.getName());
|
|
|
+ info.setQcTime(item.getReviewTime());
|
|
|
+
|
|
|
+ getUserInfo(item.getApprover(), (val) -> {
|
|
|
+ info.setQcStaffid(val.getYbCode());
|
|
|
+ info.setQcStaffname(val.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ info.setQcIssuedesc(item.getName() + item.getRemark());
|
|
|
+ info.setRecordScore(item.getMinusPoints().doubleValue());
|
|
|
+ info.setTimeoutFlag(0);
|
|
|
+
|
|
|
+ info.setModifyTime(info.getModifyTime());
|
|
|
+ getUserInfo(item.getModifyPerson(), val -> {
|
|
|
+ info.setModifier(val.getName());
|
|
|
+ info.setQcConfirmer(val.getName());
|
|
|
+ });
|
|
|
+ info.setQcConfirmtime(item.getModificationTime());
|
|
|
+ info.setQcStatus(1);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getOprnType(String code) {
|
|
|
+ return switch (code) {
|
|
|
+ case "0" -> "5";
|
|
|
+ case "1" -> "4";
|
|
|
+ case null, default -> "1";
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ private Integer getSelvFlag(Integer code) {
|
|
|
+ return switch (code) {
|
|
|
+ case 0 -> 1;
|
|
|
+ case 1 -> 2;
|
|
|
+ case null, default -> 9;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+}
|