Exemplo n.º 1
0
 ///<summary>Inserts one RxAlert into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(RxAlert rxAlert,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         rxAlert.RxAlertNum=ReplicationServers.GetKey("rxalert","RxAlertNum");
     }
     string command="INSERT INTO rxalert (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="RxAlertNum,";
     }
     command+="RxDefNum,DiseaseDefNum,AllergyDefNum,MedicationNum,NotificationMsg) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(rxAlert.RxAlertNum)+",";
     }
     command+=
              POut.Long  (rxAlert.RxDefNum)+","
         +    POut.Long  (rxAlert.DiseaseDefNum)+","
         +    POut.Long  (rxAlert.AllergyDefNum)+","
         +    POut.Long  (rxAlert.MedicationNum)+","
         +"'"+POut.String(rxAlert.NotificationMsg)+"')";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         rxAlert.RxAlertNum=Db.NonQ(command,true);
     }
     return rxAlert.RxAlertNum;
 }
Exemplo n.º 2
0
        ///<summary>Inserts one RxAlert into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(RxAlert rxAlert, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                rxAlert.RxAlertNum = ReplicationServers.GetKey("rxalert", "RxAlertNum");
            }
            string command = "INSERT INTO rxalert (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "RxAlertNum,";
            }
            command += "RxDefNum,DiseaseDefNum,AllergyDefNum,MedicationNum,NotificationMsg) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(rxAlert.RxAlertNum) + ",";
            }
            command +=
                POut.Long(rxAlert.RxDefNum) + ","
                + POut.Long(rxAlert.DiseaseDefNum) + ","
                + POut.Long(rxAlert.AllergyDefNum) + ","
                + POut.Long(rxAlert.MedicationNum) + ","
                + "'" + POut.String(rxAlert.NotificationMsg) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                rxAlert.RxAlertNum = Db.NonQ(command, true);
            }
            return(rxAlert.RxAlertNum);
        }
Exemplo n.º 3
0
 public FormRxAlertEdit(RxAlert rxAlertCur, RxDef rxDefCur)
 {
     InitializeComponent();
     Lan.F(this);
     RxAlertCur = rxAlertCur;
     RxDefCur   = rxDefCur;
 }
Exemplo n.º 4
0
 ///<summary>Inserts one RxAlert into the database.  Returns the new priKey.</summary>
 internal static long Insert(RxAlert rxAlert)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         rxAlert.RxAlertNum = DbHelper.GetNextOracleKey("rxalert", "RxAlertNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(rxAlert, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     rxAlert.RxAlertNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(rxAlert, false));
     }
 }
Exemplo n.º 5
0
 ///<summary>Returns true if Update(RxAlert,RxAlert) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(RxAlert rxAlert, RxAlert oldRxAlert)
 {
     if (rxAlert.RxDefNum != oldRxAlert.RxDefNum)
     {
         return(true);
     }
     if (rxAlert.DiseaseDefNum != oldRxAlert.DiseaseDefNum)
     {
         return(true);
     }
     if (rxAlert.AllergyDefNum != oldRxAlert.AllergyDefNum)
     {
         return(true);
     }
     if (rxAlert.MedicationNum != oldRxAlert.MedicationNum)
     {
         return(true);
     }
     if (rxAlert.NotificationMsg != oldRxAlert.NotificationMsg)
     {
         return(true);
     }
     if (rxAlert.IsHighSignificance != oldRxAlert.IsHighSignificance)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 6
0
        ///<summary>Inserts one RxAlert into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(RxAlert rxAlert, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO rxalert (";

            if (!useExistingPK && isRandomKeys)
            {
                rxAlert.RxAlertNum = ReplicationServers.GetKeyNoCache("rxalert", "RxAlertNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "RxAlertNum,";
            }
            command += "RxDefNum,DiseaseDefNum,AllergyDefNum,MedicationNum,NotificationMsg,IsHighSignificance) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(rxAlert.RxAlertNum) + ",";
            }
            command +=
                POut.Long(rxAlert.RxDefNum) + ","
                + POut.Long(rxAlert.DiseaseDefNum) + ","
                + POut.Long(rxAlert.AllergyDefNum) + ","
                + POut.Long(rxAlert.MedicationNum) + ","
                + "'" + POut.String(rxAlert.NotificationMsg) + "',"
                + POut.Bool(rxAlert.IsHighSignificance) + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                rxAlert.RxAlertNum = Db.NonQ(command, true, "RxAlertNum", "rxAlert");
            }
            return(rxAlert.RxAlertNum);
        }
