| 
					
				 | 
			
			
				@ -1337,7 +1337,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 下诊断 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param outPatientId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param advice 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param type 1带处方,2不带处方 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1430,6 +1430,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(infoJsons)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //药品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for(WlyyPrescriptionInfoDO info:infoDOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    info.setDel(1); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1440,6 +1441,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //保存药品信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                prescriptionInfoDao.save(infoDOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //计算药品费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                prescription.setDrugFee(getInfoFee(infoDOs)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //=====================药品操作======================================================================= 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1465,9 +1469,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //保存检查检验。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                wlyyInspectionDao.save(inspections); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //计算检查检验费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                prescription.setDrugFee(getInsFee(inspections)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //=====================检查检验======================================================================= 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //保存挂号费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //保存费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDao.save(prescription); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //上传his开方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return sendHisDiagnosis(jsonData,outpatientDO,prescription); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1482,6 +1494,64 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 计算药品费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param infoDOs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Double getInfoFee(List<WlyyPrescriptionInfoDO> infoDOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Double fee = 0D; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(infoDOs!=null&&infoDOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for(WlyyPrescriptionInfoDO info:infoDOs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Integer quantity = Integer.parseInt(info.getQuantity()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    fee += info.getPackRetprice()*quantity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("getInfoFee:"+e.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return fee; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 计算检查检验费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param inspections 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Double getInsFee(List<WlyyInspectionDO> inspections){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Double fee = 0D; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(inspections!=null&&inspections.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for(WlyyInspectionDO ins:inspections){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Double chargeAmount = Double.parseDouble(ins.getChargeAmount()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    fee += chargeAmount*ins.getQuantity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("getInsFee:"+e.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return fee; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 计算挂号费用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param doctor 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Double getChargeFee(String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Double fee = 0D; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return chargeDictDO.getReqFee(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("getChargeFee:"+e.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return fee; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 上传his开方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param jsonData 
			 |