public Session(int sessionId, DateTime date, OpenHRUser user, OpenHROrganisation organisation)
 {
     SessionId    = sessionId;
     Date         = date;
     User         = user;
     Organisation = organisation;
 }
 private static EomOrganisationInformation.LocationType CreateOrganisation(OpenHROrganisation organisation)
 {
     return(new EomOrganisationInformation.LocationType()
     {
         DBID = organisation.OrganisationId.ToString(),
         GUID = organisation.Organisation.id,
         LocationName = organisation.Organisation.name,
         NationalCode = organisation.Organisation.nationalPracticeCode
     });
 }
 private static EomOrganisationInformation.PersonType[] CreateUsers(OpenHROrganisation organisation)
 {
     return(organisation
            .Users
            .Select(t => new EomOrganisationInformation.PersonType()
     {
         DBID = t.OpenHRUserId.ToString(),
         GUID = t.UserInRole.id,
         Title = t.Person.title,
         FirstNames = t.Person.forenames,
         LastName = t.Person.surname
     })
            .ToArray());
 }
Exemple #4
0
        public string GetOrganisationById(Guid organisationGuid)
        {
            OpenHROrganisation organisation = DataStore
                                              .Organisations
                                              .FirstOrDefault(t => new Guid(t.Organisation.id) == organisationGuid);

            string result = string.Empty;

            if (organisation != null)
            {
                result = Utilities.Serialize(organisation.Organisation);
            }

            return(result);
        }
Exemple #5
0
        public string GetOrganisationByOdsCode(string odsCode)
        {
            OpenHROrganisation organisation = DataStore
                                              .Organisations
                                              .FirstOrDefault(t => t.Organisation.nationalPracticeCode == odsCode &&
                                                              (!string.IsNullOrEmpty(odsCode)));

            string result = string.Empty;

            if (organisation != null)
            {
                result = Utilities.Serialize(organisation.Organisation);
            }

            return(result);
        }
Exemple #6
0
        public string GetOrganisationInformation(string odsCode)
        {
            OpenHROrganisation organisation = DataStore
                                              .Organisations
                                              .FirstOrDefault(t => t.Organisation.nationalPracticeCode == odsCode &&
                                                              (!string.IsNullOrEmpty(odsCode)));

            string result = string.Empty;

            if (organisation != null)
            {
                EomOrganisationInformation.OrganisationInformation organisationInformation = EomOrganisationTransform.ToEomOrganisationInformation(organisation);

                result = Utilities.Serialize <EomOrganisationInformation.OrganisationInformation>(organisationInformation);
            }

            return(result);
        }
Exemple #7
0
        public string GetLocation(String odsCode, Guid locationGuid)
        {
            OpenHROrganisation organisation = DataStore
                                              .Organisations
                                              .FirstOrDefault(t => t.Organisation.nationalPracticeCode == odsCode &&
                                                              (!string.IsNullOrEmpty(odsCode)));

            OpenHR001Location location = organisation
                                         .Locations
                                         .Select(loc => loc.Location)
                                         .FirstOrDefault(loc => new Guid(loc.id).Equals(locationGuid));

            string result = string.Empty;

            if (location != null)
            {
                result = Utilities.Serialize(location);
            }

            return(result);
        }
Exemple #8
0
        private void DrawAppointmentBook()
        {
            lblDateHeader.Text = monthCalendar1.SelectionStart.Date.ToString("dddd dd MMMM yyyy");

            OpenHRUser[] userFilter = _allUsers;

            if (cbClinicianFilter.SelectedValue != null)
            {
                OpenHRUser selectedUser = (OpenHRUser)cbClinicianFilter.SelectedValue;

                userFilter = _allUsers
                             .Where(t => new Guid(t.Person.id) == new Guid(selectedUser.Person.id))
                             .ToArray();
            }

            if (cbOrganisationFilter.SelectedValue != null)
            {
                OpenHROrganisation selectedOrganisation = (OpenHROrganisation)cbOrganisationFilter.SelectedValue;

                userFilter = userFilter
                             .Where(t => new Guid(t.Organisation.id) == new Guid(selectedOrganisation.Organisation.id))
                             .ToArray();
            }

            DateTime selectedDate = monthCalendar1.SelectionStart.Date;

            Session[] sessions = DataStore
                                 .AppointmentSessions
                                 .Where(t => t.Date.Date.Equals(selectedDate) &&
                                        userFilter.Contains(t.User))
                                 .OrderBy(t => t.Date)
                                 .ThenBy(t => t.Organisation.Organisation.name)
                                 .ThenBy(t => t.User.Person.GetCuiDisplayName())
                                 .ToArray();

            DrawAppointmentBook(sessions);
        }
Exemple #9
0
        private void cbOrganisationFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            OpenHROrganisation selectedOrganisation = (OpenHROrganisation)cbOrganisationFilter.SelectedValue;
            OpenHRUser         selectedUser         = (OpenHRUser)cbClinicianFilter.SelectedValue;

            OpenHRUser[] users = _distinctUsers.Where(t => t.IsSessionHolder).ToArray();

            if (selectedOrganisation != null)
            {
                users = selectedOrganisation.Users;
            }

            cbClinicianFilter.PopulateComboBox(users.OrderBy(t => t.Person.GetCuiDisplayName()).ToArray(), t => t.Person.GetCuiDisplayName(), "(no filter)");

            if (selectedUser != null)
            {
                cbClinicianFilter.SelectedValue = selectedUser;

                if (cbClinicianFilter.SelectedValue == null)
                {
                    cbClinicianFilter.SelectedIndex = 0;
                }
            }
        }
 private static EomOrganisationInformation.TypeOfLocationType[] CreateLocations(OpenHROrganisation organisation)
 {
     return(organisation
            .Locations
            .Select(t => new EomOrganisationInformation.TypeOfLocationType()
     {
         DBID = t.LocationId.ToString(),
         Description = t.Location.name,
         GUID = t.Location.id
     })
            .ToArray());
 }
 public static EomOrganisationInformation.OrganisationInformation ToEomOrganisationInformation(OpenHROrganisation organisation)
 {
     return(new EomOrganisationInformation.OrganisationInformation()
     {
         OrganisationList = new EomOrganisationInformation.LocationType[]
         {
             CreateOrganisation(organisation)
         },
         LocationTypeList = CreateLocations(organisation),
         UserList = CreateUsers(organisation)
     });
 }