示例#1
0
 private void butAdd_Click(object sender, System.EventArgs e)
 {
     FormProgramLinkEdit FormPE=new FormProgramLinkEdit();
     FormPE.IsNew=true;
     FormPE.ProgramCur=new Program();
     FormPE.ShowDialog();
     changed=true;//because we don't really know what they did, so assume changed.
     FillList();
 }
示例#2
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormProgramLinkEdit FormPE = new FormProgramLinkEdit();

            FormPE.IsNew      = true;
            FormPE.ProgramCur = new Program();
            FormPE.ShowDialog();
            changed = true;          //because we don't really know what they did, so assume changed.
            FillList();
        }
        private void listProgram_DoubleClick(object sender, System.EventArgs e)
        {
            if (listProgram.SelectedIndex == -1)
            {
                return;
            }
            FormProgramLinkEdit FormPE = new FormProgramLinkEdit();

            FormPE.ProgramCur = Programs.List[listProgram.SelectedIndex];
            FormPE.ShowDialog();
            changed = true;
            FillList();
        }
示例#4
0
        private void listProgram_DoubleClick(object sender, System.EventArgs e)
        {
            if (listProgram.SelectedIndex == -1)
            {
                return;
            }
            Program program = ProgramC.Listt[listProgram.SelectedIndex].Copy();

            if (program.ProgName == "UAppoint")
            {
                FormUAppoint FormU = new FormUAppoint();
                FormU.ProgramCur = program;
                FormU.ShowDialog();
                if (FormU.DialogResult == DialogResult.OK)
                {
                    changed = true;
                    FillList();
                }
                return;
            }
            if (program.ProgName == "eClinicalWorks")
            {
                if (!Security.IsAuthorized(Permissions.SecurityAdmin))
                {
                    return;
                }
                FormEClinicalWorks FormECW = new FormEClinicalWorks();
                FormECW.ProgramCur = program;
                FormECW.ShowDialog();
                if (FormECW.DialogResult == DialogResult.OK)
                {
                    changed = true;
                    FillList();
                }
                return;
            }
            if (program.ProgName == "Mountainside")
            {
                FormMountainside FormM = new FormMountainside();
                FormM.ProgramCur = program;
                FormM.ShowDialog();
                if (FormM.DialogResult == DialogResult.OK)
                {
                    changed = true;
                    FillList();
                }
                return;
            }
            if (program.ProgName == "PayConnect")
            {
                FormPayConnectSetup fpcs = new FormPayConnectSetup();
                fpcs.ShowDialog();
                if (fpcs.DialogResult == DialogResult.OK)
                {
                    changed = true;
                    FillList();
                }
                return;
            }
            if (program.ProgName == "Xcharge")
            {
                FormXchargeSetup fxcs = new FormXchargeSetup();
                fxcs.ShowDialog();
                if (fxcs.DialogResult == DialogResult.OK)
                {
                    changed = true;
                    FillList();
                }
                return;
            }
            FormProgramLinkEdit FormPE = new FormProgramLinkEdit();

            FormPE.ProgramCur = program;
            FormPE.ShowDialog();
            changed = true;
            FillList();
        }
		private void butECards_Click(object sender,EventArgs e) {
			if(!Programs.IsEnabled(ProgramName.Divvy)) {
				if(MsgBox.Show(this,MsgBoxButtons.OKCancel,"The Divvy Program Link is not enabled. Would you like to enable it now?")) {
					FormProgramLinkEdit FormPE=new FormProgramLinkEdit();
					FormPE.ProgramCur=Programs.GetCur(ProgramName.Divvy);
					FormPE.ShowDialog();
					DataValid.SetInvalid(InvalidType.Programs);
				}
				if(!Programs.IsEnabled(ProgramName.Divvy)) {
					return;
				}
			}
			if(gridMain.Rows.Count < 1) {
				MessageBox.Show(Lan.g(this,"There are no Patients in the Recall table.  Must have at least one to send."));
				return;
			}
			if(PrefC.GetLong(PrefName.RecallStatusMailed)==0) {
				MsgBox.Show(this,"You need to set a status first in the Recall Setup window.");
				return;
			}
			if(gridMain.SelectedIndices.Length==0) {
				ContactMethod cmeth;
				for(int i=0;i<table.Rows.Count;i++) {
					cmeth=(ContactMethod)PIn.Long(table.Rows[i]["PreferRecallMethod"].ToString());
					if(cmeth!=ContactMethod.Mail && cmeth!=ContactMethod.None) {
						continue;
					}
					gridMain.SetSelected(i,true);
				}
				if(gridMain.SelectedIndices.Length==0) {
					MsgBox.Show(this,"No patients of mail type.");
					return;
				}
			}
			if(!MsgBox.Show(this,MsgBoxButtons.OKCancel,"Send postcards for all of the selected patients?")) {
				return;
			}
			Guid guid=new Guid();
			RecallListSort sortBy=(RecallListSort)comboSort.SelectedIndex;
			List<long> recallNums=new List<long>();
			for(int i=0;i<gridMain.SelectedIndices.Length;i++) {
				recallNums.Add(PIn.Long(table.Rows[gridMain.SelectedIndices[i]]["RecallNum"].ToString()));
			}
			addrTable=Recalls.GetAddrTable(recallNums,checkGroupFamilies.Checked,sortBy);
			DivvyConnect.Postcard postcard;
			DivvyConnect.Recipient recipient;
			DivvyConnect.Postcard[] listPostcards=new DivvyConnect.Postcard[gridMain.SelectedIndices.Length];
			string message;
			long clinicNum;
			Clinic clinic;
			string phone;
			for(int i=0;i<addrTable.Rows.Count;i++) {
				postcard=new DivvyConnect.Postcard();
				recipient=new DivvyConnect.Recipient();
				recipient.Name=addrTable.Rows[i]["patientNameFL"].ToString();
				recipient.ExternalRecipientID=addrTable.Rows[i]["patNums"].ToString();
				recipient.Address1=addrTable.Rows[i]["Address"].ToString();//Includes Address2
				recipient.City=addrTable.Rows[i]["City"].ToString();
				recipient.State=addrTable.Rows[i]["State"].ToString();
				recipient.Zip=addrTable.Rows[i]["Zip"].ToString();
				postcard.AppointmentDateTime=PIn.Date(addrTable.Rows[i]["dateDue"].ToString());//js I don't know why they would ask for this.  We put this in our message.
				//Body text, family card ------------------------------------------------------------------
				if(checkGroupFamilies.Checked	&& addrTable.Rows[i]["famList"].ToString()!=""){
					if(addrTable.Rows[i]["numberOfReminders"].ToString()=="0") {
						message=PrefC.GetString(PrefName.RecallPostcardFamMsg);
					}
					else if(addrTable.Rows[i]["numberOfReminders"].ToString()=="1") {
						message=PrefC.GetString(PrefName.RecallPostcardFamMsg2);
					}
					else {
						message=PrefC.GetString(PrefName.RecallPostcardFamMsg3);
					}
					message=message.Replace("[FamilyList]",addrTable.Rows[i]["famList"].ToString());
				}
				//Body text, single card-------------------------------------------------------------------
				else{
					if(addrTable.Rows[i]["numberOfReminders"].ToString()=="0") {
						message=PrefC.GetString(PrefName.RecallPostcardMessage);
					}
					else if(addrTable.Rows[i]["numberOfReminders"].ToString()=="1") {
						message=PrefC.GetString(PrefName.RecallPostcardMessage2);
					}
					else {
						message=PrefC.GetString(PrefName.RecallPostcardMessage3);
					}
					message=message.Replace("[DueDate]",addrTable.Rows[i]["dateDue"].ToString());
					message=message.Replace("[NameF]","");//Name is included
				}
				postcard.Message=message;
				postcard.Recipient=recipient;
				postcard.DesignID=PIn.Int(ProgramProperties.GetPropVal(ProgramName.Divvy,"DesignID for Recall Cards"));
				listPostcards[i]=postcard;
			}
			DivvyConnect.Practice practice=new DivvyConnect.Practice();
			clinicNum=PIn.Long(addrTable.Rows[patientsPrinted]["ClinicNum"].ToString());
			if(!PrefC.GetBool(PrefName.EasyNoClinics) && Clinics.List.Length>0 //if using clinics
				&& Clinics.GetClinic(clinicNum)!=null)//and this patient assigned to a clinic
			{
				clinic=Clinics.GetClinic(clinicNum);
				practice.Company=clinic.Description;
				practice.Address1=clinic.Address;
				practice.Address2=clinic.Address2;
				practice.City=clinic.City;
				practice.State=clinic.State;
				practice.Zip=clinic.Zip;
				phone=clinic.Phone;
			}
			else {
				practice.Company=PrefC.GetString(PrefName.PracticeTitle);
				practice.Address1=PrefC.GetString(PrefName.PracticeAddress);
				practice.Address2=PrefC.GetString(PrefName.PracticeAddress2);
				practice.City=PrefC.GetString(PrefName.PracticeCity);
				practice.State=PrefC.GetString(PrefName.PracticeST);
				practice.Zip=PrefC.GetString(PrefName.PracticeZip);
				phone=PrefC.GetString(PrefName.PracticePhone);
			}
			if(phone.Length==10 
				&& (CultureInfo.CurrentCulture.Name=="en-US" || 
				CultureInfo.CurrentCulture.Name.EndsWith("CA"))) //Canadian. en-CA or fr-CA
			{
				practice.Phone="("+phone.Substring(0,3)+")"+phone.Substring(3,3)+"-"+phone.Substring(6);
			}
			else {
				practice.Phone=phone;
			}
			DivvyConnect.PostcardServiceClient client=new DivvyConnect.PostcardServiceClient();
			DivvyConnect.PostcardReturnMessage returnMessage=new DivvyConnect.PostcardReturnMessage();
			string messages="";
			Cursor=Cursors.WaitCursor;
			try {
				returnMessage=client.SendPostcards(
				  Guid.Parse(ProgramProperties.GetPropVal(ProgramName.Divvy,"API Key")),
				  ProgramProperties.GetPropVal(ProgramName.Divvy,"Username"),
				  ProgramProperties.GetPropVal(ProgramName.Divvy,"Password"),
				  listPostcards,practice);
			}
			catch (Exception ex) {
				messages+="Exception: "+ex.Message+"\r\nData: "+ex.Data+"\r\n";
			}
			messages+="MessageCode: "+returnMessage.MessageCode.ToString();//MessageCode enum. 0=CompletedSuccessfully, 1=CompletedWithErrors, 2=Failure
			MsgBox.Show(this,"Return Messages: "+returnMessage.Message+"\r\n"+messages);
			if(returnMessage.MessageCode==DivvyConnect.MessageCode.CompletedSucessfully) {
				Cursor=Cursors.WaitCursor;
				for(int i=0;i<gridMain.SelectedIndices.Length;i++) {
					//make commlog entries for each patient
					//Commlogs.InsertForRecall(PIn.Long(table.Rows[gridMain.SelectedIndices[i]]["PatNum"].ToString()),CommItemMode.Mail,
					//  PIn.Int(table.Rows[gridMain.SelectedIndices[i]]["numberOfReminders"].ToString()),PrefC.GetLong(PrefName.RecallStatusMailed));					
					Commlogs.InsertForRecall(1,CommItemMode.Mail,
						PIn.Int(table.Rows[gridMain.SelectedIndices[i]]["numberOfReminders"].ToString()),PrefC.GetLong(PrefName.RecallStatusMailed));
				}
				for(int i=0;i<gridMain.SelectedIndices.Length;i++) {
					Recalls.UpdateStatus(
						PIn.Long(table.Rows[gridMain.SelectedIndices[i]]["RecallNum"].ToString()),PrefC.GetLong(PrefName.RecallStatusMailed));
				}
			}
			else if(returnMessage.MessageCode==DivvyConnect.MessageCode.CompletedWithErrors) {
				for(int i=0;i<returnMessage.PostcardMessages.Length;i++) {
					//todo: process return messages. Update commlog and change recall statuses for postcards that were sent.
				}
			}
			FillMain(null);
			Cursor=Cursors.Default;
		}
