Beispiel #1
0
 /// <summary>
 /// Create article with save in DB
 /// </summary>
 /// <param name="article"></param>
 public void CreateArticle(Article article)
 {
     if (article == null)
     {
         throw new NotImplementedException();
     }
     else
     {
         context.Articles.Add(article);
     }
     context.SaveChanges();
 }
 /// <summary>
 /// Create Category with save in DB
 /// </summary>
 /// <param name="category"></param>
 public void CreateCategory(Category category)
 {
     if (category == null)
     {
         throw new NotImplementedException();
     }
     else
     {
         context.Categories.Add(category);
     }
     context.SaveChanges();
 }
        public ActionResult ClearUp(int id)
        {
            var encounter = db.Encounter.Find(id);

            if (encounter == null)
            {
                return(HttpNotFound());
            }

            var instances = db.ClinicalProblemInstance.Where(x => x.Encounter.Id == encounter.Id).ToList();

            for (int j = instances.Count() - 1; j >= 0; j--)
            {
                var instance = instances[j];

                //
                // Slay associated ChangeRecords
                for (int k = instance.ChangeRecord.Count - 1; k >= 0; k--)
                {
                    var record = instance.ChangeRecord.ElementAt(k);
                    //
                    // Slay associated Facts
                    for (int i = record.Fact.Count - 1; i >= 0; i--)
                    {
                        var fact = record.Fact.ElementAt(i);
                        record.Fact.Remove(fact);
                        db.Fact.Remove(fact);
                    }
                    db.ChangeRecord.Remove(record);
                    instance.ChangeRecord.Remove(record);
                }

                //
                // Then suicide
                db.ClinicalProblemInstance.Remove(instance);
                db.SaveChanges();
            }

            return(RedirectToAction("Details", new { id = id }));
        }
