Browse Source

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

wangjun 4 years ago
parent
commit
339634bdd3

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

@ -7355,12 +7355,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
            logger.info("开始=====" + wlyyPrescriptionDO.getCheckStatus());
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
            List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId, 1);
            List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(outpatientDO.getId());
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
                try {
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId, 1);
                    DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                    List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(outpatientDO.getId());
                    //his处方拼接开方条件
                    com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
                    for (WlyyPrescriptionInfoDO info : infoDOS) {
@ -7445,6 +7446,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    e.printStackTrace();
                }
            }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                try {
                    com.alibaba.fastjson.JSONObject object = xzzxEntranceService.savePrescriptionToEntrance("0",outpatientDO.getCardNo(),outpatientDO.getRegisterNo(),outpatientDO.getDept(),doctorMappingDO.getMappingCode(),"50100",infoDOS);
                    logger.info("成功上传处方"+object);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            prescriptionLogService.addPrescriptionLog(prescriptionId, 20, 2, operate, operateName, reason, new Date());
            wlyyPrescriptionDO.setCheckStatus(2);

+ 122 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -3,6 +3,7 @@ package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictDoctorDutyDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -1189,6 +1190,81 @@ public class XzzxEntranceService{
        return json;
    }
    /**
     * 互联网医院开处方信息更新到his
     * @param IoFlag  门诊住院标志
     * @param PayCardNo 就诊卡号
     * @param NullahNumber 挂号流水号
     * @param ApplyDept 执行科室
     * @param ApplyDoctor 开单医生
     * @param ExecuteDept 执行科室(药房)
     * @param prescriptionInfoDOList
     * @return
     * @throws Exception
     */
    public String savePrescriptionToHospital(String IoFlag,String PayCardNo,String NullahNumber,
                                             String ApplyDept,String ApplyDoctor,String ExecuteDept,List<WlyyPrescriptionInfoDO> prescriptionInfoDOList)throws Exception{
        String api = "savePrescriptionToHospital";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(IoFlag)){
            condition += "<IoFlag>"+IoFlag+"</IoFlag>";
        }
        if (!StringUtils.isEmpty(PayCardNo)){
            condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
        }
        if (!StringUtils.isEmpty(NullahNumber)){
            condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>";
        }
        if (!StringUtils.isEmpty(ApplyDept)){
            condition += "<ApplyDept>"+ApplyDept+"</ApplyDept>";
        }
        if (!StringUtils.isEmpty(ApplyDoctor)){
            condition += "<ApplyDoctor>"+ApplyDoctor+"</ApplyDoctor>";
        }
        if (!StringUtils.isEmpty(ExecuteDept)){
            condition += "<ExecuteDept>"+ExecuteDept+"</ExecuteDept>";
        }
        condition +="<PresDetail>";
        for (WlyyPrescriptionInfoDO prescriptionInfoDO:prescriptionInfoDOList){
            String condition1 = "";
            condition1 += "<PhysicCode>"+prescriptionInfoDO.getDrugNo()+"</PhysicCode>";
            condition1 += "<Doseage>"+prescriptionInfoDO.getDosage()+"</Doseage>";
            condition1 += "<DoseUnit>"+prescriptionInfoDO.getUnit()+"</DoseUnit>";
            condition1 += "<Frequency>"+prescriptionInfoDO.getUsageCode()+"</Frequency>";
            condition1 += "<DayCount>"+prescriptionInfoDO.getDays()+"</DayCount>";
            condition1 += "<Usage>"+prescriptionInfoDO.getSupplyCode()+"</Usage>";
            condition1 += "<TotalDoseage>"+prescriptionInfoDO.getQuantity()+"</TotalDoseage>";
            condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>";
            condition1 += "<PrescribeMemo>"+"</PrescribeMemo>";
            condition1 += "<FryMode>"+"</FryMode>";
            condition1 += "<HerbalTakeMethodClass>"+"</HerbalTakeMethodClass>";
            condition1 += "<HerbalFryMethod>"+"</HerbalFryMethod>";
            condition1 += "<HerbalFryMethod2>"+"</HerbalFryMethod2>";
            condition+="<PresInfo>"+condition1+"</PresInfo>";
        }
        condition+="</PresDetail>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("savePrescriptionToHospital params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" savePrescriptionToHospital json:"+json);
        return json;
    }
    /**
     * 组装检查检验项目参数
     *
@ -2163,7 +2239,7 @@ public class XzzxEntranceService{
    }
    /**
     * 获取icd10字典
     * 获取药品字典
     * @param spellCode 拼音码
     * @return
     */
