Пример #1
0
        ///<summary></summary>
        public static Def CreateDefinition(DefCat category, string itemName, string itemValue = "", Color itemColor = new Color())
        {
            Def def = new Def();

            def.Category  = category;
            def.ItemColor = itemColor;
            def.ItemName  = itemName;
            def.ItemValue = itemValue;
            Defs.Insert(def);
            return(def);
        }
Пример #2
0
        public void MiddleTier_GetProcCodeWithDirtyProperty()
        {
            Def d;

            if (Defs.GetDefsForCategory(DefCat.ProcCodeCats, true).Count == 0)
            {
                d = new Def()
                {
                    Category = DefCat.ProcCodeCats, ItemName = WebServiceTests.DirtyString
                };
                d.DefNum = Defs.Insert(d);
            }
            else
            {
                d          = Defs.GetFirstForCategory(DefCat.ProcCodeCats, true);
                d.ItemName = WebServiceTests.DirtyString;
                Defs.Update(d);
            }
            Defs.RefreshCache();
            d = Defs.GetDef(DefCat.ProcCodeCats, d.DefNum);
            ProcedureCode pc = new ProcedureCode {
                IsNew = true, ProcCat = d.DefNum
            };
            ProcedureCode pc2 = new ProcedureCode {
                IsNew = true
            };
            List <ProcedureCode> listPcs   = new List <ProcedureCode>();
            List <string>        strErrors = new List <string>();

            try {
                listPcs = WebServiceTests.GetProcCodeWithDirtyProperty(pc, pc2);
            }
            catch (Exception ex) {
                strErrors.Add("Cannot serialize a property with a getter that does not retrieve the same value the setter is manipulating.");
                strErrors.Add(ex.Message);
                strErrors.Add(ex.StackTrace);
            }
            if (listPcs.Count > 0 && (listPcs[0].IsNew || listPcs[1].IsNew))
            {
                strErrors.Add(string.Format("One or more of the returned ProcedureCode objects IsNew flag should be {0} but returned {1}.", "false", "true"));
            }
            if (listPcs.Count > 0 && (listPcs[0].ProcCat != d.DefNum || listPcs[1].ProcCat != d.DefNum))
            {
                strErrors.Add("One or more of the ProcedureCode objects returned did not have the correct ProcCat.");
            }
            if (listPcs.Count > 0 && (listPcs[0].ProcCatDescript != d.ItemName || listPcs[1].ProcCatDescript != d.ItemName))
            {
                strErrors.Add("One or more of the ProcedureCode objects returned did not have the correct dirty string.");
            }
            Assert.IsTrue(strErrors.Count == 0);
        }
Пример #3
0
        public static void SetupClass(TestContext testContext)
        {
            //Set all the reactivations prefs
            PrefName.ShowFeatureReactivations.Update(true);
            PrefName.ReactivationContactInterval.Update(180);      //~6 months
            PrefName.ReactivationCountContactMax.Update(2);
            PrefName.ReactivationDaysPast.Update(730);             //Two years
            PrefName.ReactivationEmailFamMsg.Update("");           //Set these later if they're needed for a test
            PrefName.ReactivationEmailMessage.Update("");          //Set these later if they're needed for a test
            PrefName.ReactivationEmailSubject.Update("");          //Set these later if they're needed for a test
            PrefName.ReactivationGroupByFamily.Update(false);
            PrefName.ReactivationPostcardFamMsg.Update("");        //Set these later if they're needed for a test
            PrefName.ReactivationPostcardMessage.Update("");       //Set these later if they're needed for a test
            PrefName.ReactivationPostcardsPerSheet.Update(3);
            //Set the defs for reactivation statuses
            long reactEmailed = Defs.Insert(new Def()
            {
                Category = DefCat.RecallUnschedStatus, ItemName = "Reactivation E-Mailed"
            });

            PrefName.ReactivationStatusEmailed.Update(reactEmailed);
            long reactEmailedTexted = Defs.Insert(new Def()
            {
                Category = DefCat.RecallUnschedStatus, ItemName = "Reactivation E-Mailed/Texted"
            });

            PrefName.ReactivationStatusEmailedTexted.Update(reactEmailedTexted);
            long reactMailed = Defs.Insert(new Def()
            {
                Category = DefCat.RecallUnschedStatus, ItemName = "Reactivation Mailed"
            });

            PrefName.ReactivationStatusMailed.Update(reactMailed);
            long reactTexted = Defs.Insert(new Def()
            {
                Category = DefCat.RecallUnschedStatus, ItemName = "Reactivation Texted"
            });

            PrefName.ReactivationStatusTexted.Update(reactTexted);
            //Create a commlog type for reactivations
            _reactivationCommLogType = Defs.Insert(new Def()
            {
                Category = DefCat.CommLogTypes, ItemName = "ReactivationsComm", ItemValue = "REACT"
            });
            Defs.RefreshCache();
        }
