コード例 #1
0
 public DiagnosisDataSource(DiagnosisType Diagnosis)
 {
     IsVisibleTotal = true;
     IsFilteredPt   = false;
     this.Data      = Diagnosis;
     IsChecked      = false;
 }
コード例 #2
0
        public ActionResult Create(newDiagnosis data)
        {
            VisitDate visit = db.visits.Include(v => v.diagnoses).Where(v => v.ID == data.visitID).First();

            if (visit == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }

            Pacient pacient = db.pacients.Where(p => p.visits.Any(v => v.ID == data.visitID)).First();

            if (pacient == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }

            if (ModelState.IsValid)
            {
                DiagnosisType type = db.diagnosisTypes.Where(a => a.ID == data.diagnosis.type.ID).First();
                data.diagnosis.type = type;
                visit.diagnoses.Add(data.diagnosis);

                db.SaveChanges();
                return(PartialView("/views/Diagnoses/pacientDetails.cshtml", data.diagnosis));
            }
            return(PartialView("/views/Diagnoses/pacientCreate.cshtml", data));
        }
コード例 #3
0
        /// <summary>
        /// Updates or creates a resource based on the resource identifier. The PUT operation is used to update or create a resource by identifier.  If the resource doesn't exist, the resource will be created using that identifier.  Additionally, natural key values cannot be changed using this operation, and will not be modified in the database.  If the resource &quot;id&quot; is provided in the JSON body, it will be ignored as well.
        /// </summary>
        /// <param name="id">A resource identifier specifying the resource to be updated.</param>
        /// <param name="IfMatch">The ETag header value used to prevent the PUT from updating a resource modified by another consumer.</param>
        /// <param name="body">The JSON representation of the &quot;diagnosisType&quot; resource to be updated.</param>
        /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns>
        public IRestResponse PutDiagnosisType(string id, string IfMatch, DiagnosisType body)
        {
            var request = new RestRequest("/diagnosisTypes/{id}", Method.PUT);

            request.RequestFormat = DataFormat.Json;

            request.AddUrlSegment("id", id);
            // verify required params are set
            if (id == null || body == null)
            {
                throw new ArgumentException("API method call is missing required parameters");
            }
            request.AddHeader("If-Match", IfMatch);
            request.AddBody(body);
            request.Parameters.First(param => param.Type == ParameterType.RequestBody).Name = "application/json";
            var response = client.Execute(request);

            var location = response.Headers.FirstOrDefault(x => x.Name == "Location");

            if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString()))
            {
                body.id = location.Value.ToString().Split('/').Last();
            }
            return(response);
        }
コード例 #4
0
        public ActionResult CreateByDate(newDiagnosis data)
        {
            Pacient pacient = db.pacients.Include(p => p.visits.Select(v => v.diagnoses)).Include(p => p.doctor).Where(p => p.ID == data.pacientID).First();

            if (pacient == null)
            {
                return(RedirectToAction("Index", "Pacients"));
            }
            VisitDate visit = pacient.visits.Where(v => v.date == data.initialDate).FirstOrDefault();

            if (visit != null)
            {
                DiagnosisType type = db.diagnosisTypes.Where(a => a.ID == data.diagnosis.type.ID).First();
                data.diagnosis.type = type;
                visit.diagnoses.Add(data.diagnosis);
                db.SaveChanges();
                return(PartialView("/views/Diagnoses/pacientDetails.cshtml", data.diagnosis));
            }
            else
            {
                DiagnosisType type = db.diagnosisTypes.Where(a => a.ID == data.diagnosis.type.ID).First();
                data.diagnosis.type = type;
                visit           = new VisitDate();
                visit.doctorID  = pacient.doctor.ID;
                visit.date      = data.initialDate;
                visit.diagnoses = new List <Diagnosis>();
                visit.diagnoses.Add(data.diagnosis);
                pacient.visits.Add(visit);
                db.SaveChanges();
                return(PartialView("/views/Diagnoses/pacientDetails.cshtml", data.diagnosis));
            }
            //return PartialView("/views/Diagnosis/pacientCreate.cshtml", data);
        }
