zhaowenxuan
2024-11-28 edd6968aa0f62dce0229f6addb8a0762696eed0d
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -99,15 +99,17 @@
    @Logger
    public AjaxResult HisApiMethods(TjCustomer customer,TjOrder tjOrder) {
        String jzh=null;
        String dept = configService.selectConfigByKey("request_default_dept");
        String ysbm = configService.selectConfigByKey("request_default_ysbm");
        try {
//            TjOrder tjOrder = orderService.getById(orderId);
            Date dates = new Date();
            final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
            OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto();
            outpinregapplyDto.setPationid(customer.getPationId());
            outpinregapplyDto.setSqysbm("00029");
            outpinregapplyDto.setMzksbm("0101");
            outpinregapplyDto.setCzybm("00029");
            outpinregapplyDto.setSqysbm(ysbm);
            outpinregapplyDto.setMzksbm(dept);
            outpinregapplyDto.setCzybm(ysbm);
            outpinregapplyDto.setSfjz("0");
            outpinregapplyDto.setGhzlbm("01");
            outpinregapplyDto.setYwckbm("0001");
@@ -133,7 +135,7 @@
                    hisApiGetMethodService.save(object4, "Outpinregapply", hisApiConfig, JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinregapplyDto)));
                    //门诊医生接诊
                    AjaxResult result = controller.Outpinconapply(hisRegistrationId, date, "00029");
                    AjaxResult result = controller.Outpinconapply(hisRegistrationId, date, ysbm);
                    String result3 = getAjaxResult(result);
                    JSONObject object2 = getJSONObject(result3);
                    String code2 = object2.getStr("ResultCode");
@@ -156,12 +158,12 @@
                OutpinimpapplyDto dto=new OutpinimpapplyDto();
                dto.setHisRegistrationId(tjOrder.getCardId());
                dto.setMzzdid(1);
                dto.setSqysbm("00029");
                dto.setMzksbm("0101");
                dto.setSqysbm(ysbm);
                dto.setMzksbm(dept);
                dto.setFbrq(date);
                dto.setZdrq(date);
                dto.setCzybm("00029");
                dto.setCzyksbm("0101");
                dto.setCzybm(ysbm);
                dto.setCzyksbm(dept);
                dto.setZs("健康查体");
                dto.setBs("不详");
                dto.setClyz("");
@@ -190,7 +192,9 @@
    //体检对his申请单调用方法
    public AjaxResult tijianshenqing(TjCustomer customer, String date,String cardId) {
        String dept = configService.selectConfigByKey("request_default_dept");
        String ysbm = configService.selectConfigByKey("request_default_ysbm");
        String ysmc = configService.selectConfigByKey("request_default_ysmc");
        List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId);
@@ -198,11 +202,11 @@
        OutpintestapplyDto dto = new OutpintestapplyDto();
        dto.setHisRegistrationId(cardId);
        dto.setSfzh(customer.getCusIdcard());
        dto.setSqysbm("00029");
        dto.setMzksbm("0101");
        dto.setSqysbm(ysbm);
        dto.setMzksbm(dept);
        dto.setSjrq(date);
        dto.setCzybm("00029");
        dto.setCzyksbm("0101");
        dto.setCzybm(ysbm);
        dto.setCzyksbm(dept);
        dto.setSfjz("0");
        List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>();
@@ -310,10 +314,10 @@
        OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto();
        outpinexamapplyDto.setHisRegistrationId(cardId);
        outpinexamapplyDto.setSfzh(customer.getCusIdcard());
        outpinexamapplyDto.setSqysbm("00029");
        outpinexamapplyDto.setMzksbm("0101");
        outpinexamapplyDto.setCzybm("00029");
        outpinexamapplyDto.setCzyksbm("0101");
        outpinexamapplyDto.setSqysbm(ysbm);
        outpinexamapplyDto.setMzksbm(dept);
        outpinexamapplyDto.setCzybm(ysbm);
        outpinexamapplyDto.setCzyksbm(dept);
        outpinexamapplyDto.setSfjz("0");
//        List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId);
        List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>();
