///<summary>Updates Status of the provided CentralConnection</summary>
        public static void UpdateStatus(CentralConnection centralConnection)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), centralConnection);
                return;
            }
            string command = "UPDATE centralconnection SET ConnectionStatus='" + POut.String(centralConnection.ConnectionStatus)
                             + "' WHERE CentralConnectionNum=" + POut.Long(centralConnection.CentralConnectionNum);

            Db.NonQ(command);
        }
Example #2
0
        ///<summary>Check to see if column can be deleted, returns true is the column contains only nulls.</summary>
        public static void DeleteColumn(string listName, string colName)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), listName, colName);
                return;
            }
            string command = "ALTER TABLE wikilist_" + POut.String(listName) + " DROP " + POut.String(colName);

            Db.NonQ(command);
            WikiListHeaderWidths.Delete(listName, colName);
        }
Example #3
0
        ///<summary></summary>
        public static void Delete(long fHIRSubscriptionNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), fHIRSubscriptionNum);
                return;
            }
            Crud.FHIRSubscriptionCrud.Delete(fHIRSubscriptionNum);
            string command = "DELETE FROM fhircontactpoint WHERE FHIRSubscriptionNum=" + POut.Long(fHIRSubscriptionNum);

            Db.NonQ(command);
        }
Example #4
0
        ///<summary></summary>
        public static void Delete(QuickPasteNote note)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), note);
                return;
            }
            string command = "DELETE from quickpastenote WHERE QuickPasteNoteNum = '"
                             + POut.Long(note.QuickPasteNoteNum) + "'";

            Db.NonQ(command);
        }
Example #5
0
        ///<summary></summary>
        public static void Delete(LetterMerge merge)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), merge);
                return;
            }
            string command = "DELETE FROM lettermerge "
                             + "WHERE LetterMergeNum = " + POut.Long(merge.LetterMergeNum);

            Db.NonQ(command);
        }
Example #6
0
        ///<summary>Sets teeth not missing, or sets to perm, or clears movement values.  Clears all the values of one type for all teeth in the mouth.</summary>
        public static void ClearAllValuesForType(long patNum, ToothInitialType initialType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patNum, initialType);
                return;
            }
            string command = "DELETE FROM toothinitial WHERE PatNum=" + POut.Long(patNum)
                             + " AND InitialType=" + POut.Long((int)initialType);

            Db.NonQ(command);
        }
Example #7
0
        ///<summary></summary>
        public static void Delete(PayPlanCharge charge)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), charge);
                return;
            }
            string command = "DELETE from payplancharge WHERE PayPlanChargeNum = '"
                             + POut.Long(charge.PayPlanChargeNum) + "'";

            Db.NonQ(command);
        }
Example #8
0
        ///<summary>Deletes all JobSprintLinks for the JobNum and JobSprintNum.</summary>
        public static void DeleteForJobAndSprint(long jobNum, long jobSprintNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), jobNum, jobSprintNum);
            }
            string command = $@"DELETE FROM jobsprintlink 
					WHERE JobNum = {POut.Long(jobNum)} 
					AND JobSprintNum = {POut.Long(jobSprintNum)}"                    ;

            Db.NonQ(command);
        }
Example #9
0
 ///<summary>Syncs the two lists in the database.</summary>
 public static void Sync(List <MobileAppDevice> listDevicesNew, List <MobileAppDevice> listDevicesDb)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), listDevicesNew, listDevicesDb);
         return;
     }
     if (Crud.MobileAppDeviceCrud.Sync(listDevicesNew, listDevicesDb))
     {
         Signalods.SetInvalid(InvalidType.EClipboard);
     }
 }