コード例 #5
0
        public List <PatientDiagnosis> Resolve()
        {
            foreach (string diagnosisName in _potentialDiagnosisNames)
            {
                if (PrimaryDiagnoses().Contains(diagnosisName))
                {
                    if (_discoveredDiagnoses.Count == 0)
                    {
                        _currentDiagnosisCategory = GetDiagnosisCategoryByName("Primary");
                    }
                    else if (_discoveredDiagnoses.Count == 1)
                    {
                        _currentDiagnosisCategory = GetDiagnosisCategoryByName("Other");
                    }
                    DiagnosisType diagnosisType = GetDiagnosisByName(diagnosisName);
                    CreateAndAddPatientDiagnosis(diagnosisType);
                }
                else
                {
                    var underlyingDiagnoses = _potentialDiagnosisNames.Except(PrimaryDiagnoses());
                    processUnderlyingDiagnoses(underlyingDiagnoses);
                }
            }

            return(_discoveredDiagnoses);
        }
コード例 #6
0
        public override T Convert <T, U>(U entity)
        {
            DiagnosisType diagnosisType = entity as DiagnosisType;

            if (diagnosisType == null)
            {
                return(default(T));
            }

            BO.DiagnosisType diagnosisTypeBO = new BO.DiagnosisType();

            diagnosisTypeBO.ID = diagnosisType.Id;
            diagnosisTypeBO.DiagnosisTypeText = diagnosisType.DiagnosisTypeText;
            //diagnosisTypeBO.CompanyId = diagnosisType.CompanyId;
            diagnosisTypeBO.ICDTypeCodeID = diagnosisType.ICDTypeCodeID;

            if (diagnosisType.IsDeleted.HasValue)
            {
                diagnosisTypeBO.IsDeleted = diagnosisType.IsDeleted.Value;
            }
            if (diagnosisType.UpdateByUserID.HasValue)
            {
                diagnosisTypeBO.UpdateByUserID = diagnosisType.UpdateByUserID.Value;
            }

            return((T)(object)diagnosisTypeBO);
        }
コード例 #7
0
        public List <PatientDiagnosis> ResolveForName(string diagnosisName, string categoryName)
        {
            _currentDiagnosisCategory = GetDiagnosisCategoryByName(categoryName);
            DiagnosisType diagnosisType = GetDiagnosisByName(diagnosisName);

            CreateAndAddPatientDiagnosis(diagnosisType);
            return(_discoveredDiagnoses);
        }
コード例 #8
0
 private static void CheckArguments(FileInfo dumpPath, DiagnosisType diagnose, ReportTypes reportType)
 {
     if (dumpPath == null)
     {
         Console.WriteLine("Missing argument(s). Please use dump-diagnostic -h to look at all the required arguments");
         Environment.Exit(-1);
     }
 }