Exemplo n.º 7
0
 ///<summary>Inserts one RxAlert into the database.  Returns the new priKey.</summary>
 internal static long Insert(RxAlert rxAlert)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         rxAlert.RxAlertNum=DbHelper.GetNextOracleKey("rxalert","RxAlertNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(rxAlert,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     rxAlert.RxAlertNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(rxAlert,false);
     }
 }
Exemplo n.º 8
0
        ///<summary>Updates one RxAlert in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.</summary>
        public static void Update(RxAlert rxAlert, RxAlert oldRxAlert)
        {
            string command = "";

            if (rxAlert.RxDefNum != oldRxAlert.RxDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RxDefNum = " + POut.Long(rxAlert.RxDefNum) + "";
            }
            if (rxAlert.DiseaseDefNum != oldRxAlert.DiseaseDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DiseaseDefNum = " + POut.Long(rxAlert.DiseaseDefNum) + "";
            }
            if (rxAlert.AllergyDefNum != oldRxAlert.AllergyDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AllergyDefNum = " + POut.Long(rxAlert.AllergyDefNum) + "";
            }
            if (rxAlert.MedicationNum != oldRxAlert.MedicationNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MedicationNum = " + POut.Long(rxAlert.MedicationNum) + "";
            }
            if (rxAlert.NotificationMsg != oldRxAlert.NotificationMsg)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "NotificationMsg = '" + POut.String(rxAlert.NotificationMsg) + "'";
            }
            if (rxAlert.IsHighSignificance != oldRxAlert.IsHighSignificance)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsHighSignificance = " + POut.Bool(rxAlert.IsHighSignificance) + "";
            }
            if (command == "")
            {
                return;
            }
            command = "UPDATE rxalert SET " + command
                      + " WHERE RxAlertNum = " + POut.Long(rxAlert.RxAlertNum);
            Db.NonQ(command);
        }
Exemplo n.º 9
0
        ///<summary></summary>
        public static void Insert(RxAlert alert)
        {
            string command = "INSERT INTO rxalert (RxDefNum,DiseaseDefNum) VALUES("
                             + "'" + POut.PInt(alert.RxDefNum) + "', "
                             + "'" + POut.PInt(alert.DiseaseDefNum) + "')";

            alert.RxAlertNum = General.NonQ(command, true);
        }
Exemplo n.º 10
0
        ///<summary></summary>
        public static void Update(RxAlert alert)
        {
            string command = "UPDATE rxalert SET "
                             + "RxDefNum = '" + POut.PInt(alert.RxDefNum) + "'"
                             + ",DiseaseDefNum = '" + POut.PInt(alert.DiseaseDefNum) + "'"
                             + " WHERE RxAlertNum  ='" + POut.PInt(alert.RxAlertNum) + "'";

            General.NonQ(command);
        }
Exemplo n.º 11
0
 public FormRxAlertEdit(RxAlert rxAlertCur, RxDef rxDefCur)
 {
     InitializeComponent();
     Lan.F(this);
     RxAlertCur = rxAlertCur;
     RxDefCur   = rxDefCur;
     if (!PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textRxNorm.Visible  = false;
         labelRxNorm.Visible = false;
     }
 }
Exemplo n.º 12
0
        ///<summary>Updates one RxAlert in the database.</summary>
        internal static void Update(RxAlert rxAlert)
        {
            string command = "UPDATE rxalert SET "
                             + "RxDefNum       =  " + POut.Long(rxAlert.RxDefNum) + ", "
                             + "DiseaseDefNum  =  " + POut.Long(rxAlert.DiseaseDefNum) + ", "
                             + "AllergyDefNum  =  " + POut.Long(rxAlert.AllergyDefNum) + ", "
                             + "MedicationNum  =  " + POut.Long(rxAlert.MedicationNum) + ", "
                             + "NotificationMsg= '" + POut.String(rxAlert.NotificationMsg) + "' "
                             + "WHERE RxAlertNum = " + POut.Long(rxAlert.RxAlertNum);

            Db.NonQ(command);
        }
