Example #1
0
        //public MedicationDataManager(IMongoMedicationRepository repository)
        //{
        //    MedicationRepository = repository;
        //}

        public List <DTO.MedicationData> GetMedicationList(GetAllMedicationsRequest request)
        {
            try
            {
                List <DTO.MedicationData> result = null;
                var repo = MedicationRepositoryFactory.GetMedicationRepository(request, RepositoryType.Medication);
                result = repo.SelectAll().Cast <DTO.MedicationData>().ToList <DTO.MedicationData>();
                return(result);
            }
            catch (Exception ex) { throw ex; }
        }
Example #2
0
        public GetAllMedicationsResponse Get(GetAllMedicationsRequest request)
        {
            var response = new GetAllMedicationsResponse {
                Version = request.Version
            };

            try
            {
                RequireUserId(request);
                response.Medications = Manager.GetMedicationList(request);
            }
            catch (Exception ex)
            {
                RaiseException(response, ex);
            }
            return(response);
        }
        private List <MedicationData> GetMedicationMongoList()
        {
            Mapper.CreateMap <MEMedication, DTO.MedicationData>()
            .ForMember(d => d.Id, opt => opt.MapFrom(src => src.Id.ToString()))
            .ForMember(dest => dest.RecordCreatedOn, opt => opt.MapFrom(src => src.RecordCreatedOn))
            .ForMember(dest => dest.RecordCreatedBy, opt => opt.MapFrom(src => src.RecordCreatedBy.ToString()))
            .ForMember(dest => dest.LastUpdatedOn, opt => opt.MapFrom(src => src.LastUpdatedOn))
            .ForMember(dest => dest.UpdatedBy, opt => opt.MapFrom(src => src.UpdatedBy.ToString()));

            var req = new GetAllMedicationsRequest {
                Context = "NG", ContractNumber = "InHealth001"
            };
            var repo = MedicationRepositoryFactory.GetMedicationRepository(req, RepositoryType.Medication);

            var result = repo.SelectAll().Cast <DTO.MedicationData>().Where(r => r.SubstanceName != null && r.FullName != null && r.Id != null).ToList <DTO.MedicationData>();

            return(result);
        }
 public List <MedicationData> GetMedicationList(GetAllMedicationsRequest request)
 {
     throw new NotImplementedException();
 }