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.Message=="true") { FormOIDRegistryInternal FormOIDs=new FormOIDRegistryInternal(); FormOIDs.ShowDialog(); } return; } Cursor=Cursors.Default; MsgBox.Show(this,"QRDA files have been created within the selected directory."); }
private void butOIDs_Click(object sender, EventArgs e) { FormOIDRegistryInternal FormOIDI = new FormOIDRegistryInternal(); FormOIDI.ShowDialog(); }
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."); }
private void butOIDs_Click(object sender,EventArgs e) { FormOIDRegistryInternal FormOIDI=new FormOIDRegistryInternal(); FormOIDI.ShowDialog(); }