Browse Source

眼科版本更改

wangzhinan 5 days ago
parent
commit
c40d53e4a6

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

@ -22,6 +22,10 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    @Query("select a from WlyyPrescriptionDO a where a.patientCode = ?1 and a.status >= 0 ")
    List<WlyyPrescriptionDO> findByPatientCode(String patientCode);
    @Query("select a from WlyyPrescriptionDO a where a.status >= 20 ")
    List<WlyyPrescriptionDO> findByStatus();
    @Modifying
    @Query("update WlyyPrescriptionDO p set p.status=?2 where p.id=?1")
    void updateStatus(String id,Integer status);

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

@ -2878,6 +2878,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    object.put("deptCode",outpatientDO.getDeptName());
                    object.put("outpatientCode",outpatientDO.getRegisterNo());
                    object.put("eventno","R"+outpatientDO.getRegisterNo());
                    object.put("patientMobile",outpatientDO.getMobile());
                }
                com.alibaba.fastjson.JSONObject jsonObject = ykyyService.getSignPicture(outpatientDO.getDoctor());
                if (jsonObject!=null){
@ -2886,7 +2887,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        object.put("baseSign",dataJson.getString("image"));
                    }
                }
                object.put("diseaseName",outpatientDO.getDiseaseName());
                object.put("diseaseName",outpatientDO.getIcd10Name());
                if (StringUtils.isNoneBlank(infoJsons)){
                    String html = "";
                    List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class);
                    for(int i=0;i<infoDOs.size();i++){
                        WlyyPrescriptionInfoDO infoDO = infoDOs.get(i);
                        int j = i+1;
                        html += "<tr key=\""+j+"\" >\n" +
                                "<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\"  align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                ""+j+"、"+infoDO.getDrugName()+" \n" +
                                "</td>\n" +
                                "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                "10ml\n" +
                                "</td>\n" +
                                "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                "每次"+infoDO.getDosage()+infoDO.getUnitName()+"\n" +
                                "</td>\n" +
                                "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                ""+infoDO.getSupplyName()+"\n" +
                                "</td>\n" +
                                "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                ""+infoDO.getUsageName()+"\n" +
                                "</td>\n" +
                                "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                                ""+infoDO.getDays()+"日\n" +
                                "</td>\n" +
                                "</tr>";
                    }
                    object.put("info",html);
                }
                ykyyPrescriptionService.returnEmrHtmlByHLW(object,wlyyPrescriptionEmrDO);
            }
        }

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

@ -155,6 +155,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private BaseOrgDao orgDao;
    private final static String saveUrl = "http://192.168.20.55:10023/ykyy/save";
@ -2340,7 +2342,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                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,"@patientMobile@",jsonObject.getString("patientMobile"));
                htmlDeo = replaceHtml(htmlDeo,"@Special@",prescriptionEmrDO.getSpecialHistory());
                SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
@ -2352,6 +2354,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                htmlDeo = replaceHtml(htmlDeo,"@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
                htmlDeo = replaceHtml(htmlDeo,"@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
                htmlDeo = replaceHtml(htmlDeo,"@assistExamination@",prescriptionEmrDO.getAssistExamination());
                htmlDeo = replaceHtml(htmlDeo,"@info@",jsonObject.getString("info"));
            }
        }
        prescriptionEmrDO.setHtmlStr(htmlDeo);
@ -2412,4 +2415,75 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
    }
    public void syncEmr(String prescriptionId) throws Exception {
        List<WlyyPrescriptionDO> prescriptionDOS = new ArrayList<>();
        if (StringUtils.isNoneBlank(prescriptionId)){
            prescriptionDOS = prescriptionDao.findById(prescriptionId);
        }else {
            prescriptionDOS = prescriptionDao.findByStatus();
        }
        for (WlyyPrescriptionDO prescriptionDO:prescriptionDOS){
            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
            BasePatientDO basePatientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
            if (outpatientDO!=null){
                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());
                    object.put("diseaseName",outpatientDO.getIcd10Name());
                    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("patientMobile",outpatientDO.getMobile());
                }
                String html = "";
                List<WlyyPrescriptionInfoDO> infoDOs = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(),1);
                for(int i=0;i<infoDOs.size();i++){
                    WlyyPrescriptionInfoDO infoDO = infoDOs.get(i);
                    int j = i+1;
                    html += "<tr key=\""+j+"\" >\n" +
                            "<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\"  align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            ""+j+"、"+infoDO.getDrugName()+" \n" +
                            "</td>\n" +
                            "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            "10ml\n" +
                            "</td>\n" +
                            "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            "每次"+infoDO.getDosage()+infoDO.getUnitName()+"\n" +
                            "</td>\n" +
                            "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            ""+infoDO.getSupplyName()+"\n" +
                            "</td>\n" +
                            "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            ""+infoDO.getUsageName()+"\n" +
                            "</td>\n" +
                            "<td  style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\"  valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
                            ""+infoDO.getDays()+"日\n" +
                            "</td>\n" +
                            "</tr>";
                }
                object.put("info",html);
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionDO.getId());
                if (wlyyPrescriptionEmrDO!=null){
                    returnEmrHtmlByHLW(object,wlyyPrescriptionEmrDO);
                }
            }
        }
    }
}

+ 7 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -545,6 +545,13 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        prescriptionService.synDoctorInfo();
    }
    @GetMapping(value = "syncEmr")
    @ApiOperation(value = "同步病历", notes = "同步病历")
    public void syncEmr(@ApiParam(name = "prescriptionId", value = "处方id")
                            @RequestParam(value = "prescriptionId", required = false)String prescriptionId) throws Exception {
        prescriptionService.syncEmr(prescriptionId);
    }
    @GetMapping(value = "selectCardList")
    @ApiOperation(value = "获取就诊卡列表", notes = "获取就诊卡列表")