public EducationItemsResult LoadDefaults()
        {
            EducationItemsResult returnResult = new EducationItemsResult();

            bool ok = false;

            EducationItemsResult result = this.GetEducationItems("", "", EducationItemType.Unknown, 0, 0, EducationItemSort.Type);

            if (result.Success)
            {
                if (result.EducationItems == null)
                {
                    ok = true;
                }
                else if (result.EducationItems.Count == 0)
                {
                    ok = true;
                }
            }

            if (ok)
            {
                AntepartumEducationValueSet valueSet = new AntepartumEducationValueSet();

                foreach (ValueSetItem item in valueSet.Items)
                {
                    //    public enum CodingSystem {None, Loinc, SnomedCT}

                    CodingSystem[] translation = new CodingSystem[] { CodingSystem.None, CodingSystem.Loinc, CodingSystem.SnomedCT };

                    EducationItem edItem = new EducationItem();
                    edItem.Description  = item.ItemName;
                    edItem.Category     = item.Category;
                    edItem.Code         = item.Code;
                    edItem.CodingSystem = translation[(int)item.CodeSystem];
                    edItem.ItemType     = EducationItemType.DiscussionTopic;

                    IenResult saveResult = this.SaveEducationItem(edItem);

                    returnResult.SetResult(saveResult.Success, saveResult.Message);

                    if (!saveResult.Success)
                    {
                        break;
                    }
                }
            }

            return(returnResult);
        }
        public EducationItemsResult GetEducationItems(string ien, string category, EducationItemType itemType, int page, int pageSize, EducationItemSort sort)
        {
            EducationItemsResult result = new EducationItemsResult();

            if (this.broker != null)
            {
                DsioGetEducationItemsCommand command = new DsioGetEducationItemsCommand(this.broker);

                string dsioItemType = GetDsioItemType(itemType);

                command.AddCommandArguments(ien, category, dsioItemType, page, pageSize, (int)sort);

                RpcResponse response = command.Execute();

                result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage);

                if (result.Success)
                {
                    if (command.EducationItems != null)
                    {
                        if (command.EducationItems.Count > 0)
                        {
                            foreach (DsioEducationItem dsioItem in command.EducationItems)
                            {
                                EducationItem item = GetItem(dsioItem);

                                result.EducationItems.Add(item);
                            }

                            result.TotalResults = command.TotalResults;
                        }
                    }
                }
            }

            return(result);
        }
        public Dictionary <string, string> GetItemSelection()
        {
            Dictionary <string, string> returnVal = new Dictionary <string, string>();

            EducationItemsResult result = this.GetEducationItems("", "", EducationItemType.Unknown, 0, 0, EducationItemSort.Description);

            returnVal = new Dictionary <string, string>();

            if (result.Success)
            {
                if (result.EducationItems != null)
                {
                    if (result.EducationItems.Count > 0)
                    {
                        foreach (EducationItem item in result.EducationItems)
                        {
                            returnVal.Add(item.Ien, item.Description);
                        }
                    }
                }
            }

            return(returnVal);
        }