@@ -412,11 +416,11 @@
        OutpintreatapplyDto dao = new OutpintreatapplyDto();
        dao.setHisRegistrationId(cardId);
        dao.setSfzh(customer.getCusIdcard());
        dao.setSqysbm("00029");
        dao.setMzksbm("0101");
        dao.setSqysbm(ysbm);
        dao.setMzksbm(dept);
        dao.setSjrq(date);
        dao.setCzybm("00029");
        dao.setCzyksbm("0101");
        dao.setCzybm(ysbm);
        dao.setCzyksbm(dept);
        dao.setSfjz("0");
//        List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId);
        List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>();
@@ -514,11 +518,11 @@
            OutpinmedicapplyDto dto1=new OutpinmedicapplyDto();
            dto1.setHisRegistrationId(cardId);
            dto1.setSfzh(customer.getCusIdcard());
            dto1.setSqysbm("00029");
            dto1.setMzksbm("0101");
            dto1.setSqysbm(ysbm);
            dto1.setMzksbm(dept);
            dto1.setSjrq(date);
            dto1.setCzybm("00029");
            dto1.setCzyksbm("0101");
            dto1.setCzybm(ysbm);
            dto1.setCzyksbm(dept);
            dto1.setCflxbm("A");
            dto1.setYfbm("1");
            dto1.setFyts("1");
@@ -538,11 +542,11 @@
                    cf.setCardId(cardId);
                    cf.setSfzh(customer.getCusIdcard());
                    cf.setCfh(cfh);
                    cf.setSqysbm("00029");
                    cf.setSqysxm("王健萍");
                    cf.setMzksbn("0101");
                    cf.setSqysbm(ysbm);
                    cf.setSqysxm(ysmc);
                    cf.setMzksbn(dept);
                    cf.setSqrq(date);
                    cf.setCzybm("00029");
                    cf.setCzybm(ysbm);
                    cf.setYpbm(detilsDto.getYpbm());
                    cf.setYpmc("尿素[14C]呼气试验药盒");
                    cf.setSl(String.valueOf(detilsDto.getSl()));