Exemplo n.º 13
0
        ///<summary>Updates one RxAlert in the database.</summary>
        public static void Update(RxAlert rxAlert)
        {
            string command = "UPDATE rxalert SET "
                             + "RxDefNum          =  " + POut.Long(rxAlert.RxDefNum) + ", "
                             + "DiseaseDefNum     =  " + POut.Long(rxAlert.DiseaseDefNum) + ", "
                             + "AllergyDefNum     =  " + POut.Long(rxAlert.AllergyDefNum) + ", "
                             + "MedicationNum     =  " + POut.Long(rxAlert.MedicationNum) + ", "
                             + "NotificationMsg   = '" + POut.String(rxAlert.NotificationMsg) + "', "
                             + "IsHighSignificance=  " + POut.Bool(rxAlert.IsHighSignificance) + " "
                             + "WHERE RxAlertNum = " + POut.Long(rxAlert.RxAlertNum);

            Db.NonQ(command);
        }
Exemplo n.º 14
0
        ///<summary>Gets a list of all RxAlerts for one RxDef.</summary>
        public static RxAlert[] Refresh(int rxDefNum)
        {
            string    command = "SELECT * FROM rxalert WHERE RxDefNum=" + POut.PInt(rxDefNum);
            DataTable table   = General.GetTable(command);

            RxAlert[] List = new RxAlert[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i]               = new RxAlert();
                List[i].RxAlertNum    = PIn.PInt(table.Rows[i][0].ToString());
                List[i].RxDefNum      = PIn.PInt(table.Rows[i][1].ToString());
                List[i].DiseaseDefNum = PIn.PInt(table.Rows[i][2].ToString());
            }
            return(List);
        }
Exemplo n.º 15
0
 ///<summary>Inserts one RxAlert into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(RxAlert rxAlert)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(rxAlert, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             rxAlert.RxAlertNum = DbHelper.GetNextOracleKey("rxalert", "RxAlertNum");                  //Cacheless method
         }
         return(InsertNoCache(rxAlert, true));
     }
 }
Exemplo n.º 16
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<RxAlert> TableToList(DataTable table){
			List<RxAlert> retVal=new List<RxAlert>();
			RxAlert rxAlert;
			for(int i=0;i<table.Rows.Count;i++) {
				rxAlert=new RxAlert();
				rxAlert.RxAlertNum        = PIn.Long  (table.Rows[i]["RxAlertNum"].ToString());
				rxAlert.RxDefNum          = PIn.Long  (table.Rows[i]["RxDefNum"].ToString());
				rxAlert.DiseaseDefNum     = PIn.Long  (table.Rows[i]["DiseaseDefNum"].ToString());
				rxAlert.AllergyDefNum     = PIn.Long  (table.Rows[i]["AllergyDefNum"].ToString());
				rxAlert.MedicationNum     = PIn.Long  (table.Rows[i]["MedicationNum"].ToString());
				rxAlert.NotificationMsg   = PIn.String(table.Rows[i]["NotificationMsg"].ToString());
				rxAlert.IsHighSignificance= PIn.Bool  (table.Rows[i]["IsHighSignificance"].ToString());
				retVal.Add(rxAlert);
			}
			return retVal;
		}
Exemplo n.º 17
0
        private void butAddAllergy_Click(object sender, EventArgs e)
        {
            FormAllergySetup FormAS = new FormAllergySetup();

            FormAS.IsSelectionMode = true;
            FormAS.ShowDialog();
            if (FormAS.DialogResult != DialogResult.OK)
            {
                return;
            }
            RxAlert alert = new RxAlert();

            alert.AllergyDefNum = FormAS.SelectedAllergyDefNum;
            alert.RxDefNum      = RxDefCur.RxDefNum;
            RxAlerts.Insert(alert);
            FillAlerts();
        }
Exemplo n.º 18
0
        private void butAddProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

            FormD.IsSelectionMode = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            RxAlert alert = new RxAlert();

            alert.DiseaseDefNum = FormD.SelectedDiseaseDefNum;
            alert.RxDefNum      = RxDefCur.RxDefNum;
            RxAlerts.Insert(alert);
            FillAlerts();
        }
Exemplo n.º 19
0
        private void butAddMedication_Click(object sender, EventArgs e)
        {
            FormMedications FormMED = new FormMedications();

            FormMED.IsSelectionMode = true;
            FormMED.ShowDialog();
            if (FormMED.DialogResult != DialogResult.OK)
            {
                return;
            }
            RxAlert alert = new RxAlert();

            alert.MedicationNum = FormMED.SelectedMedicationNum;
            alert.RxDefNum      = RxDefCur.RxDefNum;
            RxAlerts.Insert(alert);
            FillAlerts();
        }