コード例 #9
0
        public ActionResult DeleteConfirmed(int id)
        {
            DiagnosisType diagnosisType = db.diagnosisTypes.Find(id);

            db.diagnosisTypes.Remove(diagnosisType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #10
0
        //private string _longText;
        //public string LongText
        //{
        //    get { return _longText; }
        //    set
        //    {
        //        _longText = value;
        //        OnPropertyChanged();
        //    }
        //}

        public DiagnosisType GetPanelType()
        {
            var newType = new DiagnosisType();

            //newType.LongName = LongText;
            newType.Str = ShortText;
            return(newType);
        }
コード例 #11
0
 public PatientPASDownloader(List <string> rm2Numbers, AspergillosisContext context, PASDbContext pasContext)
 {
     _newRM2Numbers         = rm2Numbers;
     _context               = context;
     _pasContext            = pasContext;
     _patientAliveStatus    = _context.PatientStatuses.Where(s => s.Name == "Active").FirstOrDefault().ID;
     _patientDeceasedStatus = _context.PatientStatuses.Where(s => s.Name == "Deceased").FirstOrDefault().ID;
     _cpaDiagnosis          = _context.DiagnosisTypes.Where(dt => dt.Name.Contains("Chronic pulmonary aspergillosis")).SingleOrDefault();
     _primaryDiagnosisCat   = _context.DiagnosisCategories.Where(dc => dc.CategoryName == "Primary").SingleOrDefault();
 }
コード例 #12
0
 public ActionResult Edit([Bind(Include = "ID,name,description")] DiagnosisType diagnosisType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(diagnosisType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(diagnosisType));
 }
コード例 #13
0
        public ActionResult Create([Bind(Include = "ID,name,description")] DiagnosisType diagnosisType)
        {
            if (ModelState.IsValid)
            {
                db.diagnosisTypes.Add(diagnosisType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(diagnosisType));
        }
コード例 #14
0
        // GET: DiagnosisTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DiagnosisType diagnosisType = db.diagnosisTypes.Find(id);

            if (diagnosisType == null)
            {
                return(HttpNotFound());
            }
            return(View(diagnosisType));
        }
コード例 #15
0
        private PatientDiagnosis BuildDiagnosisForPatient(string matchingDiagnosis)
        {
            PatientDiagnosis patientDiagnosis = new PatientDiagnosis();

            patientDiagnosis.Patient = _patient;
            DiagnosisType diagnosisType = FindDiagnosisTypeByName(matchingDiagnosis);

            patientDiagnosis.DiagnosisType = diagnosisType;
            DiagnosisCategory diagnosisCategory = ResolveDiagnosisCategory();

            patientDiagnosis.DiagnosisCategory = diagnosisCategory;
            patientDiagnosis.Description       = ExtractDiagnosisNote(matchingDiagnosis);
            return(patientDiagnosis);
        }
コード例 #16
0
        [Authorize] public ActionResult Edit(DiagnosisType obj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    dbActionResult resultAction = new dbActionResult();
                    resultAction = db.EditDiagnosisType(obj);
                    int id = resultAction.intResult;
                    if (id >= 0)
                    {
                        return(RedirectToAction("Index"));
                    }

                    if (id == -1)
                    {
                        db.DetachDiagnosisType(obj);
                        DiagnosisType oldObj = db.GetDiagnosisType(obj.DiagnosisTypeID);
                        ModelState.AddModelError("", "Ошибка параллельного доступа к данным. Если проблема повторится, обратитесь к системному администратору.");
                        if (oldObj.Code != obj.Code)
                        {
                            ModelState.AddModelError("Code", "Текущее значение: " + oldObj.Code.ToString());
                        }
                        if (oldObj.DescriptionEng != obj.DescriptionEng)
                        {
                            ModelState.AddModelError("DescriptionEng", "Текущее значение: " + oldObj.DescriptionEng.ToString());
                        }
                        if (oldObj.DescriptionRus.ToString() != obj.DescriptionRus.ToString())
                        {
                            ModelState.AddModelError("DescriptionRus", "Текущее значение: " + oldObj.DescriptionRus.ToString());
                        }
                        obj.Timestamp = oldObj.Timestamp;
                    }
                    if (id == -2)
                    {
                        ModelState.AddModelError("", resultAction.exData.Message.ToString() + " | " + resultAction.exData.GetType().ToString() + " | " +
                                                 "Невозможно сохранить изменения. Нажмите обновить страницу и повторить действия. Если проблема повторится, обратитесь к системному администратору.");
                    }
                }
            }

            catch (DataException ex)
            {
                ModelState.AddModelError("", ex.Message.ToString() + " | " + ex.GetType().ToString() + " | " + "Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
            }

            return(View(obj));
        }
コード例 #17
0
 [Authorize] public ActionResult Create(DiagnosisType obj)
 {
     try
     {
         if (ModelState.IsValid)
         {
             int id = db.AddDiagnosisType(obj);
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException ex)
     {
         ModelState.AddModelError("", ex.Message.ToString() + " Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
     }
     return(RedirectToAction("Index"));
 }
コード例 #18
0
 private void CreateAndAddPatientDiagnosis(DiagnosisType diagnosisType, string comment = null)
 {
     if (diagnosisType != null)
     {
         var patientDiagnosis = new PatientDiagnosis();
         patientDiagnosis.DiagnosisTypeId     = diagnosisType.ID;
         patientDiagnosis.PatientId           = _patient.ID;
         patientDiagnosis.DiagnosisCategoryId = _currentDiagnosisCategory.ID;
         if (!string.IsNullOrEmpty(comment))
         {
             patientDiagnosis.Description = comment;
         }
         _discoveredDiagnoses.Add(patientDiagnosis);
         _patient.PatientDiagnoses = _discoveredDiagnoses;
     }
 }
コード例 #19
0
        private void ProcessUnderlyingDiagnosis(string underlyingDiagnosis)
        {
            var existingDiagnoses = ExisitingDiagnosisTypes(_context);
            var words             = GetDiagnosisTypesWords(underlyingDiagnosis);

            if (words.Count != 0)
            {
                var matchingDiagnosesNames = existingDiagnoses.Where(ed => (SearchRegex(words).IsMatch(ed) && (ed.Split(" ").Count() < 4))).ToList();
                _currentDiagnosisCategory = GetDiagnosisCategoryByName("Underlying Diagnosis");
                foreach (var diagType in matchingDiagnosesNames)
                {
                    DiagnosisType dbDiagnosis = GetDiagnosisByName(diagType);
                    CreateAndAddPatientDiagnosis(dbDiagnosis, underlyingDiagnosis);
                }
            }
        }
コード例 #20
0
        public ActionResult Create(DiagnosisType obj)
        {
            try
            {

                if (ModelState.IsValid)
                {
                    int id = db.AddDiagnosisType(obj);
                    return RedirectToAction("Index");
                }
            }
            catch (DataException ex)
            {
                ModelState.AddModelError("", ex.Message.ToString() + " Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
            }
            return RedirectToAction("Index");
        }
コード例 #21
0
ファイル: Message.cs プロジェクト: pirenga/CVE-2020-1206-POC
        /// <summary>
        /// Get Diagnoses
        /// </summary>
        /// <param name="onlyTopLevelDiagnosisMessages"> whether to parse all diagnoses</param>
        /// <returns></returns>
        public MessageDiagnosis[] GetDiagnoses(bool onlyTopLevelDiagnosisMessages = true)
        {
            if (onlyTopLevelDiagnosisMessages)
            {
                return(monitor.GetMessageData(messageId).Diagnoses);
            }
            else
            {
                DiagnosisType diagType = monitor.GetDiagnosisTypes(messageId);

                if (diagType != DiagnosisType.None)
                {
                    // Get diagnosis from current message and lower level message
                    return(monitor.GetMessageDataWithAllDiagnoses(messageId).Diagnoses);
                }
                return(new MessageDiagnosis[0]);
            }
        }
コード例 #22
0
        protected override void ProcessSheet(ISheet currentSheet)
        {
            Action <Patient, IRow, int> sheetProcessingAction = (patient, row, cellCount) =>
            {
                _patientAliveStatus    = _context.PatientStatuses.Where(s => s.Name == "Active").FirstOrDefault().ID;
                _patientDeceasedStatus = _context.PatientStatuses.Where(s => s.Name == "Deceased").FirstOrDefault().ID;
                _cpaDiagnosis          = _context.DiagnosisTypes.Where(dt => dt.Name.Contains("Chronic pulmonary aspergillosis")).SingleOrDefault();
                _primaryDiagnosisCat   = _context.DiagnosisCategories.Where(dc => dc.CategoryName == "Primary").SingleOrDefault();

                var importedPatient = ReadCellsToPatient(patient, row, cellCount);
                AddPatientDiagnosis(patient);
                if (importedPatient.IsValid())
                {
                    Imported.Add(importedPatient);
                }
            };

            InitializeSheetProcessingForRows(HeadersDictionary(), currentSheet, sheetProcessingAction);
        }
コード例 #23
0
        public ActionResult Edit(DiagnosisType obj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    dbActionResult resultAction = new dbActionResult();
                    resultAction = db.EditDiagnosisType(obj);
                    int id = resultAction.intResult;
                    if (id >= 0)
                    {
                        return RedirectToAction("Index");
                    }

                    if (id == -1)
                    {
                        db.DetachDiagnosisType(obj);
                        DiagnosisType oldObj = db.GetDiagnosisType(obj.DiagnosisTypeID);
                        ModelState.AddModelError("", "Ошибка параллельного доступа к данным. Если проблема повторится, обратитесь к системному администратору.");
                        if (oldObj.Code != obj.Code)
                            ModelState.AddModelError("Code", "Текущее значение: " + oldObj.Code.ToString());
                        if (oldObj.DescriptionEng != obj.DescriptionEng)
                            ModelState.AddModelError("DescriptionEng", "Текущее значение: " + oldObj.DescriptionEng.ToString());
                        if (oldObj.DescriptionRus.ToString() != obj.DescriptionRus.ToString())
                            ModelState.AddModelError("DescriptionRus", "Текущее значение: " + oldObj.DescriptionRus.ToString());
                        obj.Timestamp = oldObj.Timestamp;
                    }
                    if (id == -2)
                    {
                        ModelState.AddModelError("", resultAction.exData.Message.ToString() + " | " + resultAction.exData.GetType().ToString() + " | " +
                            "Невозможно сохранить изменения. Нажмите обновить страницу и повторить действия. Если проблема повторится, обратитесь к системному администратору.");
                    }
                }
            }

            catch (DataException ex)
            {
                ModelState.AddModelError("", ex.Message.ToString() + " | " + ex.GetType().ToString() + " | " + "Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
            }

            return View(obj);
        }
コード例 #24
0
        private static Tuple <string, string, string> GetDiagnosesResultsForBMI(double BMI)
        {
            string DiagnosisText = "";
            string RiskText      = "";
            string TherapyText   = "";

            foreach (var item in DiagnosesTypeByCondition)
            {
                if (item.Key(BMI))
                {
                    DiagnosisType DiagnosisType = item.Value;
                    DiagnosisText = DiagnosisByDiagnosisKey[DiagnosisType];
                    RiskText      = RiskByDiagnosisKey[DiagnosisType];
                    TherapyText   = TherapyByDiagnosisKey[DiagnosisType];

                    break;
                }
            }

            return(new Tuple <string, string, string>(DiagnosisText, RiskText, TherapyText));
        }
コード例 #25
0
        /// <summary>
        /// Creates or updates resources based on the natural key values of the supplied resource. The POST operation can be used to create or update resources. In database terms, this is often referred to as an &quot;upsert&quot; operation (insert + update).  Clients should NOT include the resource &quot;id&quot; in the JSON body because it will result in an error (you must use a PUT operation to update a resource by &quot;id&quot;). The web service will identify whether the resource already exists based on the natural key values provided, and update or create the resource appropriately.
        /// </summary>
        /// <param name="body">The JSON representation of the &quot;diagnosisType&quot; resource to be created or updated.</param>
        /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns>
        public IRestResponse PostDiagnosisTypes(DiagnosisType body)
        {
            var request = new RestRequest("/diagnosisTypes", Method.POST);

            request.RequestFormat = DataFormat.Json;

            // verify required params are set
            if (body == null)
            {
                throw new ArgumentException("API method call is missing required parameters");
            }
            request.AddBody(body);
            var response = client.Execute(request);

            var location = response.Headers.FirstOrDefault(x => x.Name == "Location");

            if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString()))
            {
                body.id = location.Value.ToString().Split('/').Last();
            }
            return(response);
        }
コード例 #26
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 27, Configuration.FieldSeparator),
                       Id,
                       SetIdDg1.HasValue ? SetIdDg1.Value.ToString(culture) : null,
                       DiagnosisCodingMethod,
                       DiagnosisCodeDg1?.ToDelimitedString(),
                       DiagnosisDescription,
                       DiagnosisDateTime.HasValue ? DiagnosisDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       DiagnosisType?.ToDelimitedString(),
                       MajorDiagnosticCategory?.ToDelimitedString(),
                       DiagnosticRelatedGroup?.ToDelimitedString(),
                       DrgApprovalIndicator,
                       DrgGrouperReviewCode?.ToDelimitedString(),
                       OutlierType?.ToDelimitedString(),
                       OutlierDays.HasValue ? OutlierDays.Value.ToString(Consts.NumericFormat, culture) : null,
                       OutlierCost?.ToDelimitedString(),
                       GrouperVersionAndType,
                       DiagnosisPriority.HasValue ? DiagnosisPriority.Value.ToString(Consts.NumericFormat, culture) : null,
                       DiagnosingClinician != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosingClinician.Select(x => x.ToDelimitedString())) : null,
                       DiagnosisClassification?.ToDelimitedString(),
                       ConfidentialIndicator,
                       AttestationDateTime.HasValue ? AttestationDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       DiagnosisIdentifier?.ToDelimitedString(),
                       DiagnosisActionCode,
                       ParentDiagnosis?.ToDelimitedString(),
                       DrgCclValueCode?.ToDelimitedString(),
                       DrgGroupingUsage,
                       DrgDiagnosisDeterminationStatus?.ToDelimitedString(),
                       PresentOnAdmissionPoaIndicator?.ToDelimitedString()
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
コード例 #27
0
        public static void Initialize(AspergillosisContext context)
        {
            context.Database.EnsureCreated();
            if (context.DiagnosisCategories.Any())
            {
                return;
            }

            var Patients = new Patient[]
            {
                new Patient {
                    FirstName = "Carson", LastName = "Alexander", DOB = DateTime.Parse("2005-09-01"), Gender = "male", RM2Number = "1234576RD"
                },
                new Patient {
                    FirstName = "Meredith", LastName = "Alonso", DOB = DateTime.Parse("2002-09-01"), Gender = "male", RM2Number = "3454576RD"
                },
                new Patient {
                    FirstName = "Arturo", LastName = "Anand", DOB = DateTime.Parse("2003-09-01"), Gender = "male", RM2Number = "AD23445"
                },
                new Patient {
                    FirstName = "Gytis", LastName = "Barzdukas", DOB = DateTime.Parse("2002-09-01"), Gender = "female", RM2Number = "AD5467676"
                },
                new Patient {
                    FirstName = "Yan", LastName = "Li", DOB = DateTime.Parse("2002-09-01"), Gender = "male", RM2Number = "VVV333355"
                },
                new Patient {
                    FirstName = "Peggy", LastName = "Justice", DOB = DateTime.Parse("2001-09-01"), Gender = "female", RM2Number = "ASH34578"
                },
                new Patient {
                    FirstName = "Laura", LastName = "Norman", DOB = DateTime.Parse("2003-09-01"), Gender = "female", RM2Number = "POL123445"
                },
                new Patient {
                    FirstName = "Nino", LastName = "Olivetto", DOB = DateTime.Parse("2005-09-01"), Gender = "male", RM2Number = "DAT123445"
                }
            };

            foreach (Patient p in Patients)
            {
                context.Patients.Add(p);
            }
            context.SaveChanges();

            var DiagnosisCategories = new DiagnosisCategory[]
            {
                new DiagnosisCategory {
                    CategoryName = "Primary"
                },
                new DiagnosisCategory {
                    CategoryName = "Secondary"
                },
                new DiagnosisCategory {
                    CategoryName = "Other"
                },
            };

            foreach (DiagnosisCategory c in DiagnosisCategories)
            {
                context.DiagnosisCategories.Add(c);
            }
            context.SaveChanges();

            var diagnoses = new DiagnosisType[]
            {
                new DiagnosisType {
                    Name = "Allergic bronchopulmonary aspergillosis (ABPA)"
                },
                new DiagnosisType {
                    Name = "Allergic Aspergillus sinusitis"
                },
                new DiagnosisType {
                    Name = "Aspergilloma"
                },
                new DiagnosisType {
                    Name = "Chronic pulmonary aspergillosis (CPA)"
                },
                new DiagnosisType {
                    Name = "Invasive aspergillosis"
                },
                new DiagnosisType {
                    Name = "Cutaneous (skin) aspergillosis"
                },
            };

            foreach (DiagnosisType dt in diagnoses)
            {
                context.DiagnosisTypes.Add(dt);
            }
            context.SaveChanges();


            var drugs = new Drug[]
            {
                new Drug {
                    Name = "Other drug 1"
                },
                new Drug {
                    Name = "Other drug"
                },
                new Drug {
                    Name = "Other drug 2"
                },
                new Drug {
                    Name = "Other drug 3"
                },
                new Drug {
                    Name = "Other drug 4"
                },
                new Drug {
                    Name = "Other drug 7"
                },
            };

            foreach (Drug d in drugs)
            {
                context.Drugs.Add(d);
            }

            var sideEffects = new SideEffect[]
            {
                new SideEffect {
                    Name = "Clumsiness"
                },
                new SideEffect {
                    Name = "Discouragement"
                },
                new SideEffect {
                    Name = "Drowsiness"
                },
                new SideEffect {
                    Name = "Feeling sad or empty"
                },
                new SideEffect {
                    Name = "Irritability"
                },
                new SideEffect {
                    Name = "Vomiting"
                },
                new SideEffect {
                    Name = "Fever"
                },
                new SideEffect {
                    Name = "Irregular heartbeats"
                }
            };

            foreach (SideEffect se in sideEffects)
            {
                context.SideEffects.Add(se);
            }
            context.SaveChanges();
        }
コード例 #28
0
        //
        // GET: /DiagnosisType/Edit/5

        [Authorize] public ActionResult Edit(int id)
        {
            DiagnosisType obj = db.GetDiagnosisType(id);

            return(View(obj));
        }