Browse Source

历史处方和模板支持选择调用。

hurugang 3 years ago
parent
commit
4f567d4713

+ 1 - 1
src/main/java/cn/hnthyy/thmz/Utils/JsonUtil.java

@@ -8,7 +8,7 @@ import com.google.gson.GsonBuilder;
  */
 public class JsonUtil {
     // private static Gson gson = new Gson();
-    private static Gson gson = new GsonBuilder()
+    private static Gson gson = new GsonBuilder().disableHtmlEscaping()
             .registerTypeAdapter(int.class, new IntTypeAdapter())
             .registerTypeAdapter(Integer.class, new IntTypeAdapter())
             .registerTypeAdapter(double.class, new DoubleTypeAdapter())

+ 0 - 34
src/main/java/cn/hnthyy/thmz/controller/mz/MzBlRecordController.java

@@ -64,40 +64,6 @@ public class MzBlRecordController {
                 results.put("message", "查询门诊病历失败,没有对应的门诊病历数据");
                 return results;
             }
-            if (mzBlRecord.getEmrProcess() != null) {
-                String zyzl = null;
-                if (mzBlRecord.getEmrProcess().indexOf("中药治疗:") >= 0) {
-                    if (mzBlRecord.getEmrProcess().indexOf("辅助检查、检验:") >= 0) {
-                        zyzl = mzBlRecord.getEmrProcess().substring(mzBlRecord.getEmrProcess().indexOf("中药治疗:"), mzBlRecord.getEmrProcess().indexOf("辅助检查、检验:"));
-                    } else if (mzBlRecord.getEmrProcess().indexOf("诊疗:") >= 0) {
-                        zyzl = mzBlRecord.getEmrProcess().substring(mzBlRecord.getEmrProcess().indexOf("中药治疗:"), mzBlRecord.getEmrProcess().indexOf("诊疗:"));
-                    }else if (mzBlRecord.getEmrProcess().indexOf("入院处理:") >= 0) {
-                        zyzl = mzBlRecord.getEmrProcess().substring(mzBlRecord.getEmrProcess().indexOf("中药治疗:"), mzBlRecord.getEmrProcess().indexOf("入院处理:"));
-                    } else {
-                        zyzl = mzBlRecord.getEmrProcess().substring(mzBlRecord.getEmrProcess().indexOf("中药治疗:"));
-                    }
-                    if (zyzl != null && StringUtils.isNotBlank(zyzl)) {
-                        mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replace(zyzl, "%zwf%"));
-                        zyzl = zyzl.replaceAll("_", " ").replaceAll("中药治疗:", "</br>中药治疗:</br>");
-                    }
-                }
-                mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replaceAll("_", "</br>").replaceAll("西药治疗:", "西药治疗:</br>").replaceAll("辅助检查、检验:", "辅助检查、检验:</br>").replaceAll("诊疗:", "诊疗:</br>").replaceAll("入院处理:", "入院处理:</br>"));
-                if (zyzl != null) {
-                    mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replace("%zwf%", zyzl));
-                }
-                if (mzBlRecord.getEmrProcess().indexOf("中药治疗:") > 0) {
-                    mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replaceAll("中药治疗:", "</br>中药治疗:"));
-                }
-                if (mzBlRecord.getEmrProcess().indexOf("辅助检查、检验:") > 0) {
-                    mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replaceAll("辅助检查、检验:", "</br>辅助检查、检验:"));
-                }
-                if (mzBlRecord.getEmrProcess().indexOf("诊疗:") > 0) {
-                    mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replaceAll("诊疗:", "</br>诊疗:"));
-                }
-                if (mzBlRecord.getEmrProcess().indexOf("入院处理:") > 0) {
-                    mzBlRecord.setEmrProcess(mzBlRecord.getEmrProcess().replaceAll("入院处理:", "</br>入院处理:"));
-                }
-            }
             results.put("code", 0);
             results.put("message", "查询门诊病历成功");
             results.put("mzBlRecord", mzBlRecord);

+ 53 - 23
src/main/java/cn/hnthyy/thmz/service/his/mz/MzChargeDetailService.java

