Ejemplo n.º 1
0
		///<summary></summary>
		public CovSpan Copy() {
			CovSpan c=new CovSpan();
			c.CovSpanNum=CovSpanNum;
			c.CovCatNum=CovCatNum;
			c.FromCode=FromCode;
			c.ToCode=ToCode;
			return c;
		}
Ejemplo n.º 2
0
		///<summary></summary>
		public static long Insert(CovSpan span) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				span.CovSpanNum=Meth.GetLong(MethodBase.GetCurrentMethod(),span);
				return span.CovSpanNum;
			}
			Validate(span);
			return Crud.CovSpanCrud.Insert(span);
		}
Ejemplo n.º 3
0
        ///<summary></summary>
        public static long GetCat(string myCode)
        {
            //No need to check RemotingRole; no call to db.
            CovSpan covSpan = GetLastOrDefault(x => String.Compare(myCode, x.FromCode) >= 0 &&
                                               String.Compare(myCode, x.ToCode) <= 0);

            return(covSpan == null ? 0 : covSpan.CovCatNum);
        }
Ejemplo n.º 4
0
		///<summary></summary>
		public static void Delete(CovSpan span) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),span);
				return;
			}
			string command="DELETE FROM covspan"
				+" WHERE CovSpanNum = '"+POut.Long(span.CovSpanNum)+"'";
			Db.NonQ(command);
		}
Ejemplo n.º 5
0
		///<summary></summary>
		private static void Validate(CovSpan span){
			//No need to check RemotingRole; no call to db.
			if(span.FromCode=="" || span.ToCode=="") {
				throw new ApplicationException(Lans.g("FormInsSpanEdit","Codes not allowed to be blank."));
			}
			if(String.Compare(span.ToCode,span.FromCode)<0){
				throw new ApplicationException(Lans.g("FormInsSpanEdit","From Code must be less than To Code.  Remember that the comparison is alphabetical, not numeric.  For instance, 100 would come before 2, but after 02."));
			}
		}
Ejemplo n.º 6
0
		///<summary></summary>
		public static void Update(CovSpan span) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),span);
				return;
			}
			Validate(span);
			Crud.CovSpanCrud.Update(span);
			return;
		}
Ejemplo n.º 7
0
        ///<summary></summary>
        public CovSpan Copy()
        {
            CovSpan c = new CovSpan();

            c.CovSpanNum = CovSpanNum;
            c.CovCatNum  = CovCatNum;
            c.FromCode   = FromCode;
            c.ToCode     = ToCode;
            return(c);
        }
Ejemplo n.º 8
0
 ///<summary></summary>
 public static long Insert(CovSpan span)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         span.CovSpanNum = Meth.GetLong(MethodBase.GetCurrentMethod(), span);
         return(span.CovSpanNum);
     }
     Validate(span);
     return(Crud.CovSpanCrud.Insert(span));
 }
Ejemplo n.º 9
0
 ///<summary>If the supplied code falls within any of the supplied spans, then returns true.</summary>
 public static bool IsCodeInSpans(string strProcCode,CovSpan[] covSpanArray)
 {
     //No need to check RemotingRole; no call to db.
     for(int i=0;i<covSpanArray.Length;i++) {
         if(String.Compare(strProcCode,covSpanArray[i].FromCode)>=0
             && String.Compare(strProcCode,covSpanArray[i].ToCode)<=0) {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 10
0
 ///<summary></summary>
 public static void Update(CovSpan span)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), span);
         return;
     }
     Validate(span);
     Crud.CovSpanCrud.Update(span);
     return;
 }
Ejemplo n.º 11
0
 ///<summary></summary>
 private static void Validate(CovSpan span)
 {
     //No need to check RemotingRole; no call to db.
     if (span.FromCode == "" || span.ToCode == "")
     {
         throw new ApplicationException(Lans.g("FormInsSpanEdit", "Codes not allowed to be blank."));
     }
     if (String.Compare(span.ToCode, span.FromCode) < 0)
     {
         throw new ApplicationException(Lans.g("FormInsSpanEdit", "From Code must be less than To Code.  Remember that the comparison is alphabetical, not numeric.  For instance, 100 would come before 2, but after 02."));
     }
 }
Ejemplo n.º 12
0
        ///<summary></summary>
        public static void Delete(CovSpan span)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), span);
                return;
            }
            string command = "DELETE FROM covspan"
                             + " WHERE CovSpanNum = '" + POut.Long(span.CovSpanNum) + "'";

            Db.NonQ(command);
        }
