public static string Run(int scriptNum, string responseExpected, string responseTypeExpected, Claim claim, bool showForms, int pageNumber, int lastPageNumber, double firstExamFee, double diagnosticPhaseFee) { string retVal = ""; ClaimSendQueueItem queueItem = Claims.GetQueueList(claim.ClaimNum, claim.ClinicNum, 0)[0]; Clearinghouse clearinghouseHq = ClearinghouseL.GetClearinghouseHq(queueItem.ClearinghouseNum); Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum); Eclaims.GetMissingData(clearinghouseClin, queueItem); //,out warnings); if (queueItem.MissingData != "") { return("Cannot send predetermination until missing data is fixed:\r\n" + queueItem.MissingData + "\r\n"); } #if DEBUG Canadian.testNumber = scriptNum; claim.PreAuthString = "" + pageNumber + "," + lastPageNumber + "," + firstExamFee + "," + diagnosticPhaseFee; #endif long etransNum = Canadian.SendClaim(clearinghouseClin, queueItem, showForms); Etrans etrans = Etranss.GetEtrans(etransNum); string message = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum); CCDFieldInputter formData = new CCDFieldInputter(message); string responseType = formData.GetValue("A04"); if (responseType != responseTypeExpected) { return("Form type is '" + responseType + "' but should be '" + responseTypeExpected + "'\r\n"); } string responseStatus = formData.GetValue("G05"); if (responseStatus != responseExpected) { return("G05 is '" + responseStatus + "' but should be '" + responseExpected + "'\r\n"); } if (responseExpected == "R" && responseTypeExpected == "11") { //so far, only for #6. We need some other way to test if successful transaction string errorMsgCount = formData.GetValue("G06"); if (errorMsgCount == "00") { return("Wrong message count.\r\n"); } } retVal += "Predetermination #" + scriptNum + " page " + pageNumber + " of " + lastPageNumber + " successful.\r\n"; return(retVal); }
public static string Run(int scriptNum, string responseExpected, string responseTypeExpected, Claim claim, bool showForms) { string retVal = ""; ClaimSendQueueItem queueItem = Claims.GetQueueList(claim.ClaimNum, claim.ClinicNum, 0)[0]; Clearinghouse clearinghouseHq = ClearinghouseL.GetClearinghouseHq(queueItem.ClearinghouseNum); Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum); Eclaims.GetMissingData(clearinghouseClin, queueItem); //,out warnings); if (queueItem.MissingData != "") { return("Cannot send claim until missing data is fixed:\r\n" + queueItem.MissingData + "\r\n"); } #if DEBUG Canadian.testNumber = scriptNum; #endif long etransNum = Canadian.SendClaim(clearinghouseClin, queueItem, showForms); Etrans etrans = Etranss.GetEtrans(etransNum); string message = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum); CCDFieldInputter formData = new CCDFieldInputter(message); string responseType = formData.GetValue("A04"); if (responseType != responseTypeExpected) { return("Form type should be " + responseTypeExpected + "\r\n"); } string responseStatus = formData.GetValue("G05"); if (responseStatus != responseExpected) { return("G05 should be " + responseExpected + "\r\n"); } if (responseExpected == "R" && responseTypeExpected == "11") { //so far, only for #6. We need some other way to test if successful transaction string errorMsgCount = formData.GetValue("G06"); if (errorMsgCount == "00") { return("Wrong message count.\r\n"); } } retVal += "Claim #" + scriptNum.ToString() + " successful.\r\n"; return(retVal); }