Exemplo n.º 20
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        internal static List <RxAlert> TableToList(DataTable table)
        {
            List <RxAlert> retVal = new List <RxAlert>();
            RxAlert        rxAlert;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                rxAlert                 = new RxAlert();
                rxAlert.RxAlertNum      = PIn.Long(table.Rows[i]["RxAlertNum"].ToString());
                rxAlert.RxDefNum        = PIn.Long(table.Rows[i]["RxDefNum"].ToString());
                rxAlert.DiseaseDefNum   = PIn.Long(table.Rows[i]["DiseaseDefNum"].ToString());
                rxAlert.AllergyDefNum   = PIn.Long(table.Rows[i]["AllergyDefNum"].ToString());
                rxAlert.MedicationNum   = PIn.Long(table.Rows[i]["MedicationNum"].ToString());
                rxAlert.NotificationMsg = PIn.String(table.Rows[i]["NotificationMsg"].ToString());
                retVal.Add(rxAlert);
            }
            return(retVal);
        }
Exemplo n.º 21
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <RxAlert> TableToList(DataTable table)
        {
            List <RxAlert> retVal = new List <RxAlert>();
            RxAlert        rxAlert;

            foreach (DataRow row in table.Rows)
            {
                rxAlert                    = new RxAlert();
                rxAlert.RxAlertNum         = PIn.Long(row["RxAlertNum"].ToString());
                rxAlert.RxDefNum           = PIn.Long(row["RxDefNum"].ToString());
                rxAlert.DiseaseDefNum      = PIn.Long(row["DiseaseDefNum"].ToString());
                rxAlert.AllergyDefNum      = PIn.Long(row["AllergyDefNum"].ToString());
                rxAlert.MedicationNum      = PIn.Long(row["MedicationNum"].ToString());
                rxAlert.NotificationMsg    = PIn.String(row["NotificationMsg"].ToString());
                rxAlert.IsHighSignificance = PIn.Bool(row["IsHighSignificance"].ToString());
                retVal.Add(rxAlert);
            }
            return(retVal);
        }
Exemplo n.º 22
0
        private void butAddProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

            FormD.IsSelectionMode = true;
            FormD.IsMultiSelect   = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            for (int i = 0; i < FormD.ListSelectedDiseaseDefs.Count; i++)
            {
                RxAlert alert = new RxAlert();
                alert.DiseaseDefNum = FormD.ListSelectedDiseaseDefs[i].DiseaseDefNum;
                alert.RxDefNum      = RxDefCur.RxDefNum;
                RxAlerts.Insert(alert);
            }
            FillAlerts();
        }
Exemplo n.º 23
0
        ///<summary></summary>
        public static void Delete(RxAlert alert)
        {
            string command = "DELETE FROM rxalert WHERE RxAlertNum =" + POut.PInt(alert.RxAlertNum);

            General.NonQ(command);
        }
Exemplo n.º 24
0
 ///<summary>Inserts one RxAlert into the database.  Returns the new priKey.</summary>
 public static long Insert(RxAlert rxAlert)
 {
     return(Insert(rxAlert, false));
 }
Exemplo n.º 25
0
 ///<summary>Inserts one RxAlert into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(RxAlert rxAlert)
 {
     return(InsertNoCache(rxAlert, false));
 }
