public void SetPassword(int p_oid, string p_passwordCurrent, string p_passwordNew) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setPassword) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID(p_oid); if (patient != null) { if (!string.IsNullOrEmpty(p_passwordCurrent) && !string.IsNullOrEmpty(p_passwordNew)) { if (Utils.Util.GetEncondeMD5(p_passwordCurrent).Equals(patient.Password)) { patient.Password = Utils.Util.GetEncondeMD5(p_passwordNew); patientCAD.Modify(patient); } } } } /*PROTECTED REGION END*/ }
public void SetEmail(int p_oid, string p_email) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setEmail) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID(p_oid); if (patient != null) { if (!string.IsNullOrEmpty(p_email)) { patient.Email = p_email; patientCAD.Modify(patient); } } } /*PROTECTED REGION END*/ }
public void SetMaritalStatus(int p_oid, ChroniGenNHibernate.Enumerated.Chroni.MaritalStatusEnum p_maritalStatus) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setMaritalStatus) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID(p_oid); if (patient != null) { if (p_maritalStatus > 0) { patient.MaritalStatus = p_maritalStatus; patientCAD.Modify(patient); } } } /*PROTECTED REGION END*/ }
// GET: DashBoard/DashBoard public ActionResult BarChartPatients() { ViewBag.menu = "inicio"; SessionInitialize(); LocationCAD cadPos = new LocationCAD(); LocationCEN cen = new LocationCEN(cadPos); IList <LocationEN> listLocations = cen.ReadAll(0, -1); PatientCAD cadPatient = new PatientCAD(); PatientCEN cenPatient = new PatientCEN(cadPatient); IList <PatientEN> listPatients = cenPatient.ReadAll(0, -1); IList <LocationEN> listaLocationsChart = cen.ReadAll(0, -1); List <String> locations = new List <string>(); List <int> numPractitionerCentro = new List <int>(); foreach (LocationEN loc in listaLocationsChart) { IList <PatientEN> listaPacientes = cenPatient.GetPatientsByLocation(loc.Identifier); numPractitionerCentro.Add(listaPacientes.Count); } SessionClose(); return(Json(numPractitionerCentro)); }
public bool Login(string p_nif, string p_password) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_login) ENABLED START*/ // Write here your custom code... bool resultado = false; PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (!string.IsNullOrEmpty(p_nif)) { IList <PatientEN> patient = patientCEN.GetPatientByNif(p_nif); if (patient != null && patient.Count == 1) { if (!string.IsNullOrEmpty(p_password)) { if (patient [0].Password.Equals(Utils.Util.GetEncondeMD5(p_password))) { resultado = true; } } } } return(resultado); /*PROTECTED REGION END*/ }
// GET: DashBoard/Patient/Delete/5 public ActionResult Delete(int id) { ViewBag.menu = "Patients"; SessionInitialize(); PatientCAD cadPos = new PatientCAD(); PatientCEN cen = new PatientCEN(cadPos); cen.Destroy(id); PatientEN pos = cen.ReadOID(id); SessionClose(); if (pos == null) { TempData["resultado"] = Resources.textos.deleteOK; TempData["ok"] = "success"; } else { TempData["resultado"] = Resources.textos.errorKO; TempData["ok"] = "danger"; } return(RedirectToAction("Index")); }
public void SetBirthDate(int p_oid, Nullable <DateTime> p_birthDate) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setBirthDate) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID(p_oid); if (patient != null) { if (p_birthDate != null) { patient.BirthDate = p_birthDate; patientCAD.Modify(patient); } } } /*PROTECTED REGION END*/ }
// GET: DashBoard/DashBoard public ActionResult Index() { ViewBag.menu = "inicio"; SessionInitialize(); LocationCAD cadPos = new LocationCAD(); LocationCEN cen = new LocationCEN(cadPos); IList <LocationEN> listLocations = cen.ReadAll(0, -1); ViewBag.numLocations = listLocations.Count; PractitionerCAD cadPrac = new PractitionerCAD(); PractitionerCEN cenPrac = new PractitionerCEN(cadPrac); IList <PractitionerEN> listPracticioners = cenPrac.ReadAll(0, -1); ViewBag.numPractitioners = listPracticioners.Count; PatientCAD cadPatient = new PatientCAD(); PatientCEN cenPatient = new PatientCEN(cadPatient); IList <PatientEN> listPatients = cenPatient.ReadAll(0, -1); ViewBag.numPatients = listPatients.Count; MedicationCAD cadMedication = new MedicationCAD(); MedicationCEN cenMedication = new MedicationCEN(cadMedication); IList <MedicationEN> listMedications = cenMedication.ReadAll(0, -1); ViewBag.numMedications = listMedications.Count; CarePlanCAD cadCarePlan = new CarePlanCAD(); CarePlanCEN cenCarePlan = new CarePlanCEN(cadCarePlan); IList <CarePlanEN> listCarePlans = cenCarePlan.ReadAll(0, -1); ViewBag.numCarePlans = listCarePlans.Count; GoalCAD cadGoal = new GoalCAD(); GoalCEN cenGoal = new GoalCEN(cadGoal); IList <GoalEN> listGoals = cenGoal.ReadAll(0, -1); ViewBag.numGoals = listGoals.Count; SpecialtyCAD cadSpecialty = new SpecialtyCAD(); SpecialtyCEN cenSpecialty = new SpecialtyCEN(cadSpecialty); IList <SpecialtyEN> listSpecialtys = cenSpecialty.ReadAll(0, -1); ViewBag.numSpecialtys = listSpecialtys.Count; EncounterCAD cadEncounter = new EncounterCAD(); EncounterCEN cenEncounter = new EncounterCEN(cadEncounter); IList <EncounterEN> listEncounters = cenEncounter.ReadAll(0, -1); ViewBag.numEncounters = listEncounters.Count; SessionClose(); return(View("~/Areas/DashBoard/Views/Home/DashBoard.cshtml")); }
public ActionResult Create(FormCollection collection, HttpPostedFileBase imagen) { ViewBag.menu = "Patients"; try { SessionInitialize(); PatientCAD cadPos = new PatientCAD(); PatientCEN cen = new PatientCEN(cadPos); string name = collection["Name"].ToString(); string tel = collection["Phone"].ToString(); string email = collection["Email"].ToString(); string photo = string.Empty; int tamMax = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["tamMaxImgProd"].ToString()); if (imagen != null) { if (imagen.ContentLength < (tamMax)) { if (IsImage(imagen)) { string nombreImagen = "img_" + name + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + Path.GetExtension(imagen.FileName); var path = Server.MapPath("~/Content/images/"); imagen.SaveAs(Path.Combine(path + nombreImagen)); photo = nombreImagen; } else { TempData["resultado"] = Resources.textos.errorKO; TempData["ok"] = "danger"; } } else { TempData["resultado"] = Resources.textos.errorKO; TempData["ok"] = "danger"; } } cen.New_("-", true, name, "-", GenderEnum.other, DateTime.Now, false, "-", email, tel, MaritalStatusEnum.divorced, photo, null, null, "-"); SessionClose(); TempData["resultado"] = Resources.textos.createOK; TempData["ok"] = "success"; return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.error = ex.Message; return(View()); } }
public ActionResult Edit(int id, FormCollection collection, HttpPostedFileBase imagen) { ViewBag.menu = "Patients"; PatientCAD cadPos = new PatientCAD(); PatientCEN cen = new PatientCEN(cadPos); PatientEN positionEN = null; try { positionEN = cen.ReadOID(id); positionEN.Name = collection["Name"].ToString(); positionEN.Phone = collection["Phone"].ToString(); positionEN.Email = collection["Email"].ToString(); int tamMax = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["tamMaxImgProd"].ToString()); if (imagen != null) { if (imagen.ContentLength < (tamMax)) { if (IsImage(imagen)) { string nombreImagen = "img_" + positionEN.Name + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + Path.GetExtension(imagen.FileName); var path = Server.MapPath("~/Content/images/"); imagen.SaveAs(Path.Combine(path + nombreImagen)); positionEN.Photo = nombreImagen; } else { TempData["resultado"] = Resources.textos.errorKO; TempData["ok"] = "success"; } } else { TempData["resultado"] = Resources.textos.errorKO; TempData["ok"] = "success"; } } cen.Modify(positionEN.Identifier, positionEN.Nif, positionEN.Active, positionEN.Name, positionEN.Surnames, positionEN.Gender, positionEN.BirthDate, positionEN.Deceased, positionEN.Address, positionEN.Email, positionEN.Phone, positionEN.MaritalStatus, positionEN.Photo, positionEN.Password); TempData["resultado"] = Resources.textos.editOK; TempData["ok"] = "success"; return(RedirectToAction("Index")); } catch (Exception ex) { positionEN = cen.ReadOID(id); ViewBag.error = ex.Message; return(View(positionEN)); } }
public void SetRelationship(int p_oid, int p_oid_patient, int p_oid_relatedPerson) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Relationship_setRelationship) ENABLED START*/ // Write here your custom code... RelationshipCAD relationshipCAD = new RelationshipCAD(); RelationshipCEN relationshipCEN = new RelationshipCEN(relationshipCAD); PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCen = new PatientCEN(patientCAD); RelatedPersonCAD relatedPersonCAD = new RelatedPersonCAD(); RelatedPersonCEN relatedPersonCEN = new RelatedPersonCEN(relatedPersonCAD); if (p_oid > 0) { RelationshipEN relationship = relationshipCEN.ReadOID(p_oid); if (relationship != null) { if (p_oid_patient > 0) { PatientEN patient = patientCen.ReadOID(p_oid_patient); if (patient != null) { if (p_oid_relatedPerson > 0) { RelatedPersonEN relatedPerson = relatedPersonCEN.ReadOID(p_oid_relatedPerson); if (relatedPerson != null) { relationship.PatientOID = p_oid_patient; relationship.RelatedPersonOID = p_oid_relatedPerson; relationshipCAD.Modify(relationship); } } } } } } /*PROTECTED REGION END*/ }
public void SetActive (int p_oid, bool p_active) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_setActive) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD (); PatientCEN patientCEN = new PatientCEN (patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID (p_oid); if (patient != null) { patient.Active = p_active; patientCAD.Modify (patient); } } /*PROTECTED REGION END*/ }
public bool Logout(int p_oid) { /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Patient_logout) ENABLED START*/ // Write here your custom code... PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(patientCAD); if (p_oid > 0) { PatientEN patient = patientCEN.ReadOID(p_oid); if (patient != null) { return(true); } } return(false); /*PROTECTED REGION END*/ }
// GET: DashBoard/Patient/Details/5 public ActionResult Details(int id) { SessionInitialize(); string resultado = ""; string locationNombre = Resources.textos.modelEmpty; PatientCAD cadPos = new PatientCAD(); PatientCEN cen = new PatientCEN(cadPos); PatientEN posEN = cen.ReadOID(id); Dictionary <string, string> res = new Dictionary <string, string>(); if (posEN != null) { if (posEN.Name != null) { locationNombre = posEN.Name; } if (string.IsNullOrEmpty(posEN.Photo)) { posEN.Photo = "default.png"; } resultado = "<ul><li><strong>Id: </strong>" + posEN.Identifier + "</li><li><strong>Nombre: </strong>" + posEN.Name + "</li><li><strong>Teléfono: </strong>" + posEN.Phone + "</li><li><strong>Email: </strong>" + posEN.Email + "</li><li><strong>Dirección: </strong>" + posEN.Address + "</li></ul>"; res.Add("titulo", Resources.textos.detailsModal + posEN.Identifier + " " + "<img src = '/Content/images/" + posEN.Photo + "' height = '32' width = '32' />"); } else { resultado = "<p>" + Resources.textos.errorDataModal + " " + id.ToString() + "</p>"; res.Add("titulo", Resources.textos.modalTitulo); } res.Add("contenido", resultado); SessionClose(); return(Json(res)); }
// GET: DashBoard/Patient public ActionResult Index() { IEnumerable <Patient> listPos = null; try { SessionInitialize(); PractitionerCAD cadPrac = new PractitionerCAD(); PractitionerCEN cenPrac = new PractitionerCEN(cadPrac); PatientCAD cad = new PatientCAD(); PatientCEN cen = new PatientCEN(cad); IList <PatientEN> listPosEn = cen.ReadAll(0, -1); listPos = new AssemblerPatient().ConvertListENToModel(listPosEn).ToList(); foreach (Patient p in listPos) { if (string.IsNullOrEmpty(p.Imagen)) { p.Imagen = "default.png"; } } SessionClose(); } catch (Exception ex) { TempData["resultado"] = Resources.textos.modelEmpty; TempData["ok"] = "warning"; } ViewBag.menu = "Patients"; return(View(listPos)); }
// GET: DashBoard/Patient/Edit/5 public ActionResult Edit(int id) { ViewBag.menu = "Patients"; PatientEN positionEN = null; Patient pos = null; try { SessionInitialize(); PatientCAD cadPos = new PatientCAD(); PatientCEN cen = new PatientCEN(cadPos); positionEN = cen.ReadOID(id); pos = new AssemblerPatient().ConvertENToModelUI(positionEN); SessionClose(); } catch (Exception ex) { ViewBag.error = "Error: " + ex.Message; } return(View(pos)); }
public static void InitializeData() { /*PROTECTED REGION ID(initializeDataMethod) ENABLED START*/ try { // Insert the initilizations of entities using the CEN classes PatientCAD patientCAD = new PatientCAD(); PatientCEN patientCEN = new PatientCEN(); LocationCAD locationCAD = new LocationCAD(); LocationCEN locationCEN = new LocationCEN(); DiaryCAD diaryCAD = new DiaryCAD(); DiaryCEN diaryCEN = new DiaryCEN(); PractitionerCAD practitionerCAD = new PractitionerCAD(); PractitionerCEN practitionerCEN = new PractitionerCEN(); EncounterCAD encounterCAD = new EncounterCAD(); EncounterCEN encounterCEN = new EncounterCEN(); RelatedPersonCAD relatedPersonCAD = new RelatedPersonCAD(); RelatedPersonCEN relatedPersonCEN = new RelatedPersonCEN(); ScheduleCAD scheduleCAD = new ScheduleCAD(); ScheduleCEN scheduleCEN = new ScheduleCEN(); SlotCAD slotCAD = new SlotCAD(); SlotCEN slotCEN = new SlotCEN(); ConditionCAD conditionCAD = new ConditionCAD(); ConditionCEN conditionCEN = new ConditionCEN(); ConversationCAD conversationCAD = new ConversationCAD(); ConversationCEN conversationCEN = new ConversationCEN(); MessageCAD messageCAD = new MessageCAD(); MessageCEN messageCEN = new MessageCEN(); ReclamationCAD reclamationCAD = new ReclamationCAD(); ReclamationCEN reclamationCEN = new ReclamationCEN(); ReclamationResponseCAD reclamationResponseCAD = new ReclamationResponseCAD(); ReclamationResponseCEN reclamationResponseCEN = new ReclamationResponseCEN(); ObservationCAD observationCAD = new ObservationCAD(); ObservationCEN observationCEN = new ObservationCEN(); PositionCAD positionCAD = new PositionCAD(); PositionCEN positionCEN = new PositionCEN(); CarePlanCAD carePlanCAD = new CarePlanCAD(); CarePlanCEN carePlanCEN = new CarePlanCEN(); ActivityCAD activityCAD = new ActivityCAD(); ActivityCEN activityCEN = new ActivityCEN(); GoalCAD goalCAD = new GoalCAD(); GoalCEN goalCEN = new GoalCEN(); MedicationCAD medicationCAD = new MedicationCAD(); MedicationCEN medicationCEN = new MedicationCEN(); IngredientCAD ingredientCAD = new IngredientCAD(); IngredientCEN ingredientCEN = new IngredientCEN(); ConditionCodeCAD conditionCodeCAD = new ConditionCodeCAD(); ConditionCodeCEN conditionCodeCEN = new ConditionCodeCEN(); SubstanceCodeCAD substanceCodeCAD = new SubstanceCodeCAD(); SubstanceCodeCEN substanceCodeCEN = new SubstanceCodeCEN(); CarePlanCategoryCAD carePlanCategoryCAD = new CarePlanCategoryCAD(); CarePlanCategoryCEN carePlanCategoryCEN = new CarePlanCategoryCEN(); SpecialtyCAD specialtyCAD = new SpecialtyCAD(); SpecialtyCEN specialtyCEN = new SpecialtyCEN(); RelationshipCAD relationshipCAD = new RelationshipCAD(); RelationshipCEN relationshipCEN = new RelationshipCEN(); AdministratorCAD administratorCAD = new AdministratorCAD(); AdministratorCEN administratorCEN = new AdministratorCEN(administratorCAD); AssessmentCAD assessmentCAD = new AssessmentCAD(); AssessmentCEN assessmentCEN = new AssessmentCEN(assessmentCAD); //CAD CAD = new CAD(); //CEN CEN = new CEN(); //Creamos ConditionCode int conditionCode1 = conditionCodeCEN.New_("412775002", "Apraxia of dressing"); ConditionCodeEN conditionCode1EN = conditionCodeCEN.ReadOID(conditionCode1); //Creamos CarePlanCategory int carePlanCategory1 = carePlanCategoryCEN.New_("000002", "Asthma clinical management plan"); CarePlanCategoryEN carePlanCategory1EN = carePlanCategoryCEN.ReadOID(carePlanCategory1); // Creamos Locations int location1 = locationCEN.New_(LocationStatusEnum.active, "LocationName1", "LocationDescription1", LocationModeEnum.public_location, LocationTypeEnum.hospital, "address", LocationPhysicalTypeEnum.building, "ManagingOrg", "223322223", "*****@*****.**", "03183"); // Asignamos Position a Location locationCEN.ReadOID(location1).Position = positionCEN.ReadOID(positionCEN.New_(1.11111, 1.22222, 1.33333, location1)); int location2 = locationCEN.New_(LocationStatusEnum.active, "LocationName2", "LocationDescription2", LocationModeEnum.private_location, LocationTypeEnum.pharmacy, "address", LocationPhysicalTypeEnum.building, "ManagingOrg", "telf", "*****@*****.**", "CP"); // Asignamos Position a Location locationCEN.AssignPosition(location1, positionCEN.New_(2.11111, 2.22222, 2.33333, location2)); // Creamos Patients IList <int> locationsPatient1 = new List <int>(); locationsPatient1.Add(location1); int patient1 = patientCEN.New_("nif", true, "name", "surname1 surname2", GenderEnum.unknown, new DateTime(2014, 12, 12), false, "address", "*****@*****.**", "telf", MaritalStatusEnum.married, "photo", locationsPatient1, null, "password"); int patient2 = patientCEN.New_("nif2", true, "name2", "surname21 surname22", GenderEnum.male, new DateTime(2000, 02, 12), false, "address2", "*****@*****.**", "telf2", MaritalStatusEnum.single, "photo2", locationsPatient1, null, "password2"); // Asignamos Diary al Patient patientCEN.AssignDiary(patient1, diaryCEN.New_(patient1)); patientCEN.AssignDiary(patient2, diaryCEN.New_(patient2)); //Asignamos Location al Patient patientCEN.AssignLocation(patient1, locationsPatient1); //Creamos Pratitioner IList <int> locationsPractitioner1 = new List <int>(); locationsPractitioner1.Add(location1); IList <int> locationsPractitioner2 = new List <int>(); locationsPractitioner1.Add(location2); int practitioner1 = practitionerCEN.New_("nif", true, PractitionerRoleEnum.physician, "name", "surname1 surname2", GenderEnum.other, new DateTime(2014, 12, 12), "address", "*****@*****.**", "telf", "photo", new DateTime(2014, 12, 12), new DateTime(2014, 12, 12), locationsPractitioner1, "password"); int practitioner2 = practitionerCEN.New_("nif2", true, PractitionerRoleEnum.nurse, "name2", "surname12 surname22", GenderEnum.female, new DateTime(1914, 12, 11), "address2", "*****@*****.**", "telf2", "photo2", new DateTime(2014, 10, 12), new DateTime(2014, 12, 12), locationsPractitioner2, "password2"); IList <int> practitionersPatient1 = new List <int>(); practitionersPatient1.Add(practitioner1); //Asignamos Practitioners a Patient patientCEN.AssignPractitioner(patient1, practitionersPatient1); // Asignamos Practitioner al Diary diaryCEN.AssignPractitioner(patientCEN.ReadOID(patient1).Diary.Identifier, practitionersPatient1); //Creamos Specialty int specialty1 = specialtyCEN.New_("409967009", "Toxicology"); int specialty2 = specialtyCEN.New_("408467006", "Adult mental illness"); IList <int> specialtiesPractitioner1 = new List <int>(); specialtiesPractitioner1.Add(specialty1); specialtiesPractitioner1.Add(specialty2); //Asignamos Specialty a Practitioner practitionerCEN.AssignSpecialty(practitioner1, specialtiesPractitioner1 [0]); //Creamos RelatedPerson IList <int> patientsRelatedPerson1 = new List <int>(); patientsRelatedPerson1.Add(patient1); int relatedPerson1 = relatedPersonCEN.New_("nif", "name", "surname1, surname2", GenderEnum.male, new DateTime(2014, 12, 12), "address", "email", "tlf", "photo", new DateTime(2014, 12, 12), new DateTime(2014, 12, 12), "password", true); int relatedPerson2 = relatedPersonCEN.New_("nif2", "name2", "surname21, surname22", GenderEnum.male, new DateTime(2014, 12, 12), "address", "email", "tlf", "photo", new DateTime(2014, 12, 12), new DateTime(2014, 12, 12), "password", true); IList <int> relatedPersonsPatient1 = new List <int>(); relatedPersonsPatient1.Add(relatedPerson1); IList <int> patientsRelatedPerson2 = new List <int>(); patientsRelatedPerson2.Add(patient2); //Creamos Relationship int relationship_relatedPerson1_patient1 = relationshipCEN.New_(RelationshipEnum.friend, patient1, relatedPerson1); //Asignamos RelatedPerson al Patient patientCEN.AssignRelatedPerson(patient1, relatedPersonsPatient1); //Asignamos Patient a RelatedPerson relatedPersonCEN.AssignPatient(relatedPerson2, patientsRelatedPerson2); //Creamos Observations with Symptom, Measure, Factor int observation1 = observationCEN.New_(MeasureTypeEnum.Blood_preassure_systolic_y_diastolic, "name", new DateTime(2014, 12, 12), "note", new DateTime(2014, 12, 12), patientCEN.ReadOID(patient1).Diary.Identifier, new DateTime(2014, 12, 12), ObservationCategoryEnum.factor, SymptomGradeEnum.four, 120, 80, patient1); //Creamos Schedules int schedule1_practitioner1 = scheduleCEN.New_(practitioner1, location1, false, new DateTime(2017, 08, 02, 09, 30, 00), new DateTime(2017, 08, 02, 13, 00, 00), new DateTime(2017, 08, 02, 17, 30, 00), new DateTime(2017, 08, 02, 20, 00, 00), new DateTime(2017, 08, 02), new DateTime(2017, 09, 01)); int schedule2_practitioner1 = scheduleCEN.New_(practitioner1, location1, false, new DateTime(2017, 08, 02, 09, 30, 00), new DateTime(2017, 08, 02, 18, 00, 00), new DateTime(2017, 08, 02, 18, 00, 00), new DateTime(2017, 08, 02, 18, 00, 00), new DateTime(2017, 08, 02), new DateTime(2017, 09, 01)); int schedule1_practitioner2 = scheduleCEN.New_(practitioner2, location2, true, new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 09, 01)); int schedule2_practitioner2 = scheduleCEN.New_(practitioner2, location2, false, new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 08, 02), new DateTime(2017, 09, 01)); //Creamos Slots int slot1_schedule1_practitioner1 = slotCEN.New_(SlotStatusEnum.busy, new DateTime(2017, 04, 02, 8, 0, 0), new DateTime(2017, 04, 02, 8, 15, 0), "note", schedule1_practitioner1); int slot2_schedule1_practitioner1 = slotCEN.New_(SlotStatusEnum.free, new DateTime(2017, 04, 02, 8, 15, 0), new DateTime(2017, 04, 02, 8, 30, 0), "note", schedule1_practitioner2); //Creamos Encounters IList <int> practitionersEncounter1 = new List <int>(); practitionersEncounter1.Add(practitioner1); int encounter1 = encounterCEN.New_(EncounterStatusEnum.planned, EncounterTypeEnum.consultation, EncounterPriorityEnum.as_needed, new DateTime(2017, 04, 02, 8, 0, 0), new DateTime(2017, 04, 02, 8, 15, 0), "Para variar", "Seguridad social", patient1, practitionersEncounter1, null, slot1_schedule1_practitioner1, "note"); //Creamos Condition int condition1 = conditionCEN.New_(encounter1, ConditionCategoryEnum.encounter_diagnosis, ConditionClinicalStatusEnum.recurrence, ConditionSeverityEnum.severe, "onset", "abatement", "note"); conditionCEN.AssignConditionCode(condition1, conditionCode1); //ConditionEN condition1EN = conditionCEN.ReadOID (condition1); //condition1EN.ConditionCode = conditionCode1EN; //Creamos CarePlan int carePlan1 = carePlanCEN.New_("subject", CarePlanStatusEnum.active, "context", new DateTime(2017, 04, 03), new DateTime(2017, 04, 03), "description", "note", encounter1, new DateTime(2017, 06, 30)); IList <int> categoriesCarePlan1 = new List <int>(); categoriesCarePlan1.Add(carePlanCategory1); carePlanCEN.AssignCategory(carePlan1, categoriesCarePlan1); //Creamos Goal int goal1 = goalCEN.New_("subject", new DateTime(2017, 04, 03), "target", GoalCategoryEnum.behavioral, "description", GoalStatusEnum.process, GoalPriorityEnum.medium, "note", carePlan1); //Creamos Activity int activity1 = activityCEN.New_("progress", "description", carePlan1, new DateTime(2017, 04, 10), new DateTime(2017, 04, 11)); //Creamos Medication int medication1 = medicationCEN.New_("name", "manufacturer", "description", FormEnum.capsule, 2.2, "dosage", MedicationStatusEnum.active, true); int medication2 = medicationCEN.New_("name2", "manufacturer2", "description2", FormEnum.powder, 0.004, "dosage2", MedicationStatusEnum.active, false); IList <int> medicationsActivity1 = new List <int>(); medicationsActivity1.Add(medication1); //Asignamos Medication a Activity activityCEN.AssignMedication(activity1, medicationsActivity1); //Creamos SubstanceCode int substanceCode1 = substanceCodeCEN.New_("12006", "Ornithine racemase"); SubstanceCodeEN substanceCode1EN = substanceCodeCEN.ReadOID(substanceCode1); int substanceCode2 = substanceCodeCEN.New_("102002", "Hemoglobin Okaloosa"); //Creamos Ingredients int ingredient1 = ingredientCEN.New_("2.2 mg", true, substanceCode1); int ingredient2 = ingredientCEN.New_("3.0 ml", true, substanceCode2); int ingredient3 = ingredientCEN.New_("3.88 kg", true, substanceCode2); IList <int> ingredientsMedication1 = new List <int>(); ingredientsMedication1.Add(ingredient1); ingredientsMedication1.Add(ingredient2); IList <int> ingredientsMedication2 = new List <int>(); ingredientsMedication2.Add(ingredient2); ingredientsMedication2.Add(ingredient3); //Asignamos ingredient a Medication medicationCEN.AssignIngredient(medication1, ingredientsMedication1); medicationCEN.AssignIngredient(medication2, ingredientsMedication2); //Creamos Conversation2 IList <MessageEN> messagesConversation2 = new List <MessageEN>(); int conversation2 = conversationCEN.New_(new DateTime(2017, 04, 01), messagesConversation2, practitioner1); ConversationEN conversation2EN = new ConversationEN(); conversation2EN = conversationCEN.ReadOID(conversation2); conversationCEN.AssignPatient(conversation2, patient1); //Creamos Messages2 int message12 = messageCEN.New_(new DateTime(2017, 03, 01), "content", true, conversation2, "attachment"); MessageEN message12EN = messageCEN.ReadOID(message12); messagesConversation2.Add(message12EN); int message22 = messageCEN.New_(new DateTime(2017, 03, 01), "content", false, conversation2, "attachment"); MessageEN message22EN = messageCEN.ReadOID(message22); messagesConversation2.Add(message22EN); //Creamos Conversation3 IList <MessageEN> messagesConversation3 = new List <MessageEN>(); int conversation3 = conversationCEN.New_(new DateTime(2017, 04, 01), messagesConversation3, practitioner2); ConversationEN conversation3EN = new ConversationEN(); conversation3EN = conversationCEN.ReadOID(conversation3); conversationCEN.AssignRelatedPerson(conversation3, relatedPerson1); //Creamos Messages2 int message13 = messageCEN.New_(new DateTime(2017, 03, 01), "content", true, conversation3, "attachment"); MessageEN message13EN = messageCEN.ReadOID(message13); messagesConversation3.Add(message12EN); int message23 = messageCEN.New_(new DateTime(2017, 03, 01), "content", false, conversation3, "attachment"); MessageEN message23EN = messageCEN.ReadOID(message23); messagesConversation3.Add(message22EN); //Creamos Reclamation int reclamation1 = reclamationCEN.New_(ReclamationActionEnum.changePractitioner, "subject", "content", new DateTime(2017, 04, 01), practitioner1, "note", false, ReclamationTypeEnum.administrative); //Creamos ReclamationResponse int reclamation1Response1 = reclamationResponseCEN.New_("response", ReclamationResponseActionStateEnum.taken, new DateTime(2017, 04, 01), reclamation1); //Creamos Administrador int administrator1 = administratorCEN.New_("Juan", GenderEnum.male, DateTime.Now, "sinFoto", "unEmail", "1234", "Velasco", "555A", "UnaDireccion", "966459877"); //Creamos assessment int assessment1 = assessmentCEN.New_(4, practitioner1, patient2, -1); int assessment2 = assessmentCEN.New_(3, practitioner2, -1, relatedPerson2); int assessment3 = assessmentCEN.New_(1, practitioner2, patient1, -1); //Creamos customs Administrador administratorCEN.SetBirthDate(administrator1, new DateTime(1984, 5, 25)); administratorCEN.SetEmail(administrator1, "*****@*****.**"); administratorCEN.SetGender(administrator1, GenderEnum.unknown); administratorCEN.SetPassword(administrator1, "1235", "PassNoValida"); administratorCEN.SetPassword(administrator1, "1234", "PassValida"); administratorCEN.SetPhoto(administrator1, "FotoPreciosa.jpg"); administratorCEN.Login("555A", "PassValida"); administratorCEN.Logout(administrator1); //Creamos customs Assessment assessmentCEN.SetRating(assessment2, 5); //Creamos customs CarePlan carePlanCEN.SetEndDate(carePlan1, new DateTime(2017, 11, 27)); carePlanCEN.SetModified(carePlan1, new DateTime(2017, 5, 13)); //Creamos customs Condition conditionCEN.SetNote(condition1, "La nota de pruebas de Mayo"); //Creamos customs Encounter encounterCEN.SetNote(encounter1, "La nota para los encounters"); encounterCEN.SetPriority(encounter1, EncounterPriorityEnum.timing_critical); encounterCEN.SetStatus(encounter1, EncounterStatusEnum.planned); //Creamos customs Goal goalCEN.SetStatus(goal1, GoalStatusEnum.failure); goalCEN.SetStatusDate(goal1, new DateTime(2017, 05, 13)); //Creamos customs Location locationCEN.SetEmail(location1, "*****@*****.**"); locationCEN.SetManagingOrganization(location1, "Una organización chula"); locationCEN.SetMode(location1, LocationModeEnum.private_location); locationCEN.SetPhone(location1, "555999666"); locationCEN.SetPhysicalType(location1, LocationPhysicalTypeEnum.vehicle); locationCEN.SetStatus(location1, LocationStatusEnum.suspended); locationCEN.SetType(location1, LocationTypeEnum.pharmacy); //Creamos customs Medication medicationCEN.SetDosage(medication1, "Dosis de prueba"); medicationCEN.SetRate(medication1, 4.75); medicationCEN.SetStatus(medication1, MedicationStatusEnum.inactive); //Creamos customs Message messageCEN.SetIsRead(message13, true); //Creamos customs Observations observationCEN.SetDateObservation(observation1, new DateTime(2017, 05, 13)); observationCEN.SetMeasureType(observation1, MeasureTypeEnum.Heart_rate); observationCEN.SetNote(observation1, "Nota prueba set correcta"); observationCEN.SetSymptomGrade(observation1, SymptomGradeEnum.three); observationCEN.SetValue1(observation1, 451.78); observationCEN.SetValue2(observation1, 43.1); //Creamos customs Patients patientCEN.SetActive(patient1, false); patientCEN.SetAddress(patient1, "Direccion de prueba set funciona"); patientCEN.SetBirthDate(patient1, new DateTime(1978, 12, 12)); patientCEN.SetDeceased(patient1, true); patientCEN.SetEmail(patient1, "Email de prueba set funciona"); patientCEN.SetMaritalStatus(patient1, MaritalStatusEnum.widowed); patientCEN.SetName(patient1, "Nombre de prueba set funciona"); patientCEN.SetPassword(patient1, "passwordIncorecta", "1234"); patientCEN.SetPassword(patient1, "password", "123456789"); patientCEN.SetPhone(patient1, "Teléfono de prueba set funciona"); patientCEN.SetSurnames(patient1, "Apellidos de prueba set funciona"); patientCEN.Login("inventado", "inventado"); patientCEN.Login("nif", "123456789"); patientCEN.Logout(-458787454); patientCEN.Logout(458787454); patientCEN.Logout(patient1); //Creamos customs Practitioners practitionerCEN.SetActive(practitioner1, false); practitionerCEN.SetAddress(practitioner1, "Direccion de prueba set funciona"); practitionerCEN.SetEmail(practitioner1, "Email de prueba set funciona"); practitionerCEN.SetEndDate(practitioner1, new DateTime(2017, 09, 15)); practitionerCEN.SetPassword(practitioner1, "passwordIncorecta", "1234"); practitionerCEN.SetPassword(practitioner1, "password", "123456789"); practitionerCEN.SetPhone(practitioner1, "Teléfono de prueba set funciona"); practitionerCEN.SetPhoto(practitioner1, "Foto de prueba set funciona"); practitionerCEN.SetRole(practitioner1, PractitionerRoleEnum.receptionist); practitionerCEN.Login("inventado", "inventado"); practitionerCEN.Login("nif", "123456789"); practitionerCEN.Logout(-458787454); practitionerCEN.Logout(458787454); practitionerCEN.Logout(practitioner1); //Creamos customs Reclamation reclamationCEN.SetNote(reclamation1, "Nota de prueba set funciona"); reclamationCEN.SetResolved(reclamation1, false); //Creamos customs RelatedPerson relatedPersonCEN.SetAddress(relatedPerson1, "Dirección de prueba set funciona"); relatedPersonCEN.SetEmail(relatedPerson1, "Email de prueba set funciona"); relatedPersonCEN.SetEndDate(relatedPerson1, new DateTime(2017, 6, 20)); relatedPersonCEN.SetPassword(relatedPerson1, "password1", "1234"); relatedPersonCEN.SetPassword(relatedPerson1, "password", "abc123"); relatedPersonCEN.SetPhone(relatedPerson1, "Telefono de prueba set funciona"); relatedPersonCEN.SetPhoto(relatedPerson1, "Photo de prueba set funciona"); relatedPersonCEN.Login("inventado", "inventado"); relatedPersonCEN.Login("nif", "abc123"); relatedPersonCEN.Logout(-555); relatedPersonCEN.Logout(789545896); relatedPersonCEN.Logout(relatedPerson1); //Creamos customs RelationShip relationshipCEN.SetRelationshipType(relationship_relatedPerson1_patient1, RelationshipEnum.caregiver); relationshipCEN.SetRelationship(relationship_relatedPerson1_patient1, patient1, relatedPerson2); //Creamos customs Schedule scheduleCEN.SetActive(schedule1_practitioner1, false); scheduleCEN.SetMorningStart(schedule1_practitioner1, new DateTime(2017, 5, 1, 9, 00, 00)); scheduleCEN.SetMorningEnd(schedule1_practitioner1, new DateTime(2017, 5, 1, 13, 00, 00)); scheduleCEN.SetAfternoonStart(schedule1_practitioner1, new DateTime(2017, 5, 1, 15, 00, 00)); scheduleCEN.SetAfternoonEnd(schedule1_practitioner1, new DateTime(2017, 5, 1, 19, 00, 00)); scheduleCEN.SetDateStart(schedule1_practitioner1, new DateTime(2017, 5, 1)); scheduleCEN.SetDateEnd(schedule1_practitioner1, new DateTime(2018, 1, 1)); slotCEN.SetNote(slot1_schedule1_practitioner1, "Prueba nota set funciona"); slotCEN.SetStartDate(slot1_schedule1_practitioner1, new DateTime(2017, 05, 18, 10, 00, 00)); slotCEN.SetEndDate(slot1_schedule1_practitioner1, new DateTime(2017, 05, 18, 10, 15, 00)); slotCEN.SetStatus(slot1_schedule1_practitioner1, SlotStatusEnum.busy); IList <LocationEN> listaLocations = locationCEN.ReadAll(0, -1); List <int> numPacientesCentro = new List <int>(); foreach (LocationEN loc in listaLocations) { IList <PatientEN> listaPacientes = patientCEN.GetPatientsByLocation(loc.Identifier); numPacientesCentro.Add(listaPacientes.Count); } List <int> numPractitionerCentro = new List <int>(); foreach (LocationEN loc in listaLocations) { IList <PractitionerEN> listaPacientes = practitionerCEN.GetPractitionersByLocation(loc.Identifier); numPractitionerCentro.Add(listaPacientes.Count); } /*PROTECTED REGION END*/ } catch (Exception ex) { System.Console.WriteLine(ex.InnerException); throw ex; } }