| 
					
				 | 
			
			
				@@ -867,7 +867,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 throw new MzException("本次处方有医技申请,请完善既往史内容!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        setFullMzPrescriptionVo(mzPrescriptionVo, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setFullMzPrescriptionVo(mzPrescriptionVo, true, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(mzPrescriptionVo.getPatientId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (mzPatientMi == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("当前病人信息不存在,请先保存病人信息!"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1426,31 +1426,33 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param mzPrescriptionVo 处方信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param needPatient      是否需要病人信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param needVerify       是否需要校验参数  true 需要 保存处方或者计算价格  false 设置模板 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @throws MzException 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void setFullMzPrescriptionVo(MzPrescriptionVo mzPrescriptionVo, boolean needPatient) throws MzException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void setFullMzPrescriptionVo(MzPrescriptionVo mzPrescriptionVo, boolean needPatient, Boolean needVerify) throws MzException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (mzPrescriptionVo == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,处方参数不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (StringUtils.isBlank(mzPrescriptionVo.getVisitDeptCode())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && StringUtils.isBlank(mzPrescriptionVo.getVisitDeptCode())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,就诊科室不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (StringUtils.isBlank(mzPrescriptionVo.getDoctorCode())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && StringUtils.isBlank(mzPrescriptionVo.getDoctorCode())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,就诊医生不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (needPatient && StringUtils.isBlank(mzPrescriptionVo.getPatientId())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,病人ID不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (mzPrescriptionVo.getJzFlag() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && mzPrescriptionVo.getJzFlag() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,急诊标志不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (!Arrays.asList(YesNoEnum.YES.code, YesNoEnum.NO.code).contains(mzPrescriptionVo.getJzFlag())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && !Arrays.asList(YesNoEnum.YES.code, YesNoEnum.NO.code).contains(mzPrescriptionVo.getJzFlag())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,急诊标志值错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (mzPrescriptionVo.getFirstOrNot() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && mzPrescriptionVo.getFirstOrNot() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,初诊复诊标识为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (!Arrays.asList(YesNoEnum.YES.code, YesNoEnum.NO.code).contains(mzPrescriptionVo.getFirstOrNot())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (needVerify && !Arrays.asList(YesNoEnum.YES.code, YesNoEnum.NO.code).contains(mzPrescriptionVo.getFirstOrNot())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("保存处方失败,初诊复诊标识值错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int times = 0; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1472,8 +1474,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             mzPatientMi = new MzPatientMi(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Date now = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //自助开处方且是保存入库的时候 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        boolean setEmrProcess = needPatient && Constants.BRZZJF_CODE.equals(mzPrescriptionVo.getDoctorCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //(自助开处方且是保存入库的时候  或者是保存模板的时候 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean setEmrProcess = (needPatient && Constants.BRZZJF_CODE.equals(mzPrescriptionVo.getDoctorCode())) || !needVerify; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //中药治疗 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String zyzlContent = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //西药治疗 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1654,7 +1656,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             xyIndex++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             SupplyTypeEnum supplyType = SupplyTypeEnum.getSupplyTypeByCode(mzChargeDetail.getSupplyCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             OrderFrequencyEnum orderFrequency = OrderFrequencyEnum.getOrderFrequencyByCode(mzChargeDetail.getFrequency()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            String value = xyIndex + "." + mzChargeDetail.getTcName() + " " + mzChargeDetail.getQuantity() + ypZdDict.getPackUnit() + " 用法:" + supplyType != null ? supplyType.name : "" + " 频次:" + orderFrequency != null ? orderFrequency.name : "" + " "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            String value = xyIndex + "." + mzChargeDetail.getTcName() + " " + mzChargeDetail.getQuantity() + ypZdDict.getPackUnit() + " 用法:" + (supplyType != null ? supplyType.name : "") + " 频次:" + (orderFrequency != null ? orderFrequency.name : "") + " "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             if (xyzlContent == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 xyzlContent = "西药治疗:" + value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1900,7 +1902,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Map<String, Object> getAmountForTempPrescription(MzPrescriptionVo mzPrescriptionVo) throws MzException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        setFullMzPrescriptionVo(mzPrescriptionVo, false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setFullMzPrescriptionVo(mzPrescriptionVo, false, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (mzPrescriptionVo == null || (mzPrescriptionVo.getMzChargeDetailList() == null || mzPrescriptionVo.getMzYjReqList() == null)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new MzException("处方内容为空,无需进行计算!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 |