///<summary>Sends the passed in attachments to ClaimConnect. Will set the attachment id to the claim if needed.</summary> private void AddAttachments(List <ClaimConnect.ImageAttachment> listAttachments) { if (string.IsNullOrWhiteSpace(_claimCur.AttachmentID)) { //If an attachment has not already been created, create one. string attachmentId = ClaimConnect.CreateAttachment(listAttachments, textNarrative.Text, _claimCur); //Update claim if attachmentID was set. Must happen here so that the validation will consider the new attachmentID. _claimCur.AttachmentID = attachmentId; //Set the claims attached flag to 'Misc' so that the attachmentID will write to the PWK segment //when the claim is generated as an 837. if (string.IsNullOrEmpty(_claimCur.AttachedFlags)) { _claimCur.AttachedFlags = "Misc"; } else //Comma delimited { _claimCur.AttachedFlags = ",Misc"; } } else //An attachment already exists for this claim. { ClaimConnect.AddAttachment(_claimCur, listAttachments); } Claims.Update(_claimCur); }
///<summary>A helper method that does the actual validation of the claim. ///Can be called elsewhere in this form.</summary> private bool ValidateClaimHelper() { try { ClaimConnect.ValidateClaimResponse response = ClaimConnect.ValidateClaim(_claimCur, true); if (response._isValidClaim) { textClaimStatus.Text = "The claim is valid."; return(true); } //Otherwise the claim must have errors, display them to the user. StringBuilder strBuild = new StringBuilder(); for (int i = 0; i < response.ValidationErrors.Length; i++) { strBuild.AppendLine(response.ValidationErrors[i]); } textClaimStatus.Text = strBuild.ToString(); return(false); } catch (ODException ex) { textClaimStatus.Text = ex.Message; return(false); } catch (Exception ex) { textClaimStatus.Text = ex.Message; return(false); } }
private static string RetrieveReports(Clearinghouse clearinghouseClin, bool isAutomaticMode, IODProgressExtended progress = null) { progress = progress ?? new ODProgressExtendedNull(); progress.UpdateProgress(Lans.g(progress.LanThis, "Beginning report retrieval..."), "reports", "0%"); if (progress.IsPauseOrCancel()) { return(Lans.g(progress.LanThis, "Process canceled by user.")); } if (clearinghouseClin.ISA08 == "113504607") //TesiaLink //But the import will still happen { return(""); } if (clearinghouseClin.CommBridge == EclaimsCommBridge.None || clearinghouseClin.CommBridge == EclaimsCommBridge.Renaissance || clearinghouseClin.CommBridge == EclaimsCommBridge.RECS) { return(""); } if (clearinghouseClin.CommBridge == EclaimsCommBridge.WebMD) { if (!WebMD.Launch(clearinghouseClin, 0, isAutomaticMode, progress)) { return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + WebMD.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.BCBSGA) { if (!BCBSGA.Retrieve(clearinghouseClin, true, new TerminalConnector(), progress)) { return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + BCBSGA.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.ClaimConnect) { if (!Directory.Exists(clearinghouseClin.ResponsePath)) { //The clearinghouse report path is not setup. Therefore, the customer does not use ClaimConnect reports via web services. if (isAutomaticMode) //The user opened FormClaimsSend, or FormOpenDental called this function automatically. { return(""); //Suppress error message. } else //The user pressed the Get Reports button manually. //This cannot happen, because the user is blocked by the UI before they get to this point. { } } else if (!ClaimConnect.Retrieve(clearinghouseClin, progress)) { if (ClaimConnect.ErrorMessage.Contains(": 150\r\n")) //Error message 150 "Service Not Contracted" { if (isAutomaticMode) //The user opened FormClaimsSend, or FormOpenDental called this function automatically. { return(""); //Pretend that there is no error when loading FormClaimsSend for those customers who do not pay for ERA service. } else //The user pressed the Get Reports button manually. //The old way. Some customers still prefer to go to the dentalxchange web portal to view reports because the ERA service costs money. { try { Process.Start(@"http://www.dentalxchange.com"); } catch (Exception ex) { ex.DoNothing(); return(Lans.g("FormClaimReports", "Could not locate the site.")); } return(""); } } return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + ClaimConnect.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.AOS) { try { //This path would never exist on Unix, so no need to handle back slashes. Process.Start(@"C:\Program files\AOS\AOSCommunicator\AOSCommunicator.exe"); } catch { return(Lans.g("FormClaimReports", "Could not locate the file.")); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.MercuryDE) { if (!MercuryDE.Launch(clearinghouseClin, 0, progress)) { return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + MercuryDE.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EmdeonMedical) { if (!EmdeonMedical.Retrieve(clearinghouseClin, progress)) { return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EmdeonMedical.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.DentiCal) { if (!DentiCal.Launch(clearinghouseClin, 0, progress)) { return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + DentiCal.ErrorMessage); } } else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EDS) { List <string> listEdsErrors = new List <string>(); if (!EDS.Retrieve277s(clearinghouseClin, progress)) { listEdsErrors.Add(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EDS.ErrorMessage); } if (!EDS.Retrieve835s(clearinghouseClin, progress)) { listEdsErrors.Add(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EDS.ErrorMessage); } if (listEdsErrors.Count > 0) { return(string.Join("\r\n", listEdsErrors)); } } return(""); }