瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

LAPTOP-KB9HII50\70708 1 年之前
父節點
當前提交
75e404d61b

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

@ -2322,7 +2322,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        if(outpatientDO!=null){
            DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(outpatientDO.getDoctor());
            if (StringUtils.isNoneBlank(outpatientDO.getRegisterNo())){
            if (StringUtils.isNoneBlank(outpatientDO.getRegisterNo())&&(outpatientDO.getHisStatus()==null ||outpatientDO.getHisStatus()!=-1)){
                net.sf.json.JSONObject rs = entranceService.BS10138(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), outpatientDO.getRegisterNo(), outpatientDO.getWinNo(), demoFlag);
                res= rs.getJSONObject("resquest");
                logger.info("退号结果 res: " + res.toString());
@ -2808,9 +2808,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = com.alibaba.fastjson.JSONObject.parseObject(emrJson, WlyyPrescriptionEmrDO.class);
            wlyyPrescriptionEmrDO.setDel(1);
            wlyyPrescriptionEmrDO.setPrescriptionId(prescription.getId());
            prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
            wlyyPrescriptionEmrDO = prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
                BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
                if (null!=basePatientDO){
                    object.put("patientAge",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
                    object.put("patientsex",IdCardUtil.getSexForIdcard(basePatientDO.getIdcard()));
                    object.put("patientName",basePatientDO.getName());
                    object.put("patientClan","0"); }
                if (null!=outpatientDO){
                    object.put("deptCode",outpatientDO.getDeptName());
                    object.put("outpatientCode",outpatientDO.getRegisterNo());
                    object.put("eventno","R"+outpatientDO.getRegisterNo());
                }
                com.alibaba.fastjson.JSONObject jsonObject = ykyyService.getSignPicture(outpatientDO.getDoctor());
                if (jsonObject!=null){
                    if (jsonObject.getString("code").equalsIgnoreCase("1000")){
                        com.alibaba.fastjson.JSONObject dataJson = jsonObject.getJSONObject("data");
                        object.put("baseSign",dataJson.getString("image"));
                    }
                }
                object.put("diseaseName",outpatientDO.getDiseaseName());
                ykyyPrescriptionService.returnEmrHtmlByHLW(object,wlyyPrescriptionEmrDO);
            }
        }
        //=====================电子病历=================================================end
        //=====================保存日志 start=========================================================
        List<WlyyPrescriptionCheckDO> prescriptionCheckDOS = prescriptionCheckDao.findByStatus(prescription.getId(), 5);

+ 82 - 7
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -26,11 +26,11 @@ import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalMxDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationInvoiceDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -52,7 +52,6 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
@ -64,13 +63,9 @@ import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import jdk.nashorn.internal.ir.IfNode;
import nuonuo.open.sdk.NNOpenSDK;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -78,7 +73,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -152,6 +147,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    private final static String saveUrl = "http://192.168.20.55:10023/ykyy/save";
    private final static String updateEntityUrl = "http://192.168.20.55:10023/ykyy/update";
@ -1823,4 +1820,82 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    //==========================视力报告结束====================================
    /**
     * 获取历史病历
     * @param patientId
     * @param eventNo
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> selectHistoryEmrFromEntrance(String patientId,String eventNo) throws Exception {
        JSONArray jsonArray = new JSONArray();
        String sql = "SELECT\n" +
                "\to.dept_name AS \"DEPT_NAME\",\n" +
                "\tto_char (\n" +
                "\t\to.register_date,\n" +
                "\t\t'YYYY-MM-DD hh24:mi:ss'\n" +
                "\t) AS \"TREAT_DATE_TIME\",\n" +
                "\temr.id AS \"OPID\",\n" +
                "\to.doctor_name AS \"TREAT_DOCTOR_NAME\"\n" +
                "FROM\n" +
                "\twlyy_outpatient o\n" +
                "LEFT JOIN wlyy_prescription p ON o.id = p.outpatient_id\n" +
                "LEFT JOIN wlyy_prescription_emr emr ON emr.prescription_id = p.id\n" +
                "where emr.id is not null\n" +
                "and o.PATIENT = '"+patientId+"' and emr.html_str is not null ";
        sql+=" ORDER BY o.CREATE_TIME DESC  ";
        List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql);
        return maps;
    }
    /**
     * 查询病历文书html信息
     * @param bstrEmrID
     * @return
     */
    public WlyyPrescriptionEmrDO selectBrowseSingleEMR(String bstrEmrID) throws Exception {
        return prescriptionEmrDao.findOne(bstrEmrID);
    }
    /**
     * 同步门诊病历
     * @return
     */
    public WlyyPrescriptionEmrDO returnEmrHtmlByHLW(JSONObject jsonObject,WlyyPrescriptionEmrDO prescriptionEmrDO)throws Exception{
        String htmlDeo = "";
        if (null!=prescriptionEmrDO){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("EMRHTMLDEMO");
            if (null!=wlyyHospitalSysDictDO){
                htmlDeo = wlyyHospitalSysDictDO.getDictValue();
                htmlDeo = replaceHtml(htmlDeo,"@patientName@",jsonObject.getString("patientName"));
                htmlDeo = replaceHtml(htmlDeo,"@patientAge@",jsonObject.getString("patientAge"));
                htmlDeo = replaceHtml(htmlDeo,"@patientsex@",jsonObject.getString("patientsex"));
                htmlDeo = replaceHtml(htmlDeo,"@deptCode@",jsonObject.getString("deptCode"));
                htmlDeo = replaceHtml(htmlDeo,"@baseSign@",jsonObject.getString("baseSign"));
                htmlDeo = replaceHtml(htmlDeo,"@outpatientCode@",jsonObject.getString("outpatientCode"));
                htmlDeo = replaceHtml(htmlDeo,"@patientClan@",jsonObject.getString("patientClan"));
                htmlDeo = replaceHtml(htmlDeo,"@Special@",prescriptionEmrDO.getSpecialHistory());
                SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
                htmlDeo = replaceHtml(htmlDeo,"@complaint@",prescriptionEmrDO.getComplaint());
                htmlDeo = replaceHtml(htmlDeo,"@diseaseName@",jsonObject.getString("diseaseName"));
                htmlDeo = replaceHtml(htmlDeo,"@medicalHistory@",prescriptionEmrDO.getMedicalHistory());
                htmlDeo = replaceHtml(htmlDeo,"@popularHistory@",prescriptionEmrDO.getPopularHistory());
                htmlDeo = replaceHtml(htmlDeo,"@pastHistory@",prescriptionEmrDO.getPastHistory());
                htmlDeo = replaceHtml(htmlDeo,"@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
                htmlDeo = replaceHtml(htmlDeo,"@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
                htmlDeo = replaceHtml(htmlDeo,"@assistExamination@",prescriptionEmrDO.getAssistExamination());
            }
        }
        prescriptionEmrDO.setHtmlStr(htmlDeo);
        return prescriptionEmrDao.save(prescriptionEmrDO);
    }
    public String replaceHtml(String demoData,String oldChar,String newChar){
        return demoData.replace(oldChar,null==newChar?"无":newChar);
    }
}

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -513,6 +513,7 @@ public class EntranceService {
                sbs.append(" and CHARGES_DATE &lt;= '"+endDate+"' ");
                /*sbs.append("<query compy=\"=\" item=\"CHARGE_DATE\" splice=\"and\" value=\"'" + ADM_NO + "'\"/>");*/
            }
//            sbs.append(" AND PAY_MARK IN ('0','5','a') and datediff(day,CHARGES_DATE,getdate())<3 and REGISTER_SN > 0 ");
            sbs.append("</Msg> ");
            //查询信息结束
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");

+ 13 - 6
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -2193,9 +2193,15 @@ public class YkyyEntranceService {
            prescriptionId=prescriptionDO.getId();
        }
        List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(doctor);
        String deptCode=null;
        if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
            deptCode = doctorHospitalDOS.get(0).getDeptCode();
        String ksdm = "";
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            ksdm=json.getString("ksdm");
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
@ -2219,7 +2225,7 @@ public class YkyyEntranceService {
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDO.setKdsj(new Date());
            ykEmrJcsqDO.setKdks(deptCode==null?0:Integer.parseInt(deptCode));
            ykEmrJcsqDO.setKdks(ksdm==null?0:Integer.parseInt(ksdm));
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }
@ -2393,7 +2399,7 @@ public class YkyyEntranceService {
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            ksdm=json.getString("ksdm");
            ksdm=json.getString("dept");
        }
        hlwGhmxDO.setSBXH(0);
        hlwGhmxDO.setGHCS(1);
@ -2725,8 +2731,9 @@ public class YkyyEntranceService {
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            hlwGhmxDO.setCZGH(json.getString("YGBH"));
            hlwGhmxDO.setKSDM(json.getString("ksdm"));
            hlwGhmxDO.setKSDM(json.getString("dept"));
            ksdm=json.getString("ksdm");
         /*   hlwGhmxDO.set*/
        }

+ 5 - 3
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1921,13 +1921,15 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        Calendar calendar = Calendar.getInstance();
        if (businessOrderDO!=null){
            createDate = businessOrderDO.getCreateTime();
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getDictCode()));
            calendar.setTime(createDate);
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getDictCode()));
        }else {
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getPyCode()));
            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(relationCode);
            calendar.setTime(prescriptionDO.getCreateTime());
            createDate =prescriptionDO.getCreateTime();
            calendar.setTime(createDate);
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getPyCode()));
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = sdf.format(calendar.getTime());

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionEmrDO.java

