| 
					
				 | 
			
			
				@@ -1019,21 +1019,7 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             day = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    BigDecimal total = getTotal(item, day); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (StringUtil.notBlank(detailsOfDrugs.getDrugWeightUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugWeightUnit().trim())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getDrugWeight(), RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } else if (StringUtil.notBlank(detailsOfDrugs.getDrugVolUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugVolUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getDrugVolume(), RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } else if (StringUtil.notBlank(detailsOfDrugs.getPackUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getPackUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getPackSize(), RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (item.getDrugQuan().equals(BigDecimal.ZERO)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugQuan(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        item.setDrugOcc(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    dischargeWithMedicationCollection(getTotal(item, day), detailsOfDrugs, item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 计算普通药品的领量 durg_quan durg_occ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     calculateDrugAmount(item, detailsOfDrugs); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1084,6 +1070,10 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (StringUtil.isBlank(item.getSerial())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 errorMessage.add("包装大小不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtil.isBlank(item.getMiniUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                errorMessage.add("最小包装规格不能为空。"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (strictVerification) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1126,6 +1116,24 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void dischargeWithMedicationCollection(BigDecimal total, XinZhenYzActOrder detailsOfDrugs, XinZhenYzActOrder item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtil.notBlank(detailsOfDrugs.getDrugWeightUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugWeightUnit().trim())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getDrugWeight(), 0, RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (StringUtil.notBlank(detailsOfDrugs.getDrugVolUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getDrugVolUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getDrugVolume(), 0, RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (StringUtil.notBlank(detailsOfDrugs.getPackUnit()) && item.getDoseUnit().trim().equals(detailsOfDrugs.getPackUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugQuan(item.getDose().divide(detailsOfDrugs.getPackSize(), 0, RoundingMode.UP).multiply(total)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (item.getDrugQuan().equals(BigDecimal.ZERO)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugQuan(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.setDrugOcc(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 计算总量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1175,7 +1183,7 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 获取医嘱录入的模板1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 获取医嘱录入的模板 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param code         模板编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param deptCode     科室编码 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1534,7 +1542,7 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String, List<XinZhenYzActOrder>> takeTheMedicineList = new HashMap<>(Capacity.TWO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (XinZhenYzActOrder item : patInfo.getList()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            XinZhenYzActOrder feiYongXinXi = dao.getDrugOne(item.getOrderCode() + item.getSerial(), item.getGroupNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            XinZhenYzActOrder detailsOfDrugs = dao.getDrugOne(item.getOrderCode() + item.getSerial(), item.getGroupNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             int day = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 如果是临时医嘱 开了就结束了. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ("ONCE".equals(item.getFrequCode())) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1549,21 +1557,7 @@ public class YiZhuLuRuServer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 计算出院带药的领量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BigDecimal total = getTotal(item, day); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (StringUtil.notBlank(feiYongXinXi.getDrugWeightUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getDrugWeightUnit().trim())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getDrugWeight(), 0, RoundingMode.UP)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } else if (StringUtil.notBlank(feiYongXinXi.getDrugVolUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getDrugVolUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getDrugVolume(), 0, RoundingMode.UP)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } else if (StringUtil.notBlank(feiYongXinXi.getPackUnit()) && item.getDoseUnit().trim().equals(feiYongXinXi.getPackUnit())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugQuan(DecimalUtil.multiply(item.getDose(), total).divide(feiYongXinXi.getPackSize(), 0, RoundingMode.UP)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugOcc(item.getDrugQuan()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (item.getDrugQuan().equals(BigDecimal.ZERO)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugQuan(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setDrugOcc(BigDecimal.ONE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            dischargeWithMedicationCollection(getTotal(item, day), detailsOfDrugs, item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 在这里更新出院带药领量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             dao.updateThePickup(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 费用标志为 4 的就是出院带药 
			 |