public LG.Data.Models.Clinical.Data Get()
        {

            var familyCondition = new LG.Data.Models.Clinical.FamilyCondition()
            {
                InsertInput = new FamilyHistoryRecord_Insert()
                {

                },
                UpdateInput = new FamilyHistoryRecord_Update(),
                FamilyHistoryRecordItem = new LG.Services.CDMS.FamilyHistoryRecord()
                {

                }
            };
            var medicationTaken = new LG.Data.Models.Clinical.MedicationTaken
            {
                InsertInput = new MedicationTaken_Insert()
                {

                },
                UpdateInput = new MedicationTaken_Update(),
                MedicationTakenItem = new LG.Services.CDMS.MedicationTaken()
                {

                }
            };
            return new LG.Data.Models.Clinical.Data()
            {

                FamilyConditionEntitiy = familyCondition,
                MedicationTakenEntitiy = medicationTaken
            };
        }
Exemple #2
0
        public static async Task <LG.Data.Models.Clinical.FamilyCondition> FamilyCondition(LG.Data.Models.Clinical.FamilyCondition entity)
        {
            var client = ClientConnection.GetCDMS_Connection();

            try
            {
                client.Open();
                switch (entity.ActionHelper.ClincalAction)
                {
                case ClinicalAction.Add:
                    #region [@  Method     @]
                    var response = await client.AddFamilyHistoryRecordAsync(new AddFamilyHistoryRecordRequest()
                    {
                        MessageGuid         = Guid.NewGuid(),
                        FamilyHistoryRecord = entity.InsertInput,
                        PropBag             = Propbag
                    });

                    client.Close();
                    entity.NewFamilyHistoryRecordID = response.NewFamilyHistoryRecordID;
                    entity.ActionHelper             = new ActionHelper {
                        ClincalActionResult = ClinicalActionResult.Success
                    };
                    #endregion
                    break;

                case ClinicalAction.Update:
                    #region [@  Method     @]
                    var response2 = await client.UpdateFamilyHistoryRecordAsync(new UpdateFamilyHistoryRecordRequest()
                    {
                        MessageGuid         = Guid.NewGuid(),
                        FamilyHistoryRecord = entity.UpdateInput,
                        PropBag             = Propbag
                    });

                    client.Close();
                    entity.ActionHelper = new ActionHelper {
                        ClincalActionResult = ClinicalActionResult.Success
                    };
                    #endregion
                    break;

                case ClinicalAction.ToggleHidden:
                    #region [@  Method     @]

                    //var response3 = await client.ToggleIsHiddenMedicalConditionAsync(
                    //    new ToggleIsHiddenMedicalConditionRequest()
                    //    {
                    //        MessageGuid = Guid.NewGuid(),
                    //        ID = entity.UpdateInput.ID,
                    //        IsHidden = entity.UpdateInput.IsHidden,
                    //        PropBag = Propbag
                    //    });
                    //client.Close();
                    //  entity.ActionHelper = new ActionHelper { ClincalActionResult = ClinicalActionResult.Success };

                    #endregion
                    break;

                case ClinicalAction.LoadAll:
                    #region [@  Method     @]
                    var response4 = await client.GetFamilyHistoryRecordsAsync(new GetFamilyHistoryRecordsRequest()
                    {
                        MessageGuid = Guid.NewGuid(),
                        RID         = entity.RID
                    });

                    client.Close();
                    entity.List         = response4.FamilyHistoryRecords;
                    entity.ActionHelper = new ActionHelper {
                        ClincalActionResult = ClinicalActionResult.Success
                    };
                    #endregion
                    break;

                case ClinicalAction.LoadDetail:
                    #region [@  Method     @]

                    var response5 = await client.GetFamilyHistoryRecordAsync(new GetFamilyHistoryRecordRequest()
                    {
                        MessageGuid = Guid.NewGuid(),
                        ID          = entity.UpdateInput.ID
                    });

                    client.Close();
                    entity.FamilyHistoryRecordItem = response5.FamilyHistoryRecord;

                    entity.ActionHelper = new ActionHelper {
                        ClincalActionResult = ClinicalActionResult.Success
                    };
                    #endregion
                    break;
                }
                return(entity);
            }
            catch (Exception ex)
            {
                client.Close();
                entity.IsError      = true;
                entity.Message      = ex.ToString();
                entity.ActionHelper = new ActionHelper {
                    ClincalActionResult = ClinicalActionResult.Failed
                };;
                return(entity);
            }
        }