@ -2185,7 +2261,8 @@ public class XzzxEntranceService{
                object1.put("group_no","");
                object1.put("drugname",jsonObject.getString("PHYSIC_NAME"));
                object1.put("dosage",jsonObject.getString("DOSE_UNIT"));
                object1.put("mini_unit",jsonObject.getString("MIN_DOSE"));
                object1.put("MIN_DOSE",jsonObject.getString("MIN_DOSE"));
                object1.put("mini_unit",jsonObject.getString("PHYSIC_UNIT"));
                object1.put("pack_size",jsonObject.getString("PACK_SPEC"));
                object1.put("retprice",jsonObject.getString("RETAIL_PRICE"));
                object1.put("specification",jsonObject.getString("PHYSIC_SPEC"));
@ -2194,7 +2271,7 @@ public class XzzxEntranceService{
                object1.put("visible_flag",jsonObject.getString("VALID_FLAG"));
                object1.put("drug_flag",jsonObject.getString("OTC_FLAG"));
                object1.put("py_code",jsonObject.getString("SPELL_CODE"));
                object1.put("pack_unit",jsonObject.getString("PACK_SPEC"));
                object1.put("pack_unit",jsonObject.getString("PRICE_UNIT"));
                object1.put("manu_name",jsonObject.getString("SUPPLIER_NAME"));
                object1.put("weigh_unit",jsonObject.getString("DOSE_UNIT"));
                object1.put("vol_unit","");
@ -2272,7 +2349,8 @@ public class XzzxEntranceService{
                JSONObject object1 = new JSONObject();
                object1.put("@action","select");
                object1.put("DAILY_TIMES",jsonObject.getString("FREQ_COUNT"));
                object1.put("FREQ_CODE",jsonObject.getString("FREQ_DESCRIBE_CODE"));
                object1.put("FREQ_CODE",jsonObject.getString("FREQ_DESCRIBE"));
                object1.put("FREQ_DESCRIBE_CODE",jsonObject.getString("FREQ_DESCRIBE_CODE"));
                object1.put("FREQ_DESCRIBE",jsonObject.getString("FREQ_DESCRIBE"));
                object1.put("PHYSIC_NOTUSE_FLAG",jsonObject.getString("PHYSIC_NOTUSE_FLAG"));
                object1.put("FREQ_NAME",jsonObject.getString("FREQ_MEMO"));
@ -2436,6 +2514,46 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
    return resultMap;
}
    /**
     *
     * @param ioFlag 门诊住院标志
     * @param payCardNo 就诊卡号
     * @param nullahNumber 挂号流水号
     * @param applyDept 执行科室
     * @param applyDoctor 开单医生
     * @param executeDept 执行科室(药房)
     * @return
     * @throws Exception
     */
    public JSONObject savePrescriptionToEntrance(String ioFlag,String payCardNo,String nullahNumber,String applyDept,String applyDoctor,String executeDept,List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String response = "";
        String url = entranceUrl+"savePrescriptionToHospital";
        ObjectMapper mapper = new ObjectMapper();
        JSONArray array = new JSONArray();
        for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
            array.add(wlyyPrescriptionInfoDO);
        }
        Map<String,String> params = new HashedMap();
        params.put("IoFlag",ioFlag);
        params.put("PayCardNo",payCardNo);
        params.put("NullahNumber",nullahNumber);
        params.put("ApplyDept",applyDept);
        params.put("ApplyDoctor",applyDoctor);
        params.put("ExecuteDept",executeDept);
        params.put("prescriptionInfoDOS", array.toJSONString());
        logger.info("prescriptionInfoDOS"+params.get("prescriptionInfoDOS"));
        logger.info("params"+params.toString());
        response = httpClientUtil.httpPost(url,params);
        logger.info("开方成功"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
             jsonObject = object.getJSONObject("obj");
        }
        return jsonObject;
    }
//=====================hospital应用调用entrance应用============end=================

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -1204,7 +1204,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("pres_doc_name", info.get("doctor_name")== null?"0":info.get("doctor_name"));
                jb.put("pres_doc_id_no", info.get("docIdcard")== null?"0":info.get("docIdcard"));
                jb.put("trial_doc_code", trialDocCode);
                jb.put("trial_doc_name", "合理用药系统审方");
                jb.put("trial_doc_name", "陈丽玲");
                jb.put("trial_doc_id_no","350524198906247742");
                jb.put("diag_code", info.get("icd10"));
                jb.put("diag_name", info.get("icd10_name"));

+ 38 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -384,6 +384,44 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
                                   @RequestParam(value = "spellCode",required = false)String spellCode)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.GetLisApply(spellCode));
    }
    /**
     * 互联网医院开处方信息更新到his
     *
     * @param IoFlag  门诊住院标志
     * @param PayCardNo 就诊卡号
     * @param NullahNumber 挂号流水号
     * @param ApplyDept 执行科室
     * @param ApplyDoctor 开单医生
     * @param ExecuteDept 执行科室(药房)
     * @param prescriptionInfoDOS
     */
    @PostMapping(value = "/savePrescriptionToHospital")
    @ApiOperation(value = "互联网医院开处方信息更新到his", notes = "互联网医院开处方信息更新到his")
    public ObjEnvelop savePrescriptionToHospital(@ApiParam(name = "IoFlag", value = "门诊住院标志", required = false)
                                                     @RequestParam(value = "IoFlag",required = false)String IoFlag,
                                                 @ApiParam(name = "PayCardNo", value = "就诊卡号", required = false)
                                                    @RequestParam(value = "PayCardNo",required = false)String PayCardNo,
                                                 @ApiParam(name = "NullahNumber", value = "挂号流水号", required = false)
                                                     @RequestParam(value = "NullahNumber",required = false)String NullahNumber,
                                                 @ApiParam(name = "ApplyDept", value = "执行科室", required = false)
                                                     @RequestParam(value = "ApplyDept",required = false)String ApplyDept,
                                                 @ApiParam(name = "ApplyDoctor", value = "开单医生", required = false)
                                                     @RequestParam(value = "ApplyDoctor",required = false)String ApplyDoctor,
                                                 @ApiParam(name = "ExecuteDept", value = "执行科室(药房)", required = false)
                                                     @RequestParam(value = "ExecuteDept",required = false)String ExecuteDept,
                                                 @ApiParam(name = "prescriptionInfoDOS", value = "药品信息", required = false)
                                                     @RequestParam(value = "prescriptionInfoDOS",required = false)String prescriptionInfoDOS)throws Exception{
        List<WlyyPrescriptionInfoDO> prescriptionInfoDOList = new ArrayList<>();
        if (prescriptionInfoDOS!=null){
            JSONArray jsonArray = JSONArray.parseArray(prescriptionInfoDOS);
            for (int i=0;i<jsonArray.size();i++){
                WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO = toEntity(jsonArray.getJSONObject(i).toJSONString(),WlyyPrescriptionInfoDO.class);
                prescriptionInfoDOList.add(wlyyPrescriptionInfoDO);
            }
        }
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.savePrescriptionToHospital(IoFlag,PayCardNo,NullahNumber,ApplyDept,ApplyDoctor,ExecuteDept,prescriptionInfoDOList));
    }
    /**
     * 获取检验单据信息
     * @return