public static void UpdateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEvent medicalEvent_db = dc.MedicalEvents.Where(p => p.MedicalEventId.Equals(medicalEvent.MedicalEventId)).FirstOrDefault <MedicalEvent>(); medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent; medicalEvent_db.ProfesionalId = medicalEvent.ProfesionalId; medicalEvent_db.PatientId = medicalEvent.PatientId; medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad; medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta; medicalEvent_db.Motivo = medicalEvent.Motivo; medicalEvent_db.Evolucion = medicalEvent.Evolucion; medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario; medicalEvent_db.AppointmentId = medicalEvent.AppointmentId; medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId; //medicalEvent_db.CreatedDate = System.DateTime.Now; //medicalEvent_db.CreatedUserId = createdUserId; dc.SaveChanges(); } }
public static int CreateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId) { using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { MedicalEvent medicalEvent_db = new MedicalEvent(); medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent; medicalEvent_db.ProfesionalId = medicalEvent.ProfesionalId; medicalEvent_db.PatientId = medicalEvent.PatientId; medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad; medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta; medicalEvent_db.Motivo = medicalEvent.Motivo; medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario; medicalEvent_db.Evolucion = medicalEvent.Evolucion; medicalEvent_db.AppointmentId = medicalEvent.AppointmentId; medicalEvent_db.CreatedDate = System.DateTime.Now; medicalEvent_db.CreatedUserId = createdUserId; medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId; dc.MedicalEvents.AddObject(medicalEvent_db); dc.SaveChanges(); return(medicalEvent_db.MedicalEventId); } }
private void InitEvents() { // Initialize events and list for demo purposes. Symptom=0 Diagnosis=1 MedicalAction=2 MedicalEvent d0 = new MedicalEvent(1, "Strep Throat", 1985, 03, 09, gameState.HEAD_NECK_VIEW, new Vector3(-5.23f, 7.837f, 0.236f), "Throat appeared inflamed and red. Patient complained of congestion, cough, and pain. Throat swab confirmed case of strep throat.", "Azithromycin", null); MedicalEvent e0 = new MedicalEvent(2, "Lasik Eye Surgery", 1991, 02, 14, gameState.HEAD_NECK_VIEW, new Vector3(-5.298f, 8.37f, -0.631f), "Laser eye surgery.", "", null); MedicalEvent e1 = new MedicalEvent(1, "Fractured Radius", 2004, 01, 20, gameState.RIGHT_ARM_VIEW, new Vector3(-6.292f, 5.698f, -1.05f), "Cause: Bird scooter accident.", "Over-the-counter pain medication recommended", "fracture-bone-2333164_960_720"); MedicalEvent e2 = new MedicalEvent(0, "Shin Splints", 2008, 11, 17, gameState.RIGHT_LEG_VIEW, new Vector3(-5.45f, 2.388f, -0.66f), "Complaints of sharp pain through right shin following heavy running.", "None", null); MedicalEvent e3 = new MedicalEvent(0, "Shin Splints", 2009, 09, 24, gameState.RIGHT_LEG_VIEW, new Vector3(-5.487f, 2.076f, -0.587f), "Second case of sharp pain through right shin following heavy running.", "None", null); MedicalEvent e4 = new MedicalEvent(1, "Shin Splint Diagnosis", 2009, 09, 24, gameState.RIGHT_LEG_VIEW, new Vector3(-5.504f, 1.696f, -0.502f), "Doctor diagnosis of shin splints.", "Ice and over-the-counter pain medication recommended", null); MedicalEvent e5 = new MedicalEvent(0, "Lower Abdomen Pain", 2015, 10, 13, gameState.TORSO_VIEW, new Vector3(-4.454f, 5.375f, -0.418f), "ER visit 10/14/2015", "None", null); MedicalEvent e6 = new MedicalEvent(2, "Colonoscopy", 2015, 10, 14, gameState.TORSO_VIEW, new Vector3(-4.83f, 5.41f, 0.42f), "Colonoscopy reveals malignant growth.", "Cancer treatment plan pending", null); MedicalEvent e7 = new MedicalEvent(2, "Surgical Tumor Removal", 2015, 11, 12, gameState.TORSO_VIEW, new Vector3(-4.52f, 5.91f, -0.47f), "Removal of abnormal mass in colon.", "Anesthetic administered", null); MedicalEvent e8 = new MedicalEvent(1, "Spread of Cancer to Underarm Lymph Nodes", 2016, 08, 19, gameState.TORSO_VIEW, new Vector3(-4.23f, 6.92f, -0.19f), "CT Scan reveals growths in underarm area.", "Chemotherapy plan in motion", null); MedicalEvent e9 = new MedicalEvent(2, "Chemotherapy Administration", 2016, 09, 01, gameState.TORSO_VIEW, new Vector3(-5.298f, 7.25f, -0.643f), "First of four treatments.", "Doxorubicin", null); MedicalEvent e10 = new MedicalEvent(2, "Chemotherapy Administration", 2016, 10, 01, gameState.TORSO_VIEW, new Vector3(-4.999f, 7.097f, -0.603f), "Second of four treatments.", "Doxorubicin", null); MedicalEvent e11 = new MedicalEvent(2, "Chemotherapy Administration", 2016, 11, 01, gameState.TORSO_VIEW, new Vector3(-5.125f, 6.931f, -0.778f), "Third of four treatments.", "Doxorubicin", null); MedicalEvent e12 = new MedicalEvent(0, "Joint Pain in Hand", 2017, 11, 18, gameState.LEFT_ARM_VIEW, new Vector3(-2.91f, 4.76f, 0.58f), "Doctor visit for chronic joint pain.", "None", null); MedicalEvent e13 = new MedicalEvent(1, "Arthritis Diagnosis", 2017, 11, 18, gameState.LEFT_ARM_VIEW, new Vector3(-3.09f, 5.15f, 0.6f), "Patient diagnosed with arthritis.", "Aleve", null); p1_events.Add(d0); p1_events.Add(e0); p1_events.Add(e1); p1_events.Add(e2); p1_events.Add(e3); p1_events.Add(e4); p1_events.Add(e5); p1_events.Add(e6); p1_events.Add(e7); p1_events.Add(e8); p1_events.Add(e9); p1_events.Add(e10); p1_events.Add(e11); p1_events.Add(e12); p1_events.Add(e13); }
public void two_different_MedicalEvent_objects_with_default_values_are_equal() { MedicalEvent medicalEvent1 = new MedicalEvent(); MedicalEvent medicalEvent2 = new MedicalEvent(); bool actual = Equals(medicalEvent1, medicalEvent2); Assert.That(actual, Is.True); }
public void two_different_MedicalEvent_objects_are_not_reference_equal() { MedicalEvent medicalEvent1 = new MedicalEvent(); MedicalEvent medicalEvent2 = new MedicalEvent(); bool actual = medicalEvent1 == medicalEvent2; Assert.That(actual, Is.False); }
private void HourlyEventChanges(MedicalEvent anEvent) { foreach (Harm change in anEvent.GeneralHarm) { float wielkoscWplywu = change.Value * anEvent.Strength * BodyPartMechanics.BodyPartMultiplier(anEvent.Place); if (wielkoscWplywu <= -MINIMUM_WAZNEGO_ZDARZENIA && change.ResName == "Health") { ImportantEvents.Add(StringsTranslator.GetString("PowaznyWplyw") + anEvent.FriendlyName()); } _character.SetSkillValue(change.ResName, _character.getSkillValue(change.ResName) + wielkoscWplywu); } }
private float GetHourTreatment(MedicalEvent anEvent) { foreach (MedicalItemDataAddon przedmiot in _treatmentItems) { float leczenie = przedmiot.GetHourTreatment(anEvent); if (leczenie != 0) { return(leczenie); } } return(0); }
public void SetMedicalEvent(MedicalEvent mymed) { m.SetEventType(mymed.GetEventType()); m.SetEventTitle(mymed.GetEventTitle()); m.SetEventDate(mymed.GetEventDate()); m.SetEventNotes(mymed.GetEventNotes()); m.SetEventDrugs(mymed.GetEventDrugs()); m.SetLocation(mymed.GetLocation()); m.SetImageSprite(mymed.GetImageSprite()); m.SetSite(mymed.GetSite()); m.SetSiteString(mymed.GetSiteString()); m.SetGameState(mymed.GetGameState()); }
private void SortEvents() { for (int i = 0; i < CurrentEventsNumber; i++) { for (int j = i + 1; j < CurrentEventsNumber; j++) { if (_currentEvents[i].Strength < _currentEvents[j].Strength) { MedicalEvent tymczasowe = _currentEvents[i]; _currentEvents[i] = _currentEvents[j]; _currentEvents[j] = tymczasowe; } } } }
//dodaje nowe zdarzenie pierwotne (nowe choroby) public void AddNewEvent(MedicalEvent newEvent) { bool alreadyExists = false; foreach (MedicalEvent me in _currentEvents) { if (me.Type == newEvent.Type) { alreadyExists = true; } } if (!alreadyExists) { _currentEvents.Add(newEvent); } }
private void LoadFromModel(MedicalEvent model) { StudentId = model.StudentId; CreatedById = model.CreatedById; Date = model.Date; Note = model.Note; if (model.CreatedBy != null) { CreatedBy = new UserModel(model.CreatedBy); } if (model.Student != null) { Student = new StudentModel(model.Student); } }
public void two_different_MedicalEvent_objects_with_different_ID_are_not_equal() { MedicalEvent medicalEvent1 = new MedicalEvent { Id = new Guid("1c088cbe-5d23-4ea6-b645-d09098936743"), Date = new DateTime(2000, 10, 10), Medic = new Medic { Name = "Medic 1" }, Clinic = new Clinic { Name = "Clinic 1" }, Labels = new ObservableCollection <string> { "label1", "label2" }, Comments = "some comments" }; MedicalEvent medicalEvent2 = new MedicalEvent() { Id = new Guid("4ad661ed-9970-4b28-96e7-b46c5426e50a"), Date = new DateTime(2000, 10, 10), Medic = new Medic { Name = "Medic 1" }, Clinic = new Clinic { Name = "Clinic 1" }, Labels = new ObservableCollection <string> { "label1", "label2" }, Comments = "some comments" }; bool actual = Equals(medicalEvent1, medicalEvent2); Assert.That(actual, Is.False); }
public void two_different_MedicalEvent_objects_with_same_values_are_equal() { MedicalEvent medicalEvent1 = new MedicalEvent { Id = new Guid("1c088cbe-5d23-4ea6-b645-d09098936743"), Date = new DateTime(2000, 10, 10), Medic = new Medic { Name = "Medic 1" }, Clinic = new Clinic { Name = "Clinic 1" }, Labels = new ObservableCollection <string> { "label1", "label2" }, Comments = "some comments" }; MedicalEvent medicalEvent2 = new MedicalEvent() { Id = new Guid("1c088cbe-5d23-4ea6-b645-d09098936743"), Date = new DateTime(2000, 10, 10), Medic = new Medic { Name = "Medic 1" }, Clinic = new Clinic { Name = "Clinic 1" }, Labels = new ObservableCollection <string> { "label1", "label2" }, Comments = "some comments" }; bool actual = Equals(medicalEvent1, medicalEvent2); Assert.That(actual, Is.True); }
public MedicalEventAddedEventArgs(MedicalEvent medicalEvent) { MedicalEvent = medicalEvent; }
public MedicalEventModel(MedicalEvent model) : base(model) { LoadFromModel(model); }