|
@@ -34,11 +34,13 @@ import thyyxxk.webserver.dao.his.medicalinsurance.SiLogDao;
|
|
|
import thyyxxk.webserver.dao.his.medicalinsurance.SiQueryDao;
|
|
|
import thyyxxk.webserver.dao.his.medicalinsurance.UpIdCollectionDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetMain;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.SheetOverview;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.datamodify.TYbSetModifyTime;
|
|
|
import thyyxxk.webserver.entity.datamodify.TYbSetlModifyReq;
|
|
|
import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
+import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.BatjBa4;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.YbZyDisDiag;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyDisDiagYb;
|
|
@@ -358,8 +360,13 @@ public class SetlListUpldService {
|
|
|
}
|
|
|
|
|
|
Integer flag = getModifyFlag(patNo, times);
|
|
|
- // 患者基本信息
|
|
|
+ // 患者基本信息 先判断签收表是否有数据
|
|
|
+ Integer existCaseFrontsheetMain = dao.existCaseFrontsheetMain(patNo, times);
|
|
|
SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
|
|
|
+ if(existCaseFrontsheetMain ==null){
|
|
|
+ // 这里使用病案首页数据
|
|
|
+ covertCaseFrontsheetMain2SetlinfoUpld(setlinfoUpld,patNo,times);
|
|
|
+ }
|
|
|
EntityCopy.Copy(dao.setlinfo2(patNo, times), setlinfoUpld);
|
|
|
EntityCopy.Copy(dao.setlinfo3(String.format("inpatient_no ='%s'", patNo)), setlinfoUpld);
|
|
|
EntityCopy.Copy(dao.setlinfo4(patNo, times), setlinfoUpld);
|
|
@@ -538,6 +545,76 @@ public class SetlListUpldService {
|
|
|
setlinfoUpld.setSpPsnType(null);
|
|
|
return ResultVoUtil.success(upldCollection);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @description:病案首页转换为结算的的数据 用于签收表没有数据,重新取数据
|
|
|
+ * @author: lihong
|
|
|
+ * @date: 2023/2/9 16:30
|
|
|
+ * @param: setlinfoUpld
|
|
|
+ * @param: patNo
|
|
|
+ * @param: times
|
|
|
+ **/
|
|
|
+ public void covertCaseFrontsheetMain2SetlinfoUpld(SetlinfoUpld setlinfoUpld, String patNo, Integer times) {
|
|
|
+ SheetOverview overview = new SheetOverview();
|
|
|
+ overview.setInOutFlag(2);
|
|
|
+ overview.setBah(patNo);
|
|
|
+ overview.setTimes(times);
|
|
|
+ ResultVo<CaseFrontsheetMain> patientInfo = caseFrontSheetMainService.getPatientInfo(overview);
|
|
|
+ if(patientInfo.getData() !=null){
|
|
|
+ CaseFrontsheetMain caseFrontsheetMain = patientInfo.getData();
|
|
|
+ setlinfoUpld.setNtly(caseFrontsheetMain.getCountry()!=null ? dao.getCountrySiCode(caseFrontsheetMain.getCountry()):null);
|
|
|
+ setlinfoUpld.setPrfs(caseFrontsheetMain.getOccupation());
|
|
|
+ setlinfoUpld.setCertno(caseFrontsheetMain.getSocialNo());
|
|
|
+ setlinfoUpld.setCurrAddr(caseFrontsheetMain.getLivePlace());
|
|
|
+ setlinfoUpld.setEmpName(caseFrontsheetMain.getUnitName());
|
|
|
+ setlinfoUpld.setEmpAddr(caseFrontsheetMain.getUnitPlace());
|
|
|
+ setlinfoUpld.setEmpTel(caseFrontsheetMain.getUnitPhone());
|
|
|
+ setlinfoUpld.setPoscode(caseFrontsheetMain.getAddrZipCode());
|
|
|
+ setlinfoUpld.setNaty(redisLikeService.getWjwNation(caseFrontsheetMain.getNation()));
|
|
|
+ setlinfoUpld.setConerName(caseFrontsheetMain.getContactName());
|
|
|
+ setlinfoUpld.setBrdy(DateUtil.formatDatetime(caseFrontsheetMain.getBirthDate(),"yyyy-MM-dd"));
|
|
|
+ setlinfoUpld.setAge(String.valueOf(caseFrontsheetMain.getAge()));
|
|
|
+ setlinfoUpld.setGend(caseFrontsheetMain.getSex());
|
|
|
+ setlinfoUpld.setPatnRlts(redisLikeService.getYbCodeContactRelation(caseFrontsheetMain.getContactRelation()));
|
|
|
+ setlinfoUpld.setConerTel(caseFrontsheetMain.getContactPhone());
|
|
|
+ setlinfoUpld.setPwcryBfadmComaDura(caseFrontsheetMain.getComaDaysBeforeAdmiss()+"/"+caseFrontsheetMain.getComaHoursBeforeAdmiss()+"/"+caseFrontsheetMain.getComaMinutesBeforeAdmiss());
|
|
|
+ setlinfoUpld.setPwcryAfadmComaDura(caseFrontsheetMain.getComaDaysAfterAdmiss()+"/"+caseFrontsheetMain.getComaHoursAfterAdmiss()+"/"+caseFrontsheetMain.getComaMinutesAfterAdmiss());
|
|
|
+ setlinfoUpld.setDscgWay(caseFrontsheetMain.getZyDismissWay());
|
|
|
+ setlinfoUpld.setAcpMedinsName(caseFrontsheetMain.getDismissDestination());
|
|
|
+ setlinfoUpld.setDaysRinpFlag31(caseFrontsheetMain.getAdmissAgainInOneMonth());
|
|
|
+ setlinfoUpld.setDaysRinpPup31(caseFrontsheetMain.getAdmissAgainPurpose());
|
|
|
+ setlinfoUpld.setChfpdrName(StringUtil.isBlank(caseFrontsheetMain.getMainDoctorName()) ? caseFrontsheetMain.getAdmissDoctorName() : caseFrontsheetMain.getMainDoctorName());
|
|
|
+ setlinfoUpld.setChfpdrCode(StringUtil.isBlank(getYbCode(caseFrontsheetMain.getMainDoctor())) ? getYbCode(caseFrontsheetMain.getAdmissDoctor()) : getYbCode(caseFrontsheetMain.getMainDoctor()));
|
|
|
+ setlinfoUpld.setNwbAge(caseFrontsheetMain.getAgeDays() == null? "" : caseFrontsheetMain.getAgeDays().toString());
|
|
|
+ setlinfoUpld.setConerAddr(caseFrontsheetMain.getContactAddrName());
|
|
|
+ setlinfoUpld.setNwbBirWt(caseFrontsheetMain.getNewBornWeight() == null ? "" : caseFrontsheetMain.getNewBornWeight().toString());
|
|
|
+ String dutyNurse = getYbCode(caseFrontsheetMain.getDutyNurse());
|
|
|
+ if(StringUtil.notBlank(dutyNurse)){
|
|
|
+ setlinfoUpld.setRespNursCode(dutyNurse);
|
|
|
+ }
|
|
|
+ if(StringUtil.notBlank(caseFrontsheetMain.getDutyNurseName())){
|
|
|
+ setlinfoUpld.setRespNursName(caseFrontsheetMain.getDutyNurseName());
|
|
|
+ }
|
|
|
+ String refldeptDept = redisLikeService.getYbDept(caseFrontsheetMain.getTransDeptCode());
|
|
|
+ if(refldeptDept !=null){
|
|
|
+ setlinfoUpld.setRefldeptDept(refldeptDept);
|
|
|
+ }
|
|
|
+ String dscCaty = redisLikeService.getYbDept(caseFrontsheetMain.getAdmissDeptCode());
|
|
|
+ if(dscCaty != null){
|
|
|
+ setlinfoUpld.setDscgCaty(dscCaty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getYbCode(String code) {
|
|
|
+ UserInfo userInfo = redisLikeService.getUserInfoByCode(code);
|
|
|
+ String ybCode = "";
|
|
|
+ if(userInfo !=null){
|
|
|
+ ybCode = userInfo.getYbCode();
|
|
|
+ }
|
|
|
+ return ybCode;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@NotNull
|
|
|
public Integer getModifyFlag(String patNo, Integer times) {
|
|
@@ -2279,8 +2356,8 @@ public class SetlListUpldService {
|
|
|
sheetOverview.setTimes(param.getAdmissTimes());
|
|
|
sheetOverview.setInOutFlag(2);
|
|
|
ResultVo<Map<String, List<CodeName>>> mapResultVo = caseFrontSheetMainService.sheetVerification(sheetOverview);
|
|
|
- Integer count = dao.queryCountTCaseFrontsheetMain(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
- if(ListUtil.isBlank(mapResultVo.getData().get("force")) && count < 1){
|
|
|
+ Integer count = dao.existCaseFrontsheetMain(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
+ if(ListUtil.isBlank(mapResultVo.getData().get("force")) && count != null){
|
|
|
throw new BizException(ExceptionEnum.LOGICAL_ERROR,"病案首页签收表没有数据,请去病案首页操作打印正反面!");
|
|
|
}
|
|
|
return mapResultVo;
|