예제 #1
0
파일: EhrPatients.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static void Update(EhrPatient ehrPatient) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),ehrPatient);
				return;
			}
			Crud.EhrPatientCrud.Update(ehrPatient);
		}
예제 #2
0
 ///<summary></summary>
 public static void Update(EhrPatient ehrPatient)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), ehrPatient);
         return;
     }
     Crud.EhrPatientCrud.Update(ehrPatient);
 }
예제 #3
0
파일: EhrPatients.cs 프로젝트: mnisl/OD
		///<summary></summary>
		private static void Insert(long patNum) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),patNum);
				return;
			}
			//Random keys not necessary to check because of 1:1 patNum.
			//However, this is a lazy insert, so multiple locations might attempt it.
			//Just in case, we will have it fail silently.
			EhrPatient ehrPatient=new EhrPatient();
			ehrPatient.PatNum=patNum;
			try {
				Crud.EhrPatientCrud.Insert(ehrPatient,true);
			}
			catch {
				//Fail Silently.
			}
		}
예제 #4
0
        ///<summary></summary>
        private static void Insert(long patNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patNum);
                return;
            }
            //Random keys not necessary to check because of 1:1 patNum.
            //However, this is a lazy insert, so multiple locations might attempt it.
            //Just in case, we will have it fail silently.
            EhrPatient ehrPatient = new EhrPatient();

            ehrPatient.PatNum = patNum;
            try {
                Crud.EhrPatientCrud.Insert(ehrPatient, true);
            }
            catch {
                //Fail Silently.
            }
        }
예제 #5
0
		private void FormVaccines_Load(object sender,EventArgs e) {
			FillGridVaccine();
			_ehrPatientCur=EhrPatients.Refresh(PatCur.PatNum);
			listVacShareOk.SelectedIndex=(int)_ehrPatientCur.VacShareOk;
		}
