|
|
@@ -1,16 +1,11 @@
|
|
|
package cn.hnthyy.thmz.service.impl.his;
|
|
|
|
|
|
import cn.hnthyy.thmz.entity.MzException;
|
|
|
-import cn.hnthyy.thmz.entity.his.APatientMi;
|
|
|
-import cn.hnthyy.thmz.entity.his.MzZyReq;
|
|
|
-import cn.hnthyy.thmz.entity.his.ZyActpatient;
|
|
|
+import cn.hnthyy.thmz.entity.his.*;
|
|
|
import cn.hnthyy.thmz.enums.BedStatusEnum;
|
|
|
import cn.hnthyy.thmz.enums.ResponceTypeEnum;
|
|
|
import cn.hnthyy.thmz.enums.YesNoEnum;
|
|
|
-import cn.hnthyy.thmz.mapper.his.APatientMiMapper;
|
|
|
-import cn.hnthyy.thmz.mapper.his.MzZyReqMapper;
|
|
|
-import cn.hnthyy.thmz.mapper.his.PatientMiSfzMapper;
|
|
|
-import cn.hnthyy.thmz.mapper.his.ZyActpatientMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.*;
|
|
|
import cn.hnthyy.thmz.service.his.ZyActpatientService;
|
|
|
import cn.hnthyy.thmz.service.his.ZyConfigService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -21,6 +16,7 @@ import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -38,6 +34,15 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
|
|
|
@SuppressWarnings("all")
|
|
|
@Autowired
|
|
|
private PatientMiSfzMapper patientMiSfzMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private ZyAdtMapper zyAdtMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private ZyBedMiMapper zyBedMiMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private zyLedgerFileMapper zyLedgerFileMapper;
|
|
|
@Autowired
|
|
|
private ZyConfigService zyConfigService;
|
|
|
|
|
|
@@ -56,6 +61,9 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
|
|
|
if(aPatientMiDb==null){
|
|
|
throw new MzException("当前病人还未建档成功!");
|
|
|
}
|
|
|
+ if(zyActpatientMapper.selectCountByInpatientNo(aPatientMiDb.getInpatientNo())>0){
|
|
|
+ throw new MzException("当前病人是在院病人,请不要重复操作!");
|
|
|
+ }
|
|
|
if(aPatientMiDb.getLastadmissTimes()==null){
|
|
|
aPatientMiDb.setLastadmissTimes(0);
|
|
|
}
|
|
|
@@ -106,9 +114,11 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
|
|
|
zyActpatient.setDept(zyActpatient.getAdmissDept());
|
|
|
zyActpatient.setWard(zyActpatient.getAdmissWard());
|
|
|
zyActpatient.setSex(aPatientMiDb.getSex());
|
|
|
+ zyActpatient.setInputDate(new Date());
|
|
|
zyActpatient.setTableName("zy_actpatient");
|
|
|
int num= zyActpatientMapper.insertZyActpatient(zyActpatient);
|
|
|
if(num>0){
|
|
|
+ //修改门诊住院申请单
|
|
|
MzZyReq mzZyReq = new MzZyReq();
|
|
|
mzZyReq.setPatientId(zyActpatient.getMzNo());
|
|
|
mzZyReq.setConfirmId(zyActpatient.getOpIdCode());
|
|
|
@@ -116,6 +126,82 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
|
|
|
mzZyReq.setZySerialNo(zyActpatient.getZySerialNo());
|
|
|
mzZyReq.setReqStatus(YesNoEnum.YES.code.toString());
|
|
|
mzZyReqMapper.updateMzZyReq(mzZyReq);
|
|
|
+ //病人流转入库
|
|
|
+ ZyAdt zyAdt = new ZyAdt();
|
|
|
+ zyAdt.setZySerialNo(zyActpatient.getZySerialNo());
|
|
|
+ zyAdt.setInpatientNo(zyActpatient.getInpatientNo());
|
|
|
+ zyAdt.setAdmissTimes(zyActpatient.getAdmissTimes());
|
|
|
+ zyAdt.setTransTimes(0);
|
|
|
+ zyAdt.setAdmissDate(zyActpatient.getAdmissDate());
|
|
|
+ zyAdt.setCurrWard(zyActpatient.getWard());
|
|
|
+ zyAdt.setCurrDept(zyActpatient.getDept());
|
|
|
+ zyAdt.setCurrRoom(null);
|
|
|
+ zyAdt.setCurrBed(zyActpatient.getBedNo());
|
|
|
+ zyAdt.setMark("1");
|
|
|
+ zyAdtMapper.deleteZyAdt(zyAdt.getInpatientNo(),zyAdt.getAdmissTimes());
|
|
|
+ zyAdtMapper.inserZyAdt(zyAdt);
|
|
|
+ //更新床号记录
|
|
|
+ ZyBedMi zyBedMi = new ZyBedMi();
|
|
|
+ zyBedMi.setBedStatus(ZyBedMi.BED_STATUS_FREE);
|
|
|
+ zyBedMi.setInpatientNo(zyActpatient.getInpatientNo());
|
|
|
+ zyBedMi.setAdmissTimes(zyActpatient.getAdmissTimes());
|
|
|
+ zyBedMi.setDeptCode(zyActpatient.getDept());
|
|
|
+ zyBedMi.setWardCode(zyActpatient.getDept());
|
|
|
+ zyBedMi.setBedNo(zyActpatient.getBedNo());
|
|
|
+ zyBedMiMapper.updateZyBedMi(zyBedMi);
|
|
|
+ //入库账页信息
|
|
|
+ ZyLedgerFile zyLedgerFile = new ZyLedgerFile();
|
|
|
+ zyLedgerFile.setInpatientNo(zyActpatient.getInpatientNo());
|
|
|
+ zyLedgerFile.setAdmissTimes(zyActpatient.getAdmissTimes());
|
|
|
+ zyLedgerFile.setLedgerSn(1);
|
|
|
+ zyLedgerFile.setOpIdCode(zyActpatient.getOpIdCode());
|
|
|
+ zyLedgerFile.setDeposit(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setBalance(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setTotalCharge(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge1(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge2(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge3(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge4(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge5(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge6(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge7(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge8(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge9(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge10(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge11(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge12(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge13(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge14(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge15(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge16(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge17(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge18(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge19(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge20(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge21(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge22(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge23(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge24(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge25(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge26(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge27(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge28(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge29(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setCharge30(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setSettle(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setLastBalance(BigDecimal.ZERO);
|
|
|
+ zyLedgerFile.setSettleType("0");
|
|
|
+ zyLedgerFile.setDeptCode(zyActpatient.getDept());
|
|
|
+ zyLedgerFile.setWardCode(zyActpatient.getWard());
|
|
|
+ zyLedgerFile.setDeptX("");
|
|
|
+ zyLedgerFile.setWardX("");
|
|
|
+ zyLedgerFile.setAccountDate(null);
|
|
|
+ zyLedgerFile.setCashDate(null);
|
|
|
+ zyLedgerFile.setCashId("");
|
|
|
+ zyLedgerFile.setDcountNo("");
|
|
|
+ zyLedgerFile.setDcountDate(null);
|
|
|
+ zyLedgerFile.setZySerialNo(zyActpatient.getZySerialNo());
|
|
|
+ zyLedgerFileMapper.insetZyLedgerFile(zyLedgerFile);
|
|
|
}
|
|
|
return num;
|
|
|
}
|