Ejemplo n.º 13
0
 ///<summary></summary>
 public static CovSpan[] GetForCat(long catNum)
 {
     //No need to check RemotingRole; no call to db.
     ArrayList AL=new ArrayList();
     for(int i=0;i<CovSpanC.List.Length;i++){
         if(CovSpanC.List[i].CovCatNum==catNum){
             AL.Add(CovSpanC.List[i].Copy());
         }
     }
     CovSpan[] retVal=new CovSpan[AL.Count];
     AL.CopyTo(retVal);
     return retVal;
 }
Ejemplo n.º 14
0
        ///<summary></summary>
        public static CovSpan[] GetForCat(long catNum)
        {
            //No need to check RemotingRole; no call to db.
            ArrayList AL = new ArrayList();

            for (int i = 0; i < CovSpanC.List.Length; i++)
            {
                if (CovSpanC.List[i].CovCatNum == catNum)
                {
                    AL.Add(CovSpanC.List[i].Copy());
                }
            }
            CovSpan[] retVal = new CovSpan[AL.Count];
            AL.CopyTo(retVal);
            return(retVal);
        }
Ejemplo n.º 15
0
Archivo: CovSpanC.cs Proyecto: mnisl/OD
		///<summary></summary>
		public static CovSpan[] GetList() {
			bool isListNull=false;
			lock(_lockObj) {
				if(_list==null) {
					isListNull=true;
				}
			}
			if(isListNull) {
				CovSpans.RefreshCache();
			}
			CovSpan[] arrayCovSpans;
			lock(_lockObj) {
				arrayCovSpans=new CovSpan[_list.Length];
				for(int i=0;i<_list.Length;i++) {
					arrayCovSpans[i]=_list[i].Copy();
				}
			}
			return arrayCovSpans;
		}
Ejemplo n.º 16
0
 private void butAddSpan_Click(object sender, System.EventArgs e)
 {
     if(gridMain.SelectedIndices.Length<1){
         MsgBox.Show(this,"Please select a category first.");
         return;
     }
     if(gridMain.Rows[gridMain.SelectedIndices[0]].Tag.GetType()!=typeof(CovCat)){
         MsgBox.Show(this,"Please select a category first.");
         return;
     }
     CovSpan covspan=new CovSpan();
     covspan.CovCatNum=((CovCat)gridMain.Rows[gridMain.SelectedIndices[0]].Tag).CovCatNum;
     FormInsSpanEdit FormE=new FormInsSpanEdit(covspan);
     FormE.IsNew=true;
     FormE.ShowDialog();
     if(FormE.DialogResult!=DialogResult.OK){
         return;
     }
     changed=true;
     FillSpans();
 }
Ejemplo n.º 17
0
        ///<summary>Deletes the current CovSpans for the given eBenefitCategory, then creates new code ranges from the ranges specified in arrayCodeRanges.  The values in arrayCodeRanges can be a single code such as "D0120" or a code range such as "D9000-D9999".</summary>
        private static void RecreateSpansForCategory(EbenefitCategory eBenefitCategory, params string[] arrayCodeRanges)
        {
            long covCatNum = GetForEbenCat(eBenefitCategory).CovCatNum;

            CovSpans.DeleteForCat(covCatNum);
            for (int i = 0; i < arrayCodeRanges.Length; i++)
            {
                string  codeRange = arrayCodeRanges[i];
                CovSpan span      = new CovSpan();
                span.CovCatNum = covCatNum;
                if (codeRange.Contains("-"))                 //Code range
                {
                    span.FromCode = codeRange.Substring(0, codeRange.IndexOf("-"));
                    span.ToCode   = codeRange.Substring(span.FromCode.Length + 1);
                }
                else                  //Single code
                {
                    span.FromCode = codeRange;
                    span.ToCode   = codeRange;
                }
                CovSpans.Insert(span);
            }
        }