Beispiel #4
0
        void SeedEBM()
        {
            var ebm1 = new EBM()
            {
                Content             = "Oral beta-blockers in all patients without contraindications",
                EvidenceLevel       = EnumEvidenceLevel.A.ToString(),
                RecommendationClass = EnumRecommendationClass.I.ToString(),
                Source = "ACC/AHA Guidelines for the Management of Patients With ST-Elevation Myocardial Infarction (2004)",
                URL    = "http://www.nepsy.szote.u-szeged.hu/~kincsesz/docs/acc_ami_2004.pdf"
            };
            var ebm2 = new EBM()
            {
                Content             = @"beta-blockers are reasonable for patients unless
contraindicated, especially if a tachyarrhythmia or hypertension is present",
                EvidenceLevel       = EnumEvidenceLevel.B.ToString(),
                RecommendationClass = EnumRecommendationClass.IIA.ToString(),
                Source = "ACC/AHA Guidelines for the Management of Patients With ST-Elevation Myocardial Infarction (2004)",
                URL    = "http://www.nepsy.szote.u-szeged.hu/~kincsesz/docs/acc_ami_2004.pdf"
            };

            db.EBM.Add(ebm1);
            db.EBM.Add(ebm2);
            db.SaveChanges();

            db.MedicalOrderDefinition.Where(x => x.Name.Contains("洛尔")).ToList().ForEach(x =>
            {
                db.MedicalOrderDefinition_EBM_Association.Add(new MedicalOrderDefinition_EBM_Association()
                {
                    EBM_Id = ebm1.Id, MedicalOrderDefinition_Id = x.Id
                });
                db.MedicalOrderDefinition_EBM_Association.Add(new MedicalOrderDefinition_EBM_Association()
                {
                    EBM_Id = ebm2.Id, MedicalOrderDefinition_Id = x.Id
                });
                //x.EBM.Add(ebm1);
                //x.EBM.Add(ebm2);
                db.SaveChanges();
            });

            PlanDefinition plan;
            EBM            ebm;

            plan = db.PlanDefinition.FirstOrDefault(x => x.Name == "冠脉造影");
            if (plan != null)
            {
                ebm = new EBM()
                {
                    Content             = @"Primary PCI should be performed as quickly as
    possible, with the goal of a medical contact–toballoon or door-to-balloon time of within 90 minutes.",
                    EvidenceLevel       = EnumEvidenceLevel.B.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "ACC/AHA Guidelines for the Management of Patients With ST-Elevation Myocardial Infarction (2004)",
                    URL    = "http://www.nepsy.szote.u-szeged.hu/~kincsesz/docs/acc_ami_2004.pdf"
                };
                db.EBM.Add(ebm);
                db.SaveChanges(); // only after called SaveChanges, id is generated.
                db.PlanDefinition_EBM_Association.Add(new PlanDefinition_EBM_Association()
                {
                    EBM_Id = ebm.Id, PlanDefinition_Id = plan.Id
                });
                db.SaveChanges();

                ebm = new EBM()
                {
                    Content             = @"Primary PCI should be performed as quickly as
    possible, with the goal of a medical contact–toballoon or door-to-balloon time of within 90 minutes.",
                    EvidenceLevel       = EnumEvidenceLevel.A.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = @"Bittl, J. A., S. G. Ellis, et al. (2011). 2011 ACCF/AHA/SCAI Guideline for Percutaneous Coronary Intervention. Cardiol 58: e44-122.",
                    URL    = "http://lib.kums.ac.ir/documents/10129/152774/e44.pdf"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.PlanDefinition_EBM_Association.Add(new PlanDefinition_EBM_Association()
                {
                    EBM_Id = ebm.Id, PlanDefinition_Id = plan.Id
                });
                db.SaveChanges();

                ebm = new EBM()
                {
                    Content             = @"Primary PCI should be performed for patients less
    than 75 years old with ST elevation or LBBB who develop shock within 36 hours of MI and are suitable for revascularization that can be performed within 18 hours of shock, unless further support is futile because of the patient's wishes or contraindications/unsuitability for further invasive care.",
                    EvidenceLevel       = EnumEvidenceLevel.B.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "ACC/AHA Guidelines for the Management of Patients With ST-Elevation Myocardial Infarction (2004)",
                    URL    = "http://www.nepsy.szote.u-szeged.hu/~kincsesz/docs/acc_ami_2004.pdf"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.PlanDefinition_EBM_Association.Add(new PlanDefinition_EBM_Association()
                {
                    EBM_Id = ebm.Id, PlanDefinition_Id = plan.Id
                });
                db.SaveChanges();
            }


            plan = db.PlanDefinition.FirstOrDefault(x => x.Name.Contains("冠心病"));
            if (plan != null)
            {
                ebm = new EBM()
                {
                    Content             = @"Treatment for coronary artery disease usually involves lifestyle changes and, if necessary, drugs and certain medical procedures.",
                    EvidenceLevel       = EnumEvidenceLevel.C.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "coronary artery disease Treatments and drugs",
                    URL    = "http://www.mayoclinic.com/health/coronary-artery-disease/DS00064/DSECTION=treatments-and-drugs"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.PlanDefinition_EBM_Association.Add(new PlanDefinition_EBM_Association()
                {
                    EBM_Id = ebm.Id, PlanDefinition_Id = plan.Id
                });
                db.SaveChanges();
            }

            plan = db.PlanDefinition.FirstOrDefault(x => x.Name.Contains("高血压"));
            if (plan != null)
            {
                ebm = new EBM()
                {
                    Content             = @"Emergency Department Algorithm/Protocol
    for Patients With Symptoms and Signs of STEMI",
                    EvidenceLevel       = EnumEvidenceLevel.A.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "ACC/AHA Guidelines for the Management of Patients With ST-Elevation Myocardial Infarction (2004)",
                    URL    = "/KnowledgeBase/Problems/STEMI_ED_Algorithm.PNG"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.PlanDefinition_EBM_Association.Add(new PlanDefinition_EBM_Association()
                {
                    EBM_Id = ebm.Id, PlanDefinition_Id = plan.Id
                });
                db.SaveChanges();
            }

            var rule = db.TriggerRule.FirstOrDefault(x => x.Name == "心肌梗死");

            if (rule != null)
            {
                ebm = new EBM()
                {
                    Content             = @"the universal definition of myocardial infarction recommends the measurement of cardiac troponin either as cardiac troponin T (cTnT) or cardiac troponin I (cTnI).",
                    EvidenceLevel       = EnumEvidenceLevel.A.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "Thygesen K, Alpert JS, White HD, et al. Universal definition of myocardial infarction. Circulation 2007;116:2634–53.",
                    URL    = "http://heart.bmj.com/cgi/ijlink?linkType=FULL&journalCode=circulationaha&resid=116/22/2634"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.TriggerRule_EBM_Association.Add(new TriggerRule_EBM_Association()
                {
                    EBM_Id = ebm.Id, TriggerRule_Id = rule.Id
                });
                db.SaveChanges();

                ebm = new EBM()
                {
                    Content             = @"The measurement of the MB isoenzyme of creatine kinase by a mass measurement (CK-MB mass) to be significantly inferior to the measurement of cardiac troponin",
                    EvidenceLevel       = EnumEvidenceLevel.A.ToString(),
                    RecommendationClass = EnumRecommendationClass.I.ToString(),
                    Source = "Collinson P, Goodacre S, Gaze D, et al. Very early diagnosis of chest pain by point-of-care testing: comparison of the diagnostic efficiency of a panel of cardiac biomarkers compared with troponin measurement alone in the RATPAC trial. Heart 2012;98:312–18.",
                    URL    = "http://heart.bmj.com/cgi/ijlink?linkType=ABST&journalCode=heartjnl&resid=98/4/312"
                };
                db.EBM.Add(ebm);
                db.SaveChanges();
                db.TriggerRule_EBM_Association.Add(new TriggerRule_EBM_Association()
                {
                    EBM_Id = ebm.Id, TriggerRule_Id = rule.Id
                });
                db.SaveChanges();
            }
        }