public SubjectAssessmentDTO(SubjectAssessment source)

        {
            SubjectAssessmentID      = source.SubjectAssessmentID;
            SubjectUserID            = source.SubjectUserID;
            SORSubjectID             = source.SORSubjectID;
            SORAssessmentID          = source.SORAssessmentID;
            AssessmentName           = source.AssessmentName;
            AssessmentTakenOn        = source.AssessmentTakenOn;
            AssessmentAdministeredBy = source.AssessmentAdministeredBy;
            OverallRisk = source.OverallRisk;
            if (source.AssessmentTakenOn != null)
            {
                AssessmentNameDate = source.AssessmentName + " " + source.AssessmentTakenOn.ToString("MM/dd/yyyy");
            }
        }
        public SubjectDTO(PersonDetailsDTO person, SubjectAssessment assessment = null)
        {
            /*
             * Sourced from VPT Accounts person data
             */
            SourceOrganizationID = person.SourceOrganizationID;
            Auth0UserID          = person.Auth0UserID;
            FirstName            = person.FirstName;
            MiddleName           = person.MiddleName;
            LastName             = person.LastName;
            BirthDate            = person.BirthDate;
            GenderID             = person.GenderID;
            RaceID   = person.RaceID;
            ImageURL = person.ImageURL;
            ImageSrc = person.ImageSrc;
            personID = person.PersonID;
            SubjectPortalUsername = person.SubjectPortalUsername;
            PersonGUID            = person.PersonGUID;
            //email
            if (person.Contacts.Any())
            {
                var primaryEmail = person.Contacts.FirstOrDefault(c => c.Primary && c.TypeID == (int)ContactType.Email);
                PrimaryEmail = primaryEmail != null ? primaryEmail.Value : string.Empty;
            }
            else
            {
                PrimaryEmail = string.Empty;
            }

            //phone
            if (person.Contacts.Any())
            {
                var primaryPhone = person.Contacts.FirstOrDefault(c => c.TypeID == (int)ContactType.Phone);
                PrimaryPhone = primaryPhone != null ? primaryPhone.Value : string.Empty;
            }
            else
            {
                PrimaryPhone = string.Empty;
            }

            //mobile
            if (person.Contacts.Any())
            {
                var primaryMobile = person.Contacts.FirstOrDefault(c => c.TypeID == (int)ContactType.Mobile);
                PrimaryMobile = primaryMobile != null ? primaryMobile.Value : string.Empty;
            }
            else
            {
                PrimaryMobile = string.Empty;
            }


            if (person.ExternalIDs.Any())
            {
                var sorExternalID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.SystemOfRecord);
                SORExternalID = sorExternalID != null ? sorExternalID.Value : string.Empty;
                var fbiID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.FbiID);
                FBIID = fbiID != null ? fbiID.Value : string.Empty;
                var sID = person.ExternalIDs.FirstOrDefault(e => e.Type == SystemControlledExternalIDType.SID);
                SID = sID != null ? sID.Value : string.Empty;
            }
            else
            {
                SORExternalID = string.Empty;
                FBIID         = string.Empty;
                SID           = string.Empty;
            }

            Groups = new List <string>();
            foreach (var group in person.Groups)
            {
                Groups.Add(group.DisplayName);
            }

            /*
             * Sourced from VPT Case Mgmt subject data
             */
            SubjectUserID     = assessment == null ? 0 : assessment.SubjectUserID;
            subjectAssessment = assessment == null ? null : new SubjectAssessmentDTO(assessment);
        }