Ejemplo n.º 18
0
        public static void SetSpansToDefaultUsa()
        {
            //This can only be run if the validation checks have been run first.
            //No need to check RemotingRole; no call to db.
            long    covCatNum;
            CovSpan span;

            covCatNum = GetForEbenCat(EbenefitCategory.General).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D0000";
            span.ToCode    = "D7999";
            CovSpans.Insert(span);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D9000";
            span.ToCode    = "D9999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Diagnostic).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D0000";
            span.ToCode    = "D0999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.DiagnosticXRay).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D0200";
            span.ToCode    = "D0399";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.RoutinePreventive).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D1000";
            span.ToCode    = "D1999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Restorative).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D2000";
            span.ToCode    = "D2699";
            CovSpans.Insert(span);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D2800";
            span.ToCode    = "D2999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Endodontics).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D3000";
            span.ToCode    = "D3999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Periodontics).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D4000";
            span.ToCode    = "D4999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.OralSurgery).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D7000";
            span.ToCode    = "D7999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Crowns).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D2700";
            span.ToCode    = "D2799";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Prosthodontics).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D5000";
            span.ToCode    = "D5899";
            CovSpans.Insert(span);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D6200";
            span.ToCode    = "D6899";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.MaxillofacialProsth).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D5900";
            span.ToCode    = "D5999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Accident).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            covCatNum = GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D8000";
            span.ToCode    = "D8999";
            CovSpans.Insert(span);
            covCatNum = GetForEbenCat(EbenefitCategory.Adjunctive).CovCatNum;
            CovSpans.DeleteForCat(covCatNum);
            span           = new CovSpan();
            span.CovCatNum = covCatNum;
            span.FromCode  = "D9000";
            span.ToCode    = "D9999";
            CovSpans.Insert(span);
        }
Ejemplo n.º 19
0
		///<summary></summary>
		public FormInsSpanEdit(CovSpan covSpanCur){
			InitializeComponent();// Required for Windows Form Designer support
			CovSpanCur=covSpanCur.Copy();
			Lan.F(this);
		}
Ejemplo n.º 20
0
		public static void SetSpansToDefault() {
			//This can only be run if the validation checks have been run first.
			//No need to check RemotingRole; no call to db.
			long covCatNum;
			CovSpan span;
			covCatNum=GetForEbenCat(EbenefitCategory.General).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D0000";
			span.ToCode="D7999";
			CovSpans.Insert(span);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D9000";
			span.ToCode="D9999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Diagnostic).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D0000";
			span.ToCode="D0999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.DiagnosticXRay).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D0200";
			span.ToCode="D0399";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.RoutinePreventive).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D1000";
			span.ToCode="D1999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Restorative).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D2000";
			span.ToCode="D2699";
			CovSpans.Insert(span);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D2800";
			span.ToCode="D2999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Endodontics).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D3000";
			span.ToCode="D3999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Periodontics).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D4000";
			span.ToCode="D4999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.OralSurgery).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D7000";
			span.ToCode="D7999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Crowns).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D2700";
			span.ToCode="D2799";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Prosthodontics).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D5000";
			span.ToCode="D5899";
			CovSpans.Insert(span);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D6200";
			span.ToCode="D6899";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.MaxillofacialProsth).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D5900";
			span.ToCode="D5999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Accident).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			covCatNum=GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D8000";
			span.ToCode="D8999";
			CovSpans.Insert(span);
			covCatNum=GetForEbenCat(EbenefitCategory.Adjunctive).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			span=new CovSpan();
			span.CovCatNum=covCatNum;
			span.FromCode="D9000";
			span.ToCode="D9999";
			CovSpans.Insert(span);


		}
Ejemplo n.º 21
0
Archivo: CovCats.cs Proyecto: mnisl/OD
		///<summary>Deletes the current CovSpans for the given eBenefitCategory, then creates new code ranges from the ranges specified in arrayCodeRanges.  The values in arrayCodeRanges can be a single code such as "D0120" or a code range such as "D9000-D9999".</summary>
		private static void RecreateSpansForCategory(EbenefitCategory eBenefitCategory,params string[] arrayCodeRanges) {
			long covCatNum=GetForEbenCat(eBenefitCategory).CovCatNum;
			CovSpans.DeleteForCat(covCatNum);
			for(int i=0;i<arrayCodeRanges.Length;i++) {
				string codeRange=arrayCodeRanges[i];
				CovSpan span=new CovSpan();
				span.CovCatNum=covCatNum;
				if(codeRange.Contains("-")) {//Code range
					span.FromCode=codeRange.Substring(0,codeRange.IndexOf("-"));
					span.ToCode=codeRange.Substring(span.FromCode.Length+1);
				}
				else {//Single code
					span.FromCode=codeRange;
					span.ToCode=codeRange;
				}
				CovSpans.Insert(span);
			}
		}