|
@@ -14,6 +14,8 @@ import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.sidicts.Insutype;
|
|
|
import thyyxxk.webserver.constants.sidicts.MedType;
|
|
|
import thyyxxk.webserver.dao.his.LoginDao;
|
|
|
+import thyyxxk.webserver.dao.his.datamodify.YzActOrderModifyVerifyDao;
|
|
|
+import thyyxxk.webserver.dao.his.inpatient.TransferInOfExpensesDao;
|
|
|
import thyyxxk.webserver.dao.his.inpatient.casefrontsheet.BasSelectOverviewDao;
|
|
|
import thyyxxk.webserver.dao.his.inpatient.casefrontsheet.CaseFrontSheetDao;
|
|
|
import thyyxxk.webserver.dao.his.inpatient.casefrontsheet.SheetCreatedDao;
|
|
@@ -26,18 +28,22 @@ import thyyxxk.webserver.entity.casefrontsheet.response.BaOpLog;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.response.LendOutSheet;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.state.AuditState;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.state.State;
|
|
|
+import thyyxxk.webserver.entity.casefrontsheet.tcmsheet.TcmFrontSheetIcuinfo;
|
|
|
import thyyxxk.webserver.entity.covid.Region;
|
|
|
import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.dictionary.HisWjwMatchEntity;
|
|
|
+import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
|
|
|
import thyyxxk.webserver.http.drg.DrgWebApi;
|
|
|
import thyyxxk.webserver.service.externalhttp.PowersiSrvc;
|
|
|
import thyyxxk.webserver.service.zhuyuanyisheng.emr.EmrServer;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
@@ -50,9 +56,10 @@ public class CaseFrontSheetMainService {
|
|
|
private final PowersiSrvc srvc;
|
|
|
private final EmrServer emrService;
|
|
|
private final DrgWebApi drgWebApi;
|
|
|
+ private final TransferInOfExpensesDao transferInOfExpensesDao;
|
|
|
|
|
|
public CaseFrontSheetMainService(SheetCreatedDao createdDao, CaseFrontSheetDao dao, BasSelectOverviewDao basDao,
|
|
|
- LoginDao userDao, PowersiSrvc srvc, EmrServer emrService, DrgWebApi drgWebApi) {
|
|
|
+ LoginDao userDao, PowersiSrvc srvc, EmrServer emrService, DrgWebApi drgWebApi, TransferInOfExpensesDao transferInOfExpensesDao) {
|
|
|
this.dao = dao;
|
|
|
this.createdDao = createdDao;
|
|
|
this.basDao = basDao;
|
|
@@ -60,6 +67,7 @@ public class CaseFrontSheetMainService {
|
|
|
this.srvc = srvc;
|
|
|
this.emrService = emrService;
|
|
|
this.drgWebApi = drgWebApi;
|
|
|
+ this.transferInOfExpensesDao = transferInOfExpensesDao;
|
|
|
if (allDictionary == null) {
|
|
|
allDictionary = new ConcurrentHashMap<>();
|
|
|
}
|
|
@@ -100,6 +108,7 @@ public class CaseFrontSheetMainService {
|
|
|
allDictionary.put("getCountry", createdDao.getCountry());
|
|
|
allDictionary.put("getNation", createdDao.getNation());
|
|
|
allDictionary.put("getPayMethod", createdDao.getPayMethod());
|
|
|
+ allDictionary.put("getPsnCertType", createdDao.getPsnCertType());
|
|
|
} catch (Exception e) {
|
|
|
log.error("病案字典提取出错", e);
|
|
|
allDictionary.clear();
|
|
@@ -330,6 +339,7 @@ public class CaseFrontSheetMainService {
|
|
|
sheet.setDisdiagList(getSheetDisDiags(bah, times, State.FileStatus.UNSIGNED));
|
|
|
sheet.setSurgeryList(getSheetSurgeries(bah, times, State.FileStatus.UNSIGNED));
|
|
|
sheet.setSupplement(getSheetSupplement(bah, times));
|
|
|
+ sheet.setIcuInfoList(getSheetIcuinfos(bah, times));
|
|
|
if (null == standardAddressMember) {
|
|
|
sheet.setLivePlaceCombo(sheet.getLivePlace());
|
|
|
} else {
|
|
@@ -352,6 +362,60 @@ public class CaseFrontSheetMainService {
|
|
|
return sheet;
|
|
|
}
|
|
|
|
|
|
+ private List<TcmFrontSheetIcuinfo> getSheetIcuinfos(String bah, Integer times) {
|
|
|
+ List<TcmFrontSheetIcuinfo> icuinfos = new ArrayList<>();
|
|
|
+
|
|
|
+ String icuCode = "1000503";
|
|
|
+ List<Map<String,Object>> yzActOrderList = dao.selectZkOrderList(bah, times);
|
|
|
+ List<Map<String,Object>> yzActOrderFilterList = yzActOrderList.stream().filter(e-> icuCode.equals(e.get("old_dept")) || icuCode.equals(e.get("new_dept")) ).collect(Collectors.toList());
|
|
|
+ List<Map<String,Object>> yzActOrderSortList = yzActOrderFilterList.stream().sorted(Comparator.comparing(e->(Date)e.get("exec_time"))).collect(Collectors.toList());
|
|
|
+ ZyPatientInfo zyPatientInfo = transferInOfExpensesDao.getPatientHospitalStay(bah);
|
|
|
+// StringBuffer inTime = new StringBuffer("");
|
|
|
+// StringBuffer outTime = new StringBuffer("");
|
|
|
+// yzActOrderList.stream().sorted(Comparator.comparing(e->{
|
|
|
+// if (icuCode.equals(e.get("old_dept"))) {
|
|
|
+// tcmFrontSheetIcuinfo.setStartTime(DateUtil.parse(e.get("exec_time"),"yyyy-MM-dd HH:mm"));
|
|
|
+// }
|
|
|
+// })).collect(Collectors.toList());
|
|
|
+// for (int i = 0; i < yzActOrderSortList.size(); i++) {
|
|
|
+// if(i == 0 && icuCode.equals(yzActOrderSortList.get(i).get("old_dept"))){
|
|
|
+// tcmFrontSheetIcuinfo.setStartTime(DateUtil.parse(String.valueOf(zyPatientInfo.getDisDate()),"yyyy-MM-dd HH:mm"));
|
|
|
+// tcmFrontSheetIcuinfo.setEndTime(DateUtil.parse(yzActOrderSortList.get(i).get("exec_time"),"yyyy-MM-dd HH:mm"));
|
|
|
+// } else {
|
|
|
+// if (icuCode.equals(yzActOrderSortList.get(i).get("old_dept"))) {
|
|
|
+// tcmFrontSheetIcuinfo.setStartTime(DateUtil.parse(yzActOrderSortList.get(i).get("exec_time"),"yyyy-MM-dd HH:mm"));
|
|
|
+// }
|
|
|
+// outTime.append(DateUtil.parse(yzActOrderSortList.get(i).get("exec_time"),"yyyy-MM-dd HH:mm"));
|
|
|
+// }
|
|
|
+// }
|
|
|
+ List<Date> list = new ArrayList<>();
|
|
|
+
|
|
|
+ if(icuCode.equals(yzActOrderSortList.get(0).get("old_dept"))){
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ list.add(zyPatientInfo.getAdmissDate());
|
|
|
+ }
|
|
|
+ if(icuCode.equals(yzActOrderSortList.get(yzActOrderSortList.size()-1).get("new_dept"))){
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ list.add(zyPatientInfo.getDisDate());
|
|
|
+ }
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ TcmFrontSheetIcuinfo tcmFrontSheetIcuinfo = new TcmFrontSheetIcuinfo();
|
|
|
+ tcmFrontSheetIcuinfo.setIcuName("ICU");
|
|
|
+ tcmFrontSheetIcuinfo.setStartTime(list.get(i));
|
|
|
+ if (i+1 < list.size()) {
|
|
|
+ tcmFrontSheetIcuinfo.setEndTime(list.get(i+1));
|
|
|
+ }
|
|
|
+
|
|
|
+ icuinfos.add(tcmFrontSheetIcuinfo);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+
|
|
|
+ while (icuinfos.size() < 3) {
|
|
|
+ icuinfos.add(new TcmFrontSheetIcuinfo());
|
|
|
+ }
|
|
|
+ return icuinfos;
|
|
|
+ }
|
|
|
+
|
|
|
private void autoFillPart(CaseFrontsheetMain sheet) {
|
|
|
String patNo = sheet.getBah();
|
|
|
int times = sheet.getAdmissTimes();
|