public void Cure(IPatient patient, Diagnosis diagnosis, Treatment appoitment) { if (patient.PatientBill.IsPayed) { // magic } }
public async Task <IActionResult> Edit(int id, [Bind("DiagnosisId,Name,DiagnosisCategoryId")] Diagnosis diagnosis) { if (id != diagnosis.DiagnosisId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(diagnosis); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DiagnosisExists(diagnosis.DiagnosisId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DiagnosisCategoryId"] = new SelectList(_context.DiagnosisCategory, "Id", "Name", diagnosis.DiagnosisCategoryId); return(View(diagnosis)); }
private void SetDiagnoses() { var d = new Diagnosis { Id = 1, Name = "Грипп", Description = "Острое инфекционное заболевание дыхательных путей, " + "вызываемое вирусом гриппа. Входит в группу острых респираторных" + " вирусных инфекций (ОРВИ). Периодически распространяется в виде эпидемий." }; Diagnoses.Add(d); d = new Diagnosis { Id = 2, Name = "Просту́да", Description = "Острая респираторная инфекция общей (невыясненной) этиологии" + " с воспалением верхних дыхательных путей, затрагивающая преимущественно нос." + " В воспаление могут быть также вовлечены горло, гортань и пазухи." + " Термин используется наряду с фарингитом, ларингитом, трахеитом и другими." }; Diagnoses.Add(d); d = new Diagnosis { Id = 3, Name = "Диаре́я", Description = "Патологическое состояние, при котором у больного наблюдается учащённая" + " (более 3 раз в сутки) дефекация, при этом стул становится водянистым," + " имеет объём более 200 мл и часто сопровождается болевыми ощущениями в области живота," + " экстренными позывами и анальным недержанием" }; Diagnoses.Add(d); }
public static List<TestDiagnosis> BuildDiagnosisFromDataBaseDate(string IdStep, string IdParentDiagnosis = "") { List<TestDiagnosis> tdList = new List<TestDiagnosis>(); if (IdStep != "") { using (SqlConnection connection = Global.GetSqlConnection()) { string findTD = ""; if (IdParentDiagnosis == "") findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis IS NULL"; else findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis = '" + IdParentDiagnosis + "'"; SqlCommand TDcommand = new SqlCommand(findTD, connection); using (SqlDataReader TDReader = TDcommand.ExecuteReader()) { while (TDReader.Read()) { Diagnosis d = new Diagnosis(); TestDiagnosis td = new TestDiagnosis(d); td.info = TestDiagnosisInfo.BuildDiagnosisFromDataBaseDate(TDReader["IdDiagnosis"].ToString()); if (TDReader["IdDiagnosedDoctor"].ToString() != "") td.doctor = TestDoctor.BuildTestDoctorFromDataBase(TDReader["IdDiagnosedDoctor"].ToString()); tdList.Add(td); } } } } if (tdList.Count != 0) return tdList; else return null; }
private void Open() { try { using (WaitCursor wc = new WaitCursor()) { int id = SelectedId; if (id != 0) { Diagnosis diagnosis = null; using (GmConnection conn = App.CreateConnection()) { diagnosis = Diagnosis.GetDiagnosis(conn, id); } if (diagnosis != null) { DiagnosisForm form = new DiagnosisForm(diagnosis); if (form.ShowDialog() == DialogResult.OK) { DataRow dr = SelectedRow; if (dr != null) { dr["Name"] = diagnosis.name; } } } } } } catch (Exception ex) { Log.Exception(ex); } }
public void addQuestion(Subject s, List <Topic> diagnoses, List <string> images, string qText) { Question q = new Question { QuestionId = _questionID, SubjectId = s.SubjectId, text = qText, level = Levels.DEFAULT_LVL, points = Questions.QUESTION_INITAL_POINTS, timeAdded = DateTime.Now, isDeleted = false }; _db.addQuestion(q); foreach (Topic t in diagnoses) { Diagnosis d = new Diagnosis { QuestionId = _questionID, TopicId = t.TopicId, SubjectId = s.SubjectId }; _db.addDiagnosis(d); } foreach (string path in images) { QuestionImage i = new QuestionImage { ImageId = path, QuestionId = _questionID, }; _db.addImage(i); } _questionID++; }
public async Task <IActionResult> Edit(uint id, [Bind("Id,Code,MedicalTerm")] Diagnosis diagnosis) { if (id != diagnosis.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(diagnosis); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DiagnosisExists(diagnosis.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(diagnosis)); }
public bool AddDiagnosis(Hospital hospital, Diagnosis diagnosis) { try { string query = "select * from diagnosis where name ='" + diagnosis.name + "'"; var dt = DataAccess.GetDataTable(query); if (dt == null || dt.Rows.Count == 0) { query = "insert into diagnosis(name, cost, hospitalId) values('" + diagnosis.name + "', '" + diagnosis.cost + "', '" + hospital.hospitalId + "') "; } else { query = "Update diagnosis set cost = '" + diagnosis.cost + "' where name = '" + diagnosis.name + "' "; } int count = DataAccess.ExecuteUpdateQuery(query); if (count >= 1) { return(true); } else { return(false); } } catch (Exception exception) { textE = exception.ToString(); return(false); } }
public async Task <IActionResult> Create(Int32?patientId, DiagnosisViewModel model) { if (patientId == null) { return(this.NotFound()); } var patient = await this._context.Patients .SingleOrDefaultAsync(x => x.Id == patientId); if (patient == null) { return(this.NotFound()); } if (this.ModelState.IsValid) { var diagnosis = new Diagnosis { PatientId = patient.Id, Type = model.Type, Complications = model.Complications, Details = model.Details }; this._context.Add(diagnosis); await this._context.SaveChangesAsync(); return(this.RedirectToAction("Index", new { patientId = patient.Id })); } this.ViewBag.Patient = patient; return(this.View(model)); }
public void Diagnosis_SDataCode_Should_Be_An_Enum_Test() { var diagnosis = new Diagnosis { SDataCode = DiagnosisCode.ApplicationDiagnosis, ApplicationCode = "Application error" }; string xml; using (var textWriter = new StringWriter()) using (var xmlWriter = new XmlTextWriter(textWriter)) { diagnosis.WriteTo(xmlWriter, null); xml = textWriter.ToString(); } XPathNavigator nav; using (var textReader = new StringReader(xml)) using (var xmlReader = new XmlTextReader(textReader)) { nav = new XPathDocument(xmlReader).CreateNavigator(); } var node = nav.SelectSingleNode("diagnosis/sdataCode"); Assert.IsNotNull(node); Assert.AreEqual("ApplicationDiagnosis", node.Value); node = nav.SelectSingleNode("diagnosis/applicationCode"); Assert.IsNotNull(node); Assert.AreEqual("Application error", node.Value); }
public void Write(Diagnosis diagnosis) { if (Severity.Error <= this.SeverityFilter) { lock (_syncState) { string diagnosisErrorMsg = ""; diagnosisErrorMsg += "Application code: " + diagnosis.ApplicationCode; diagnosisErrorMsg += Environment.NewLine; diagnosisErrorMsg += "Message: " + diagnosis.Message; diagnosisErrorMsg += Environment.NewLine; diagnosisErrorMsg += "PayloadPath: " + diagnosis.PayloadPath; diagnosisErrorMsg += Environment.NewLine; diagnosisErrorMsg += "SdataCode: " + diagnosis.SdataCode.ToString(); diagnosisErrorMsg += Environment.NewLine; diagnosisErrorMsg += "Severity: " + diagnosis.Severity.ToString(); diagnosisErrorMsg += Environment.NewLine; if (this.SeverityFilter >= Severity.Trace) { diagnosisErrorMsg += "StackTrace: " + diagnosis.StackTrace; diagnosisErrorMsg += Environment.NewLine; } _syncState.ErrorMsg = diagnosisErrorMsg; } } }
/// <summary> /// Reset Positions of ABG Variables. Create new Diagnosis if practice mode. /// </summary> public void Reset(Diagnosis d = null) { //Since the drag/drop slots handle positioning/scaling and everything else, just tell the objects who their parent/slot is. tttPH.SetParent(startParentPH); tttCO2.SetParent(startParentCO2); tttHCO3.SetParent(startParentHCO3); //If a diagnosis was provided, use it if (d != null) { diagnosis = d; } //otherwise, create our own. else { //we must be in practice mode diagnosis = abg.RandomDiagnosis(); Debug.Log("Created random diagnosis"); } //set the text inside of the drag and drop objects. dragndropPH.text = "pH\n" + diagnosis.PH.ToString("F2"); dragndropCO2.text = "CO2\n" + Mathf.RoundToInt(diagnosis.CO2).ToString();//ToString("F2"); dragndropHCO3.text = "HCO3\n" + Mathf.RoundToInt(diagnosis.HCO3).ToString();//("F2")*/; //reset the color of each button to it's original color/status imageRM.color = colNormal; imageAA.color = colNormal; imageC.color = colNormal; // reset the value of each answer text to it's original text ansAA.text = defaultAA; ansRM.text = defaultRM; ansC.text = defaultC; //make sure submit button is clickable. btnSubmit.interactable = true; //reset timer answerTimerUsed = 0; //Set answersubmitted and correct to false; answerCorrect = false; answerSubmitted = false; //if we are in practice mode, make sure help panel is enabled, and the sliders are reset if (practice) { if (panelHelp) { //make sure the help panel is on. panelHelp.SetActive(true); //reset the value of each slider. sliderCO2.value = 40; sliderHCO3.value = 24; sliderPH.value = 7.4f; } } }
public void CanInsertNewPatientRecord() { var name = new PersonName(); name.FirstName = "Thomas"; name.LastName = "Chapman"; name.MiddleName = "C"; var newDiagnosis1 = new Diagnosis(); newDiagnosis1.SetId = 9998; newDiagnosis1.DiagnosisDateTime = DateTime.Now; newDiagnosis1.Description = "Test Diagnosis 1"; newDiagnosis1.Clinician = "Dr. Test"; var newDiagnosis2 = new Diagnosis(); newDiagnosis2.SetId = 9998; newDiagnosis2.DiagnosisDateTime = DateTime.Now; newDiagnosis2.Description = "Test Diagnosis 2"; newDiagnosis2.Clinician = "Dr. Assert"; var newPatientVisit = new PatientVisit(); newPatientVisit.SetId = 9998; newPatientVisit.Location.Bed = "1"; newPatientVisit.Location.Building = "5"; newPatientVisit.Location.Facility = "UMC"; newPatientVisit.Location.Floor = "2"; newPatientVisit.Location.LocationDescription = "General"; newPatientVisit.Location.LocationStatus = "Active"; newPatientVisit.Location.Room = "2112"; var newPatient = new Patient(); newPatient.ExternalPatientId = "123456789"; newPatient.InternalPatientId = "987654321"; newPatient.Address.Address1 = "1917 Churchill Downs"; newPatient.Address.Address2 = ""; newPatient.Address.City = "Lebanon"; newPatient.Address.State = "TN"; newPatient.Address.PostalCode = "37087"; newPatient.Gender = "M"; newPatient.DateOfBirth = Convert.ToDateTime("11/23/1976"); newPatient.PrimaryPhoneNumber.AreaCode = "615"; newPatient.PrimaryPhoneNumber.CountryCode = "1"; newPatient.PrimaryPhoneNumber.LineNumber = "496-4071"; newPatient.Names.Add(name); newPatient.Diagnosis.Add(newDiagnosis1); newPatient.Diagnosis.Add(newDiagnosis2); newPatient.PatientVisit.Add(newPatientVisit); IHL7UnitOfWork uow = new HL7UnitOfWork(); uow.Patients.Add(newPatient); uow.Commit(); Assert.IsTrue(true); }
private void btnDiagnosa_Click(object sender, EventArgs e) { Diagnosis dg = new Diagnosis(); dg.Dock = DockStyle.Fill; LoadPanel.Controls.Add(dg); dg.Show(); }
private void dgvDiagnosis_DoubleClick(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; Diagnosis.Remove( Diagnosis.FirstOrDefault(d => d.DiagnosiName == dgvDiagnosis.SelectedRows[0].Cells[0].Value.ToString())); FillDiagnosisGrid(); Cursor = Cursors.Default; }
public ActionResult DeleteConfirmed(int id) { Diagnosis diagnosis = db.diagnoses.Find(id); db.diagnoses.Remove(diagnosis); db.SaveChanges(); return(RedirectToAction("Index")); }
public int SaveDiagnosis(Diagnosis mDiagnosis) { if (mDiagnosis.chapter != null) { int chapterID = diagnosisRepository.SaveChapter(mDiagnosis.chapter); } return(diagnosisRepository.SaveDiagnosis(mDiagnosis)); }
public int Delete(Diagnosis diagnosis) { if (sqlConnection.State == ConnectionState.Closed) { sqlConnection.Open(); } return(sqlConnection.Execute($"delete from Diagnoses where Id = '{diagnosis.Id}'")); }
private void ClearData() { diagnosis = new Diagnosis(); DescriptionME.Text = string.Empty; NameTE.Text = string.Empty; PatientLE.EditValue = null; DoctorLE.EditValue = null; }
public string insertDiagnosisBusiness(Diagnosis diagnosis, Userr user) { string message = ""; message = diagnosisData.insertDiagnosisData(diagnosis, user); return(message); }
public string updateDiagnosisWithoutDiagnosisIdBusiness(Diagnosis diagnosis, Userr user) { string message = ""; message = diagnosisData.updateDiagnosisWithoutDiagnosisIdData(diagnosis, user); return(message); }
/// <summary> /// Initializes a new instance of the <see cref="AddEditDiagnosisForm" /> class. /// </summary> /// <param name="diagnosis">The diagnosis.</param> public AddEditDiagnosisForm(Diagnosis diagnosis) { this.InitializeComponent(); this.diagnosis = diagnosis; this.edit = true; this.txtLabTestName.Text = diagnosis.DiagnosisInformation; this.chkFinal.Checked = diagnosis.FinalDiagnosis; }
/// <summary> /// Retrieve all the diagnoses information of a specific patient /// </summary> public List <PatientDiagnosis> RetrievePatientDiagnoses(string patientNRIC, string therapistNRIC) { List <PatientDiagnosis> result = new List <PatientDiagnosis>(); using (MySqlCommand cmd = new MySqlCommand()) { cmd.CommandText = @"SELECT a.name_first, a.name_last, pd.diagnosis_code, pd.start, pd.end, d.diagnosis_description_short, d.category_title FROM patient_diagnosis pd INNER JOIN diagnosis d ON pd.diagnosis_code = d.diagnosis_Code INNER JOIN account a ON a.nric = pd.therapist_nric INNER JOIN record_type_permission rtp ON rtp.patient_nric = pd.patient_nric WHERE rtp.patient_nric = @patientNRIC AND rtp.therapist_nric = @therapistNRIC AND rtp.approved_time IS NOT NULL ORDER BY pd.end DESC, pd.start DESC;"; cmd.Parameters.AddWithValue("@patientNRIC", patientNRIC); cmd.Parameters.AddWithValue("@therapistNRIC", therapistNRIC); using (cmd.Connection = connection) { cmd.Connection.Open(); cmd.ExecuteNonQuery(); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { Entity.Therapist therapist = new Entity.Therapist { firstName = Convert.ToString(reader["name_first"]), lastName = Convert.ToString(reader["name_last"]) }; Diagnosis diagnosis = new Diagnosis { code = Convert.ToString(reader["diagnosis_code"]), descriptionShort = Convert.ToString(reader["diagnosis_description_short"]), categoryTitle = Convert.ToString(reader["category_title"]) }; PatientDiagnosis patientDiagnosis = new PatientDiagnosis { therapist = therapist, diagnosis = diagnosis, start = Convert.ToDateTime(reader["start"]), }; patientDiagnosis.end = reader["end"] == DBNull.Value ? null : (DateTime?)Convert.ToDateTime(reader["end"]); result.Add(patientDiagnosis); } } } } return(result); }
/// <summary> /// Updates the Diagnosis /// </summary> /// <param name="Diagnosis">Diagnosis</param> public void UpdateDiagnosis(Diagnosis diagnosis) { if (diagnosis == null) { throw new ArgumentNullException(nameof(diagnosis)); } _diagnosisRepository.Update(diagnosis); }
/// <summary> /// Insert a Diagnosis /// </summary> /// <param name="Diagnosis">Diagnosis</param> public void InsertDiagnosis(Diagnosis diagnosis) { if (diagnosis == null) { throw new ArgumentNullException(nameof(diagnosis)); } _diagnosisRepository.Insert(diagnosis); }
public TestDiagnosis(Diagnosis d, string idLpu = "") { if (d != null) { document = d; info = new TestDiagnosisInfo(d.DiagnosisInfo); doctor = new TestDoctor(d.Doctor, idLpu); } }
public async Task <IActionResult> Delete(int id) { Diagnosis diagnosis = await diagnosisRepository.Get(id).ConfigureAwait(true); diagnosisRepository.Remove(diagnosis); await unitOfWork.CompleteAsync().ConfigureAwait(true); return(Ok(mapper.Map <DiagnosisForGetDTO>(diagnosis))); }
/// <summary> /// Retrieve all the diagnoses attributed to a specific record of a specific patient /// </summary> public List <RecordDiagnosis> RetrieveRecordDiagnoses(long recordID, string patientNRIC, string therapistNRIC) { List <RecordDiagnosis> result = new List <RecordDiagnosis>(); using (MySqlCommand cmd = new MySqlCommand()) { cmd.CommandText = @"SELECT d.diagnosis_code, d.diagnosis_description_short, d.category_title, a.name_first, a.name_last FROM record_diagnosis rd INNER JOIN record r ON r.id = rd.record_id INNER JOIN account_patient ap ON ap.nric = r.patient_nric INNER JOIN diagnosis d ON rd.diagnosis_code = d.diagnosis_Code INNER JOIN account a ON a.nric = rd.creator_nric INNER JOIN record_type_permission rtp ON rtp.patient_nric = ap.nric WHERE rtp.patient_nric = @patientNRIC AND rtp.therapist_nric = @therapistNRIC AND r.id = @recordID ORDER BY rd.create_time DESC;"; cmd.Parameters.AddWithValue("@patientNRIC", patientNRIC); cmd.Parameters.AddWithValue("@therapistNRIC", therapistNRIC); cmd.Parameters.AddWithValue("@recordID", recordID); using (cmd.Connection = connection) { cmd.Connection.Open(); cmd.ExecuteNonQuery(); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { Entity.Therapist therapist = new Entity.Therapist { firstName = Convert.ToString(reader["name_first"]), lastName = Convert.ToString(reader["name_last"]) }; Diagnosis diagnosis = new Diagnosis { code = Convert.ToString(reader["diagnosis_code"]), descriptionShort = Convert.ToString(reader["diagnosis_description_short"]), categoryTitle = Convert.ToString(reader["category_title"]) }; RecordDiagnosis recordDiagnosis = new RecordDiagnosis { therapist = therapist, diagnosis = diagnosis, }; result.Add(recordDiagnosis); } } } } return(result); }
/// <summary> ///Accepts as input a set of diagnoses and single diagnosis. ///Used trie data structure to alocate the diagnosis. ///Used toString function that used to represent the diagnosis as a string. ///Insert the single diagnosis to the trie data sturcture of all minimal diagnosis. /// </summary> /// <param name="R">The data structure that alocate all the uniq diagnosis (minimal).</param> /// <param name="W">The current diagnosis.</param> public void AddToTrie(Trie <Diagnosis> R, Diagnosis w) { if (w != null) { R.Put(diagnosisToString(w.TheDiagnosis), w); minimalDiagnoses.AddDiagnosis(w); addToCheckList(w.TheDiagnosis); } }
public ModelDiagnosis MapDiagosis(Diagnosis diagnosis) { ModelDiagnosis md = new ModelDiagnosis(); md.Id = diagnosis.Id; md.Name = diagnosis.Name; md.Description = diagnosis.Description; return(md); }
public async Task <IActionResult> Put(DiagnosisForEditDTO model) { Diagnosis diagnosis = mapper.Map <Diagnosis>(model); diagnosisRepository.Edit(diagnosis); await unitOfWork.CompleteAsync().ConfigureAwait(true); return(Ok(mapper.Map <DiagnosisForGetDTO>(await diagnosisRepository.Get(diagnosis.Id).ConfigureAwait(true)))); }
// GET: Diagnosis/Details/5 public ActionResult Details(int id = 0) { diagnosis = db.Diagnosis.Find(id); if (diagnosis == null) { return(HttpNotFound()); } return(View(diagnosis)); }
private void Add_Click(object sender, RoutedEventArgs e) { Diagnosis diagnosis = null; diagnosis = diagnosisController.FindByName((string)Dijagnoze.SelectedItem); medicalRecordController.UpdateIllnessHistory(diagnosis, medicalRecordController.GetMedicalRecord(Informations.currentRecord.MedicalRecord.IdRecord)); Informations.currentRecord.MedicalRecord = medicalRecordController.GetMedicalRecord(Informations.currentRecord.MedicalRecord.IdRecord); NavigationService.Navigate(new Uri("/Pages/MedicalRecord/Informations.xaml", UriKind.Relative)); }
public TestClinicMainDiagnosis(Diagnosis d, string idLpu = "") { if (d != null) { if (d.DiagnosisInfo != null) diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo); if (d.Doctor != null) doctor = new TestDoctor(d.Doctor, idLpu); } }
public bool AddDiagnosis(Diagnosis diagnosis) { try { entities.Diagnoses.Add(diagnosis); entities.SaveChanges(); return true; } catch (Exception x) { FileLogger.LogError(x); return false; } }
public Diagnosis CreateOrUpdateEntity(Diagnosis entity) { if (entity == null) { throw new ArgumentNullException("entity"); } using (var context = new DomainContext(this.ConnectionString)) { if (this.GetEntityById(entity.Id) == null) { context.Diagnosises.Add(entity); } else { context.Entry(entity).State = EntityState.Modified; } context.SaveChanges(); } return entity; }
private List<string> CheckDiagnosis(string id, string idDoctor, Diagnosis diagnos) { var errorList = new List<string>(); bool DignosisExist = false; using (var conn = new SqlConnection(Data.connString)) { // ищем пациента в бд var que = "SELECT MkbCode, IdDiagnoseStage, Diagnosis.IdDiagnosisType, NameCod, IdDiagnosis " + "FROM Diagnosis join [nsi].[MKB10] " + "ON MkbCode = Cod " + "join Step " + "ON Diagnosis.IdStep = Step.IdStep " + "WHERE [dbo].[Step].IdCase = '" + id + "'"; // "WHERE [dbo].[Diagnosis].IdStep = " + // "(SELECT IdStep " + // "FROM [dbo].[Step] " + // "WHERE ([dbo].[Step].IdCase = '" + id + "') and " + // "([dbo].[Step].IdDoctor IS NULL))"; conn.Open(); SqlCommand command = new SqlCommand(que); command.Connection = conn; SqlDataReader dataReader = command.ExecuteReader(); while (dataReader.Read()) { if (diagnos.Id.ToString() == dataReader["IdDiagnosis"].ToString()) { DignosisExist = true; if (diagnos.Code != dataReader["MkbCode"].ToString()) errorList.Add("Code заполнен некорректно"); if (dataReader["IdDiagnoseStage"] != DBNull.Value && diagnos.DiagnosisStage.ToString() != dataReader["IdDiagnoseStage"].ToString()) errorList.Add("DiagnosisStage заполнен некорректно"); if (diagnos.DiagnosisType.ToString() != dataReader["IdDiagnosisType"].ToString()) errorList.Add("DiagnosisType заполнен некорректно"); if (diagnos.Name != dataReader["NameCod"].ToString()) errorList.Add("Name заполнен некорректно"); } } if (!DignosisExist) errorList.Add("Диагноза нет в БД"); dataReader.Close(); conn.Close(); } return errorList; }
/// <summary> /// Return a Diagnosis with Random Values for Practice mode. /// </summary> /// <returns>Diagnosis with Random Answer Values.</returns> public Diagnosis RandomDiagnosis() { //create new diagnosis Diagnosis d = new Diagnosis(); //set values for answers DiagnosisAnswerValues(d); return d; }
/// <summary> /// Read in data from file to create a list of diagnoses. /// </summary> private void CreateDiagnoses() { Debug.Log("ABG is creating Diagnoses"); //Come back and change this to read in from a file later. //Initialize Test Sample lists. testStoriesL = new List<string>(); testStoriesS = new List<string>(); testSymptoms1 = new List<string>(); testSymptoms2 = new List<string>(); testSymptoms3 = new List<string>(); testSymptoms4 = new List<string>(); testConditions1 = new List<string>(); testConditions2 = new List<string>(); testConditions3 = new List<string>(); testConditions4 = new List<string>(); testMedications1 = new List<string>(); testMedications2 = new List<string>(); testMedications3 = new List<string>(); testMedications4 = new List<string>(); //populate the test sample lists. //long stories testStoriesL.Add("I fell off a ladder yesterday afternoon while trimming my hedges and have been taking a narcotic pain reliever since shortly after the accident."); testStoriesL.Add("I woke up in the middle of the night with stomach cramps and feeling nauseous after eating at a delicatessen yesterday. I vomited lots of green fluid 3 times and I feel weak and sick to my stomach."); testStoriesL.Add("I was on my way to an important meeting for work when I realized I forgot several essential documents. I became anxious and started hyperventilating. Then I became dizzy and felt tingling in my fingertips."); testStoriesL.Add("My child has been very difficult to feed and has had very frequent runny poops for the past 3 days. My child also seems to be breathing fast."); //short stories testStoriesS.Add("I fell off a ladder yesterday afternoon while trimming my hedges."); testStoriesS.Add("I woke up in the middle of the night with stomach cramps"); testStoriesS.Add("I became anxious on the way to work and started hyperventilating!!"); testStoriesS.Add("My child has been difficult to feed and has had runny poops for days."); //symptoms testSymptoms1.Add("Severe Pain"); testSymptoms1.Add("Cyanotic Fingers"); testSymptoms2.Add("Stomach Cramps"); testSymptoms2.Add("Weak & Fainty"); testSymptoms3.Add("Hyperventilation"); testSymptoms3.Add("Dizziness"); testSymptoms3.Add("Palpitations"); testSymptoms3.Add("Tingling in arms"); testSymptoms4.Add("Tachypnea"); testSymptoms4.Add("Depressed anterior fontanel"); //conditions testConditions1.Add("Asthma"); testConditions1.Add("Lung Disease"); testConditions2.Add("Stomach Polyps"); testConditions2.Add("Peptic Ulcer Disease"); //medications testMedications1.Add("Alleve"); testMedications1.Add("Zyrtec"); testMedications2.Add("Pepto-Bismol"); testMedications2.Add("Tums"); //generate the diagnoses Diagnosis d = new Diagnosis("Respiratory", "Acidosis", "Uncompensated", testStoriesL[0], testStoriesS[0], testMedications1, testSymptoms1, testConditions1); Diagnosis e = new Diagnosis("Metabolic", "Alkalosis", "Compensated", testStoriesL[1], testStoriesS[1], testMedications2, testSymptoms2, testConditions2); Diagnosis f = new Diagnosis("Respiratory", "Alkalosis", "Uncompensated", testStoriesL[2], testStoriesS[2], testMedications3, testSymptoms3, testMedications3); Diagnosis g = new Diagnosis("Metabolic", "Acidosis", "Compensated", testStoriesL[3], testStoriesS[3], testMedications4, testSymptoms4, testConditions4); //add the new diagnoses to the list. diagnoses.Add(d); diagnoses.Add(e); diagnoses.Add(f); diagnoses.Add(g); //get the values for the diagnoses for (int i = 0; i < diagnoses.Count; i++ ) { diagnoses[i] = DiagnosisAnswerValues(diagnoses[i]); } }
public void SetDiagnosis(Int32 nodeId, Diagnosis diagnosis) { if (diagnosis == null) { throw new HttpResponseException(HttpStatusCode.BadRequest); } _storage.SetDiagnosis(nodeId, diagnosis); }
private List<EMKServise.Diagnosis> ConvertDiagnosis(Diagnosis[] c) { List<EMKServise.Diagnosis> lmr = new List<EMKServise.Diagnosis>(); foreach (Diagnosis i in c) { EMKServise.Diagnosis ecmd = new EMKServise.Diagnosis(); ecmd.DiagnosisInfo = ConvertDiagnosisInfo(i.DiagnosisInfo); ecmd.Doctor = ConvertMedicalStaff(i.Doctor); lmr.Add(ecmd); } if (lmr.Count == 0) return null; else return lmr; }
public bool AddNew(Diagnosis diagnosis) { return repository.AddNewDiagnosis(diagnosis); }
private Diagnosis GetDiagnosis(SdataTransactionResult result) { Diagnosis d = result.Diagnosis; if(d == null) { d= new Diagnosis(); d.Message = result.HttpMessage; } return d; }
public Diagnosis MinDiagnosis() { Diagnosis diag = new Diagnosis { DiagnosisInfo = new DiagnosisInfo { DiagnosedDate = MedRecordData.diagnosis.DiagnosisInfo.DiagnosedDate, IdDiagnosisType = MedRecordData.diagnosis.DiagnosisInfo.IdDiagnosisType, Comment = MedRecordData.diagnosis.DiagnosisInfo.Comment, MkbCode = MedRecordData.diagnosis.DiagnosisInfo.MkbCode }, Doctor = MinDoctorSet() }; return diag; }
/// <summary> /// Set the answer values for a diagnosis /// </summary> /// <param name="d">The Diagnosis</param> /// <returns>The same Diagnosis with answers and values</returns> public Diagnosis DiagnosisAnswerValues(Diagnosis d) { //if the diagnosis does not have set answers, give it some. if (d.AnswerRespiratoryMetabolic == "") { int r = Random.Range(0, 12); //create strings to hold the answer values. string rm = "", aa = "", c = ""; switch (r) { case (0): rm = "Respiratory"; aa = "Acidosis"; c = "Uncompensated"; break; case (1): rm = "Respiratory"; aa = "Acidosis"; c = "Partial Compensation"; break; case (2): rm = "Respiratory"; aa = "Acidosis"; c = "Compensated"; break; case (3): rm = "Respiratory"; aa = "Alkalosis"; c = "Uncompensated"; break; case (4): rm = "Respiratory"; aa = "Alkalosis"; c = "Partial Compensation"; break; case (5): rm = "Respiratory"; aa = "Alkalosis"; c = "Compensated"; break; case (6): rm = "Metabolic"; aa = "Acidosis"; c = "Uncompensated"; break; case (7): rm = "Metabolic"; aa = "Acidosis"; c = "Partial Compensation"; break; case (8): rm = "Metabolic"; aa = "Acidosis"; c = "Compensated"; break; case (9): rm = "Metabolic"; aa = "Alkalosis"; c = "Uncompensated"; break; case (10): rm = "Metabolic"; aa = "Alkalosis"; c = "Partial Compensation"; break; case (11): rm = "Metabolic"; aa = "Alkalosis"; c = "Compensated"; break; } // Don't need to translate here, or ever because the answer is returned in it's translated form. d.AnswerRespiratoryMetabolic = rm; d.AnswerAcidosisAlkalosis = aa; d.AnswerCompensation = c; //go through the method again but this time, pick up the number values. return DiagnosisAnswerValues(d); } else { //prepare our answer values and comparison values string rm = d.AnswerRespiratoryMetabolic, aa = d.AnswerAcidosisAlkalosis, comp = d.AnswerCompensation; string r = "Respiratory", m = "Metabolic", alk = "Alkalosis", aci = "Acidosis", uc = "Uncompensated", pc = "Partial Compensation", c = "Compensated"; //translate the answers if possible if (LanguageManager._LanguageManager) { LanguageManager lm = LanguageManager._LanguageManager; r = lm.DirectTranslation("ABG", r); m = lm.DirectTranslation("ABG", m); alk = lm.DirectTranslation("ABG", alk); aci = lm.DirectTranslation("ABG", aci); uc = lm.DirectTranslation("ABG", uc); pc = lm.DirectTranslation("ABG", pc.Replace(" ",""));//due to xml syntax, this is not spelled the same and the whitespace needs to be removed. c = lm.DirectTranslation("ABG", c); } //since we have set answers, set the number values if (rm == r && aa == aci && comp == uc) { //Debug.Log("Resp Aci UC"); d.PH = GenerateDiagnosisValues("PH", -2); d.CO2 = GenerateDiagnosisValues("CO2", -2); d.HCO3 = GenerateDiagnosisValues("HCO3", 0); } else if (rm == r && aa == aci && comp == pc) { //Debug.Log("Resp Aci PC"); d.PH = GenerateDiagnosisValues("PH", -2); d.CO2 = GenerateDiagnosisValues("CO2", -2); d.HCO3 = GenerateDiagnosisValues("HCO3", 2); } else if (rm == r && aa == aci && comp == c) { //Debug.Log("Resp Aci Comp"); d.PH = GenerateDiagnosisValues("PH", -1); d.CO2 = GenerateDiagnosisValues("CO2", -2); d.HCO3 = GenerateDiagnosisValues("HCO3", 2); } else if (rm == r && aa == alk && comp == uc) { d.PH = GenerateDiagnosisValues("PH", 2); d.CO2 = GenerateDiagnosisValues("CO2", 2); d.HCO3 = GenerateDiagnosisValues("HCO3", 0); } else if (rm == r && aa == alk && comp == pc) { d.PH = GenerateDiagnosisValues("PH", 2); d.CO2 = GenerateDiagnosisValues("CO2", 2); d.HCO3 = GenerateDiagnosisValues("HCO3", -2); } else if (rm == r && aa == alk && comp == c) { d.PH = GenerateDiagnosisValues("PH", 1); d.CO2 = GenerateDiagnosisValues("CO2", 2); d.HCO3 = GenerateDiagnosisValues("HCO3", -2); } else if (rm == m && aa == aci && comp == uc) { d.PH = GenerateDiagnosisValues("PH", -2); d.CO2 = GenerateDiagnosisValues("CO2", 0); d.HCO3 = GenerateDiagnosisValues("HCO3", -2); } else if (rm == m && aa == aci && comp == pc) { d.PH = GenerateDiagnosisValues("PH", -2); d.CO2 = GenerateDiagnosisValues("CO2", 2); d.HCO3 = GenerateDiagnosisValues("HCO3", -2); } else if (rm == m && aa == aci && comp == c) { d.PH = GenerateDiagnosisValues("PH", -1); d.CO2 = GenerateDiagnosisValues("CO2", 2); d.HCO3 = GenerateDiagnosisValues("HCO3", -2); } else if (rm == m && aa == alk && comp == uc) { d.PH = GenerateDiagnosisValues("PH", 2); d.CO2 = GenerateDiagnosisValues("CO2", 0); d.HCO3 = GenerateDiagnosisValues("HCO3", 2); } else if (rm == m && aa == alk && comp == pc) { d.PH = GenerateDiagnosisValues("PH", 2); d.CO2 = GenerateDiagnosisValues("CO2", -2); d.HCO3 = GenerateDiagnosisValues("HCO3", 2); } else if (rm == m && aa == alk && comp == c) { d.PH = GenerateDiagnosisValues("PH", 1); d.CO2 = GenerateDiagnosisValues("CO2", -2); d.HCO3 = GenerateDiagnosisValues("HCO3", 2); } return d; } }
public void PatientSetup(string n, string dob, Diagnosis d) { PersonInitialize(); PatientInitalize(); tag = "Patient"; name = n; patientName = n; dateOfBirth = dob; diagnosis = d; assessmentAA = " "; assessmentRM = " "; Debug.Log(name + "'s Diagnosis is: " + d.AnswerRespiratoryMetabolic + " " + d.AnswerAcidosisAlkalosis + " " + d.AnswerCompensation); //Debug.Log(name + "'s Story is: " + d.Story("S")); }
public void SetDiagnosis(string nodeId, Diagnosis diagnosis) { Int32 id; if (!Int32.TryParse(nodeId, out id)) { throw new WebFaultException(HttpStatusCode.BadRequest); } _storage.SetDiagnosis(id, diagnosis); }
private void LoadDiagnosesFromXML() { Debug.Log("LoadDiagnosesFromXML"); if (fileLocation != "") { //create a reader that uses our settings defined earlier. TextAsset xml = Resources.Load(fileLocation) as TextAsset; //XmlReader xmlreader = XmlReader.Create(fileLocation, xmlreaderSettings); //create a new instance of an xml document XmlDocument xmlDoc = new XmlDocument(); //xmlDoc.Load(xmlreader); xmlDoc.LoadXml(xml.text); //Debug.Log(xmlDoc.ChildNodes[1].InnerText); //parse through all the different interventions. XmlNodeList interventions = xmlDoc.GetElementsByTagName("Intervention"); //determine how many languages there are. //int totalLanguages = interventions[0].ChildNodes.Count; #region Nursing Intervention foreach (XmlNode intervention in interventions) { //create the variables //RespiratoryMetabolic, AcidosisAlkalosis, Compensation, Greeting string rm = "" , aa = "", c = ""; string greetingEnglish = "", greetingSpanish = ""; //History, and Signs & Symptoms List<string> historyEnglish = new List<string>(); List<string> historySpanish = new List<string>(); List<string> signsSymptomsEnglish = new List<string>(); List<string> signsSymptomsSpanish = new List<string>(); //Get the Diagnosis /Intervention/English/Diagnosis XmlNode xn = intervention.FirstChild.FirstChild; //Respiratory Or Metabolic, Acidosis or Alkalosis, Compensation rm = xn.FirstChild.InnerText; aa = xn.ChildNodes[1].InnerText; c = xn.LastChild.InnerText; //get the greeting, signs and symptoms, and history for each language. #region Language foreach (XmlNode langauge in intervention) { //Keep track of what language we are currently in. string lang = langauge.Name; //Debug.Log(lang); //the greeting for this language string greeting = ""; //The history and signs and symptoms for this language List<string> hist = new List<string>(); List<string> ss = new List<string>(); #region Sections //now find the information for each section in this language. foreach (XmlNode section in langauge) { //Greeting if (section.Name == "Greeting") { greeting = section.InnerText; } //Signs and Symptoms else if (section.Name == "SignsAndSymptoms") { //comb through the list of elements and add each value foreach (XmlNode element in section) { if (element.NodeType != XmlNodeType.Comment && element.InnerText != "" && element.NodeType != XmlNodeType.Whitespace) { ss.Add(element.InnerText); } } } else if (section.Name == "History") { foreach (XmlNode element in section) { if (element.NodeType != XmlNodeType.Comment && element.InnerText != "" && element.NodeType != XmlNodeType.Whitespace) { hist.Add(element.InnerText); } } } } //now save the retrieved values to their proper variables. if (lang == "English") { greetingEnglish = greeting; historyEnglish = hist; signsSymptomsEnglish = ss; } else if (lang == "Spanish") { greetingSpanish = greeting; historySpanish = hist; signsSymptomsSpanish = ss; } #endregion } #endregion #region Create the Nursing Intervention And add to list Diagnosis d = new Diagnosis(rm, aa, c, greetingEnglish, greetingSpanish, historyEnglish, historySpanish, signsSymptomsEnglish, signsSymptomsSpanish); diagnoses.Add(d); #endregion } #endregion } }
public Diagnosis getDiag(int _gotSerial) { NpgsqlDataAdapter getDiagData = new NpgsqlDataAdapter("Select * from diag_data where serial = '" + _gotSerial + "';", DBExchange.Inst.connectDb); tlDiagData = new DataTable(); Diagnosis _diag = new Diagnosis(); try { _diag.DiagSerial = _gotSerial; getDiagData.Fill(tlDiagData); if (tlDiagData.Rows.Count > 0) { if (Convert.IsDBNull(tlDiagData.Rows[0]["type"]) == false) { _diag.DiagType = Convert.ToInt16(tlDiagData.Rows[0]["type"]); } if (Convert.IsDBNull(tlDiagData.Rows[0]["diag_date"]) == false) { _diag.DiagDate = Convert.ToDateTime(tlDiagData.Rows[0]["diag_date"]); } if (Convert.IsDBNull(tlDiagData.Rows[0]["main_mark"]) == false) { _diag.DiagMain = (bool)tlDiagData.Rows[0]["main_mark"]; } if (Convert.IsDBNull(tlDiagData.Rows[0]["comment"]) == false) { _diag.DiagBody = (string)tlDiagData.Rows[0]["comment"]; } if (Convert.IsDBNull (tlDiagData.Rows[0]["diag"]) == false ) { _diag.DiagMkbId = (int)tlDiagData.Rows[0]["diag"]; } } } catch (Exception exception) { Warnings.WarnLog log = new Warnings.WarnLog(); log.writeLog(MethodBase.GetCurrentMethod().Name, exception.Message.ToString(), exception.StackTrace.ToString()); } return _diag; }
/// <summary> /// Sets the SdataTransactionResult.Diagnosis Object based on the Information in sdTrResult so the consumer gets a decent Error Message /// </summary> /// <param name="sdTrResult"></param> private static void AttachDiagnosis(SdataTransactionResult sdTrResult) { Diagnosis diag = new Diagnosis(); diag.Message = sdTrResult.HttpMessage; diag.Severity = Severity.Error; diag.ApplicationCode = sdTrResult.HttpStatus.ToString(); diag.SDataCode = DiagnosisCode.ApplicationDiagnosis; sdTrResult.Diagnosis = diag; }
public virtual Treatment PrescribeTreatment(Diagnosis diagnosis) { return new Treatment(); }