示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="user"></param>
        /// <param name="sPatientID"></param>
        /// <param name="sSection"></param>
        /// <returns></returns>
        public async Task<List<ChartSectionItem>> GetChartSections(string user, string sPatientID, string sSection)
        {
            List<ChartSectionItem> lstChartSection = new List<ChartSectionItem>();
            string sJson = await UnityDataService.Magic("GetPatientChartSections", user, UnityDataService.UnityAppName, sPatientID, UnityDataService.Token, sSection, "", "", "", "", "", "");

            JArray obj = Newtonsoft.Json.Linq.JArray.Parse(sJson);
            foreach (JObject jo in obj)
            {
                JToken table = jo.SelectToken("getpatientchartsectionsinfo", false);
                if (!table.ToString().Equals(UnityDataService.EMPTY_JSON_TABLE))
                {
                    foreach (JToken joRow in table)
                    {
                        ChartSectionItem csi = new ChartSectionItem();

                        csi.section = joRow["section"].ToString();
                        csi.transid = joRow["transid"].ToString();
                        csi.style = joRow["style"].ToString();
                        csi.date = joRow["date"].ToString();
                        csi.level1 = joRow["level1"].ToString();
                        csi.sortorder = joRow["sortorder"].ToString();
                        csi.description = joRow["description"].ToString();
                        csi.detail = joRow["detail"].ToString();
                        csi.status = joRow["status"].ToString();
                        csi.included = joRow["included"].ToString();
                        csi.includeimmutable = joRow["includeimmutableflag"].ToString();
                        csi.displaydate = joRow["displaydate"].ToString();
                        csi.highlight = joRow["highlight"].ToString();
                        csi.expdescription = joRow["expdescription"].ToString();
                        csi.expdetail = joRow["expdetail"].ToString();
                        csi.exprightdescription = joRow["exprightdescription"].ToString();
                        csi.expright = joRow["expright"].ToString();
                        csi.exphighlight = joRow["exphighlight"].ToString();
                        csi.exp2description = joRow["exp2description"].ToString();
                        csi.exp2detail = joRow["exp2detail"].ToString();
                        csi.exp2rightdescription = joRow["exp2rightdescription"].ToString();
                        csi.exp2right = joRow["exp2right"].ToString();
                        csi.expmenu = joRow["expmenu"].ToString();
                        //Todo: fix, Bob
                        if (joRow["annotation"].ToString().Equals("Y"))
                        {
                            //csi.annotations = 
                        }

                        csi.comment = joRow["comment"].ToString();
                        csi.actions = joRow["actions"].ToString();

                        if (csi.highlight.Contains("red") || csi.exphighlight.Contains("red"))
                        {
                            csi.textcolor = "Red";
                        }
                        else
                        {
                            csi.textcolor = "Black";
                        }


                        lstChartSection.Add(csi);

                    }
                }
            }
            return lstChartSection;
        }
示例#2
0
        /// <summary>
        /// 
        /// </summary>
        private async void ExecuteSaveAllergenCommand()
        {

            Allergen allergen = new Allergen();
            ChartSectionItem csi = new ChartSectionItem();
            string allergyID = string.Empty;

            //if (LvNewAllergenMedVisibility == Visibility.Visible) // new med
            //{
                if (SelectedAllergen != null)
                {
                    allergyID = SelectedAllergen.AllergyID;
                }
                else
                {
                    throw new Exception("You must select an alergen to add a new allergy!");
                }
            //}
            //else // edit existing med
            //{
                //if (SelectedGroupedChartSectionItem != null)
                //{
                //    allergyID = SelectedGroupedChartSectionItem.transid;
                //}
                //else
                //{
                    //throw new Exception("There is nothing to save!");
                //}
            //}

            string reactions = string.Empty;
            foreach (AllergicReaction ae in SelectedAllergicReactions)
            {
                reactions += ae.ReactionID + ",";
            }

            reactions = reactions.Remove(reactions.Length - 1);

            string status = await PatientDataService.AllergySave(UnityDataService.UnityAppUser, Patient.ID, allergyID, reactions, AnnotationText);

            //LoadChartAllergies();
        }