Ejemplo n.º 1
0
        internal static DataTypes.Appointment TranslateBusinessToService(BMS.Appointment from)
        {
            DataTypes.Appointment to = new DataTypes.Appointment();
            to.Ubrn               = from.Ubrn;
            to.StartDateTime      = from.StartDateTime;
            to.EndDateTime        = from.EndDateTime;
            to.CreatedDateTime    = from.CreatedDateTime;
            to.UpdatedDateTime    = from.UpdatedDateTime;
            to.CancelledDateTime  = from.CancelledDateTime;
            to.CancellationReason = from.CancellationReason;
            to.Referrer           = DirectoryTranslator.TranslateBusinessToService(from.Referrer);
            to.Patient            = DirectoryTranslator.TranslateBusinessToService(from.Patient);
            to.Provider           = ProviderTranslator.TranslateBusinessToService(from.Provider);
            to.ClinicType         = DirectoryTranslator.TranslateBusinessToService(from.ClinicType);

            to.Status       = (DataTypes.AppointmentStatus)from.Status;
            to.Comments     = from.Comments;
            to.ReminderDate = from.ReminderDate;
            to.WorkflowId   = from.WorkflowId;
            if (from.CancelledBy != null)
            {
                to.CancelledById = from.CancelledBy.Id;
            }
            if (from.Slot != null)
            {
                to.Slot = SlotTranslator.TranslateBusinessToService(from.Slot);
            }

            return(to);
        }
Ejemplo n.º 2
0
        public SlotCollection FindSlot(DataTypes.SlotSearchCriteria criteria)
        {
            if (criteria == null)
            {
                throw new ArgumentNullException("criteria");
            }

            BMS.SlotSearchCriteria businessCriteria = SlotTranslator.TranslateSearchCriteria(criteria);

            List <BMS.Slot> businessSlots = new List <BMS.Slot>(Helper.GetApplication().Find(businessCriteria));

            return(new SlotCollection(businessSlots.ConvertAll <DataTypes.Slot>(
                                          new Converter <BMS.Slot, DataTypes.Slot>(SlotTranslator.TranslateBusinessToService)
                                          )));
        }