示例#6
0
        private void gridProgram_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            DialogResult dResult = DialogResult.None;
            Program      program = _listPrograms[gridProgram.GetSelectedIndex()].Copy();

            switch (program.ProgName)
            {
            case "UAppoint":
                FormUAppoint FormU = new FormUAppoint();
                FormU.ProgramCur = program;
                dResult          = FormU.ShowDialog();
                break;

            case "eClinicalWorks":
                if (!Security.IsAuthorized(Permissions.SecurityAdmin))
                {
                    break;
                }
                FormEClinicalWorks FormECW = new FormEClinicalWorks();
                FormECW.ProgramCur = program;
                dResult            = FormECW.ShowDialog();
                break;

            case "eRx":
                FormErxSetup FormES = new FormErxSetup();
                dResult = FormES.ShowDialog();
                break;

            case "Mountainside":
                FormMountainside FormM = new FormMountainside();
                FormM.ProgramCur = program;
                dResult          = FormM.ShowDialog();
                break;

            case "PayConnect":
                FormPayConnectSetup fpcs = new FormPayConnectSetup();
                dResult = fpcs.ShowDialog();
                break;

            case "Podium":
                FormPodiumSetup FormPS = new FormPodiumSetup();
                dResult = FormPS.ShowDialog();
                break;

            case "Xcharge":
                FormXchargeSetup fxcs = new FormXchargeSetup();
                dResult = fxcs.ShowDialog();
                break;

            case "FHIR":
                FormFHIRSetup FormFS = new FormFHIRSetup();
                dResult = FormFS.ShowDialog();
                break;

            case "Transworld":
                FormTransworldSetup FormTs = new FormTransworldSetup();
                dResult = FormTs.ShowDialog();
                break;

            case "PaySimple":
                FormPaySimpleSetup formPS = new FormPaySimpleSetup();
                dResult = formPS.ShowDialog();
                break;

            default:
                FormProgramLinkEdit FormPE = new FormProgramLinkEdit();
                if (Programs.IsStatic(program))
                {
                    FormPE.AllowToolbarChanges = false;
                }
                FormPE.ProgramCur = program;
                dResult           = FormPE.ShowDialog();
                break;
            }
            if (dResult == DialogResult.OK)
            {
                changed = true;
                FillList();
            }
        }
		private void listProgram_DoubleClick(object sender, System.EventArgs e) {
			if(listProgram.SelectedIndex==-1){
				return;
			}
			Program program=ProgramC.Listt[listProgram.SelectedIndex].Copy();
			if(program.ProgName=="UAppoint"){
				FormUAppoint FormU=new FormUAppoint();
				FormU.ProgramCur=program;
				FormU.ShowDialog();
				if(FormU.DialogResult==DialogResult.OK){
					changed=true;
					FillList();
				}
				return;
			}
			if(program.ProgName=="eClinicalWorks") {
				if(!Security.IsAuthorized(Permissions.SecurityAdmin)) {
					return;
				}
				FormEClinicalWorks FormECW=new FormEClinicalWorks();
				FormECW.ProgramCur=program;
				FormECW.ShowDialog();
				if(FormECW.DialogResult==DialogResult.OK) {
					changed=true;
					FillList();
				}
				return;
			}
			if(program.ProgName=="Mountainside") {
				FormMountainside FormM=new FormMountainside();
				FormM.ProgramCur=program;
				FormM.ShowDialog();
				if(FormM.DialogResult==DialogResult.OK) {
					changed=true;
					FillList();
				}
				return;
			}
			if(program.ProgName=="PayConnect") {
				FormPayConnectSetup fpcs=new FormPayConnectSetup();
				fpcs.ShowDialog();
				if(fpcs.DialogResult==DialogResult.OK) {
					changed=true;
					FillList();
				}
				return;
			}
			if(program.ProgName=="Xcharge") {
				FormXchargeSetup fxcs=new FormXchargeSetup();
				fxcs.ShowDialog();
				if(fxcs.DialogResult==DialogResult.OK) {
					changed=true;
					FillList();
				}
				return;
			}
			FormProgramLinkEdit FormPE=new FormProgramLinkEdit();
			FormPE.ProgramCur=program;
			FormPE.ShowDialog();
			changed=true;
			FillList();
		}