Exemplo n.º 26
0
		///<summary>Updates one RxAlert in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(RxAlert rxAlert,RxAlert oldRxAlert){
			string command="";
			if(rxAlert.RxDefNum != oldRxAlert.RxDefNum) {
				if(command!=""){ command+=",";}
				command+="RxDefNum = "+POut.Long(rxAlert.RxDefNum)+"";
			}
			if(rxAlert.DiseaseDefNum != oldRxAlert.DiseaseDefNum) {
				if(command!=""){ command+=",";}
				command+="DiseaseDefNum = "+POut.Long(rxAlert.DiseaseDefNum)+"";
			}
			if(rxAlert.AllergyDefNum != oldRxAlert.AllergyDefNum) {
				if(command!=""){ command+=",";}
				command+="AllergyDefNum = "+POut.Long(rxAlert.AllergyDefNum)+"";
			}
			if(rxAlert.MedicationNum != oldRxAlert.MedicationNum) {
				if(command!=""){ command+=",";}
				command+="MedicationNum = "+POut.Long(rxAlert.MedicationNum)+"";
			}
			if(rxAlert.NotificationMsg != oldRxAlert.NotificationMsg) {
				if(command!=""){ command+=",";}
				command+="NotificationMsg = '"+POut.String(rxAlert.NotificationMsg)+"'";
			}
			if(rxAlert.IsHighSignificance != oldRxAlert.IsHighSignificance) {
				if(command!=""){ command+=",";}
				command+="IsHighSignificance = "+POut.Bool(rxAlert.IsHighSignificance)+"";
			}
			if(command==""){
				return false;
			}
			command="UPDATE rxalert SET "+command
				+" WHERE RxAlertNum = "+POut.Long(rxAlert.RxAlertNum);
			Db.NonQ(command);
			return true;
		}
Exemplo n.º 27
0
		///<summary>Updates one RxAlert in the database.</summary>
		public static void Update(RxAlert rxAlert){
			string command="UPDATE rxalert SET "
				+"RxDefNum          =  "+POut.Long  (rxAlert.RxDefNum)+", "
				+"DiseaseDefNum     =  "+POut.Long  (rxAlert.DiseaseDefNum)+", "
				+"AllergyDefNum     =  "+POut.Long  (rxAlert.AllergyDefNum)+", "
				+"MedicationNum     =  "+POut.Long  (rxAlert.MedicationNum)+", "
				+"NotificationMsg   = '"+POut.String(rxAlert.NotificationMsg)+"', "
				+"IsHighSignificance=  "+POut.Bool  (rxAlert.IsHighSignificance)+" "
				+"WHERE RxAlertNum = "+POut.Long(rxAlert.RxAlertNum);
			Db.NonQ(command);
		}
Exemplo n.º 28
0
 ///<summary>Updates one RxAlert in the database.</summary>
 internal static void Update(RxAlert rxAlert)
 {
     string command="UPDATE rxalert SET "
         +"RxDefNum       =  "+POut.Long  (rxAlert.RxDefNum)+", "
         +"DiseaseDefNum  =  "+POut.Long  (rxAlert.DiseaseDefNum)+", "
         +"AllergyDefNum  =  "+POut.Long  (rxAlert.AllergyDefNum)+", "
         +"MedicationNum  =  "+POut.Long  (rxAlert.MedicationNum)+", "
         +"NotificationMsg= '"+POut.String(rxAlert.NotificationMsg)+"' "
         +"WHERE RxAlertNum = "+POut.Long(rxAlert.RxAlertNum);
     Db.NonQ(command);
 }
Exemplo n.º 29
0
 ///<summary>Updates one RxAlert in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.</summary>
 internal static void Update(RxAlert rxAlert,RxAlert oldRxAlert)
 {
     string command="";
     if(rxAlert.RxDefNum != oldRxAlert.RxDefNum) {
         if(command!=""){ command+=",";}
         command+="RxDefNum = "+POut.Long(rxAlert.RxDefNum)+"";
     }
     if(rxAlert.DiseaseDefNum != oldRxAlert.DiseaseDefNum) {
         if(command!=""){ command+=",";}
         command+="DiseaseDefNum = "+POut.Long(rxAlert.DiseaseDefNum)+"";
     }
     if(rxAlert.AllergyDefNum != oldRxAlert.AllergyDefNum) {
         if(command!=""){ command+=",";}
         command+="AllergyDefNum = "+POut.Long(rxAlert.AllergyDefNum)+"";
     }
     if(rxAlert.MedicationNum != oldRxAlert.MedicationNum) {
         if(command!=""){ command+=",";}
         command+="MedicationNum = "+POut.Long(rxAlert.MedicationNum)+"";
     }
     if(rxAlert.NotificationMsg != oldRxAlert.NotificationMsg) {
         if(command!=""){ command+=",";}
         command+="NotificationMsg = '"+POut.String(rxAlert.NotificationMsg)+"'";
     }
     if(command==""){
         return;
     }
     command="UPDATE rxalert SET "+command
         +" WHERE RxAlertNum = "+POut.Long(rxAlert.RxAlertNum);
     Db.NonQ(command);
 }