public void addCreateOhipInvoiceTrans( BillingClaimHeader1Data billHeader, List<BillingItemData> billItemList) { if (billItemList.size() < 1) { return; } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Timestamp updateTs = new Timestamp(new Date().getTime()); BillingOnTransaction billTrans = null; BillingOnTransactionDao billTransDao = (BillingOnTransactionDao) SpringUtils.getBean(BillingOnTransactionDao.class); for (BillingItemData billItem : billItemList) { billTrans = new BillingOnTransaction(); billTrans.setActionType(BillingDataHlp.ACTION_TYPE.C.name()); try { billTrans.setAdmissionDate(sdf.parse(billHeader.getAdmission_date())); } catch (Exception e) { billTrans.setAdmissionDate(null); } try { billTrans.setBillingDate(sdf.parse(billHeader.getBilling_date())); } catch (Exception e) { billTrans.setBillingDate(null); } billTrans.setBillingNotes(billHeader.getComment()); billTrans.setBillingOnItemPaymentId(Integer.parseInt(billItem.getId())); billTrans.setCh1Id(Integer.parseInt(billHeader.getId())); billTrans.setClinic(billHeader.getClinic()); billTrans.setCreator(billHeader.getCreator()); billTrans.setDemographicNo(Integer.parseInt(billHeader.getDemographic_no())); billTrans.setDxCode(billItem.getDx()); billTrans.setFacilityNum(billHeader.getFacilty_num()); billTrans.setManReview(billHeader.getMan_review()); billTrans.setPaymentDate(null); billTrans.setPaymentId(0); billTrans.setPaymentType(0); billTrans.setPayProgram(billHeader.getPay_program()); billTrans.setProviderNo(billHeader.getProviderNo()); billTrans.setProvince(billHeader.getProvince()); billTrans.setRefNum(billHeader.getRef_num()); billTrans.setServiceCode(billItem.getService_code()); billTrans.setServiceCodeInvoiced(billItem.getFee()); billTrans.setServiceCodeDiscount(BigDecimal.ZERO); billTrans.setServiceCodePaid(BigDecimal.ZERO); billTrans.setServiceCodeRefund(BigDecimal.ZERO); billTrans.setServiceCodeNum(billItem.getSer_num()); billTrans.setStatus(billHeader.getStatus()); billTrans.setSliCode(billHeader.getLocation()); billTrans.setUpdateDatetime(updateTs); billTrans.setUpdateProviderNo(billHeader.getCreator()); billTrans.setVisittype(billHeader.getVisittype()); billTransDao.persist(billTrans); } }