Example #10
0
        ///<summary>Deletes the patplan with the specified patPlanNum.  Rearranges the other patplans for the patient to keep the ordinal sequence contiguous.  Then, recomputes all estimates for this patient because their coverage is now different.  Also sets patient.HasIns to the correct value.</summary>
        public static void Delete(long patPlanNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patPlanNum);
                return;
            }
            string    command = "SELECT PatNum FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
            DataTable table   = Db.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return;
            }
            long           patNum      = PIn.Long(table.Rows[0][0].ToString());
            List <PatPlan> patPlans    = PatPlans.Refresh(patNum);
            bool           doDecrement = false;

            for (int i = 0; i < patPlans.Count; i++)
            {
                if (doDecrement)                 //patPlan has already been deleted, so decrement the rest.
                {
                    command = "UPDATE patplan SET Ordinal=" + POut.Long(patPlans[i].Ordinal - 1)
                              + " WHERE PatPlanNum=" + POut.Long(patPlans[i].PatPlanNum);
                    Db.NonQ(command);
                    continue;
                }
                if (patPlans[i].PatPlanNum == patPlanNum)
                {
                    command = "DELETE FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    command = "DELETE FROM benefit WHERE PatPlanNum=" + POut.Long(patPlanNum);
                    Db.NonQ(command);
                    doDecrement = true;
                    InsVerifies.DeleteByFKey(patPlanNum, VerifyTypes.PatientEnrollment);
                }
            }
            Family           fam                = Patients.GetFamily(patNum);
            Patient          pat                = fam.GetPatient(patNum);
            List <ClaimProc> claimProcs         = ClaimProcs.Refresh(patNum);
            List <ClaimProc> listClaimProcsEsts = claimProcs.Where(x => x.Status.In(ClaimProcStatus.Estimate, ClaimProcStatus.CapEstimate)).ToList();
            List <Procedure> procs              = Procedures.Refresh(patNum);

            patPlans = PatPlans.Refresh(patNum);
            List <InsSub>  subList  = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList = InsPlans.RefreshForSubList(subList);
            List <Benefit> benList  = Benefits.Refresh(patPlans, subList);

            Procedures.ComputeEstimatesForAll(patNum, listClaimProcsEsts, procs, planList, patPlans, benList, pat.Age, subList, claimProcs);
            Patients.SetHasIns(patNum);
//Cameron_ Possibly create outbound ADT message to update insurance info
        }
Example #11
0
        ///<summary></summary>
        public static void DeleteObject(long sheetDefNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), sheetDefNum);
                return;
            }
            //validate that not already in use by a refferral.
            string    command = "SELECT LName,FName FROM referral WHERE Slip=" + POut.Long(sheetDefNum);
            DataTable table   = Db.GetTable(command);
            //int count=PIn.PInt(Db.GetCount(command));
            string referralNames = "";

            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (i > 0)
                {
                    referralNames += ", ";
                }
                referralNames += table.Rows[i]["FName"].ToString() + " " + table.Rows[i]["LName"].ToString();
            }
            if (table.Rows.Count > 0)
            {
                throw new ApplicationException(Lans.g("sheetDefs", "SheetDef is already in use by referrals. Not allowed to delete.") + " " + referralNames);
            }
            //validate that not already in use by automation.
            command = "SELECT AutomationNum FROM automation WHERE SheetDefNum=" + POut.Long(sheetDefNum);
            table   = Db.GetTable(command);
            if (table.Rows.Count > 0)
            {
                throw new ApplicationException(Lans.g("sheetDefs", "SheetDef is in use by automation. Not allowed to delete."));
            }
            //validate that not already in use by a laboratory
            command = "SELECT Description FROM laboratory WHERE Slip=" + POut.Long(sheetDefNum);
            table   = Db.GetTable(command);
            if (table.Rows.Count > 0)
            {
                throw new ApplicationException(Lans.g("sheetDefs", "SheetDef is in use by laboratories. Not allowed to delete.")
                                               + "\r\n" + string.Join(", ", table.Select().Select(x => x["Description"].ToString())));
            }
            //validate that not already in use by clinicPref.
            command = "SELECT ClinicNum FROM clinicpref WHERE ValueString='" + POut.Long(sheetDefNum) + "' AND PrefName='" + POut.String(PrefName.SheetsDefaultRx.ToString()) + "'";
            table   = Db.GetTable(command);
            if (table.Rows.Count > 0)
            {
                throw new ApplicationException(Lans.g("sheetDefs", "SheetDef is in use by clinics. Not allowed to delete.")
                                               + "\r\n" + string.Join(", ", table.Select().Select(x => Clinics.GetDesc(PIn.Long(x["ClinicNum"].ToString())))));
            }
            command = "DELETE FROM sheetfielddef WHERE SheetDefNum=" + POut.Long(sheetDefNum);
            Db.NonQ(command);
            Crud.SheetDefCrud.Delete(sheetDefNum);
        }
