private void FillGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("PatNum", 50); gridMain.Columns.Add(col); col = new ODGridColumn("Patient Name", 140); gridMain.Columns.Add(col); col = new ODGridColumn("Numerator", 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("Exclusion", 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("Explanation", 200); gridMain.Columns.Add(col); table = QualityMeasures.GetTable(Qcur.Type, DateStart, DateEnd, ProvNum); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < table.Rows.Count; i++) { row = new ODGridRow(); row.Cells.Add(table.Rows[i]["PatNum"].ToString()); row.Cells.Add(table.Rows[i]["patientName"].ToString()); row.Cells.Add(table.Rows[i]["numerator"].ToString()); row.Cells.Add(table.Rows[i]["exclusion"].ToString()); row.Cells.Add(table.Rows[i]["explanation"].ToString()); //if(table.Rows[i]["met"].ToString()=="X") { // row.ColorBackG=Color.LightGreen; //} gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { if (comboProv.SelectedIndex == -1) { MsgBox.Show(this, "Please select a provider first."); return; } DateTime dateStart = PIn.Date(textDateStart.Text); DateTime dateEnd = PIn.Date(textDateEnd.Text); if (dateStart == DateTime.MinValue || dateEnd == DateTime.MinValue) { MsgBox.Show(this, "Fix date format and try again."); return; } _dateStart = dateStart; _dateEnd = dateEnd; _provNum = listProvsKeyed[comboProv.SelectedIndex].ProvNum; gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Id", 100); gridMain.Columns.Add(col); col = new ODGridColumn("Description", 200); gridMain.Columns.Add(col); col = new ODGridColumn("Denominator", 75, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("Numerator", 65, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("Exclusion", 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("Exception", 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("NotMet", 50, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn("PerformanceRate", 100, HorizontalAlignment.Center); gridMain.Columns.Add(col); listQ = QualityMeasures.GetAll2014(dateStart, dateEnd, _provNum); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < listQ.Count; i++) { row = new ODGridRow(); row.Cells.Add(listQ[i].Id); row.Cells.Add(listQ[i].Descript); row.Cells.Add(listQ[i].Denominator.ToString()); row.Cells.Add(listQ[i].Numerator.ToString()); row.Cells.Add(listQ[i].Exclusions.ToString()); row.Cells.Add(listQ[i].Exceptions.ToString()); row.Cells.Add(listQ[i].NotMet.ToString()); row.Cells.Add(listQ[i].Numerator.ToString() + "/" + (listQ[i].Numerator + listQ[i].NotMet).ToString() + " = " + listQ[i].PerformanceRate.ToString() + "%"); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { if (comboProv.SelectedIndex == -1) { return; } try { DateTime.Parse(textDateStart.Text); DateTime.Parse(textDateEnd.Text); } catch { return; } DateTime dateStart = PIn.Date(textDateStart.Text); DateTime dateEnd = PIn.Date(textDateEnd.Text); long provNum = listProvsKeyed[comboProv.SelectedIndex].ProvNum; gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn("Id", 80); gridMain.ListGridColumns.Add(col); col = new GridColumn("Description", 200); gridMain.ListGridColumns.Add(col); col = new GridColumn("Denom", 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn("Numerator", 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn("Exclusion", 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn("NotMet", 60, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); col = new GridColumn("PerformanceRate", 110, HorizontalAlignment.Center); gridMain.ListGridColumns.Add(col); listQ = QualityMeasures.GetAll(dateStart, dateEnd, provNum); gridMain.ListGridRows.Clear(); GridRow row; for (int i = 0; i < listQ.Count; i++) { row = new GridRow(); row.Cells.Add(listQ[i].Id); row.Cells.Add(listQ[i].Descript); row.Cells.Add(listQ[i].Denominator.ToString()); row.Cells.Add(listQ[i].Numerator.ToString()); row.Cells.Add(listQ[i].Exclusions.ToString()); row.Cells.Add(listQ[i].NotMet.ToString()); row.Cells.Add(listQ[i].Numerator.ToString() + "/" + (listQ[i].Numerator + listQ[i].NotMet).ToString() + " = " + listQ[i].PerformanceRate.ToString() + "%"); gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
public string GeneratePQRS_xml() { //provider and dates already validated at button push Provider prov = listProvsKeyed[comboProv.SelectedIndex]; DateTime dateStart = PIn.Date(textDateStart.Text); DateTime dateEnd = PIn.Date(textDateEnd.Text); List <QualityType> typesToReport = new List <QualityType>(); typesToReport.Add(QualityType.WeightOver65); typesToReport.Add(QualityType.Hypertension); typesToReport.Add(QualityType.TobaccoUse); typesToReport.Add(QualityType.InfluenzaAdult); typesToReport.Add(QualityType.WeightChild_1_1); typesToReport.Add(QualityType.ImmunizeChild_1); typesToReport.Add(QualityType.Pneumonia); typesToReport.Add(QualityType.DiabetesBloodPressure); typesToReport.Add(QualityType.BloodPressureManage); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.OmitXmlDeclaration = true; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; StringBuilder strBuilder = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(strBuilder, xmlSettings)){ writer.WriteRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); writer.WriteStartElement("submission"); writer.WriteAttributeString("type", "PQRI-REGISTRY"); writer.WriteAttributeString("option", "PAYMENT"); writer.WriteAttributeString("version", "2.0"); writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance"); writer.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "Registry_Payment.xsd"); writer.WriteStartElement("file-audit-data"); writer.WriteElementString("create-date", DateTime.Today.ToString("MM-dd-yyyy")); writer.WriteElementString("create-time", DateTime.Now.ToString("HH:mm")); //military time writer.WriteElementString("create-by", "RegistryA"); //many values are hard-coded for test because they don't explain them writer.WriteElementString("version", "1.0"); writer.WriteElementString("file-number", "1"); writer.WriteElementString("number-of-files", "1"); writer.WriteEndElement(); //file-audit-data writer.WriteStartElement("registry"); writer.WriteElementString("registry-name", "Model Registry"); writer.WriteElementString("registry-id", "125789123"); writer.WriteElementString("submission-method", "A"); writer.WriteEndElement(); //registry writer.WriteStartElement("measure-group"); writer.WriteAttributeString("ID", "X"); writer.WriteStartElement("provider"); writer.WriteElementString("npi", prov.NationalProvID); writer.WriteElementString("tin", prov.SSN); writer.WriteElementString("waiver-signed", "Y"); writer.WriteElementString("encounter-from-date", dateStart.ToString("MM-dd-yyyy")); writer.WriteElementString("encounter-to-date", dateEnd.ToString("MM-dd-yyyy")); //measure-group-stat must be omitted because measure-group ID is X for (int i = 0; i < listQ.Count; i++) { if (!typesToReport.Contains(listQ[i].Type)) { continue; } writer.WriteStartElement("pqri-measure"); writer.WriteElementString("pqri-measure-number", QualityMeasures.GetPQRIMeasureNumber(listQ[i].Type)); writer.WriteElementString("eligible-instances", listQ[i].Denominator.ToString()); writer.WriteElementString("meets-performance-instances", listQ[i].Numerator.ToString()); writer.WriteElementString("performance-exclusion-instances", listQ[i].Exclusions.ToString()); writer.WriteElementString("performance-not-met-instances", listQ[i].NotMet.ToString()); writer.WriteElementString("reporting-rate", listQ[i].ReportingRate.ToString("f2")); if (listQ[i].Denominator == 0) //rate is null { writer.WriteStartElement("performance-rate"); writer.WriteAttributeString("xsi", "nil", System.Xml.Schema.XmlSchema.InstanceNamespace, "true"); writer.WriteEndElement(); } else { writer.WriteElementString("performance-rate", listQ[i].PerformanceRate.ToString("f2")); } writer.WriteEndElement(); //pqri-measure } writer.WriteEndElement(); //provider writer.WriteEndElement(); //measure-group writer.WriteEndElement(); //submission } return(strBuilder.ToString()); }
private void butCreateQRDAs_Click(object sender, EventArgs e) { if (comboProv.SelectedIndex == -1) { MsgBox.Show(this, "Please select a provider first."); return; } if (listQ == null) { MsgBox.Show(this, "Click Refresh first."); return; } long provSelected = listProvsKeyed[comboProv.SelectedIndex].ProvNum; if (_provNum != provSelected) { MsgBox.Show(this, "The values in the grid do not apply to the provider selected. Click Refresh first."); return; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() != DialogResult.OK) { return; } string folderPath = fbd.SelectedPath + "\\" + "CQMs_" + DateTime.Today.ToString("MM_dd_yyyy"); if (System.IO.Directory.Exists(folderPath)) //if the folder already exists //find a unique folder name { int uniqueID = 1; string originalPath = folderPath; do { folderPath = originalPath + "_" + uniqueID.ToString(); uniqueID++; }while(System.IO.Directory.Exists(folderPath)); } try { System.IO.Directory.CreateDirectory(folderPath); for (int i = 0; i < listQ.Count; i++) { if (System.IO.Directory.Exists(folderPath + "\\Measure_" + listQ[i].eMeasureNum)) { continue; } System.IO.Directory.CreateDirectory(folderPath + "\\Measure_" + listQ[i].eMeasureNum); } } catch (Exception ex) { MessageBox.Show("Folder was not created: " + ex.Message); return; } Cursor = Cursors.WaitCursor; try { QualityMeasures.GenerateQRDA(listQ, _provNum, _dateStart, _dateEnd, folderPath); //folderPath is a new directory created within the chosen directory } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); return; } Cursor = Cursors.Default; MsgBox.Show(this, "QRDA files have been created within the selected directory."); }
private void butCreateQRDAs_Click(object sender, EventArgs e) { if (comboProv.SelectedIndex == -1) { MsgBox.Show(this, "Please select a provider first."); return; } if (listQ == null) { MsgBox.Show(this, "Click Refresh first."); return; } long provSelected = listProvsKeyed[comboProv.SelectedIndex].ProvNum; if (_provNum != provSelected) { MsgBox.Show(this, "The values in the grid do not apply to the provider selected. Click Refresh first."); return; } Provider provDefault = Providers.GetProv(PrefC.GetLong(PrefName.PracticeDefaultProv)); long provNumLegal = provDefault.ProvNum; //The practice default provider may be set to a non-person, like Apple Tree Dental, in which case there is no first name allowed and an NPI number does not make sense. //Prompt user to select the provider to set as the legal authenticator for the QRDA documents. //The Legal Authenticator must have a valid first name, last name, and NPI number and is the "single person legally responsible for the document" and "must be a person". if (provDefault.IsNotPerson) { MsgBox.Show(this, "The practice default provider is marked 'Not a Person'. Please select the provider legally responsible for the documents. The provider must have a first name, last name, and NPI number."); FormProviderPick FormPP = new FormProviderPick(); if (FormPP.ShowDialog() != DialogResult.OK) { return; } if (Providers.GetProv(FormPP.SelectedProvNum).IsNotPerson) { MsgBox.Show(this, "The selected provider was marked 'Not a person'."); return; } provNumLegal = FormPP.SelectedProvNum; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() != DialogResult.OK) { return; } string folderPath = fbd.SelectedPath + "\\" + "CQMs_" + DateTime.Today.ToString("MM_dd_yyyy"); if (System.IO.Directory.Exists(folderPath)) //if the folder already exists //find a unique folder name { int uniqueID = 1; string originalPath = folderPath; do { folderPath = originalPath + "_" + uniqueID.ToString(); uniqueID++; }while(System.IO.Directory.Exists(folderPath)); } try { System.IO.Directory.CreateDirectory(folderPath); } catch (Exception ex) { MessageBox.Show("Folder was not created: " + ex.Message); return; } Cursor = Cursors.WaitCursor; try { QualityMeasures.GenerateQRDA(listQ, _provNum, _dateStart, _dateEnd, folderPath, provNumLegal); //folderPath is a new directory created within the chosen directory } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); if (ex.InnerException != null && ex.InnerException.Message == "true") { FormOIDRegistryInternal FormOIDs = new FormOIDRegistryInternal(); FormOIDs.ShowDialog(); } return; } Cursor = Cursors.Default; MsgBox.Show(this, "QRDA files have been created within the selected directory."); }