protected bool LoadPatEthnicityRaceSource() { CPatEthnicityRace per = new CPatEthnicityRace(); DataSet dsEthnicity = per.GetPatientEthnicityDS( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } if (dsEthnicity.Tables[0].Rows.Count > 0) { rblEthnicity.SelectedValue = dsEthnicity.Tables[0].Rows[0]["ETHNICITY_ID"].ToString(); } DataSet dsRace = per.GetPatientRaceDS( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } cblRace.ClearSelection(); foreach (DataRow dr in dsRace.Tables[0].Rows) { foreach (ListItem li in cblRace.Items) { if (dr["RACE_ID"].ToString() == li.Value) { li.Selected = true; } } } DataSet dsSource = per.GetPatEthRaceSourceDS( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } if (dsSource.Tables[0].Rows.Count > 0) { rblSource.SelectedValue = dsSource.Tables[0].Rows[0]["ETH_RACE_SOURCE_ID"].ToString(); } return(true); }
protected void LoadEthnicityRaceLists() { CPatEthnicityRace per = new CPatEthnicityRace(); rblEthnicity.DataTextField = "ETHNICITY_NAME"; rblEthnicity.DataValueField = "ETHNICITY_ID"; rblEthnicity.DataSource = per.GetEthnicityDS(Master); rblEthnicity.DataBind(); cblRace.DataTextField = "RACE_TITLE"; cblRace.DataValueField = "RACE_ID"; cblRace.DataSource = per.GetRaceDS(Master); cblRace.DataBind(); }
// save ethnicity and race for the current patient protected bool SaveEthnicityRaceSource() { CPatEthnicityRace per = new CPatEthnicityRace(); per.DeletePatientEthnicity( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } if (rblEthnicity.SelectedIndex >= 0) { per.InsertPatientEthnicity( Master, Master.SelectedPatientID, Convert.ToInt64(rblEthnicity.SelectedValue)); if (Master.StatusCode != 0) { return(false); } } per.DeletePatientRace( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } foreach (ListItem li in cblRace.Items) { if (li.Selected) { per.InsertPatientRace( Master, Master.SelectedPatientID, Convert.ToInt64(li.Value)); if (Master.StatusCode != 0) { return(false); } } } per.DeletePatEthRaceSource( Master, Master.SelectedPatientID); if (Master.StatusCode != 0) { return(false); } if (rblSource.SelectedIndex >= 0) { per.InsertPatEthRaceSource( Master, Master.SelectedPatientID, Convert.ToInt64(rblSource.SelectedValue)); if (Master.StatusCode != 0) { return(false); } } return(true); }