Example #12
0
        ///<summary>Truncates the current rxnorm and refills based on the rxnorm.zip resource.  May take a few seconds.</summary>
        public static void CreateFreshRxNormTableFromZip()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            MemoryStream ms = new MemoryStream();

            using (ZipFile unzipped = ZipFile.Read(Properties.Resources.rxnorm)) {
                ZipEntry ze = unzipped["rxnorm.txt"];
                ze.Extract(ms);
            }
            StreamReader reader = new StreamReader(ms);

            ms.Position = 0;
            StringBuilder command = new StringBuilder();

            command.AppendLine("TRUNCATE TABLE rxnorm;");
            string line;

            if (DataConnection.DBtype == DatabaseType.MySql)
            {
                while ((line = reader.ReadLine()) != null)
                {
                    string[] lineSplit = line.Split('\t');
                    command.AppendLine("INSERT INTO rxnorm(RxCui,MmslCode,Description) VALUES('" + lineSplit[0] + "','" + lineSplit[1] + "','" + lineSplit[2] + "');");
                }
            }
            else              //oracle
            {
                long count = 0;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] lineSplit = line.Split('\t');
                    if (count < 1)                   //Hardcode first insert for oracle.
                    {
                        command.AppendLine("INSERT INTO rxnorm(RxNormNum,RxCui,MmslCode,Description) "
                                           + "VALUES(1,'" + lineSplit[0] + "','" + lineSplit[1] + "','" + lineSplit[2] + "');");
                    }
                    else
                    {
                        command.AppendLine("INSERT INTO rxnorm(RxNormNum,RxCui,MmslCode,Description) "
                                           + "VALUES((SELECT MAX(RxNormNum)+1 FROM rxnorm),'" + lineSplit[0] + "','" + lineSplit[1] + "','" + lineSplit[2] + "');");
                    }
                    count++;
                }
            }
            Db.NonQ(command.ToString());
            ms.Close();
            reader.Close();
        }
        ///<summary>Also alters the db table for the list itself.  Throws exception if number of columns does not match.</summary>
        public static void UpdateNamesAndWidths(string listName, List <WikiListHeaderWidth> columnDefs)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), columnDefs);
                return;
            }
            string    command = "DESCRIBE wikilist_" + POut.String(listName);
            DataTable tableListDescription = Db.GetTable(command);

            if (tableListDescription.Rows.Count != columnDefs.Count)
            {
                throw new ApplicationException("List schema has been altered. Unable to save changes to list.");
            }
            //rename Columns with dummy names in case user is renaming a new column with an old name.---------------------------------------------
            for (int i = 0; i < tableListDescription.Rows.Count; i++)
            {
                if (tableListDescription.Rows[i][0].ToString().ToLower() == POut.String(listName) + "num")
                {
                    //skip primary key
                    continue;
                }
                command = "ALTER TABLE wikilist_" + POut.String(listName) + " CHANGE " + POut.String(tableListDescription.Rows[i][0].ToString()) + " " + POut.String(dummyColName + i) + " TEXT NOT NULL";
                Db.NonQ(command);
                command =
                    "UPDATE wikiListHeaderWidth SET ColName='" + POut.String(dummyColName + i) + "' "
                    + "WHERE ListName='" + POut.String(listName) + "' "
                    + "AND ColName='" + POut.String(tableListDescription.Rows[i][0].ToString()) + "'";
                Db.NonQ(command);
            }
            //rename columns names and widths-------------------------------------------------------------------------------------------------------
            for (int i = 0; i < tableListDescription.Rows.Count; i++)
            {
                if (tableListDescription.Rows[i][0].ToString().ToLower() == listName + "num")
                {
                    //skip primary key
                    continue;
                }
                command = "ALTER TABLE wikilist_" + POut.String(listName) + " CHANGE  " + POut.String(dummyColName + i) + " " + POut.String(columnDefs[i].ColName) + " TEXT NOT NULL";
                Db.NonQ(command);
                command = "UPDATE wikiListHeaderWidth "
                          + "SET ColName='" + POut.String(columnDefs[i].ColName) + "', ColWidth='" + POut.Int(columnDefs[i].ColWidth) + "' "
                          + "WHERE ListName='" + POut.String(listName) + "' "
                          + "AND ColName='" + POut.String(dummyColName + i) + "'";
                Db.NonQ(command);
            }
            //handle width of PK seperately because we do not rename the PK column, ever.
            command = "UPDATE wikiListHeaderWidth SET ColWidth='" + POut.Int(columnDefs[0].ColWidth) + "' "
                      + "WHERE ListName='" + POut.String(listName) + "' AND ColName='" + POut.String(columnDefs[0].ColName) + "'";
            Db.NonQ(command);
            RefreshCache();
        }