Пример #4
0
 private static void ProcessFile(string fullPath)
 {
     if(PrefC.AtoZfolderUsed==DataStorageType.InDatabase) {
         MsgBox.Show("TigerView","TigerView is not currently supported when storing images in the database.");
         return;
     }
     if(CloudStorage.IsCloudStorage) {
         MsgBox.Show("TigerView","TigerView is not currently supported when storing images in the cloud.");
         return;
     }
     string filename=Path.GetFileName(fullPath);
     //Get the patNum/chartNum from filename.  Example: tmb123.20091119.XXXXXX.tig where X is identifier
     string[] splitFileName=filename.Split(new char[] { '.' });
     if(splitFileName.Length!=4) { //Not correct format
         return;
     }
     string identifier=splitFileName[2]; //Third quadrant
     bool useChartNum=false;
     for(int i=0;i<identifier.Length;i++) { //Check to see if the identifer has anything but numbers, if so it has to be a chartnum or invalid
         if(!Char.IsNumber(identifier,i)) {
             useChartNum=true;
             break;
         }
     }
     if(!useChartNum) { //If it could be a valid patnum, check program pref
         List<ProgramProperty> propertiesForProgram =ProgramProperties.GetForProgram(Programs.GetProgramNum(ProgramName.TigerView));
         ProgramProperty programProperty=ProgramProperties.GetCur(propertiesForProgram,"Enter 0 to use PatientNum, or 1 to use ChartNum");
         if(programProperty.PropertyValue=="1") {//ChartNum
             useChartNum=true;
         }
     }
     Patient patCur;
     if(!useChartNum) {//Use PatNum
         patCur=Patients.GetPat(PIn.Long(identifier));
     }
     else {//Use ChartNum
         patCur=Patients.GetPatByChartNumber(identifier);
     }
     if(patCur==null) { //Could not find a patient with given PatNum/ChartNum
         return;
     }
     long imageCatDefNum=0;
     List<Def> listImageCatDefs=Defs.GetDefsForCategory(DefCat.ImageCats);
     for(int j=0;j<listImageCatDefs.Count;j++) { //Look for an image category with the name "Xray"
         if(listImageCatDefs[j].ItemName.ToLower()=="xray") {
             imageCatDefNum=listImageCatDefs[j].DefNum;
         }
     }
     if(imageCatDefNum==0) { //If no "Xray" category exists, insert new category with the name "Xray"
         Def def = new Def();
         def.ItemName="Xray";
         def.Category=DefCat.ImageCats;
         def.ItemValue="X"; //Will make this category show in the chart module
         def.ItemOrder=listImageCatDefs.Count;
         imageCatDefNum=Defs.Insert(def);
         Cache.Refresh(InvalidType.Defs);
     }
     string newFileName="TV_"+filename.Substring(0,filename.IndexOf('.')+1)+CodeBase.MiscUtils.CreateRandomAlphaNumericString(4);
     newFileName=newFileName.Replace('.','_'); //Get rid of any periods in the file name.
     newFileName+=".tig"; //Add extention on to file name after other '.' were replaced.
     string newpath=CodeBase.ODFileUtils.CombinePaths(ImageStore.GetPatientFolder(patCur,ImageStore.GetPreferredAtoZpath()),newFileName);
     Document docCur = new Document();
     docCur.DocCategory=imageCatDefNum;
     docCur.FileName=newFileName;
     docCur.PatNum=patCur.PatNum;
     docCur.ImgType=ImageType.Photo;
     docCur.DateCreated=DateTime.Now;
     docCur.Description=newFileName;
     System.IO.File.Move(fullPath,newpath);
     Documents.Insert(docCur,patCur);
 }