@@ -70,10 +70,10 @@ public interface MzChargeDetailService {
      * 将未缴费的处方转成完整的收费明细
      *
      * @param patientId 病人id
-     * @param name 病人姓名
+     * @param name      病人姓名
      * @return
      */
-    List<MzChargeDetail> unPaidToFullChargeDetail(String patientId,String name) throws MzException;
+    List<MzChargeDetail> unPaidToFullChargeDetail(String patientId, String name) throws MzException;
 
 
     /**
@@ -89,10 +89,10 @@ public interface MzChargeDetailService {
      *
      * @param opId
      * @param mzDepositFileVo
-     * @param ipAddress   客户端IP  自助的时候是传自助编码
+     * @param ipAddress       客户端IP  自助的时候是传自助编码
      * @return
      */
-    int chargeFee(String opId, MzDepositFileVo mzDepositFileVo,String ipAddress) throws MzException;
+    int chargeFee(String opId, MzDepositFileVo mzDepositFileVo, String ipAddress) throws MzException;
 
     /**
      * 查询当前就诊次数的所有取药号与药房信息
@@ -135,10 +135,10 @@ public interface MzChargeDetailService {
      *
      * @param opId
      * @param mzDepositFileVo
-     * @param ipAddress 客户端IP  自助的时候是传自助编码
+     * @param ipAddress       客户端IP  自助的时候是传自助编码
      * @return
      */
-    int refundFee(String opId, MzDepositFileVo mzDepositFileVo,String ipAddress) throws MzException;
+    int refundFee(String opId, MzDepositFileVo mzDepositFileVo, String ipAddress) throws MzException;
 
     /**
      * 获取退费后新产生的缴费明细记录
@@ -196,7 +196,7 @@ public interface MzChargeDetailService {
      * @param mzReceiptSerial
      * @throws MzException
      */
-    void afterChargeFee(String patientId, Integer times, List<MzDepositFile> mzDepositFiles, Date now, int serialNo, MzReceiptSerial mzReceiptSerial, BigDecimal totalPayable,ReceiptSerialFee receiptSerialFee) throws MzException;
+    void afterChargeFee(String patientId, Integer times, List<MzDepositFile> mzDepositFiles, Date now, int serialNo, MzReceiptSerial mzReceiptSerial, BigDecimal totalPayable, ReceiptSerialFee receiptSerialFee) throws MzException;
 
 
     /**
@@ -284,22 +284,25 @@ public interface MzChargeDetailService {
 
     /**
      * 保存处方信息
+     *
      * @param mzPrescriptionVo 处方信息
-     * @param dbClinic 被修改的就诊记录,如果没有可以是null
+     * @param dbClinic         被修改的就诊记录,如果没有可以是null
      * @return
      */
-    Clinic savePrescription(MzPrescriptionVo mzPrescriptionVo,Clinic dbClinic) throws MzException;
+    Clinic savePrescription(MzPrescriptionVo mzPrescriptionVo, Clinic dbClinic) throws MzException;
 
     /**
      * 删除处方
-     * @param clnicId 就诊记录主键
+     *
+     * @param clnicId   就诊记录主键
      * @param tokenUser 当前操作人
      * @return
      */
-    int deletePrescription(Long clnicId,User tokenUser) throws MzException;
+    int deletePrescription(Long clnicId, User tokenUser) throws MzException;
 
     /**
      * 核酸检测(单人)
+     *
      * @param patientId
      * @return
      */
@@ -307,6 +310,7 @@ public interface MzChargeDetailService {
 
     /**
      * 核酸检测(混检)开处方收费,只收费不生成医技申请
+     *
      * @param patientId
      * @return
      */
@@ -315,6 +319,7 @@ public interface MzChargeDetailService {
 
     /**
      * 核酸检测(混检)开处方,只生成医技申请不收费
+     *
      * @param patientId
      * @return
      */
@@ -322,6 +327,7 @@ public interface MzChargeDetailService {
 
     /**
      * 查询药房类型
+     *
      * @param
      * @return
      */
@@ -329,12 +335,13 @@ public interface MzChargeDetailService {
 
     /**
      * 修改付款方式
-     * @param chequeType 新付款方式
-     * @param receiptSn 流水号
+     *
+     * @param chequeType    新付款方式
+     * @param receiptSn     流水号
      * @param oldChequeType 老的付款方式
      * @return
      */
-    int modifyChequType( String chequeType,Integer receiptSn,String oldChequeType) throws MzException;
+    int modifyChequType(String chequeType, Integer receiptSn, String oldChequeType) throws MzException;
 
 
 //    /**
@@ -346,6 +353,7 @@ public interface MzChargeDetailService {
 
     /**
      * 查询门诊收费记录
+     *
      * @param mzChargeDetail
      * @return
      */
@@ -354,21 +362,23 @@ public interface MzChargeDetailService {
 
     /**
      * 计算临时处方的中药,西药,诊疗以及总金额
+     *
      * @param mzPrescriptionVo
      * @return
      * @throws MzException
      */
-    Map<String,Object> getAmountForTempPrescription(MzPrescriptionVo mzPrescriptionVo) throws MzException;
+    Map<String, Object> getAmountForTempPrescription(MzPrescriptionVo mzPrescriptionVo) throws MzException;
 
     /**
      * 获取病人某次处方信息
+     *
      * @param patientId
      * @param times
-     * @param MzBlRecordFlag  如果是修改处方传false  如果是重复接诊传; true 时,只需要构造病历信息,不需要设置用药和诊疗信息
+     * @param MzBlRecordFlag 如果是修改处方传false  如果是重复接诊传; true 时,只需要构造病历信息,不需要设置用药和诊疗信息
      * @param payMark
      * @return
      */
-    MzPrescriptionVo getMzPrescriptionVo(String patientId,Integer times,Boolean MzBlRecordFlag,String payMark) throws MzException;
+    MzPrescriptionVo getMzPrescriptionVo(String patientId, Integer times, Boolean MzBlRecordFlag, String payMark) throws MzException;
 
     /**
      * 修改门诊发药打印标记
@@ -389,42 +399,54 @@ public interface MzChargeDetailService {
 
     /**
      * 清洗历史数据
+     *
      * @return
      */
     Integer setPriceTime();
 
     /**
      * 打印医技申请单
+     *
      * @param patientId
      * @param times
-     * @param reqType 申请单类型:2:检验;3:检查
+     * @param reqType   申请单类型:2:检验;3:检查
      * @return
      */
-    Map<String,Object> printYjReq(String patientId,Integer times,String reqType) throws MzException;
+    Map<String, Object> printYjReq(String patientId, Integer times, String reqType) throws MzException;
 
     /**
      * 设置完整处方
      *
      * @param mzPrescriptionVo 处方信息
      * @param needPatient      是否需要病人信息
-     * @param needVerify      是否需要校验参数  true 需要
+     * @param needVerify       是否需要校验参数  true 需要
      * @throws MzException
      */
-    void setFullMzPrescriptionVo(MzPrescriptionVo mzPrescriptionVo, boolean needPatient,Boolean needVerify) throws MzException;
+    void setFullMzPrescriptionVo(MzPrescriptionVo mzPrescriptionVo, boolean needPatient, Boolean needVerify) throws MzException;
 
 
+    /**
+     * 设置处方明细的描述
+     *
+     * @param mzPrescriptionVo
+     * @param chargeOrDiscount 加收或者打折 Yes  新处方需要计算  No 已入库处方以及不需要计算
+     */
+    void setPrescriptionDetail(MzPrescriptionVo mzPrescriptionVo, YesNoEnum chargeOrDiscount, Date birthDay) throws MzException;
+
     /**
      * 医技申请确认费用
+     *
      * @param flag
      * @param opId
      * @param reqNo
      * @return
      */
-    int modifyReceiveFlagAndConfirmFlag(String flag, String opId,Integer reqNo) throws MzException;
+    int modifyReceiveFlagAndConfirmFlag(String flag, String opId, Integer reqNo) throws MzException;
 
 
     /**
      * 查询核酸混检病人总数
+     *
      * @param mzYjReq
      * @return
      */
@@ -441,6 +463,7 @@ public interface MzChargeDetailService {
 
     /**
      * 获取处方打印状态
+     *
      * @param patientId
      * @param times
      * @param orderNo
@@ -451,7 +474,14 @@ public interface MzChargeDetailService {
 
     /**
      * 查询患者是否有已经缴费且未确认的检查记录
+     *
      * @return
      */
-    Integer queryCountMzChargeDetailByPatientIdAndChargeItemCode(String patientId,String chargeItemCode);
+    Integer queryCountMzChargeDetailByPatientIdAndChargeItemCode(String patientId, String chargeItemCode);
+
+    /**
+     * 设置药品集合里的麻精药物的药房编号,零时的,不会入库,因为没有这样的药房
+     * @param mzChargeDetailList
+     */
+    void setMjGroupForTempDetail(List<MzChargeDetail> mzChargeDetailList);
 }

+ 198 - 186
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1043,7 +1043,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (mzPatientMi == null) {
             throw new MzException("当前病人信息不存在,请先保存病人信息!");
         }
-        //判断当前患者本次就诊是否急诊号
+        //判断当前患者本次就诊是否急诊号
         Integer JzFlag = getJzFlag(mzPrescriptionVo, mzPatientMi);
         setPrescriptionDetail(mzPrescriptionVo, YesNoEnum.YES, mzPatientMi.getBirthDay());
         if (dbClinic != null && dbClinic.getId() != null && StringUtils.isNotBlank(dbClinic.getPatientId()) && dbClinic.getTimes() != null && ClinicStatusEnum.HAD_CLINIC.code.equals(dbClinic.getClinicStatus())) {
@@ -1181,9 +1181,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
      * 设置处方明细的描述
      *
      * @param mzPrescriptionVo
-     * @param savePrescription Yes  新处方  已入库处方
+     * @param chargeOrDiscount 加收或者打折 Yes  新处方需要计算  No 已入库处方以及不需要计算
      */
-    private void setPrescriptionDetail(MzPrescriptionVo mzPrescriptionVo, YesNoEnum savePrescription, Date birthDay) throws MzException {
+    public void setPrescriptionDetail(MzPrescriptionVo mzPrescriptionVo, YesNoEnum  chargeOrDiscount, Date birthDay) throws MzException {
         Map<String, Object> prescriptionDetail = new HashMap<>();
         List<Map<String, Object>> zyPrescription = new ArrayList();
         prescriptionDetail.put("zyPrescription", zyPrescription);
@@ -1206,7 +1206,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (mzPrescriptionVo.getMzYjReqList() != null && mzPrescriptionVo.getMzYjReqList().size() > 0) {
             Map<String, Object> yjMap = new HashMap<>();
             yjMap.put("amount", BigDecimal.ZERO);
-            List<String> detail = new ArrayList<>();
+            List<Map<String,Object>> detail = new ArrayList<>();
             Map<String, Object> jcHalfFareMap = null;
             //List<Map<String, List<ZdChargeItem>>> fullZdChargeItemList = new ArrayList<>();
             //医技医嘱码对应的处方明细
@@ -1217,18 +1217,30 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             Map<String, MzYjReq> mzYjReqMap = null;
             for (int i = 0; i < mzPrescriptionVo.getMzYjReqList().size(); i++) {
                 MzYjReq mzYjReq = mzPrescriptionVo.getMzYjReqList().get(i);
+                Map<String, Object> yjDetail = new HashMap<>();
+                detail.add(yjDetail);
                 int index = i + 1;
+                yjDetail.put("index",index);
+                yjDetail.put("orderCode",mzYjReq.getOrderCode());
+                yjDetail.put("name",mzYjReq.getGroupName());
                 String name = index + "." + mzYjReq.getGroupName();
                 if (StringUtils.isNotBlank(mzYjReq.getJyRemark())) {
                     name += " 备注:" + mzYjReq.getJyRemark();
+                    yjDetail.put("remark",mzYjReq.getJyRemark());
                 }
-                detail.add(name);
-                if (emrFzjc == null) {
-                    emrFzjc = name;
-                } else {
-                    emrFzjc += "," + name;
+                //检查
+                if("3".equals(mzYjReq.getReqType())){
+                    if (emrFzjc == null) {
+                        emrFzjc = name;
+                    } else {
+                        emrFzjc += " " + name;
+                    }
+                    yjDetail.put("inspectPart",mzYjReq.getInspectPart());
+                }else {
+                    yjDetail.put("inspectStuff",mzYjReq.getInspectStuff());
                 }
-                if (YesNoEnum.YES.equals(savePrescription)) {
+                yjDetail.put("execDept",mzYjReq.getExecDept());
+                if (YesNoEnum.YES.equals(chargeOrDiscount)) {
                     if (jcHalfFareMap == null) {
                         jcHalfFareMap = new HashMap<>();
                     }
@@ -1312,13 +1324,23 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     }
                     amount = amount.add(tempAmount);
                     tempMap.put("amount", amount);
-                    List<String> detail = (List<String>) tempMap.get("detail");
-                    String name = mzChargeDetail.getTcName();
+                    List<Map<String,Object>> detail = (List<Map<String,Object>>) tempMap.get("detail");
+                    Map<String,Object> zyDetail = new HashMap<>();
+                    zyDetail.put("orderCode",mzChargeDetail.getChargeItemCode()+"_"+mzChargeDetail.getSerial());
+                    zyDetail.put("name",mzChargeDetail.getTcName());
                     if (StringUtils.isNotBlank(mzChargeDetail.getInstructionText())) {
-                        name += "[" + mzChargeDetail.getInstructionText() + "]";
+                        zyDetail.put("instructionCode",mzChargeDetail.getInstructionCode());
+                        zyDetail.put("instructionText",mzChargeDetail.getInstructionText());
                     }
-                    name += mzChargeDetail.getQuantity() + "g";
-                    detail.add(name);
+                    zyDetail.put("quantity",mzChargeDetail.getQuantity());
+//                    zyDetail.put("cyMtjs",mzChargeDetail.getCyMtjs());
+//                    zyDetail.put("cyJsl",mzChargeDetail.getCyJsl());
+//                    zyDetail.put("cyZql",mzChargeDetail.getCyZql());
+//                    zyDetail.put("cyFj",mzChargeDetail.getCyFj());
+//                    zyDetail.put("cyFfcs",mzChargeDetail.getCyFfcs());
+//                    zyDetail.put("cyFysm",mzChargeDetail.getCyFysm());
+//                    zyDetail.put("cyJssm",mzChargeDetail.getCyJssm());
+                    detail.add(zyDetail);
                 } else if (Constants.YJ_GROUP_NO.equals(mzChargeDetail.getGroupNo())) {
                     if (Constants.TC.equals(mzChargeDetail.getBillItemCode()) || Constants.SSWRF.equals(mzChargeDetail.getBillItemCode())) {
                         continue;
@@ -1334,10 +1356,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         continue;
                     }
                     if (zlPrescription.size() == 0) {
-                        Map<String, Object> yjMap = new HashMap<>();
-                        yjMap.put("amount", BigDecimal.ZERO);
-                        yjMap.put("detail", new ArrayList<>());
-                        zlPrescription.add(yjMap);
+                        Map<String, Object> zlMap = new HashMap<>();
+                        zlMap.put("amount", BigDecimal.ZERO);
+                        zlMap.put("detail", new ArrayList<>());
+                        zlPrescription.add(zlMap);
                     }
                     Map<String, Object> tempMap = zlPrescription.get(0);
                     BigDecimal amount = (BigDecimal) tempMap.get("amount");
@@ -1365,13 +1387,17 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     tempMap.put("amount", amount);
                     if (StringUtils.isBlank(mzChargeDetail.getTcNo())) {
                         //诊疗项目
-                        List<String> detail = (List<String>) tempMap.get("detail");
+                        List<Map<String, Object>> detail = (List<Map<String, Object>>) tempMap.get("detail");
+                        Map<String, Object> zlDetail = new HashMap<>();
                         int index = detail.size() + 1;
-                        String name = index + "." + mzChargeDetail.getTcName();
+                        zlDetail.put("index",index);
+                        zlDetail.put("orderCode",mzChargeDetail.getChargeItemCode());
+                        zlDetail.put("name",mzChargeDetail.getTcName());
                         if (StringUtils.isNotBlank(mzChargeDetail.getInstructionText())) {
-                            name += " 备注:" + mzChargeDetail.getInstructionText();
+                            zlDetail.put("instructionCode",mzChargeDetail.getInstructionCode());
+                            zlDetail.put("instructionText",mzChargeDetail.getInstructionText());
                         }
-                        detail.add(name);
+                        detail.add(zlDetail);
                     }
                 } else if (Constants.XY_ZCY_GROUP_NO.equals(mzChargeDetail.getGroupNo()) || Constants.YC_GROUP_NO.equals(mzChargeDetail.getGroupNo())) {
                     YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCodeAndSerial(mzChargeDetail.getChargeItemCode(), mzChargeDetail.getSerial());
@@ -1402,123 +1428,120 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         }
                     }
                     BigDecimal amount = (BigDecimal) xyDetailMap.get("amount");
-                    List<String> detail = (List<String>) xyDetailMap.get("detail");
+                    List< Map<String, Object>> detail = (List< Map<String, Object>>) xyDetailMap.get("detail");
                     amount = amount.add(tempAmount);
                     xyDetailMap.put("amount", amount);
-                    String name = mzChargeDetail.getTcName();
-                    if (mzChargeDetail.getGroupOrder() != null) {
-                        name = mzChargeDetail.getGroupOrder() + "." + name;
+                    Map<String, Object> xyDetail = new HashMap<>();
+                    detail.add(xyDetail);
+                    xyDetail.put("name",mzChargeDetail.getTcName());
+                    xyDetail.put("orderCode",mzChargeDetail.getChargeItemCode()+"_"+mzChargeDetail.getSerial());
+                    //String name = mzChargeDetail.getTcName();
+                    if (mzChargeDetail.getGroupOrder() == null) {
+                        mzChargeDetail.setGroupOrder(1);
                     }
+                    xyDetail.put("groupOrder",mzChargeDetail.getGroupOrder());
                     if (StringUtils.isNotBlank(ypZdDict.getManuCode())) {
                         String manufactoryName = ypZdManufactoryService.queryYpZdManufactoryByCode(ypZdDict.getManuCode());
                         if (StringUtils.isNotBlank(manufactoryName)) {
-                            name += "(" + manufactoryName + ")&nbsp;&nbsp;&nbsp;&nbsp;";
+                            xyDetail.put("manufactoryName",manufactoryName);
                         }
                     }
-                    String unitDesc = "";
                     if (mzChargeDetail.getDrugUnit() != null) {
-                        unitDesc = UnitTypeEnum.getUnitTypeByCode(mzChargeDetail.getDrugUnit()).name;
-//                        if (mzChargeDetail.getDrugUnit().equals(ypZdDict.getWeighUnit()) && ypZdDict.getWeight() != null) {
-//                            name += " " + ypZdDict.getWeight().doubleValue() + unitDesc;
-//                        } else if (mzChargeDetail.getDrugUnit().equals(ypZdDict.getVolUnit()) && ypZdDict.getVolum() != null) {
-//                            name += " " + ypZdDict.getVolum().doubleValue() + unitDesc;
-//                        }
-                        // name += " " + mzChargeDetail.getDrugQuan() + unitDesc;
+                        xyDetail.put("unitDesc",UnitTypeEnum.getUnitTypeByCode(mzChargeDetail.getDrugUnit()).name);
                     }
                     if (StringUtils.isNotBlank(ypZdDict.getSpecification())) {
-                        name += ypZdDict.getSpecification() + "&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;";
+                        xyDetail.put("specification",ypZdDict.getSpecification());
                     }
-                    name += mzChargeDetail.getQuantity() + UnitTypeEnum.getUnitTypeByCode(ypZdDict.getPackUnit()).name;
-                    // name += " 共" + mzChargeDetail.getQuantity() + UnitTypeEnum.getUnitTypeByCode(ypZdDict.getPackUnit()).name;
+                    xyDetail.put("quantity",mzChargeDetail.getQuantity());
+                    xyDetail.put("packUnit",UnitTypeEnum.getUnitTypeByCode(ypZdDict.getPackUnit()).name);
                     if (StringUtils.isNotBlank(mzChargeDetail.getSupplyCode())) {
                         MzZdSupplyType mzZdSupplyType = mzZdSupplyTypeMapper.selectMzZdSupplyTypeByCode(mzChargeDetail.getSupplyCode());
-                        //SupplyTypeEnum supplyTypeEnum = SupplyTypeEnum.getSupplyTypeByCode(mzChargeDetail.getSupplyCode());
                         if (mzZdSupplyType != null) {
-                            name += " 用法:" + mzZdSupplyType.getSupplyName();
-                            name += " " + mzChargeDetail.getDrugQuan() + unitDesc;
+                            xyDetail.put("supplyName",mzZdSupplyType.getSupplyName());
+                            xyDetail.put("drugQuan",mzChargeDetail.getDrugQuan());
                         }
                     }
                     if (StringUtils.isNotBlank(mzChargeDetail.getFrequency())) {
                         OrderFrequencyEnum orderFrequencyEnum = OrderFrequencyEnum.getOrderFrequencyByCode(mzChargeDetail.getFrequency());
                         if (orderFrequencyEnum != null) {
-                            name += " 频次:" + orderFrequencyEnum.name;
+                            xyDetail.put("frequency",orderFrequencyEnum.name);
                         }
                     }
                     if (mzChargeDetail.getOrderDays() != null) {
-                        name += " " + mzChargeDetail.getOrderDays() + "天";
+                        xyDetail.put("orderDays",mzChargeDetail.getOrderDays());
                     }
                     if (StringUtils.isNotBlank(mzChargeDetail.getTryFlag()) && YesNoEnum.YES.code.toString().equals(mzChargeDetail.getTryFlag())) {
-                        name += " 皮试";
+                        xyDetail.put("tryFlag","皮试");
                     }
                     if (StringUtils.isNotBlank(mzChargeDetail.getInstructionText())) {
-                        name += " 医嘱:" + mzChargeDetail.getInstructionText();
+                        xyDetail.put("instructionCode",mzChargeDetail.getInstructionCode());
+                        xyDetail.put("instructionText",mzChargeDetail.getInstructionText());
                     }
-                    detail.add(name);
                 }
             }
         }
         MzZyReq mzZyReq = mzPrescriptionVo.getMzZyReq();
         if (mzZyReq != null && mzZyReq.getReqDept() != null && StringUtils.isNotBlank(mzZyReq.getReqDept())) {
-            String zyReqPrescription = "收住院";
-            zyReqPrescription += " [" + zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getReqDept());
+            Map<String, Object> zyDetail = new HashMap<>();
+            zyDetail.put("reqDept",zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getReqDept()));
             if (mzZyReq.getSmallDept() != null && StringUtils.isNotBlank(mzZyReq.getSmallDept())) {
-                zyReqPrescription += " (" + zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getSmallDept()) + ") ";
+                zyDetail.put("smallDept",zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getSmallDept()));
             }
-            zyReqPrescription += "] ";
             if (mzZyReq.getAdmissStatus() != null && StringUtils.isNotBlank(mzZyReq.getAdmissStatus())) {
                 CodeNameEntity codeNameEntity = mzZdCommonMapper.selectAdmissStatusByCode(mzZyReq.getAdmissStatus());
                 if (codeNameEntity != null) {
-                    zyReqPrescription += "  " + codeNameEntity.getName();
+                    zyDetail.put("admissStatus",codeNameEntity.getName());
                 }
             }
-            zyReqPrescription += " 侯床";
-            prescriptionDetail.put("zyReqPrescription", zyReqPrescription);
+            zyDetail.put("bedNo",mzZyReq.getBedNo());
+            prescriptionDetail.put("zyReqPrescription", zyDetail);
         }
         mzPrescriptionVo.getMzBlRecord().setPrescriptionDetail(JsonUtil.object2Json(prescriptionDetail));
         StringBuilder sbd = new StringBuilder();
-        if (pyPrescription.size() > 0 || jePrescription.size() > 0 || mjPrescription.size() > 0 || ycPrescription.size() > 0) {
-            sbd.append("西药治疗:");
-            int index = 0;
-            index = getIndex(pyPrescription, sbd, index);
-            index = getIndex(ycPrescription, sbd, index);
-            index = getIndex(mjPrescription, sbd, index);
-            getIndex(jePrescription, sbd, index);
+        if (pyPrescription.size() > 0) {
+            sbd.append("西药(普药)治疗:</br>");
+            setXyDetail(pyPrescription, sbd);
+        }
+        if (mjPrescription.size() > 0) {
+            sbd.append("西药(麻、精一)治疗:</br>");
+            setXyDetail(mjPrescription, sbd);
+        }
+        if (jePrescription.size() > 0) {
+            sbd.append("西药(精二)治疗:</br>");
+            setXyDetail(jePrescription, sbd);
+        }
+        if (ycPrescription.size() > 0) {
+            sbd.append("医材治疗:</br>");
+            setXyDetail(ycPrescription, sbd);
         }
         if (zyPrescription.size() > 0) {
             Map<String, Object> map = zyPrescription.get(0);
-            if (sbd.length() > 0) {
-                sbd.append(" ");
-            }
-            sbd.append("中药治疗:付数");
-            sbd.append(map.get("zyfs"));
-            getIndex(zyPrescription, sbd, 1);
+            sbd.append("中药治疗:付数 ");
+            sbd.append(map.get("zyfs")).append(" 付</br>");
+            setZyDetail(zyPrescription, sbd);
         }
         if (jcjyPrescription.size() > 0) {
             List<String> detail = (List<String>) jcjyPrescription.get(0).get("detail");
             if (detail != null && detail.size() > 0) {
-                if (sbd.length() > 0) {
-                    sbd.append(" ");
-                }
-                sbd.append("辅助检查、检验:");
-                getIndex(jcjyPrescription, sbd, 0);
+                sbd.append("辅助检查、检验:</br>");
+                setJcjyDetail(jcjyPrescription, sbd);
             }
         }
         if (zlPrescription.size() > 0) {
             List<String> detail = (List<String>) zlPrescription.get(0).get("detail");
             if (detail != null && detail.size() > 0) {
-                if (sbd.length() > 0) {
-                    sbd.append(" ");
-                }
-                sbd.append("诊疗:");
-                getIndex(zlPrescription, sbd, 0);
+                sbd.append("诊疗:</br>");
+                setJcjyDetail(zlPrescription, sbd);
             }
         }
-        String zyReqPrescription = (String) prescriptionDetail.get("zyReqPrescription");
-        if (zyReqPrescription != null && StringUtils.isNotBlank(zyReqPrescription)) {
-            if (sbd.length() > 0) {
-                sbd.append(" ");
+        Map<String,Object> zyReqPrescription = (Map<String,Object>) prescriptionDetail.get("zyReqPrescription");
+        if (zyReqPrescription != null && zyReqPrescription.size()>0) {
+            sbd.append("入院处理:</br>").append("收住院 [").append(zyReqPrescription.get("reqDept"));
+            String smallDept=(String) zyReqPrescription.get("smallDept");
+            if(StringUtils.isNotBlank(smallDept)){
+                sbd.append("(").append(smallDept).append(")");
             }
-            sbd.append("入院处理:").append(zyReqPrescription);
+            sbd.append("} ").append(zyReqPrescription.get("admissStatus")==null?"":zyReqPrescription.get("admissStatus")).append("侯床").append("</br>");
         }
         mzPrescriptionVo.getMzBlRecord().setEmrFzjc(emrFzjc);
         mzPrescriptionVo.getMzBlRecord().setEmrProcess(sbd.toString());
@@ -1741,25 +1764,82 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         return tempAmount;
     }
 
-    private int getIndex(List<Map<String, Object>> prescription, StringBuilder sbd, int index) {
+    /**
+     * 设置西成药
+     * @param prescription
+     * @param sbd
+     */
+    private void setXyDetail(List<Map<String, Object>> prescription, StringBuilder sbd) {
+        if (prescription.size() > 0) {
+            for (Map<String, Object> map : prescription) {
+                List<Map<String,Object>> detail = (List<Map<String,Object>>) map.get("detail");
+                if (detail.size() > 0) {
+                    for (Map<String,Object> detailMap : detail) {
+                        sbd.append(detailMap.get("groupOrder"))
+                                .append(". ")
+                                .append(detailMap.get("name"))
+                                .append(" ")
+                                .append(detailMap.get("specification")==null?"":detailMap.get("specification"))
+                                .append(" X ")
+                                .append(detailMap.get("quantity"))
+                                .append(detailMap.get("packUnit"))
+                                .append("</br>")
+                                .append("用法:").append(detailMap.get("supplyName")==null?"":detailMap.get("supplyName"))
+                                .append(" ")
+                                .append(detailMap.get("drugQuan")==null?"":detailMap.get("drugQuan"))
+                                .append(detailMap.get("packUnit"))
+                                .append(" 频次: ")
+                                .append(detailMap.get("frequency")==null?"":detailMap.get("frequency")).append(" ").append(detailMap.get("orderDays")==null?"":detailMap.get("orderDays")).append("天</br>");
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 设置中药
+     * @param prescription
+     * @param sbd
+     */
+    private void setZyDetail(List<Map<String, Object>> prescription, StringBuilder sbd) {
         if (prescription.size() > 0) {
             for (Map<String, Object> map : prescription) {
-                List<String> detail = (List<String>) map.get("detail");
+                List<Map<String,Object>> detail = (List<Map<String,Object>>) map.get("detail");
                 if (detail.size() > 0) {
-                    for (String str : detail) {
-                        if (index > 0) {
-                            sbd.append("_");
+                    for (Map<String,Object> detailMap : detail) {
+                        sbd.append(detailMap.get("name"));
+                        String instructionText = (String)detailMap.get("instructionText");
+                        if(StringUtils.isNotBlank(instructionText)){
+                            sbd .append("[").append(instructionText).append("]");
                         }
-                        sbd.append(str);
-                        index++;
+                        sbd .append(" ").append(detailMap.get("quantity")).append("g</br>");
                     }
                 }
             }
         }
-        return index;
     }
 
 
+
+    /**
+     * 设置辅助检查、检验\诊疗
+     * @param prescription
+     * @param sbd
+     */
+    private void setJcjyDetail(List<Map<String, Object>> prescription, StringBuilder sbd) {
+        if (prescription.size() > 0) {
+            for (Map<String, Object> map : prescription) {
+                List<Map<String,Object>> detail = (List<Map<String,Object>>) map.get("detail");
+                if (detail.size() > 0) {
+                    for (Map<String,Object> detailMap : detail) {
+                        sbd.append(detailMap.get("index")).append(".").append(detailMap.get("name")).append("</br>");
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * 设置完整处方  needPatient needVerify 同事为true 时是保存处方
      *
@@ -1813,20 +1893,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             mzPatientMi = new MzPatientMi();
         }
         Date now = new Date();
-        //(自助开处方且是保存入库的时候  或者是保存模板的时候
-        boolean setEmrProcess = (needPatient && Constants.BRZZJF_CODE.equals(mzPrescriptionVo.getDoctorCode())) || !needVerify;
-        //中药治疗
-        String zyzlContent = null;
-        //西药治疗
-        String xyzlContent = null;
-        //检查检验
-        String jcjyContent = null;
-        //诊疗治疗
-        String zlzlContent = null;
-        //辅助检查
-        String emrFzjc = null;
-        int zlIndex = 0;
-        int xyIndex = 0;
         String reqTzComment = getReqTzComment(mzPrescriptionVo.getMzBlRecord());
         //保存医技入库
         if (mzPrescriptionVo.getMzYjReqList() != null && mzPrescriptionVo.getMzYjReqList().size() > 0) {
@@ -1874,17 +1940,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 if (mzYjReq.getReqComment().length() > 37) {
                     mzYjReq.setReqComment(mzYjReq.getReqComment().substring(0, 36));
                 }
-                if (setEmrProcess) {
-                    zlIndex++;
-                    String value = zlIndex + "." + mzYjReq.getOrderName() + " " + (mzYjReq.getJyRemark() == null ? "" : mzYjReq.getJyRemark()) + " ";
-                    if (jcjyContent == null) {
-                        jcjyContent = "辅助检查、检验:" + value;
-                        emrFzjc = value;
-                    } else {
-                        jcjyContent += "_" + value;
-                        emrFzjc += "," + value;
-                    }
-                }
             }
         }
         //保存药品入库
@@ -2021,18 +2076,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         mzChargeDetail.setDrugWin(1);
                         mzChargeDetail.setGroupType(Constants.XYF.equals(ypZdDict.getBillItemMz()) ? "1" : "2");
                         mzChargeDetail.setSupplyAmount(mzChargeDetail.getOrderDays() * OrderFrequencyEnum.getOrderFrequencyByCode(mzChargeDetail.getFrequency()).times);
-                        if (setEmrProcess) {
-                            xyIndex++;
-                            MzZdSupplyType mzZdSupplyType = mzZdSupplyTypeMapper.selectMzZdSupplyTypeByCode(mzChargeDetail.getSupplyCode());
-                            //SupplyTypeEnum supplyType = SupplyTypeEnum.getSupplyTypeByCode(mzChargeDetail.getSupplyCode());
-                            OrderFrequencyEnum orderFrequency = OrderFrequencyEnum.getOrderFrequencyByCode(mzChargeDetail.getFrequency());
-                            String value = xyIndex + "." + mzChargeDetail.getTcName() + " " + mzChargeDetail.getQuantity() + ypZdDict.getPackUnit() + " 用法:" + (mzZdSupplyType != null ? mzZdSupplyType.getSupplyName() : "") + " 频次:" + (orderFrequency != null ? orderFrequency.name : "") + " ";
-                            if (xyzlContent == null) {
-                                xyzlContent = "西药治疗:" + value;
-                            } else {
-                                xyzlContent += "_" + value;
-                            }
-                        }
                     } else if (Constants.CYF.equals(ypZdDict.getBillItemMz())) {
                         if (Constants.GRANULA_DRUG_KIND.equals(ypZdDict.getDrugKind())) {
                             mzChargeDetail.setGroupNo(Constants.GRANULA_GROUP_NO);
@@ -2046,18 +2089,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                             throw new MzException("保存处方失败,第" + itemNo + "行药品的剂量为空");
                         }
                         mzChargeDetail.setSupplyAmount(1);
-                        if (setEmrProcess) {
-                            String value = mzChargeDetail.getTcName() + " ";
-                            if (StringUtils.isNotBlank(mzChargeDetail.getInstructionText())) {
-                                value += "[" + mzChargeDetail.getInstructionText() + "]";
-                            }
-                            value += mzChargeDetail.getDrugQuan() + "g" + " ";
-                            if (zyzlContent == null) {
-                                zyzlContent = "中药治疗:付数" + mzChargeDetail.getDrugWin() + "_" + value;
-                            } else {
-                                zyzlContent += "_" + value;
-                            }
-                        }
                     } else {
                         throw new MzException("保存处方失败,第" + itemNo + "行药品的账单类型错误");
                     }
@@ -2080,18 +2111,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     mzChargeDetail.setDrugWin(1);
                     mzChargeDetail.setGroupType(GroupTypeEnum.DIAGNOSIS.code);
                     mzChargeDetail.setSupplyAmount(1);
-                    //诊疗在页面开立的时候是在医技里,但是保存入库是在项目明细表
-                    if (setEmrProcess) {
-                        zlIndex++;
-                        String value = zlIndex + "." + mzChargeDetail.getTcName() + " " + mzChargeDetail.getInstructionText() + " ";
-                        if (zlzlContent == null) {
-                            zlzlContent = "诊疗:" + value;
-                            //emrFzjc = value;
-                        } else {
-                            zlzlContent += "_" + value;
-                            //emrFzjc += "," + value;
-                        }
-                    }
                 }
                 mzChargeDetail.setWarnDept(mzPrescriptionVo.getVisitDeptCode());
                 mzChargeDetail.setPriceId(mzPrescriptionVo.getDoctorCode());
@@ -2157,23 +2176,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             mzZyReq.setPatientId(mzPatientMi.getPatientId());
             mzZyReq.setResponceType(mzPatientMi.getResponseType());
         }
-        if (setEmrProcess) {
-            String emrProcess = "";
-            if (xyzlContent != null) {
-                emrProcess += xyzlContent;
-            }
-            if (zyzlContent != null) {
-                emrProcess += zyzlContent;
-            }
-            if (jcjyContent != null) {
-                emrProcess += jcjyContent;
-            }
-            if (zlzlContent != null) {
-                emrProcess += zlzlContent;
-            }
-            mzPrescriptionVo.getMzBlRecord().setEmrProcess(emrProcess);
-            mzPrescriptionVo.getMzBlRecord().setEmrFzjc(emrFzjc);
-        }
     }
 
     @Override
@@ -2214,6 +2216,34 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         return mzChargeDetailMapper.selectCountMzChargeDetailByPatientIdAndChargeItemCode(patientId, chargeItemCode);
     }
 
+    @Override
+    public void setMjGroupForTempDetail(List<MzChargeDetail> mzChargeDetailList) {
+        if(mzChargeDetailList==null || mzChargeDetailList.size()==0){
+            return;
+        }
+        //麻、精一
+        List<MzZdYpYsh> mjyList = mzZdYpYshMapper.selectMjyByCommonParams(null, null);
+        Set<String> mjySet = null;
+        if (mjyList != null) {
+            mjySet = mjyList.stream().map(m -> m.getCode()).collect(Collectors.toSet());
+        }
+        //精二
+        List<MzZdYpYsh> jeList = mzZdYpYshMapper.selectJeByCommonParams(null, null);
+        Set<String> jeSet = null;
+        if (jeList != null) {
+            jeSet = jeList.stream().map(m -> m.getCode()).collect(Collectors.toSet());
+        }
+        for(MzChargeDetail mzChargeDetail:mzChargeDetailList){
+            if (mjySet != null && mjySet.contains(mzChargeDetail.getChargeItemCode().trim())) {
+                //麻精处方
+                mzChargeDetail.setGroupNo("111");
+            } else if (jeSet != null && jeSet.contains(mzChargeDetail.getChargeItemCode().trim())) {
+                //精二处方
+                mzChargeDetail.setGroupNo("131");
+            }
+        }
+    }
+
     @Override
     public Clinic nucleicAcidApplication(String patientId) throws MzException {
         MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
@@ -2583,24 +2613,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     temSet.add(sbd.append(mzChargeDetail.getPatientId()).append("_").append(mzChargeDetail.getTimes()).append("_").append(mzChargeDetail.getReceiptNo()).append("_").append(mzChargeDetail.getItemNo()).append("_").append(mzChargeDetail.getChargeItemCode()).toString());
                 }
             }
-//            if (hisMzChargeDetailList != null && hisMzChargeDetailList.size() > 0) {
-//                if (supplyChargeItemCodeSet == null) {
-//                    List<MzZdSupplyCharge> mzZdSupplyChargeList = mzZdSupplyChargeService.queryMzZdSupplyChargeByCodeList(SupplyTypeEnum.getAllSupplyTypeCode());
-//                    if (mzZdSupplyChargeList != null && mzZdSupplyChargeList.size() > 0) {
-//                        supplyChargeItemCodeSet = mzZdSupplyChargeList.stream().map(s -> s.getChargeCode()).collect(Collectors.toSet());
-//                    }
-//                }
-//                for (MzChargeDetail mzChargeDetail : hisMzChargeDetailList) {
-//                    if (temSet.contains(sbd.append(mzChargeDetail.getPatientId()).append("_").append(mzChargeDetail.getTimes()).append("_").append(mzChargeDetail.getReceiptNo()).append("_").append(mzChargeDetail.getItemNo()).append("_").append(mzChargeDetail.getChargeItemCode()).toString())) {
-//                        continue;
-//                    }
-//                    //是给药方式产生的诊疗项目,不添加进构造的处方
-//                    if (supplyChargeItemCodeSet != null && supplyChargeItemCodeSet.contains(mzChargeDetail.getChargeItemCode())) {
-//                        supplyList.add(mzChargeDetail);
-//                    }
-//                    mzChargeDetailList.add(mzChargeDetail);
-//                }
-//            }
         }
         //给药方式对应的诊疗项目不用回写到处方页面
         if (supplyList != null && mzChargeDetailList != null) {

+ 12 - 1
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TemplateServiceImpl.java

@@ -37,6 +37,7 @@ public class TemplateServiceImpl implements TemplateService {
             throw new MzException("保存处方失败,处方参数不能为空");
         }
         mzChargeDetailService.setFullMzPrescriptionVo(mzPrescriptionVo, false, false);
+        mzChargeDetailService.setPrescriptionDetail(mzPrescriptionVo, YesNoEnum.NO, null);
         template.setTemplateData(JsonUtil.object2Json(mzPrescriptionVo));
         if (template.getId() == null) {
             template.setCreateTime(new Date());
@@ -87,7 +88,17 @@ public class TemplateServiceImpl implements TemplateService {
 
     @Override
     public Template queryById(Long id) {
-        return templateMapper.selectById(id);
+        Template template=templateMapper.selectById(id);
+        if(template==null || StringUtils.isBlank(template.getTemplateData())){
+            return template;
+        }
+        MzPrescriptionVo mzPrescriptionVo = (MzPrescriptionVo) JsonUtil.jsontoObject(template.getTemplateData(), MzPrescriptionVo.class);
+        if (mzPrescriptionVo == null) {
+            return template;
+        }
+        mzChargeDetailService.setMjGroupForTempDetail(mzPrescriptionVo.getMzChargeDetailList());
+        template.setTemplateData(JsonUtil.object2Json(mzPrescriptionVo));
+        return template;
     }
 
     @Override

+ 20 - 2
src/main/resources/static/js/common/string-util.js

@@ -147,10 +147,10 @@ function getUID() {
 /**
  * 判断数据是否在数组中
  * @param data
- * @param array
+ * @param array 字符串连接串
  * @returns {boolean}
  */
-function isInArray(data,array){
+function isInArrayStr(data,array){
     var arr = array;
     if(array!=null && array.length>0){
         arr=array.split(",");
@@ -162,4 +162,22 @@ function isInArray(data,array){
         }
     }
     return false;
+}
+
+
+
+/**
+ * 判断数据是否在数组中
+ * @param data
+ * @param array 数组
+ * @returns {boolean}
+ */
+function isInArray(data,array){
+    for(var i=0;i<array.length;i++){
+        var item=array[i];
+        if(data===item){
+            return true;
+        }
+    }
+    return false;
 }

File diff suppressed because it is too large
+ 599 - 345
src/main/resources/static/js/mz/clinic.js


+ 6 - 6
src/main/resources/static/js/mz/registration_list.js

@@ -1591,7 +1591,7 @@ function loadCardList() {
                         // '                                <i class="fa fa-credit-card"></i>' +
                         // '                            </button>' +
                         // '                        </div>' +
-                        if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                        if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                             html += '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                                 '                            <button type="button" class="can-not-used"' +
                                 '                                    title="取消接诊">' +
@@ -1633,7 +1633,7 @@ function loadCardList() {
                         // '                                <i class="fa fa-credit-card"></i>' +
                         // '                            </button>' +
                         // '                        </div>' +
-                        if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                        if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                             html += '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                                 '                            <button type="button" class="registration-no-color-foot-button"' +
                                 '                                    title="取消接诊"  onclick="cancelClinic(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
@@ -1683,7 +1683,7 @@ function loadCardList() {
                         // '                                <i class="fa fa-credit-card"></i>' +
                         // '                            </button>' +
                         // '                        </div>' +
-                        if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                        if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                             html += '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                                 '                            <button type="button" class="can-not-used"' +
                                 '                                    title="取消接诊">' +
@@ -1876,7 +1876,7 @@ function loadTableList() {
                         if (row.mzyReqrec.cancelMark == 1) {
                             var html= '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
                             //       '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
-                            if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                            if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                                 html += '<button type="button" class="can-not-used"  title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
                             }
                             html += '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button><button type="button" class="can-not-used" title="打印" ><i class="fa fa-print"></i></button>';
@@ -1884,7 +1884,7 @@ function loadTableList() {
                         }
                         if (row.mzyReqrec.visitedMark == 1) {
                             var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
-                            if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                            if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                                 html += '<button type="button" class="registration-no-color-foot-button"  title="取消接诊" onclick="cancelClinic(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-mail-reply"></i></button>';
                             }
                             // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\',\''+row.mzyReqrec.times+','+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
@@ -1908,7 +1908,7 @@ function loadTableList() {
                         }
                         var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
                         // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
-                        if (!(buttonCodes == null || !isInArray("cancel_clinic", buttonCodes))) {
+                        if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
                             html += '<button type="button" class="can-not-used"  title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
                         }
                         html += '<button type="button" class="registration-no-color-foot-button" title="退号" onclick="backNoModal(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-minus-square-o"></i></button>';

+ 2 - 2
src/main/resources/static/js/mz/toll_administration.js

@@ -391,7 +391,7 @@ function initFeeTable() {
                         //是否有权限设置合同编号
                         var buttonCodes = localStorage.getItem("buttonCodes");
                         if (buttonCodes != null) {
-                            if (isInArray("contract_match", buttonCodes)) {
+                            if (isInArrayStr("contract_match", buttonCodes)) {
                                 str += '<button type="button" class="registration-no-color-foot-button" title="合作项目维护" onclick="matchProject(\'' + row.realNo + '\');"><i class="fa fa-plug"></i></button>';
                             }
                         }
@@ -813,7 +813,7 @@ function getRePortRangeArr() {
 function confirmFeeModal(times, totalCharge, receiptNo) {
     var buttonCodes = localStorage.getItem("buttonCodes");
     if (buttonCodes != null) {
-        if (isInArray("contract_match", buttonCodes)) {
+        if (isInArrayStr("contract_match", buttonCodes)) {
             $("#projectDiv").removeClass("hide").addClass("in");
         } else {
             $("#projectDiv").removeClass("in").addClass("hide");

+ 149 - 44
src/main/resources/templates/mz/clinic.html

@@ -1121,7 +1121,8 @@
                     </div>
                     <div class="item form-group thmz_alert">
                         <div class="col-md-6 col-sm-6 col-xs-12">
-                            <label class="control-label col-md-4 col-sm-4 col-xs-12" for="rapidAcceptsUserContact">联系人</label>
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
+                                   for="rapidAcceptsUserContact">联系人</label>
                             <div class="col-md-8 col-sm-8 col-xs-12">
                                 <input id="rapidAcceptsUserContact" class="form-control col-md-7 col-xs-12"
                                        data-validate-length-range="2,10"
@@ -1368,7 +1369,7 @@
 <!--就诊【详情】信息弹窗开始-->
 <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="visitingDetailModal">
     <div class="modal-dialog modal-lg">
-        <div class="modal-content" style="width: 680px;height: 550px;overflow-y: auto;">
+        <div class="modal-content" style="width: 780px;height: 500px;overflow-y: auto;">
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
                 </button>
@@ -1397,10 +1398,42 @@
                                                     style="width: 100%;height: 100%;"></div>
                     </div>
                     <div class="item form-group">
-                        <div class="checkbox">
-                            <label style="padding-left: 0px;">
-                                <input type="checkbox" class="flat" checked="checked" id="conciseRecordsJzxq">&nbsp;&nbsp;简明病历
-                            </label>
+                        <div class="checkbox" style="cursor: pointer;">
+                            <input type="checkbox"
+                                   id="conciseRecordsJzxq"
+                                   style="width: 20px;height: 20px;margin-left: 0px;margin-top: -1px;">
+                            <span style="margin-left: 20px;" onclick="prescriptionJmblChosice(this)">&nbsp;&nbsp;简明病历</span>
+                            <!--<label style="padding-left: 0px;">-->
+                                <!--<input type="checkbox" class="flat" checked="checked" id="conciseRecordsJzxq">&nbsp;&nbsp;简明病历-->
+                            <!--</label>-->
+                        </div>
+                    </div>
+                    <div class="item form-group thmz_alert">
+                        <div class="col-md-6 col-sm-6 col-xs-12 item"
+                             style="color: #2e69eb!important;margin-left: -10px;">
+                            主诉:
+                        </div>
+                    </div>
+                    <div class="item form-group thmz_alert"
+                         style="padding-bottom: 10px;">
+                        <div class="col-md-12 col-sm-12 col-xs-12 item">
+                            <div class="tagZdy" id="prescriptionDetail_zs">
+                                <!--流涕咽疼3天。-->
+                            </div>
+                        </div>
+                    </div>
+                    <div class="item form-group thmz_alert">
+                        <div class="col-md-6 col-sm-6 col-xs-12 item"
+                             style="color: #2e69eb!important;margin-left: -10px;">
+                            现病史:
+                        </div>
+                    </div>
+                    <div class="item form-group thmz_alert"
+                         style="padding-bottom: 10px;">
+                        <div class="col-md-12 col-sm-12 col-xs-12 item">
+                            <div class="tagZdy" id="prescriptionDetail_xbs">
+                                <!--患者在3 天前因受凉后出现流涕、咽疼,无咳嗽、咯痰,无发热,曾自服感冒药症状加重,来诊。-->
+                            </div>
                         </div>
                     </div>
                     <div class="item form-group thmz_alert">
@@ -1415,43 +1448,77 @@
                         </div>
                     </div>
                     <div class="item form-group">
-                        <div class="checkbox">
-                            <label style="padding-left: 0px;">
-                                <input type="checkbox" class="flat" checked="checked" id="prescriptionSubsidiaryJzxq">&nbsp;&nbsp;处方明细
-                            </label>
+                        <div class="checkbox" style="cursor: pointer;">
+                            <input type="checkbox"  onclick="prescriptionCfmxChosice(this,1)"
+                                   id="prescriptionSubsidiaryJzxq"
+                                   style="width: 20px;height: 20px;margin-left: 0px;margin-top: -1px;">
+                            <span style="margin-left: 20px;"
+                                  onclick="prescriptionCfmxChosice(this,0)">&nbsp;&nbsp;处方明细</span>
+                            <!-- <label style="padding-left: 0px;">
+                                 <input type="checkbox" class="flat" checked="checked" id="prescriptionSubsidiaryJzxq">&nbsp;&nbsp;处方明细
+                             </label>-->
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;" id="prescriptionDetail_xyzlTitle">
-                            西药治疗:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;"
+                             id="prescriptionDetail_xypyTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/>
+                            <span onclick="titleClick(this,0)">西药(普药)治疗:</span>
                         </div>
-                        <div id="prescriptionDetail_xyzlContent">
+                        <div id="prescriptionDetail_xypyContent">
                         </div>
                     </div>
-                    <div class="conent" style="margin-bottom: 5px;" id="prescriptionDetail_zyzlTitle">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;">
-                            中药治疗:
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;"
+                             id="prescriptionDetail_xymjTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/>
+                            <span onclick="titleClick(this,0)">西药(麻、精一)治疗:</span>
+                        </div>
+                        <div id="prescriptionDetail_xymjContent">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;"
+                             id="prescriptionDetail_xyjeTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">西药(精二)治疗:</span>
+                        </div>
+                        <div id="prescriptionDetail_xyjeContent">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;"
+                             id="prescriptionDetail_yczlTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">医材治疗:</span>
+                        </div>
+                        <div id="prescriptionDetail_yczlContent">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;cursor: pointer;" id="prescriptionDetail_zyzlTitle">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;" onclick="titleClick(this,0)">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">中药治疗:</span>
                         </div>
-                        <div id="prescriptionDetail_zyzlContent">
+                        <div id="prescriptionDetail_zyzlContent" class="item form-group">
                         </div>
                     </div>
-                    <div class="conent" style="margin-bottom: 5px;" id="prescriptionDetail_zlyjTitle">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;">
-                            辅助检查、检验:
+                    <div class="conent" style="margin-bottom: 5px;" id="prescriptionDetail_jcjyTitle">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;"
+                             onclick="titleClick(this,0)">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">辅助检查、检验:</span>
                         </div>
-                        <div id="prescriptionDetail_zlyjContent">
+                        <div id="prescriptionDetail_jcjyContent">
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;" id="prescriptionDetail_zlTitle">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;">
-                            诊疗:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span
+                                onclick="titleClick(this,0)">诊疗:</span>
                         </div>
                         <div id="prescriptionDetail_zlContent">
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;" id="prescriptionDetail_zyReqTitle">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;">
-                            入院处理:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">入院处理:</span>
                         </div>
                         <div id="prescriptionDetail_zyReqContent">
                         </div>
@@ -1514,10 +1581,14 @@
                         </div>
                     </div>
                     <div class="item form-group">
-                        <div class="checkbox">
-                            <label style="padding-left: 0px;">
-                                <input type="checkbox" class="flat" checked="checked" id="conciseRecordsYlfw">&nbsp;&nbsp;简明病历
-                            </label>
+                        <div class="checkbox" style="cursor: pointer;">
+                            <input type="checkbox"
+                                   id="conciseRecordsYlfw"
+                                   style="width: 20px;height: 20px;margin-left: 0px;margin-top: -1px;">
+                            <span style="margin-left: 20px;" onclick="prescriptionJmblChosice(this)">&nbsp;&nbsp;简明病历</span>
+                            <!--<label style="padding-left: 0px;">-->
+                                <!--<input type="checkbox" class="flat" checked="checked" id="conciseRecordsYlfw">&nbsp;&nbsp;简明病历-->
+                            <!--</label>-->
                         </div>
                     </div>
                     <div class="item form-group thmz_alert">
@@ -1560,40 +1631,74 @@
                         </div>
                     </div>
                     <div class="item form-group">
-                        <div class="checkbox">
-                            <label style="padding-left: 0px;">
-                                <input type="checkbox" class="flat" checked="checked" id="prescriptionSubsidiaryYlfw">&nbsp;&nbsp;处方明细
-                            </label>
+                        <div class="checkbox" style="cursor: pointer;">
+                            <input type="checkbox"  onclick="prescriptionCfmxChosice(this,1)"
+                                   id="prescriptionSubsidiaryYlfw"
+                                   style="width: 20px;height: 20px;margin-left: 0px;margin-top: -1px;">
+                            <span style="margin-left: 20px;"
+                                  onclick="prescriptionCfmxChosice(this,0)">&nbsp;&nbsp;处方明细</span>
+                            <!--<label style="padding-left: 0px;" onclick="prescriptionCfmxChosice(this)">-->
+                            <!---->
+                            <!--</label>-->
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;" id="xyzlTitle">
-                            西药治疗:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="xypyTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">西药(普药)治疗:</span>
                         </div>
-                        <div id="xyzlContent">
+                        <div id="xypyContent">
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;" id="zyzlTitle">
-                            中药治疗:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="xymjTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">西药(麻、精一)治疗:</span>
                         </div>
-                        <div id="zyzlContent">
+                        <div id="xymjContent">
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;" id="zlyjTitle">
-                            辅助检查、检验:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="xyjeTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">西药(精二)治疗:</span>
                         </div>
-                        <div id="zlyjContent">
+                        <div id="xyjeContent">
                         </div>
                     </div>
                     <div class="conent" style="margin-bottom: 5px;">
-                        <div style="color: #2e69eb!important;margin-bottom: 5px;" id="zlTitle">
-                            诊疗:
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="yczlTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">医材治疗:</span>
+                        </div>
+                        <div id="yczlContent">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="zyzlTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">中药治疗:</span>
+                        </div>
+                        <div id="zyzlContent" class="item form-group">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="jcjyTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">辅助检查、检验:</span>
+                        </div>
+                        <div id="jcjyContent">
+                        </div>
+                    </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="zlTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span
+                                onclick="titleClick(this,0)">诊疗:</span>
                         </div>
                         <div id="zlContent">
                         </div>
                     </div>
+                    <div class="conent" style="margin-bottom: 5px;">
+                        <div style="color: #2e69eb!important;margin-bottom: 5px;cursor: pointer;" id="zyReqTitle">
+                            <input type="checkbox" onclick="titleClick(this,1)"/><span onclick="titleClick(this,0)">入院处理:</span>
+                        </div>
+                        <div id="zyReqContent">
+                        </div>
+                    </div>
                 </form>
             </div>
             <div class="modal-footer">

Some files were not shown because too many files changed in this diff