public JsonResult UploadIMRDecisionDoc(int id, int id2) { HttpPostedFileBase fileContent = Request.Files[0]; string filename = Guid.NewGuid().ToString() + Path.GetExtension(fileContent.FileName); StorageModel _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(id, GlobalConst.ConstantChar.Char_R)); _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords; string path = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + filename; RFAReferralFile _rfaFile = new RFAReferralFile(); _rfaFile.RFAReferralID = id; _rfaFile.RFAReferralFileName = filename; _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRDecisionUpload; _rfaFile.RFAFileCreationDate = DateTime.Now; _rfaFile.RFAFileUserID = MMCUser.UserId; if (id2 != 0) { System.IO.File.Delete(path); fileContent.SaveAs(path); _rfaFile.RFAReferralFileID = id2; _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } else { fileContent.SaveAs(path); id2 = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } return(Json(id2)); }
public ActionResult GenerateIMRResponse(IEnumerable <RFAReferralFile> RFAReferralFile, int ReflID, int ImrRFAReferralFileID) { StorageModel _storageModel = new StorageModel(); _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(ReflID, GlobalConst.ConstantChar.Char_R)); _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); string savePath; string AttachedDocument = ""; foreach (RFAReferralFile __rfaReferralFiledetail in RFAReferralFile) { if (__rfaReferralFiledetail.IsChecked) { AttachedDocument += __rfaReferralFiledetail.Mode + ","; } } AttachedDocument = AttachedDocument.Substring(0, AttachedDocument.Length - 1); string uClientPathURL = GlobalConst.Extension.http + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + GlobalConst.ConstantChar.ForwardSlash; string reportURL = string.Format(ConfigurationManager.AppSettings[GlobalConst.SSRSReportName.RptIMRResponse], ReflID, AttachedDocument, uClientPathURL, GlobalConst.Extension.PDF); _storageModel.FolderName = GlobalConst.FolderName.LegalDocs; _storageModel.ReferralID = ReflID; savePath = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + ReflID + "_IMRResponseLetter.pdf"; if (System.IO.File.Exists(savePath)) { System.IO.File.Delete(savePath); } using (WebClient client = new WebClient()) { client.Credentials = CredentialCache.DefaultNetworkCredentials; client.DownloadFile(reportURL, savePath); client.Dispose(); } RFAReferralFile _rfaFile = new RFAReferralFile(); _rfaFile.RFAReferralFileID = ImrRFAReferralFileID; _rfaFile.RFAReferralID = ReflID; _rfaFile.RFAReferralFileName = ReflID.ToString() + "_IMRResponseLetter.pdf"; _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRResponse; _rfaFile.RFAFileCreationDate = DateTime.Now; _rfaFile.RFAFileUserID = MMCUser.UserId; if (ImrRFAReferralFileID != 0) { _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } else { ImrRFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } string toSearched = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); string toReplace = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString(); String URL = savePath.Replace(toSearched, toReplace); Tuple <string, string, int> savePathWithFileName = new Tuple <string, string, int>(savePath, URL, ImrRFAReferralFileID); return(Json(savePathWithFileName)); }
public ActionResult uploadNotificationDoc(RFAReferralFile _rfaReferralFile) { StorageModel _storageModel = new StorageModel(); _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaReferralFile.RFAReferralID, GlobalConst.ConstantChar.Char_R)); _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); _storageModel.FolderName = GlobalConst.FolderName.LegalDocs; string filename = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName); string path = _storageService.GeneateStorage(_storageModel); string fileToDelete = _rfaReferralFile.RFAReferralFileName; _rfaReferralFile.rfaReferralFile.SaveAs(path + GlobalConst.ConstantChar.DoubleBackSlash + filename); _rfaReferralFile.RFAReferralFileName = filename; _rfaReferralFile.RFAFileTypeID = GlobalConst.FileType.UploadInitialNotifications; _rfaReferralFile.RFAFileCreationDate = DateTime.Now; _rfaReferralFile.RFAFileUserID = MMCUser.UserId; if (_rfaReferralFile.RFAReferralFileID == 0) { _rfaReferralFile.RFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile)); } else { System.IO.File.Delete(path + GlobalConst.ConstantChar.DoubleBackSlash + fileToDelete); _intakeService.updateReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile)); } _rfaReferralFile.rfaReferralFile = null; return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml)); }
public ActionResult UploadPatientMedicalRecord(RFAReferralFile _rfaReferralFile) { string path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.Patients); string filename = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName); _rfaReferralFile.rfaReferralFile.SaveAs(path + "\\" + filename); _rfaReferralFile.RFAReferralFileName = filename; _rfaReferralFile.rfaReferralFile = null; _rfaReferralFile.RFAReferralFileFullPath = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.Patients + "\\" + filename; _rfaReferralFile.TotalPages = _pdfSplitterService.getTotalPageofFilePatientMedicalRecord(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), filename); return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml)); }
public void ADDReferralFiletEST() { RFAReferralFile obj = new RFAReferralFile { RFAReferralID = 1192, RFAReferralFileName = "1192_TimeExtensionLetter.pdf", RFAFileTypeID = 15, RFAFileUserID = 1, RFAFileCreationDate = System.DateTime.Now }; var data = _intakeRepository.addReferralFile(obj); Assert.IsTrue(data > 0, "failed"); }
public ActionResult GenerateIMRDecisionLetter(int referralID, int RFAReferralFileID, int DecisionID) { StorageModel _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(referralID, GlobalConst.ConstantChar.Char_R)); _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); _storageModel.FolderName = GlobalConst.FolderName.LegalDocs; string fileName = (DecisionID == 2 ? GlobalConst.ReportName.IMRCertify : GlobalConst.ReportName.IMRModify) + GlobalConst.Extension.pdf; string savePath = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + fileName; string uClientPathURL = GlobalConst.Extension.http + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + GlobalConst.ConstantChar.ForwardSlash; string reportURL = string.Format(ConfigurationManager.AppSettings[GlobalConst.SSRSReportName.RptIMRDecisionLetter], referralID, uClientPathURL, GlobalConst.Extension.PDF); if (System.IO.File.Exists(savePath)) { System.IO.File.Delete(savePath); } using (WebClient client = new WebClient()) { client.Credentials = CredentialCache.DefaultNetworkCredentials; client.DownloadFile(reportURL, savePath); client.Dispose(); } RFAReferralFile _rfaFile = new RFAReferralFile(); _rfaFile.RFAReferralFileID = RFAReferralFileID; _rfaFile.RFAReferralID = referralID; _rfaFile.RFAReferralFileName = fileName; _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRDecisionLetter; _rfaFile.RFAFileCreationDate = DateTime.Now; _rfaFile.RFAFileUserID = MMCUser.UserId; if (RFAReferralFileID != 0) { _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } else { RFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } IEnumerable <RFAReferralFile> IMRLetters = Mapper.Map <IEnumerable <RFAReferralFile> >(_iIMRService.GetIMRLetters(referralID)); string toSearched = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); string toReplace = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString(); String URL = savePath.Replace(toSearched, toReplace); Tuple <string, string, int, IEnumerable <RFAReferralFile> > savePathWithFileName = new Tuple <string, string, int, IEnumerable <RFAReferralFile> >(fileName, URL, RFAReferralFileID, IMRLetters); return(Json(savePathWithFileName)); }
public void updateReferralFile() { RFAReferralFile obj = new RFAReferralFile { RFAReferralID = 391, RFAReferralFileName = "391_IntakeUpload.pdf", RFAReferralFileID = 447, RFAFileTypeID = 6, RFAFileUserID = 1, RFAFileCreationDate = System.DateTime.Now }; var data = _intakeRepository.updateReferralFile(obj); Assert.IsTrue(data > 0, "failed"); }
public ActionResult GenerateProofOfService(int _rfaId, int POSRFAReferralFileID) { StorageModel _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaId, GlobalConst.ConstantChar.Char_R)); _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); _storageModel.FolderName = GlobalConst.FolderName.LegalDocs; string savePath = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + _rfaId.ToString() + GlobalConst.ReportName.IMRProofOfService + GlobalConst.Extension.pdf; User objUserModel = new User(); var _UserResult = _iUserService.getUserByID(MMCUser.UserId); objUserModel = Mapper.Map <User>(_UserResult); string uSignURL = GlobalConst.Extension.http + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + GlobalConst.VirtualPathFolders.StorageUserPath + objUserModel.UserId + GlobalConst.ConstantChar.ForwardSlash + objUserModel.UserSignatureFileName; string reportURL = string.Format(ConfigurationManager.AppSettings[GlobalConst.SSRSReportName.RptIMRResponseProofOfService], _rfaId, objUserModel.UserFirstName + ' ' + objUserModel.UserLastName, uSignURL, GlobalConst.Extension.PDF); using (WebClient client = new WebClient()) { client.Credentials = CredentialCache.DefaultNetworkCredentials; client.DownloadFile(reportURL, savePath); client.Dispose(); } RFAReferralFile _rfaFile = new RFAReferralFile(); _rfaFile.RFAReferralFileID = POSRFAReferralFileID; _rfaFile.RFAReferralID = _rfaId; _rfaFile.RFAReferralFileName = _rfaId.ToString() + GlobalConst.ReportName.IMRProofOfService + GlobalConst.Extension.pdf; _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRProofofService; _rfaFile.RFAFileCreationDate = DateTime.Now; _rfaFile.RFAFileUserID = objUserModel.UserId; if (POSRFAReferralFileID != 0) { _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } else { POSRFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); } string toSearched = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); string toReplace = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString(); String URL = savePath.Replace(toSearched, toReplace); Tuple <string, string, int> savePathWithFileName = new Tuple <string, string, int>(GlobalConst.ReportName.IMRDecisionProofOfService, URL, POSRFAReferralFileID); return(Json(savePathWithFileName)); }
public ActionResult uploadIMRDoc(RFAReferralFile _rfaFile, IMRRFAReferral _imrReferral, RFAReferral rfa) { rfa.RFAReferralID = _imrReferral.RFAReferralID; _rfaFile.RFAReferralID = _imrReferral.RFAReferralID; int b = _iIMRService.UpdateRFAIMRReferenceNumberByReferralID(Mapper.Map <MMCService.IMRService.RFAReferral>(rfa)); if (b == 0) { return(Json("IMR Referrance Number already exists.")); } else { if (_imrReferral.IMRRFAReferralID == 0) { int a = _iIMRService.addIMRRFAReferral(Mapper.Map <MMCService.IMRService.IMRRFAReferral>(_imrReferral)); } else { int a = _iIMRService.updateIMRRFAReferral(Mapper.Map <MMCService.IMRService.IMRRFAReferral>(_imrReferral)); } StorageModel _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaFile.RFAReferralID, GlobalConst.ConstantChar.Char_R)); _storageModel.ReferralID = 0; _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()); _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords; //Save file Temporary for Split string filename = Guid.NewGuid().ToString() + Path.GetExtension(_rfaFile.rfaReferralFile.FileName); string path = _storageService.GeneateStorage(_storageModel); _rfaFile.rfaReferralFile.SaveAs(path + GlobalConst.ConstantChar.DoubleBackSlash + filename); string ContentFile = _pdfSplitterService.SplitPDFFilePatientMedicalRecord(1, 3, path + GlobalConst.ConstantChar.DoubleBackSlash + filename, _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash, "Independent Medical Review Notice of Assignment and Request for Information Letter"); string BarcodeFile = _pdfSplitterService.SplitPDFFilePatientMedicalRecord(4, 4, path + GlobalConst.ConstantChar.DoubleBackSlash + filename, _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash, _rfaFile.RFAReferralID.ToString() + "_SplitBarcode"); //Delete Temporary file System.IO.File.Delete(path + GlobalConst.ConstantChar.DoubleBackSlash + filename); _rfaFile.RFAReferralFileName = "Independent Medical Review Notice of Assignment and Request for Information Letter"; _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRSplitContent; _rfaFile.RFAFileCreationDate = DateTime.Now; _rfaFile.RFAFileUserID = MMCUser.UserId; _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); _rfaFile.RFAFileTypeID = GlobalConst.FileType.IMRSplitBarcode; _rfaFile.RFAReferralFileName = _rfaFile.RFAReferralID.ToString() + "_SplitBarcode"; _rfaFile.RFAFileCreationDate = DateTime.Now; _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile)); return(Json(GlobalConst.Message.UploadedSucessfully)); } }
public ActionResult uploadIntakeFile(RFAReferralFile _rfaReferralFile) { string path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.IntakeUploadFiles); string filename = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName); string fileToDelete = _rfaReferralFile.RFAReferralFileName; _rfaReferralFile.rfaReferralFile.SaveAs(path + "\\" + filename); _rfaReferralFile.RFAReferralFileName = filename; if (_rfaReferralFile.RFAReferralFileID == 0) { _rfaReferralFile = Mapper.Map <RFAReferralFile>(_intakeService.addReferralFileIntake(GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf, MMCUser.UserId)); _commonService.AddProcessLevelByReferralID(_rfaReferralFile.RFAReferralID, GlobalConst.ProcessLevel.Intake); _commonService.AddProcessLevelByReferralID(_rfaReferralFile.RFAReferralID, GlobalConst.ProcessLevel.ClaimVerification); System.IO.File.Move(path + "\\" + filename, path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf); _rfaReferralFile.Mode = "Add"; } else { _rfaReferralFile.RFAFileTypeID = GlobalConst.FileTypes.IntakeUpload; if (System.IO.File.Exists(path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf)) { System.IO.File.Delete(path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf); } _rfaReferralFile.RFAReferralFileName = _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf; _rfaReferralFile.RFAFileUserID = MMCUser.UserId; _rfaReferralFile.RFAFileCreationDate = DateTime.Now; _intakeService.updateReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile)); _pdfSplitterService.deleteIntakeUploadedFile(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), fileToDelete); System.IO.File.Move(path + "\\" + filename, path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf); _rfaReferralFile.Mode = "Update"; } filename = _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf; _rfaReferralFile.RFAReferralFileFullPath = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.IntakeUploadFiles + "\\" + filename; _rfaReferralFile.rfaReferralFile = null; _rfaReferralFile.TotalPages = _pdfSplitterService.getTotalPageofFileIntake(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), filename); return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml)); }