@ -68,6 +68,19 @@ public class WlyyPrescriptionEmrDO extends UuidIdentityEntityWithOperator {
     *特殊病史
     */
    private String specialHistory;
    private String htmlStr;
    @Column(name = "html_str")
    public String getHtmlStr() {
        return htmlStr;
    }
    public void setHtmlStr(String htmlStr) {
        this.htmlStr = htmlStr;
    }
    @Column(name = "popular_history")
    public String getPopularHistory() {
        return popularHistory;

+ 4 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -7,6 +7,10 @@ server:
spring:
  datasource:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 100
    max-idle: 100 #最大空闲连接

+ 4 - 1
server/svr-authentication/src/main/resources/application.yml

@ -4,7 +4,10 @@ server:
spring:
  datasource:
  hikari:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    registerMbeans: true
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 100

+ 4 - 0
svr/svr-base/src/main/resources/application.yml

@ -10,6 +10,10 @@ express:
spring:
  datasource:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接

+ 3 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -356,12 +356,14 @@ public class YkyyController extends EnvelopRestEndpoint {
                            ykMsYj02DO.setXmlx(xmlx);
                            ykMsYj02DO.setFygb(Integer.valueOf(fyxhList.get(0).get("fygb").toString()));
                            ykMsYj02DO.setYldj(new BigDecimal(fyxhList.get(0).get("fydj").toString()));
                            totalprice =new BigDecimal(ykMsYj02DO.getYlsl()).multiply(ykMsYj02DO.getYldj());
                            ykMsYj02DO.setHjje(totalprice);
                        }
                        ykMsYj02DO.setZfbl(1);
                        ykMsYj02DO.setZxpb(0);
                        ykMsYj02DO.setZjflag(0);
                        ykMsYj02DO.setHjje(totalprice);
                /*        ykMsYj02DO.setHjje(totalprice);*/
                        System.out.println(ykMsYj02DO);
                        ykyyEntranceService.save(ykMsYj02DO);
                    }

+ 4 - 0
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -5,6 +5,10 @@ server:
spring:
  datasource:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接

+ 4 - 0
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -4,6 +4,10 @@ server:
spring:
  datasource:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接

+ 5 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2703,7 +2703,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectHistoryEmrFromEntrance(patient, null));
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok", hcyyPrescriptionService.selectHistoryEmrFromEntrance(patient, null));
            } else {
            }  else if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                return ObjEnvelop.getSuccess("ok", ykyyPrescriptionService.selectHistoryEmrFromEntrance(patient, null));
            }else {
                return ObjEnvelop.getSuccess("ok", prescriptionService.outpatient(patient, doctorId));
            }
@ -2737,6 +2739,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectBrowseSingleEMR(opid));
            }else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok", hcyyPrescriptionService.selectBrowseSingleEMR(opid));
            } else if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                return ObjEnvelop.getSuccess("ok", ykyyPrescriptionService.selectBrowseSingleEMR(opid));
            }  else {
                return ObjEnvelop.getSuccess("ok", prescriptionService.getPatInfoDataXml(opid, recSn));
            }

+ 4 - 0
svr/svr-internet-hospital/src/main/resources/application.yml

@ -6,6 +6,10 @@ spring:
  aop:
    proxy-target-class: true
  datasource:
    hikari:
      idle-timeout: 600000 # 10 minutes
      max-lifetime: 1800000 # 30 minutes
      health-check-properties: "select 1"
    max-active: 200
    max-idle: 200 #最大空闲连接
    min-idle: 10 #最小空闲连接