Browse Source

添加工具类判断节假日

wangzhinan 2 years ago
parent
commit
db704706bc

+ 33 - 11
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java

@ -130,6 +130,8 @@ public class HcyyEntranceService {
    private static String caKey = "bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String checkKey = "ydxtMEQmPymRtfz15lW76Tne88pHcuAU8WygMu/TrTKPRY5G7jttcg==";
    //发送微信模板消息
    /*@Value("${wechat.url}")*/
    private String sendMessageUrl="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
@ -2449,10 +2451,12 @@ public class HcyyEntranceService {
    public String initParams(String serviceCode,String payType,String patient,String doctor,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
    public String initParams(String hisId,String serviceCode,String payType,String patient,String doctor,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
        String xml ="";
        String hisId = UUID.randomUUID().toString();
        if (!StringUtils.isNoneBlank(hisId)){
            hisId = UUID.randomUUID().toString();
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if (patientMappingDO == null){
            return "患者信息映射表为空";
@ -2605,7 +2609,7 @@ public class HcyyEntranceService {
                    "   </opt_diagnosis>  ";
            prescriptionDiagnoses += prescriptionDiagnose;
        }
        String cancelPrescription = "<opt_prescriptions>  \n" +
        String savePrescription = "<opt_prescriptions>  \n" +
                "       <opt_prescription>  \n" +
                "           <opt_prescription_info>  \n" +
                "               <recipe_id><![CDATA["+hisId+"]]></recipe_id>  \n" +
@ -2632,11 +2636,14 @@ public class HcyyEntranceService {
        if (serviceCode.equals("GY_V4_FLEXIBLE") || serviceCode.equals("GY_SF_V4")){
            xml = "<root>" + base + optPatient + prescriptions + diagnoses + "</root>";
        }
        if (serviceCode.equalsIgnoreCase("submitRecipe")){
            xml ="<root>"+ base+ savePrescription+" </root>";
        }
        else if (serviceCode.equals("SF_V4_VALID_FLAG")){
            xml = "<root>" + base + cancelPrescription + "</root>";
            xml = "<root>" + base + savePrescription + "</root>";
        }
        else if (serviceCode.equals("CANCEL_GROUP_DRUG_V4")){
            xml = "<root>" + base + doctors + cancelPrescription + "</root>";
            xml = "<root>" + base + doctors + savePrescription + "</root>";
        }
     /*   else if (serviceCode.equals("SF_V4_DOUBLE_SIGN")){
            xml = "<root>" + base + doctors + feedback + "</root>";
@ -2662,7 +2669,7 @@ public class HcyyEntranceService {
                "   <serverName>"+serviceCode+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+caKey+"</certificate> " +
                "   <certificate>"+checkKey+"</certificate> " +
                "</root>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                jsonData;
@ -2696,12 +2703,27 @@ public class HcyyEntranceService {
            return "诊断信息为空";
        }
            String xml = "";
            xml = initParams("GY_SF_V4",payType, patient, doctor, infos, diagnosisDOS,outpatientId);
            xml = initParams(hisId,"GY_SF_V4",payType, patient, doctor, infos, diagnosisDOS,outpatientId);
            String response = checkPrescription("GY_SF_V4", xml, "合理用药审查");
        return response;
    }
    public String saveCheckPrescriptions(String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
        if (null == infos || infos.size() == 0) {
            return "药品信息为空";
        }
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
        String xml = "";
        xml = initParams(hisId,"submitRecipe",payType, patient, doctor, infos, diagnosisDOS,outpatientId);
        String response = checkPrescription("submitRecipe", xml, "合理用药审查");
        return response;
    }
    //处方在医生站系统成功保存后调用
    public String saveCheck(String outpatient, String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
        if (infos == null || infos.size() == 0) {
@ -2712,7 +2734,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("GY_SF_V4", payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("","GY_SF_V4", payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2730,7 +2752,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_VALID_FLAG",payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("","SF_V4_VALID_FLAG",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2748,7 +2770,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("CANCEL_GROUP_DRUG_V4",payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("","CANCEL_GROUP_DRUG_V4",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2766,7 +2788,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_DOUBLE_SIGN",payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("","SF_V4_DOUBLE_SIGN",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }

+ 44 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java

@ -646,8 +646,9 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
        return success(hcyyEntranceService.checkPrescriptions(prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS,outpatientId));
    }
    /**
     * 处方在医生站系统成功保存后调用
     * 合理用药审核
     * @param patient 病人id
     * @param doctor 医生id
     * @param diagnosisDOS 诊断json
@ -655,6 +656,47 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/saveCheckPrescriptions")
    @ApiOperation(value = "合理用药审核")
    public Envelop saveCheckPrescriptions(
            @ApiParam(name = "prescriptionOnly", value = "处方唯一标识")
            @RequestParam(value = "prescriptionOnly", defaultValue = "") String prescriptionOnly,
            @ApiParam(name = "payType", value = "付款方式0自费;1医保")
            @RequestParam(value = "payType", defaultValue = "") String payType,
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", defaultValue = "") String doctor,
            @ApiParam(name = "patient", value = "病人id")
            @RequestParam(value = "patient", defaultValue = "") String patient,
            @ApiParam(name = "diagnosisDOS", value = "诊断json")
            @RequestParam(value = "diagnosisDOS", defaultValue = "") String diagnosisDOS,
            @ApiParam(name = "infos", value = "药品json")
            @RequestParam(value = "infos", defaultValue = "") String infos,
            @ApiParam(name = "outpatientId",value = "门诊id")
            @RequestParam(value = "outpatientId", defaultValue = "") String outpatientId) throws Exception {
        JSONArray druginfos = JSONArray.parseArray(infos);
        List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = new ArrayList<>();
        for (int i = 0; i < druginfos.size(); i++) {
            WlyyPrescriptionInfoDO wlyyPrescriptionInfo = toEntity(druginfos.get(i).toString(), WlyyPrescriptionInfoDO.class);
            wlyyPrescriptionInfoDOS.add(wlyyPrescriptionInfo);
        }
        JSONArray diagnosis = JSONArray.parseArray(diagnosisDOS);
        List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOS = new ArrayList<>();
        for (int i = 0; i < diagnosis.size(); i++) {
            WlyyPrescriptionDiagnosisDO wlyyPrescriptionDiagnosisDO = toEntity(diagnosis.get(i).toString(), WlyyPrescriptionDiagnosisDO.class);
            wlyyPrescriptionDiagnosisDOS.add(wlyyPrescriptionDiagnosisDO);
        }
        return success(hcyyEntranceService.saveCheckPrescriptions(prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS,outpatientId));
    }
   /* *//**
     * 处方在医生站系统成功保存后调用
     * @param patient 病人id
     * @param doctor 医生id
     * @param diagnosisDOS 诊断json
     * @param infos  药品json
     * @return
     * @throws Exception
     *//*
    @PostMapping(value = "/hcyySaveCheckInfo")
    @ApiOperation(value = "处方在医生站系统成功保存后调用")
    public Envelop hcyySaveCheckInfo(
@ -685,7 +727,7 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
            wlyyPrescriptionDiagnosisDOS.add(wlyyPrescriptionDiagnosisDO);
        }
        return success(hcyyEntranceService.saveCheck(outpatient,prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS));
    }
    }*/
    /**
     * 处方保存成功后,发送给审方系统进行人工审方