@@ -792,6 +796,8 @@
    //退费后取消接诊作废申请单等操作
    @Transactional
    public boolean ZfHisApiMethods(TjCustomer customer, TjOrder order,Boolean isUseLisAndPacsRegister) {
        String ysbm = configService.selectConfigByKey("request_default_ysbm");
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
@@ -846,7 +852,7 @@
            //2.1.6.5 作废门诊检查申请
            if (null != jcsqdh && jcsqdh.size()>0) {
                for (String s : jcsqdh) {
                    AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", s);
                    AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
@@ -862,7 +868,7 @@
            //2.1.6.3 作废门诊检验申请
            if (null != jysqdh && jysqdh.size()>0) {
                for (String s : jysqdh) {
                    ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", s);
                    ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s);
                    result2 = getAjaxResult(ajaxResult);
                    object1 = getJSONObject(result2);
                    code1 = object1.getStr("ResultCode");
@@ -878,7 +884,7 @@
            //2.1.6.9 作废门诊治疗处置申请
            if (null != zlsqdh && zlsqdh.size()>0) {
                for (String s : zlsqdh) {
                    ajaxResult = controller.Outpintdelreatapply(order.getCardId(), "00029", s);
                    ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s);
                    result2 = getAjaxResult(ajaxResult);
                    object1 = getJSONObject(result2);
                    code1 = object1.getStr("ResultCode");
@@ -891,7 +897,7 @@
            //作废药品申请
            if(null !=cfhs && cfhs.size()>0){
                for (String cfh : cfhs) {
                    AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), "00029", cfh);
                    AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
@@ -903,7 +909,7 @@
//        }
        //2.1.3 门诊医生取消接诊
        ajaxResult = controller.Outpinunconapply(order.getCardId(), date, "00029");
        ajaxResult = controller.Outpinunconapply(order.getCardId(), date, ysbm);
        result2 = getAjaxResult(ajaxResult);
        object1 = getJSONObject(result2);
        code1 = object1.getStr("ResultCode");
@@ -920,6 +926,7 @@
        log.info("bldhs ->{}",JSONUtil.toJsonStr(bldhs));
        if(null !=bldhs && bldhs.size()>0){
            log.info("进入判断");
            String ysbm = configService.selectConfigByKey("request_default_ysbm");
            try {
                for (String bldh : bldhs) {
@@ -978,7 +985,7 @@
//                        2.1.6.5 作废门诊检查申请
                        if (null != jcsqdh && jcsqdh.size()>0) {
                            for (String s : jcsqdh) {
                                AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", s);
                                AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s);
                                String result1 = getAjaxResult(result);
                                JSONObject object = getJSONObject(result1);
                                String code = object.getStr("ResultCode");
@@ -993,7 +1000,7 @@
                        //2.1.6.3 作废门诊检验申请
                        if (null != jysqdh && jysqdh.size()>0) {
                            for (String s : jysqdh) {
                                ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", s);
                                ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s);
                                result2 = getAjaxResult(ajaxResult);
                                object1 = getJSONObject(result2);
                                code1 = object1.getStr("ResultCode");
@@ -1008,7 +1015,7 @@
                        //2.1.6.9 作废门诊治疗处置申请
                        if (null != zlsqdh && zlsqdh.size()>0) {
                            for (String s : zlsqdh) {
                                ajaxResult = controller.Outpintdelreatapply(order.getCardId(), "00029", s);
                                ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s);
                                result2 = getAjaxResult(ajaxResult);
                                object1 = getJSONObject(result2);
                                code1 = object1.getStr("ResultCode");
@@ -1023,7 +1030,7 @@
                        //作废药品申请
                        if(null !=cfhs && cfhs.size()>0){
                            for (String cfh : cfhs) {
                                AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), "00029", cfh);
                                AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh);
                                String result1 = getAjaxResult(result);
                                JSONObject object = getJSONObject(result1);
                                String code = object.getStr("ResultCode");
@@ -1047,6 +1054,7 @@
    //退费后取消接诊作废申请单等操作
    public boolean ZfHisApiMethod(String jzh) {
        String ysbm = configService.selectConfigByKey("request_default_ysbm");
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
@@ -1063,7 +1071,7 @@
        //2.1.6.5 作废门诊检查申请
        if (null != jcsqdh && jcsqdh.size()>0) {
            for (String s : jcsqdh) {
                AjaxResult result = controller.Outpindelexamapply(jzh, "00029", s);
                AjaxResult result = controller.Outpindelexamapply(jzh, ysbm, s);
                String result1 = getAjaxResult(result);
                JSONObject object = getJSONObject(result1);
                String code = object.getStr("ResultCode");
@@ -1084,7 +1092,7 @@
        if (null != jysqdh && jysqdh.size()>0) {
            for (String s : jysqdh) {
                ajaxResult = controller.Outpindeltestapply(jzh, "00029", s);
                ajaxResult = controller.Outpindeltestapply(jzh, ysbm, s);
                result2 = getAjaxResult(ajaxResult);
                object1 = getJSONObject(result2);
                code1 = object1.getStr("ResultCode");
@@ -1097,7 +1105,7 @@
        //2.1.6.9 作废门诊治疗处置申请
        if (null != zlsqdh && zlsqdh.size()>0) {
            for (String s : zlsqdh) {
                ajaxResult = controller.Outpintdelreatapply(jzh, "00029", s);
                ajaxResult = controller.Outpintdelreatapply(jzh, ysbm, s);
                result2 = getAjaxResult(ajaxResult);
                object1 = getJSONObject(result2);
                code1 = object1.getStr("ResultCode");
@@ -1110,7 +1118,7 @@
        //作废药品申请
        if(null !=cfhs && cfhs.size()>0){
            for (String cfh : cfhs) {
                AjaxResult result = controller.Outpindelmedicapply(jzh, "00029", cfh);
                AjaxResult result = controller.Outpindelmedicapply(jzh, ysbm, cfh);
                String result1 = getAjaxResult(result);
                JSONObject object = getJSONObject(result1);
                String code = object.getStr("ResultCode");
@@ -1122,7 +1130,7 @@
        //2.1.3 门诊医生取消接诊
        ajaxResult = controller.Outpinunconapply(jzh, date, "00029");
        ajaxResult = controller.Outpinunconapply(jzh, date, ysbm);
        result2 = getAjaxResult(ajaxResult);
        object1 = getJSONObject(result2);
        code1 = object1.getStr("ResultCode");