Bläddra i källkod

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 5 år sedan
förälder
incheckning
878792a5b7

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PatientRegisterDao.java

@ -12,4 +12,7 @@ import java.util.List;
public interface PatientRegisterDao extends PagingAndSortingRepository<WlyyPatientRegisterDO, String>, JpaSpecificationExecutor<WlyyPatientRegisterDO> {
    List<WlyyPatientRegisterDO> findByPatientAndDate(String patient,String date);
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctor(String patient,String date,String doctor);
}

+ 35 - 9
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1043,7 +1043,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //查找居民当天挂号记录
        String date = DateUtil.dateToStr(new Date(),"yyyy-MM-dd");
        List<WlyyPatientRegisterDO>  patientRegisterDOs = patientRegisterDao.findByPatientAndDate(outpatientDO.getPatient(),date);
        List<WlyyPatientRegisterDO>  patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctor(outpatientDO.getPatient(),date,doctor);
        if(patientRegisterDOs!=null&&patientRegisterDOs.size()>0){
            WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
            //判断是否已经挂号,如果已经挂号
@ -1081,8 +1081,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            // 存储挂号医生与挂号科室
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            //挂号流水号与挂号次数
            registerDO.setRegisterNo(serialNo);
            registerDO.setConNo(conNo);
            registerDO.setCreateTime(new Date());
@ -1100,6 +1107,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            registerDO.setRegisterNo(serialNo);
@ -1260,8 +1273,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //获取门诊记录
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outPatientId);
        //设置医嘱
        outpatientDO.setAdvice(advice);
        //========================处方操作=============================================================
        //创建处方记录
        List<WlyyPrescriptionDO> prescriptionDOs = prescriptionDao.findByOutpatientId(outPatientId);
        WlyyPrescriptionDO prescriptionDO = null;
@ -1279,10 +1294,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        prescriptionDO.setDoctorName(outpatientDO.getDoctorName());
        WlyyPrescriptionDO prescription = prescriptionDao.save(prescriptionDO);
        //========================处方操作结束=============================================================
        //加入处方状态变更流水日志
        prescriptionLogService.addPrescriptionLog(prescription.getId(),10,2,outpatientDO.getDoctor(),outpatientDO.getDoctorName(),"",new Date());
        //下诊断
        //============================下诊断==============================================================
        //删除之前诊断
        List<WlyyPrescriptionDiagnosisDO> ds = prescriptionDiagnosisDao.findByPrescriptionId(prescription.getId());
        if(ds!=null&&ds.size()>0){
@ -1304,11 +1321,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        prescriptionDiagnosisDao.save(diagnosisDOs);
        //存储icd10
        Icd10 = Icd10.substring(0,Icd10.length()-1);
        Icd10Name = Icd10Name.substring(0,Icd10Name.length()-1);
        outpatientDO.setIcd10(Icd10);
        outpatientDO.setIcd10Name(Icd10Name);
        outpatientDao.save(outpatientDO);
        //============================下诊断end==============================================================
        //判断是否有检查检验或药品开方
        if("1".equals(type)){
@ -1319,15 +1338,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                throw new RuntimeException("未找到医生映射信息");
            }
            //删除原有药品信息
            //his处方拼接开方条件
            com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
            //===================药品操作======================================================
            // 删除原有药品信息
            List<WlyyPrescriptionInfoDO> oldInfos = prescriptionInfoDao.findByPrescriptionId(prescription.getId());
            if(oldInfos!=null&&oldInfos.size()>0){
                prescriptionInfoDao.delete(oldInfos);
            }
            //his处方拼接开方条件
            com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
            //存储药品,构建his开方入参
            if(StringUtils.isNotBlank(infoJsons)){
                //药品
@ -1340,16 +1360,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    //设置his药品查询条件
                    setInfoJsonParam(jsonData,doctorMappingDO,outpatientDO,prescriptionDO,info,Icd10);
                }
                //保存处方
                //保存药品信息
                prescriptionInfoDao.save(infoDOs);
            }
            //=====================药品操作=======================================================================
            //=====================检查检验=======================================================================
            //存储检查检验,构建his开方入参
            //删除之前检查检验
            List<WlyyInspectionDO> inspectionDels = wlyyInspectionDao.findByOutpatientId(outPatientId);
            if(inspectionDels!=null&&inspectionDels.size()>0){
                wlyyInspectionDao.delete(inspectionDels);
            }
            //存储检查检验,构建his开方入参
            if(StringUtils.isNotBlank(inspectionJson)){
                List<WlyyInspectionDO> inspections = (List<WlyyInspectionDO>) com.alibaba.fastjson.JSONArray.parseArray(inspectionJson, WlyyInspectionDO.class);
                for(WlyyInspectionDO ins:inspections){
@ -1364,11 +1388,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
            }
            //=====================检查检验=======================================================================
            //上传his开方
            return sendHisDiagnosis(jsonData,outpatientDO,prescription);
        }else{
            //
            outpatientDO.setStatus("2");
            outpatientDao.save(outpatientDO);
            result.put("code",1);

+ 36 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java

@ -15,6 +15,10 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    private String patient;//居民id
    private String patientName;//居民姓名
    private String doctor;//就诊医生
    private String doctorName;//就诊医生姓名
    private String dept;//部门
    private String deptName;//部门号
    private String conNo;//就诊次数
    private String registerNo;//挂号流水号',
    private String date;//yyyy-MM-dd',
@ -67,4 +71,36 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}