internal static BMS.Appointment TranslateServiceToBusiness(DataTypes.Appointment from)
        {
            Application application = Helper.GetApplication();

            BMS.Patient patient = (BMS.Patient)application.FindPatientById(from.Patient.Id);


            BMS.Referrer referrer = null;
            if (from.Referrer == null)
            {
                referrer = patient.ReferringClinician;
            }
            else
            {
                referrer = (BMS.Referrer)application.FindReferrerById(from.Referrer.Id);
            }

            BMS.Provider   provider   = (BMS.Provider)application.FindProviderById(from.Provider.Id);
            BMS.ClinicType clinicType = (BMS.ClinicType)application.FindClinicTypeById(from.ClinicType.Id);

            EAppointments.BMS.Appointment to = application.NewAppointment(
                patient, referrer, provider, clinicType
                );

            return(to);
        }
        internal static DataTypes.Patient TranslateBusinessToService(BMS.Patient from)
        {
            DataTypes.Patient to = new DataTypes.Patient();

            to.Id            = from.Id;
            to.PatientNo     = from.PatientNo;
            to.Referrer      = TranslateBusinessToService(from.ReferringClinician);
            to.Title         = from.Title;
            to.FirstName     = from.FirstName;
            to.LastName      = from.LastName;
            to.AddressLine1  = from.AddressLine1;
            to.AddressLine2  = from.AddressLine2;
            to.City          = from.City;
            to.State         = from.State;
            to.ZipCode       = from.ZipCode;
            to.Country       = from.Country;
            to.ContactNumber = from.ContactNumber;
            to.DateOfBirth   = from.DateOfBirth;
            to.Gender        = from.Gender;
            to.Email         = from.Email;

            return(to);
        }