Example #14
0
        /// <summary>Deletes the current recalltype and recalltrigger tables and fills them with our default.  Typically ran to switch T codes to D codes.</summary>
        public static void SetToDefault()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            string command = "DELETE FROM recalltype";

            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,TimePattern,Procedures) VALUES (1,'Prophy',393217,'/XXXX/','D0120,D1110')";
            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,TimePattern,Procedures) VALUES (2,'Child Prophy',0,'XXX','D0120,D1120,D1203')";
            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,TimePattern,Procedures) VALUES (3,'Perio',262144,'/XXXX/','D4910')";
            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,Procedures) VALUES (4,'4BW',16777216,'D0274')";
            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,Procedures) VALUES (5,'Pano',83886080,'D0330')";
            Db.NonQ(command);
            command = "INSERT INTO recalltype (RecallTypeNum,Description,DefaultInterval,Procedures) VALUES (6,'FMX',83886080,'D0210')";
            Db.NonQ(command);
            command = "DELETE FROM recalltrigger";
            Db.NonQ(command);
            //command="INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (1,1,"+ProcedureCodes.GetCodeNum("D0415")+")";//collection of microorg for culture
            //Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (1,1," + ProcedureCodes.GetCodeNum("D0150") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (2,4," + ProcedureCodes.GetCodeNum("D0274") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (3,5," + ProcedureCodes.GetCodeNum("D0330") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (4,6," + ProcedureCodes.GetCodeNum("D0210") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (5,1," + ProcedureCodes.GetCodeNum("D1110") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (6,1," + ProcedureCodes.GetCodeNum("D1120") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (7,3," + ProcedureCodes.GetCodeNum("D4910") + ")";
            Db.NonQ(command);
            command = "INSERT INTO recalltrigger (RecallTriggerNum,RecallTypeNum,CodeNum) VALUES (8,3," + ProcedureCodes.GetCodeNum("D4341") + ")";
            Db.NonQ(command);
            //Update the special types in preference table.
            command = "UPDATE preference SET ValueString='1' WHERE PrefName='RecallTypeSpecialProphy'";
            Db.NonQ(command);
            command = "UPDATE preference SET ValueString='2' WHERE PrefName='RecallTypeSpecialChildProphy'";
            Db.NonQ(command);
            command = "UPDATE preference SET ValueString='3' WHERE PrefName='RecallTypeSpecialPerio'";
            Db.NonQ(command);
            command = "UPDATE preference SET ValueString='1,2,3' WHERE PrefName='RecallTypesShowingInList'";
            Db.NonQ(command);
        }
