Example #1
0
        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
            };
        }
Example #2
0
        public static async Task <LG.Data.Models.Clinical.MedicationTaken> Medication(LG.Data.Models.Clinical.MedicationTaken entity)
        {
            var client = ClientConnection.GetCDMS_Connection();

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

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

                case ClinicalAction.Update:
                    #region [@  Method     @]
                    var response2 = await client.UpdateMedicationTakenAsync(new UpdateMedicationTakenRequest()
                    {
                        MessageGuid     = Guid.NewGuid(),
                        MedicationTaken = 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.GetMedicationsTakenAsync(new GetMedicationsTakenRequest()
                    {
                        MessageGuid = Guid.NewGuid(),
                        RID         = entity.RID
                    });

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

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

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

                    client.Close();
                    entity.MedicationTakenItem = response5.MedicationTaken;
                    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);
            }
        }