///<summary>Supply a list of ClaimSendQueueItems. Called from FormClaimSend. Can only send to one clearinghouse at a time. Able to send just send one claim. Cannot include Canadian.</summary> public static void SendBatch(List <ClaimSendQueueItem> queueItems, Clearinghouse clearhouse, EnumClaimMedType medType) { string messageText = ""; if (clearhouse.Eformat == ElectronicClaimFormat.Canadian) { MsgBox.Show("Eclaims", "Cannot send Canadian claims as part of Eclaims.SendBatch."); return; } //get next batch number for this clearinghouse int batchNum = Clearinghouses.GetNextBatchNumber(clearhouse); //--------------------------------------------------------------------------------------- //Create the claim file for this clearinghouse if (clearhouse.Eformat == ElectronicClaimFormat.x837D_4010 || clearhouse.Eformat == ElectronicClaimFormat.x837D_5010_dental || clearhouse.Eformat == ElectronicClaimFormat.x837_5010_med_inst) { messageText = x837Controller.SendBatch(queueItems, batchNum, clearhouse, medType); } else if (clearhouse.Eformat == ElectronicClaimFormat.Renaissance) { messageText = Renaissance.SendBatch(queueItems, batchNum); } else if (clearhouse.Eformat == ElectronicClaimFormat.Dutch) { messageText = Dutch.SendBatch(queueItems, batchNum); } else { messageText = ""; //(ElectronicClaimFormat.None does not get sent) } if (messageText == "") //if failed to create claim file properly, { return; //don't launch program or change claim status } //---------------------------------------------------------------------------------------- //Launch Client Program for this clearinghouse if applicable if (clearhouse.CommBridge == EclaimsCommBridge.None) { AttemptLaunch(clearhouse, batchNum); } else if (clearhouse.CommBridge == EclaimsCommBridge.WebMD) { if (!WebMD.Launch(clearhouse, batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); return; } } else if (clearhouse.CommBridge == EclaimsCommBridge.BCBSGA) { if (!BCBSGA.Launch(clearhouse, batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); return; } } else if (clearhouse.CommBridge == EclaimsCommBridge.Renaissance) { AttemptLaunch(clearhouse, batchNum); } else if (clearhouse.CommBridge == EclaimsCommBridge.ClaimConnect) { if (!ClaimConnect.Launch(clearhouse, batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); return; } } else if (clearhouse.CommBridge == EclaimsCommBridge.RECS) { if (!RECS.Launch(clearhouse, batchNum)) { MessageBox.Show("Claim file created, but could not launch RECS client."); //continue; } } else if (clearhouse.CommBridge == EclaimsCommBridge.Inmediata) { if (!Inmediata.Launch(clearhouse, batchNum)) { MessageBox.Show("Claim file created, but could not launch Inmediata client."); //continue; } } else if (clearhouse.CommBridge == EclaimsCommBridge.AOS) // added by SPK 7/13/05 { if (!AOS.Launch(clearhouse, batchNum)) { MessageBox.Show("Claim file created, but could not launch AOS Communicator."); //continue; } } else if (clearhouse.CommBridge == EclaimsCommBridge.PostnTrack) { AttemptLaunch(clearhouse, batchNum); } else if (clearhouse.CommBridge == EclaimsCommBridge.MercuryDE) { if (!MercuryDE.Launch(clearhouse, batchNum)) { MsgBox.Show("Eclaims", "Error sending."); return; } } else if (clearhouse.CommBridge == EclaimsCommBridge.ClaimX) { if (!ClaimX.Launch(clearhouse, batchNum)) { MessageBox.Show("Claim file created, but encountered an error while launching ClaimX Client."); } } else if (clearhouse.CommBridge == EclaimsCommBridge.EmdeonMedical) { if (!EmdeonMedical.Launch(clearhouse, batchNum, medType)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); return; } } //---------------------------------------------------------------------------------------- //finally, mark the claims sent. (only if not Canadian) EtransType etype = EtransType.ClaimSent; if (clearhouse.Eformat == ElectronicClaimFormat.Renaissance) { etype = EtransType.Claim_Ren; } if (clearhouse.Eformat != ElectronicClaimFormat.Canadian) { for (int j = 0; j < queueItems.Count; j++) { Etrans etrans = Etranss.SetClaimSentOrPrinted(queueItems[j].ClaimNum, queueItems[j].PatNum, clearhouse.ClearinghouseNum, etype, batchNum); Etranss.SetMessage(etrans.EtransNum, messageText); } } }
///<summary>Supply an arrayList of type ClaimSendQueueItem. Called from FormClaimSend. Can send to multiple clearinghouses simultaneously.</summary> public static void SendBatches(ArrayList queueItems) { //claimsByCHouse is of type ClaimSendQueueItem ArrayList[] claimsByCHouse = new ArrayList[Clearinghouses.List.Length]; for (int i = 0; i < claimsByCHouse.Length; i++) { claimsByCHouse[i] = new ArrayList(); } //divide the items by clearinghouse: for (int i = 0; i < queueItems.Count; i++) { claimsByCHouse[Clearinghouses.GetIndex(((ClaimSendQueueItem)queueItems[i]).ClearinghouseNum)] .Add(queueItems[i]); } //for any clearinghouses with claims, send them: int batchNum; bool result = true; for (int i = 0; i < claimsByCHouse.Length; i++) { if (claimsByCHouse[i].Count == 0) { continue; } //get next batch number for this clearinghouse batchNum = Clearinghouses.GetNextBatchNumber(Clearinghouses.List[i]); //--------------------------------------------------------------------------------------- //Create the claim file(s) for this clearinghouse if (Clearinghouses.List[i].Eformat == ElectronicClaimFormat.X12) { result = X12.SendBatch(claimsByCHouse[i], batchNum); } else if (Clearinghouses.List[i].Eformat == ElectronicClaimFormat.Renaissance) { result = Renaissance.SendBatch(claimsByCHouse[i], batchNum); } else if (Clearinghouses.List[i].Eformat == ElectronicClaimFormat.Canadian) { //Canadian is a little different because we need the sequence numbers. //So all programs are launched and statuses changed from within Canadian.SendBatch() //We don't care what the result is. Canadian.SendBatch(claimsByCHouse[i], batchNum); continue; } else { result = false; //(ElectronicClaimFormat.None does not get sent) } if (!result) //if failed to create claim file properly, { continue; //don't launch program or change claim status } //---------------------------------------------------------------------------------------- //Launch Client Program for this clearinghouse if applicable if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.None) { AttemptLaunch(Clearinghouses.List[i], batchNum); } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.WebMD) { if (!WebMD.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.BCBSGA) { if (!BCBSGA.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.Renaissance) { AttemptLaunch(Clearinghouses.List[i], batchNum); } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.ClaimConnect) { if (!WebClaim.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show(Lan.g("Eclaims", "Error sending.")); continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.RECS) { if (!RECS.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show("Claim file created, but could not launch RECS client."); //continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.Inmediata) { if (!Inmediata.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show("Claim file created, but could not launch Inmediata client."); //continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.AOS) // added by SPK 7/13/05 { if (!AOS.Launch(Clearinghouses.List[i], batchNum)) { MessageBox.Show("Claim file created, but could not launch AOS Communicator."); //continue; } } else if (Clearinghouses.List[i].CommBridge == EclaimsCommBridge.PostnTrack) { AttemptLaunch(Clearinghouses.List[i], batchNum); //if(!PostnTrack.Launch(Clearinghouses.List[i],batchNum)){ // MessageBox.Show("Claim file created, but could not launch AOS Communicator."); //continue; //} } //---------------------------------------------------------------------------------------- //finally, mark the claims sent. (only if not Canadian) EtransType etype = EtransType.ClaimSent; if (Clearinghouses.List[i].Eformat == ElectronicClaimFormat.Renaissance) { etype = EtransType.Claim_Ren; } if (Clearinghouses.List[i].Eformat != ElectronicClaimFormat.Canadian) { for (int j = 0; j < claimsByCHouse[i].Count; j++) { Etranss.SetClaimSentOrPrinted(((ClaimSendQueueItem)claimsByCHouse[i][j]).ClaimNum, ((ClaimSendQueueItem)claimsByCHouse[i][j]).PatNum, Clearinghouses.List[i].ClearinghouseNum, etype); } } } //for(int i=0;i<claimsByCHouse.Length;i++){ }