Example #15
0
        ///<summary></summary>
        public static void Delete(PerioExam Cur)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), Cur);
                return;
            }
            string command = "DELETE from perioexam WHERE PerioExamNum = '" + Cur.PerioExamNum.ToString() + "'";

            Db.NonQ(command);
            command = "DELETE from periomeasure WHERE PerioExamNum = '" + Cur.PerioExamNum.ToString() + "'";
            Db.NonQ(command);
        }
Example #16
0
 ///<summary></summary>
 public static void Update(JournalEntry je)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), je);
         return;
     }
     if (je.DebitAmt < 0 || je.CreditAmt < 0)
     {
         throw new ApplicationException(Lans.g("JournalEntries", "Error. Credit and debit must both be positive."));
     }
     Crud.JournalEntryCrud.Update(je);
 }
Example #17
0
        ///<summary>This will also delete all screen items, so may need to ask user first.</summary>
        public static void Delete(ScreenGroup Cur)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), Cur);
                return;
            }
            string command = "DELETE from screen WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'";

            Db.NonQ(command);
            command = "DELETE from screengroup WHERE ScreenGroupNum ='" + POut.Long(Cur.ScreenGroupNum) + "'";
            Db.NonQ(command);
        }
Example #18
0
        ///<summary></summary>
        public static void SetDeleted(DeletedObjectType objType, long objectNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), objType, objectNum);
                return;
            }
            DeletedObject delObj = new DeletedObject();

            delObj.ObjectNum  = objectNum;
            delObj.ObjectType = objType;
            Crud.DeletedObjectCrud.Insert(delObj);
        }
Example #19
0
        ///<summary>Also deletes all journal entries for the transaction.  Will later throw an error if journal entries attached to any reconciles.  Be sure to surround with try-catch.</summary>
        public static void Delete(Transaction trans)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), trans);
                return;
            }
            string command = "DELETE FROM journalentry WHERE TransactionNum=" + POut.Long(trans.TransactionNum);

            Db.NonQ(command);
            command = "DELETE FROM transaction WHERE TransactionNum = " + POut.Long(trans.TransactionNum);
            Db.NonQ(command);
        }
Example #20
0
        ///<summary>Must supply the old field name so that the patient lists can be updated.</summary>
        public static void Update(PatFieldDef patFieldDef, string oldFieldName)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patFieldDef, oldFieldName);
                return;
            }
            Crud.PatFieldDefCrud.Update(patFieldDef);
            string command = "UPDATE patfield SET FieldName='" + POut.String(patFieldDef.FieldName) + "' "
                             + "WHERE FieldName='" + POut.String(oldFieldName) + "'";

            Db.NonQ(command);
        }
Example #21
0
 ///<summary>Inserts, updates, or deletes db rows to match listNew.  No need to pass in userNum, it's set before remoting role check and passed to
 ///the server if necessary.</summary>
 public static void Sync(List <PaySplit> listNew, List <PaySplit> listOld, long userNum = 0)
 {
     if (RemotingClient.RemotingRole != RemotingRole.ServerWeb)
     {
         userNum = Security.CurUser.UserNum;
     }
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), listNew, listOld, userNum);
         return;
     }
     Crud.PaySplitCrud.Sync(listNew, listOld, userNum);
 }
Example #22
0
        public static void SetSqlMode()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            string command = "SET GLOBAL sql_mode=''";          //in case user did not use our my.ini file.

            //A slightly more elegant approach could require less user permissions.  It could first check SELECT @@GLOBAL.sql_mode,
            //and then only attempt to set if it was not blank already.
            Db.NonQ(command);
        }