예제 #6
0
		private void FormPatientEdit_Load(object sender, System.EventArgs e) {
			FillComboZip();
			checkSame.Checked=true;
			checkNotesSame.Checked=true;
			if(PatCur!=null){
				for(int i=0;i<FamCur.ListPats.Length;i++){
					if(PatCur.HmPhone!=FamCur.ListPats[i].HmPhone
						|| PatCur.Address!=FamCur.ListPats[i].Address
						|| PatCur.Address2!=FamCur.ListPats[i].Address2
						|| PatCur.City!=FamCur.ListPats[i].City
						|| PatCur.State!=FamCur.ListPats[i].State
						|| PatCur.Zip!=FamCur.ListPats[i].Zip
						|| PatCur.CreditType!=FamCur.ListPats[i].CreditType
						|| PatCur.BillingType!=FamCur.ListPats[i].BillingType
						|| PatCur.PriProv!=FamCur.ListPats[i].PriProv
						|| PatCur.SecProv!=FamCur.ListPats[i].SecProv
						|| PatCur.FeeSched!=FamCur.ListPats[i].FeeSched)
					{
						checkSame.Checked=false;
					}
					if(PatCur.AddrNote!=FamCur.ListPats[i].AddrNote)
					{
						checkNotesSame.Checked=false;
					}
				}
			}
			textPatNum.Text=PatCur.PatNum.ToString();
			textLName.Text=PatCur.LName;
			textFName.Text=PatCur.FName;
			textMiddleI.Text=PatCur.MiddleI;
			textPreferred.Text=PatCur.Preferred;
			textTitle.Text=PatCur.Title;
			textSalutation.Text=PatCur.Salutation;
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {//Show mother's maiden name UI if using EHR.
				_ehrPatientCur=EhrPatients.Refresh(PatCur.PatNum);
				labelMotherMaidenFname.Visible=true;
				textMotherMaidenFname.Visible=true;
				textMotherMaidenFname.Text=_ehrPatientCur.MotherMaidenFname;
				labelMotherMaidenLname.Visible=true;
				textMotherMaidenLname.Visible=true;
				textMotherMaidenLname.Text=_ehrPatientCur.MotherMaidenLname;
			}
			listStatus.Items.Add(Lan.g("enumPatientStatus","Patient"));
			listStatus.Items.Add(Lan.g("enumPatientStatus","NonPatient"));
			listStatus.Items.Add(Lan.g("enumPatientStatus","Inactive"));
			listStatus.Items.Add(Lan.g("enumPatientStatus","Archived"));
			listStatus.Items.Add(Lan.g("enumPatientStatus","Deceased"));
			listStatus.Items.Add(Lan.g("enumPatientStatus","Prospective"));
			listGender.Items.Add(Lan.g("enumPatientGender","Male"));
			listGender.Items.Add(Lan.g("enumPatientGender","Female"));
			listGender.Items.Add(Lan.g("enumPatientGender","Unknown"));
			listPosition.Items.Add(Lan.g("enumPatientPosition","Single"));
			listPosition.Items.Add(Lan.g("enumPatientPosition","Married"));
			listPosition.Items.Add(Lan.g("enumPatientPosition","Child"));
			listPosition.Items.Add(Lan.g("enumPatientPosition","Widowed"));
			listPosition.Items.Add(Lan.g("enumPatientPosition","Divorced"));
			switch (PatCur.PatStatus){
				case PatientStatus.Patient : listStatus.SelectedIndex=0; break;
				case PatientStatus.NonPatient : listStatus.SelectedIndex=1; break;
				case PatientStatus.Inactive : listStatus.SelectedIndex=2; break;
				case PatientStatus.Archived : listStatus.SelectedIndex=3; break;
				case PatientStatus.Deceased : listStatus.SelectedIndex=4; break;
				case PatientStatus.Prospective : listStatus.SelectedIndex=5; break;}
			switch (PatCur.Gender){
				case PatientGender.Male : listGender.SelectedIndex=0; break;
				case PatientGender.Female : listGender.SelectedIndex=1; break;
				case PatientGender.Unknown : listGender.SelectedIndex=2; break;}
			switch (PatCur.Position){
				case PatientPosition.Single : listPosition.SelectedIndex=0; break;
				case PatientPosition.Married : listPosition.SelectedIndex=1; break;
				case PatientPosition.Child : listPosition.SelectedIndex=2; break;
				case PatientPosition.Widowed : listPosition.SelectedIndex=3; break;
				case PatientPosition.Divorced : listPosition.SelectedIndex=4; break;}
			FillGuardians();
			if(PatCur.Birthdate.Year < 1880)
				textBirthdate.Text="";
			else
				textBirthdate.Text=PatCur.Birthdate.ToShortDateString();
			if(PatCur.DateTimeDeceased.Year < 1880) {
				textDateDeceased.Text="";
			}
			else {
				textDateDeceased.Text=PatCur.DateTimeDeceased.ToShortDateString()+"  "+PatCur.DateTimeDeceased.ToShortTimeString();
			}
			textAge.Text=PatientLogic.DateToAgeString(PatCur.Birthdate,PatCur.DateTimeDeceased);
			if(CultureInfo.CurrentCulture.Name=="en-US"//if USA
				&& PatCur.SSN!=null//the null catches new patients
				&& PatCur.SSN.Length==9)//and length exactly 9 (no data gets lost in formatting)
			{
				textSSN.Text=PatCur.SSN.Substring(0,3)+"-"
					+PatCur.SSN.Substring(3,2)+"-"+PatCur.SSN.Substring(5,4);
			}
			else{
				textSSN.Text=PatCur.SSN;
			}
			textMedicaidID.Text=PatCur.MedicaidID;
			textAddress.Text=PatCur.Address;
			textAddress2.Text=PatCur.Address2;
			textCity.Text=PatCur.City;
			textState.Text=PatCur.State;
			textCountry.Text=PatCur.Country;
			textZip.Text=PatCur.Zip;
			textHmPhone.Text=PatCur.HmPhone;
			textWkPhone.Text=PatCur.WkPhone;
			textWirelessPhone.Text=PatCur.WirelessPhone;
			listTextOk.SelectedIndex=(int)PatCur.TxtMsgOk;
			textEmail.Text=PatCur.Email;
			textCreditType.Text=PatCur.CreditType;
			if(PatCur.DateFirstVisit.Year < 1880){
				textDateFirstVisit.Text="";
			}
			else{
				textDateFirstVisit.Text=PatCur.DateFirstVisit.ToShortDateString();
			}
			if(PatCur.AskToArriveEarly>0){
				textAskToArriveEarly.Text=PatCur.AskToArriveEarly.ToString();
			}
			textChartNumber.Text=PatCur.ChartNumber;
			textEmployer.Text=Employers.GetName(PatCur.EmployerNum);
			//textEmploymentNote.Text=PatCur.EmploymentNote;
			languageList=new List<string>();
			if(PrefC.GetString(PrefName.LanguagesUsedByPatients)!="") {
				string[] lanstring=PrefC.GetString(PrefName.LanguagesUsedByPatients).Split(',');
				for(int i=0;i<lanstring.Length;i++) {
					if(lanstring[i]=="") {
						continue;
					}
					languageList.Add(lanstring[i]);
				}
			}
			if(PatCur.Language!="" && PatCur.Language!=null && !languageList.Contains(PatCur.Language)) {
				languageList.Add(PatCur.Language);
			}
			comboLanguage.Items.Add(Lan.g(this,"none"));//regardless of how many languages are listed, the first item is "none"
			comboLanguage.SelectedIndex=0;
			for(int i=0;i<languageList.Count;i++) {
				if(languageList[i]=="") {
					continue;
				}
				CultureInfo culture=CodeBase.MiscUtils.GetCultureFromThreeLetter(languageList[i]);
				if(culture==null) {//custom language
					comboLanguage.Items.Add(languageList[i]);
				}
				else {
					comboLanguage.Items.Add(culture.DisplayName);
				}
				if(PatCur.Language==languageList[i]) {
					comboLanguage.SelectedIndex=i+1;
				}
			}
			for(int i=0;i<ProviderC.ListShort.Count;i++){
				comboPriProv.Items.Add(ProviderC.ListShort[i].Abbr);
				if(ProviderC.ListShort[i].ProvNum==PatCur.PriProv) {
					comboPriProv.SelectedIndex=i;
				}
			}
			/*Provider should not automatically change.  So may end up with no provider selected.
			if(comboPriProv.SelectedIndex==-1){
				int defaultindex=Providers.GetIndex(PrefC.GetLong(PrefName.PracticeDefaultProv));
				if(defaultindex==-1) {//default provider hidden
					comboPriProv.SelectedIndex=0;
				}
				else {
					comboPriProv.SelectedIndex=defaultindex;
				}
			}*/
			comboSecProv.Items.Clear();
			comboSecProv.Items.Add(Lan.g(this,"none"));
			comboSecProv.SelectedIndex=0;
			for(int i=0;i<ProviderC.ListShort.Count;i++){
				comboSecProv.Items.Add(ProviderC.ListShort[i].Abbr);
				if(ProviderC.ListShort[i].ProvNum==PatCur.SecProv)
					comboSecProv.SelectedIndex=i+1;
			}
			comboFeeSched.Items.Clear();
			comboFeeSched.Items.Add(Lan.g(this,"none"));
			comboFeeSched.SelectedIndex=0;
			for(int i=0;i<FeeSchedC.ListShort.Count;i++){
				comboFeeSched.Items.Add(FeeSchedC.ListShort[i].Description);
				if(FeeSchedC.ListShort[i].FeeSchedNum==PatCur.FeeSched){
					comboFeeSched.SelectedIndex=i+1;
				}
			}
			//MessageBox.Show(DefC.Short[(int)DefCat.BillingTypes].Length.ToString());
			for(int i=0;i<DefC.Short[(int)DefCat.BillingTypes].Length;i++){
				comboBillType.Items.Add(DefC.Short[(int)DefCat.BillingTypes][i].ItemName);
				if(DefC.Short[(int)DefCat.BillingTypes][i].DefNum==PatCur.BillingType)
					comboBillType.SelectedIndex=i;
			}
			if(comboBillType.SelectedIndex==-1){
				if(comboBillType.Items.Count==0) {
					MsgBox.Show(this,"Error.  All billing types have been hidden.  Please go to Definitions and unhide at least one.");
					DialogResult=DialogResult.Cancel;
					return;
				}
				comboBillType.SelectedIndex=0;
			}
			comboClinic.Items.Clear();
			comboClinic.Items.Add(Lan.g(this,"none"));
			comboClinic.SelectedIndex=0;
			for(int i=0;i<Clinics.List.Length;i++){
				comboClinic.Items.Add(Clinics.List[i].Description);
				if(Clinics.List[i].ClinicNum==PatCur.ClinicNum){
					comboClinic.SelectedIndex=i+1;
				}
			}
			switch(PatCur.StudentStatus){
				case "N"://non
				case "":
					radioStudentN.Checked=true;
					break;
				case "P"://parttime
					radioStudentP.Checked=true;
					break;
				case "F"://fulltime
					radioStudentF.Checked=true;
					break;
			}
			textSchool.Text=PatCur.SchoolName;
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				labelSchoolName.Text=Lan.g(this,"Name of School");
				comboCanadianEligibilityCode.Items.Add("0 - Please Choose");
				comboCanadianEligibilityCode.Items.Add("1 - Full-time student");
				comboCanadianEligibilityCode.Items.Add("2 - Disabled");
				comboCanadianEligibilityCode.Items.Add("3 - Disabled student");
				comboCanadianEligibilityCode.Items.Add("4 - Code not applicable");
				comboCanadianEligibilityCode.SelectedIndex=PatCur.CanadianEligibilityCode;
			}
			textAddrNotes.Text=PatCur.AddrNote;
			if(PrefC.GetBool(PrefName.EasyHidePublicHealth)){
				groupPH.Visible=false;
			}
			if(PrefC.GetBool(PrefName.EasyHideMedicaid)){
				label31.Visible=false;
				label37.Visible=false;
				textMedicaidID.Visible=false;
			}
			if(PrefC.GetBool(PrefName.EasyNoClinics)){
				comboClinic.Visible=false;
				labelClinic.Visible=false;
			}
			comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","none"));//0 none option for both regular and EHR users.
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {
				labelRaceEthnicity.Text="Race";
				//comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Aboriginal"));//Hidden for EHR
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","AfricanAmerican"));//1
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","AmericanIndian"));//2
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Asian"));//3
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","DeclinedToSpecify"));//4
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","HawaiiOrPacIsland"));//5
				//comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Hispanic"));//Hidden for EHR. Supplemental to base 'race'. Shows in comboEthnicity instead.
				//comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Multiracial"));//Hidden for EHR
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Other"));//6
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","White"));//7
				comboEthnicity.Items.Add(Lan.g(this,"none"));//0 
				comboEthnicity.Items.Add(Lan.g(this,"DeclinedToSpecify"));//1
				comboEthnicity.Items.Add(Lan.g(this,"Not Hispanic"));//2
				comboEthnicity.Items.Add(Lan.g(this,"Hispanic"));//3
				List<int> listPatRaces=PatientRaces.GetPatRaceList(PatCur.PatNum);
				comboEthnicity.SelectedIndex=0;//none
				for(int i=0;i<listPatRaces.Count;i++) {
					PatRace race=(PatRace)listPatRaces[i];
					if(race==PatRace.AfricanAmerican) {
						comboBoxMultiRace.SetSelected(1,true);//AfricanAmerican
					}
					else if(race==PatRace.AmericanIndian) {
						comboBoxMultiRace.SetSelected(2,true);//AmericanIndian
					}
					else if(race==PatRace.Asian) {
						comboBoxMultiRace.SetSelected(3,true);//Asian
					}
					else if(race==PatRace.DeclinedToSpecifyRace) {
						comboBoxMultiRace.SetSelected(4,true);//DeclinedToSpecify
					}
					else if(race==PatRace.HawaiiOrPacIsland) {
						comboBoxMultiRace.SetSelected(5,true);//HawaiiOrPacIsland
					}
					else if(race==PatRace.Hispanic) {
						comboEthnicity.SelectedIndex=3;//Hispanic
					}
					else if(race==PatRace.NotHispanic) {
						comboEthnicity.SelectedIndex=2;//Not Hispanic
					}
					else if(race==PatRace.Other) {
						comboBoxMultiRace.SetSelected(6,true);//Other
					}
					else if(race==PatRace.White) {
						comboBoxMultiRace.SetSelected(7,true);//White
					}
					else if(race==PatRace.DeclinedToSpecifyEthnicity) {
						comboEthnicity.SelectedIndex=1;//DeclinedToSpecify
					}
				}
			}
			else {//EHR not enabled
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Aboriginal"));//1
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","AfricanAmerican"));//2
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","AmericanIndian"));//3
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Asian"));//4
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","DeclinedToSpecify"));//5
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","HawaiiOrPacIsland"));//6
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Hispanic"));//7
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Multiracial"));//8
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","Other"));//9
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","White"));//10
				comboBoxMultiRace.Items.Add(Lan.g("enumPatRace","NotHispanic"));//11
				List<int> listPatRaces=PatientRaces.GetPatRaceList(PatCur.PatNum);
				for(int i=0;i<listPatRaces.Count;i++) {
					comboBoxMultiRace.SetSelected(listPatRaces[i]+1,true);//Offset by 1 because of none option at location 0.
				}
				labelEthnicity.Visible=false;
				comboEthnicity.Visible=false;
			}
			if(comboBoxMultiRace.SelectedIndices.Count==0) {//no race set
				comboBoxMultiRace.SetSelected(0,true);//Set to none
			}
			comboBoxMultiRace.RefreshText();
			textCounty.Text=PatCur.County;
			textSite.Text=Sites.GetDescription(PatCur.SiteNum);
			string[] enumGrade=Enum.GetNames(typeof(PatientGrade));
			for(int i=0;i<enumGrade.Length;i++){
				comboGradeLevel.Items.Add(Lan.g("enumGrade",enumGrade[i]));
			}
			comboGradeLevel.SelectedIndex=(int)PatCur.GradeLevel;
			string[] enumUrg=Enum.GetNames(typeof(TreatmentUrgency));
			for(int i=0;i<enumUrg.Length;i++){
				comboUrgency.Items.Add(Lan.g("enumUrg",enumUrg[i]));
			}
			comboUrgency.SelectedIndex=(int)PatCur.Urgency;
			if(PatCur.ResponsParty!=0){
				textResponsParty.Text=Patients.GetLim(PatCur.ResponsParty).GetNameLF();
			}
			if(Programs.IsEnabled(ProgramName.TrophyEnhanced)){
				textTrophyFolder.Text=PatCur.TrophyFolder;
			}
			else{
				labelTrophyFolder.Visible=false;
				textTrophyFolder.Visible=false;
			}
			if(PrefC.GetBool(PrefName.EasyHideHospitals)){
				textWard.Visible=false;
				labelWard.Visible=false;
				textAdmitDate.Visible=false;
				labelAdmitDate.Visible=false;
			}
			textWard.Text=PatCur.Ward;
			for(int i=0;i<Enum.GetNames(typeof(ContactMethod)).Length;i++){
				comboContact.Items.Add(Lan.g("enumContactMethod",Enum.GetNames(typeof(ContactMethod))[i]));
				comboConfirm.Items.Add(Lan.g("enumContactMethod",Enum.GetNames(typeof(ContactMethod))[i]));
				comboRecall.Items.Add(Lan.g("enumContactMethod",Enum.GetNames(typeof(ContactMethod))[i]));
			}
			comboContact.SelectedIndex=(int)PatCur.PreferContactMethod;
			comboConfirm.SelectedIndex=(int)PatCur.PreferConfirmMethod;
			comboRecall.SelectedIndex=(int)PatCur.PreferRecallMethod;
			if(PatCur.AdmitDate.Year>1880){
				textAdmitDate.Text=PatCur.AdmitDate.ToShortDateString();
			}
			textLName.Select();
			if(HL7Defs.IsExistingHL7Enabled()) {
				if(HL7Defs.GetOneDeepEnabled().ShowDemographics==HL7ShowDemographics.Show) {//If show, then not edit so disable OK button
					butOK.Enabled=false;
				}
			}
			if(!PrefC.GetBool(PrefName.DockPhonePanelShow)) {
				labelST.Text="ST";
				textCountry.Visible=false;
			}
		}