예제 #1
0
        public void SInTests_SInEnum()
        {
            ProcStat procStatus    = ProcStat.EC;
            int      procStatusInt = (int)procStatus;

            Assert.AreEqual(procStatus, SIn.Enum <ProcStat>(procStatusInt));
        }
예제 #2
0
        public void SInTests_SInEnum_IntAsString()
        {
            PatientStatus patStat       = PatientStatus.Inactive;
            string        patStatIntStr = ((int)patStat).ToString();

            Assert.AreEqual(patStat, SIn.Enum <PatientStatus>(patStatIntStr, isEnumAsString: false));
        }
예제 #3
0
        public void SInTests_SInEnum_AsString()
        {
            PatientStatus patStat    = PatientStatus.Inactive;
            string        patStatStr = patStat.ToString();

            Assert.AreEqual(patStat, SIn.Enum <PatientStatus>(patStatStr, isEnumAsString: true));
        }
예제 #4
0
        public void SInTests_SInEnum_FlagsDefault()
        {
            CrudSpecialColType specialType = CrudSpecialColType.None;
            int specialTypeInt             = (int)specialType;

            Assert.AreEqual(specialType, SIn.Enum(specialTypeInt, defaultEnumOption: CrudSpecialColType.TextIsClob));
        }
예제 #5
0
        public void SInTests_SInEnum_Flags()
        {
            CrudSpecialColType specialType = CrudSpecialColType.CleanText | CrudSpecialColType.EnumAsString;
            int specialTypeInt             = (int)specialType;

            Assert.AreEqual(specialType, SIn.Enum <CrudSpecialColType>(specialTypeInt));
        }
        private void GetDataTablePatForConn(ODThread odThread)
        {
            CentralConnection connection = (CentralConnection)odThread.Parameters[0];
            //Filter the threads by their connection name
            string connName = "";

            if (connection.DatabaseName == "")           //uri
            {
                connName = connection.ServiceURI;
            }
            else
            {
                connName = connection.ServerName + ", " + connection.DatabaseName;
            }
            if (!CentralConnectionHelper.SetCentralConnection(connection, false))
            {
                lock (_lockObj) {
                    _invalidConnsLog += "\r\n" + connName;
                    _complConnCount++;
                }
                connection.ConnectionStatus = "OFFLINE";
                BeginInvoke((Action)FillGridPats);
                return;
            }
            List <DisplayField> fields = DisplayFields.GetForCategory(DisplayFieldCategory.CEMTSearchPatients);
            bool      hasNextLastVisit = fields.Any(x => x.InternalName.In("NextVisit", "LastVisit"));
            DataTable table            = new DataTable();

            try {
                PtTableSearchParams ptTableSearchParams = new PtTableSearchParams(checkLimit.Checked, textLName.Text, textFName.Text, textPhone.Text,
                                                                                  textAddress.Text, checkHideInactive.Checked, textCity.Text, textState.Text, textSSN.Text, textPatNum.Text, textChartNumber.Text, 0,
                                                                                  checkGuarantors.Checked, !checkHideArchived.Checked,//checkHideArchived is opposite label for what this function expects, but hideArchived makes more sense
                                                                                  SIn.DateT(textBirthdate.Text), 0, textSubscriberID.Text, textEmail.Text, textCountry.Text, "", "", "", "", hasNextLastVisit: hasNextLastVisit);
                table = Patients.GetPtDataTable(ptTableSearchParams);
            }
            catch (ThreadAbortException tae) {
                throw tae;                //ODThread needs to clean up after an abort exception is thrown.
            }
            catch (Exception) {
                //This can happen if the connection to the server was severed somehow during the execution of the query.
                lock (_lockObj) {
                    _invalidConnsLog += "\r\n" + connName + "  -GetPtDataTable";
                    _complConnCount++;
                }
                BeginInvoke((Action)FillGridPats);                //Pops up a message box if this was the last thread to finish.
                return;
            }
            table.TableName = connName;
            odThread.Tag    = table;
            lock (_lockObj) {
                _complConnCount++;
                _dataSetPats.Tables.Add((DataTable)odThread.Tag);
            }
            BeginInvoke((Action)FillGridPats);
        }
예제 #7
0
        public void SInTests_SInEnum_IntNoMatch()
        {
            int patStatInt = (int)PatientStatus.Inactive + (int)PatientStatus.Prospective;

            Assert.AreEqual(PatientStatus.Patient, SIn.Enum(patStatInt, defaultEnumOption: PatientStatus.Patient));
        }
예제 #8
0
        public void SInTests_SInEnum_FlagsNoMatch()
        {
            int specialTypeInt = int.MaxValue;

            Assert.AreEqual(CrudSpecialColType.None, SIn.Enum(specialTypeInt, defaultEnumOption: CrudSpecialColType.None));
        }