public void FaxReport(YellowstonePathology.Business.Reports.Cytology.CytologyUnsatLetterItem item) { string path = @"\\CFileServer\documents\Reports\Cytology\CytologyAbnormalUnsatLetter\"; YellowstonePathology.Business.Client.Model.Client client = Business.Gateway.PhysicianClientGateway.GetClientByClientId(item.ClientId); string fileName = path + item.PhysicianClientId.ToString() + ".doc"; YellowstonePathology.Business.ReportDistribution.Model.FaxSubmission.Submit(client.Fax, "Cytology Unsat Letters", fileName); }
public void CreateReport(YellowstonePathology.Business.Reports.Cytology.CytologyUnsatLetterItem item) { this.ReportXml = new XmlDocument(); this.ReportXml.Load(this.m_ReportTemplate); this.NameSpaceManager = new XmlNamespaceManager(ReportXml.NameTable); this.NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml"); this.NameSpaceManager.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint"); this.m_ReportSaveFileName = @"\\CFileServer\Documents\Reports\Cytology\CytologyAbnormalUnsatLetter\" + item.PhysicianClientId.ToString() + ".xml"; string openingStatement = "Below is a list of your patient(s) who have had an abnormal or unsatisfactory Pap Test between report_start_date and report_end_date."; XmlNode nodeTable = this.FindXmlTableInDetail("letter_date"); XmlNode nodeLetterDate = this.FindXmlTableRowInDetail("letter_date", nodeTable); XmlNode nodePhysicianName = this.FindXmlTableRowInDetail("physician_name", nodeTable); XmlNode nodeClientName = this.FindXmlTableRowInDetail("client_name", nodeTable); XmlNode nodeClientAddress = this.FindXmlTableRowInDetail("client_address", nodeTable); XmlNode nodeClientCityStateZip = this.FindXmlTableRowInDetail("client_city_state_zip", nodeTable); XmlNode nodeOpeningStatement = this.FindXmlTableRowInDetail("opening_statement", nodeTable); this.ReplaceTextInRowNode(nodeLetterDate, "letter_date", DateTime.Today.ToLongDateString()); this.ReplaceTextInRowNode(nodePhysicianName, "physician_name", item.PhysicianName); this.ReplaceTextInRowNode(nodeClientName, "client_name", item.ClientName); this.ReplaceTextInRowNode(nodeClientAddress, "client_address", item.Address); this.ReplaceTextInRowNode(nodeClientCityStateZip, "client_city_state_zip", item.CityStateZip); string newOpeningStatement = openingStatement.Replace("report_start_date", this.m_StartDate.ToShortDateString()); newOpeningStatement = newOpeningStatement.Replace("report_end_date", this.m_EndDate.ToShortDateString()); this.ReplaceTextInRowNode(nodeOpeningStatement, "opening_statement", newOpeningStatement); XmlNode nodeTemplateR1 = this.FindXmlTableRowInDetail("patient_name", nodeTable); foreach (YellowstonePathology.Business.Reports.Cytology.CytologyUnsatLetterDetailItem detailItem in item.DetailItems) { XmlNode nodeNewR1 = nodeTemplateR1.Clone(); this.ReplaceTextInRowNode(nodeNewR1, "patient_name", detailItem.PatientName); this.ReplaceTextInRowNode(nodeNewR1, "report_no", detailItem.ReportNo); this.ReplaceTextInRowNode(nodeNewR1, "birth_date", detailItem.PBirthdate.Value.ToShortDateString()); this.ReplaceTextInRowNode(nodeNewR1, "collection_date", detailItem.CollectionDate.Value.ToShortDateString()); this.ReplaceTextInRowNode(nodeNewR1, "screening_impression", detailItem.ScreeningImpression); nodeTable.InsertAfter(nodeNewR1, nodeTemplateR1); } nodeTable.RemoveChild(nodeTemplateR1); this.SaveReport(); Business.Helper.FileConversionHelper.ConvertXMLToDoc(this.m_ReportSaveFileName, this.m_ReportSaveFileName.Replace(".xml", ".doc")); }