// INSERT ASSESSMENT INTO DB private void insertVisitAssessment(PatientVisit pv) { MySqlConnectionStringBuilder builder = DBConnection.Connect(); MySqlConnection conn = new MySqlConnection(builder.ToString()); String qry = ""; if (thisAssessment is BurnsVisit) { BurnsVisit v = thisAssessment as BurnsVisit; qry = $"INSERT INTO burns_visit VALUES('{v.VisitID}','{v.Purpose}','{v.Description}','{v.Manner}'," + $"'{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," + $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," + $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," + $"'{v.Site}','{v.Size}','{v.Depth}','{v.Exudate}','{v.Circumferential}','{v.PeripheralCirculation}'," + $"'{pv.id}')"; } else if (thisAssessment is ChronicUlcerVisit) { ChronicUlcerVisit v = thisAssessment as ChronicUlcerVisit; qry = $"INSERT INTO chronic_ulcer_visit VALUES('{v.VisitID}','{v.Purpose}','{v.DurationOfUlcer}','{v.Treatment}'," + $"'{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," + $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," + $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," + $"'{v.Site}','{v.Size}','{v.Depth}','{v.ExtentOfUndermining}','{v.WoundSurface}','{v.Exudate}','{v.PeriwoundTissue}'," + $"'{pv.id}')"; } else if (thisAssessment is DiabeticFootVisit) { DiabeticFootVisit v = thisAssessment as DiabeticFootVisit; qry = $"INSERT INTO diabetic_foot_visit VALUES('{v.VisitID}','{v.Purpose}','{v.DurationOfUlcer}','{v.Treatment}'," + $"'{v.Claudication}','{v.PainAtRest}','{v.Hypesthesia}','{v.Hyperesthesia}','{v.Paraesthesia}','{v.Dysesthesia}'," + $"'{v.RadicularPain}','{v.Anhydrosis}','{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," + $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," + $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," + $"'{v.Site}','{v.Size}','{v.Depth}','{v.ExtentOfUndermining}','{v.WoundSurface}','{v.Exudate}','{v.PeriwoundTissue}'," + $"'{v.Callus}','{v.BrittleNail}','{v.HammerToe}','{v.Fissures}','{v.HairGrowth}'," + $"'{v.CyanosisOfToes}','{v.PallorOfFoot}','{pv.id}')";; } MySqlCommand cmd = new MySqlCommand(qry, conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); }
private DiabeticFootVisit createDiabeticFootVisit(VisitAssessment commonVisit) { string id = IDManager.getNextDiabeticFootID(); string durationUlcer = TxtDurationUlcer.Text; string treatment = convertToggleValue(ToggleTreatment.IsOn) + ". " + TxtCommentTreatment.Text; string claudication = convertToggleValue(ToggleClaudication.IsOn) + ". " + TxtCommentClaudication.Text; string painAtRest = convertToggleValue(TogglePainAtRest.IsOn) + ". " + TxtCommentPainAtRest.Text; string hypesthesia = convertToggleValue(ToggleHypesthesia.IsOn) + ". " + TxtCommentHypesthesia.Text; string hyperesthesia = convertToggleValue(ToggleHyperesthesia.IsOn) + ". " + TxtCommentHyperesthesia.Text; string paraesthesia = convertToggleValue(ToggleParaesthesia.IsOn) + ". " + TxtCommentParaesthesia.Text; string dysesthesia = convertToggleValue(ToggleDysesthesia.IsOn) + ". " + TxtCommentDysesthesia.Text; string radPain = convertToggleValue(ToggleRadPain.IsOn) + ". " + TxtCommentRadPain.Text; string anhydrosis = convertToggleValue(ToggleAnhydrosis.IsOn) + ". " + TxtCommentAnhydrosis.Text; string undermining = TxtUndermining.Text; string surface = TxtWoundSurface.Text; string periwound = TxtPeriwound.Text; string callus = TxtCallus.Text; string brittleNail = TxtBrittleNail.Text; string hammertoe = TxtHammerToe.Text; string fissures = TxtFissures.Text; string lossHairGrowth = TxtLossHairGrowth.Text; string cyanosis = TxtCyanosis.Text; string pallorfoot = TxtPallorFoot.Text; DiabeticFootVisit visit = new DiabeticFootVisit(durationUlcer, treatment, claudication, painAtRest, hyperesthesia, hyperesthesia, paraesthesia, dysesthesia, radPain, anhydrosis, undermining, surface, periwound, callus, brittleNail, hammertoe, fissures, lossHairGrowth, cyanosis, pallorfoot, id, commonVisit.PatientVisitID, commonVisit.Purpose, commonVisit.DiabetesMellitus, commonVisit.Hypertension, commonVisit.IHD, commonVisit.Asthma, commonVisit.Thyroid, commonVisit.CVA, commonVisit.DVT, commonVisit.Allergy, commonVisit.Smoking, commonVisit.Pallor, commonVisit.Jaundice, commonVisit.Clubbing, commonVisit.Pulses, commonVisit.Cardiovascular, commonVisit.Respiratory, commonVisit.Abdominal, commonVisit.Neurological, commonVisit.BP, commonVisit.Pulse, commonVisit.Temperature, commonVisit.RBS, commonVisit.Site, commonVisit.Size, commonVisit.Depth, commonVisit.Exudate); return(visit); }