Example #23
0
        ///<summary></summary>
        public static void Delete(long vaccinePatNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), vaccinePatNum);
                return;
            }
            string command = "DELETE FROM vaccinepat WHERE VaccinePatNum = " + POut.Long(vaccinePatNum);

            Db.NonQ(command);
            //Delete any attached observations.
            VaccineObses.DeleteForVaccinePat(vaccinePatNum);
        }
Example #24
0
        public static void RecallUndo(DateTime date)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), date);
                return;
            }
            string command = "DELETE FROM commlog "
                             + "WHERE " + DbHelper.DateColumn("CommDateTime") + " = " + POut.Date(date) + " "
                             + "AND (SELECT ItemValue FROM definition WHERE definition.DefNum=commlog.CommType) ='" + CommItemTypeAuto.RECALL.ToString() + "'";

            Db.NonQ(command);
        }
Example #25
0
        ///<summary>Deletes the patplan and benefits with the specified patPlanNum.  Does not rearrange the other patplans for the patient.  A patplan must be inserted after this function is called to take the place of the patplan being deleted.</summary>
        public static void DeleteNonContiguous(long patPlanNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), patPlanNum);
                return;
            }
            string command = "DELETE FROM patplan WHERE PatPlanNum=" + POut.Long(patPlanNum);

            Db.NonQ(command);
            command = "DELETE FROM benefit WHERE PatPlanNum=" + POut.Long(patPlanNum);
            Db.NonQ(command);
        }
Example #26
0
 public static void DetachDocFromStatements(long docNum)
 {
     if (docNum == 0)
     {
         return;                //Avoid MiddleTier.
     }
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), docNum);
         return;
     }
     Db.NonQ("UPDATE statement SET DocNum=0 WHERE DocNum=" + POut.Long(docNum));
 }
Example #27
0
        ///<summary>Deletes all fields for the appointment and field name passed in.</summary>
        public static void DeleteFieldForAppt(string fieldName, long aptNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), fieldName, aptNum);
                return;
            }
            string command = $@"DELETE FROM apptfield 
				WHERE AptNum = {POut.Long(aptNum)}
				AND FieldName ='{POut.String(fieldName)}'"                ;

            Db.NonQ(command);
        }
Example #28
0
 /// <summary>Bulk Insert</summary>
 public static void InsertMany(List <Fee> listFees)
 {
     if (RemotingClient.RemotingRole != RemotingRole.ServerWeb)
     {
         listFees.ForEach(x => x.SecUserNumEntry = Security.CurUser.UserNum);              //must be before normal remoting role check to get user at workstation
     }
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), listFees);
         return;
     }
     Crud.FeeCrud.InsertMany(listFees);
 }
Example #29
0
        ///<summary>Delete all MedLabFacAttach objects for the list of MedLabNums and/or list of MedLabResultNums.  Supply either list or both lists and
        ///the MedLabFacAttach entries for either list will be deleted.  This could leave MedLabFacility entries not attached
        ///to any lab or result, but we won't worry about cleaning those up since the MedLabFacility table will likely always remain very small.</summary>
        public static void DeleteAllForLabsOrResults(List <long> listLabNums, List <long> listResultNums)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), listLabNums, listResultNums);
                return;
            }
            string command = "DELETE FROM medlabfacattach "
                             + "WHERE MedLabNum IN(" + String.Join(",", listLabNums) + ") "
                             + "OR MedLabResultNum IN(" + String.Join(",", listResultNums) + ")";

            Db.NonQ(command);
        }
Example #30
0
 ///<summary></summary>
 public static void InsertMany(List <PayPlanCharge> listPayPlanCharges)
 {
     if (listPayPlanCharges.IsNullOrEmpty())
     {
         return;
     }
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), listPayPlanCharges);
         return;
     }
     Crud.PayPlanChargeCrud.InsertMany(listPayPlanCharges);
 }