public PupilViewModel(Rscd.Web.ApiClient.Pupil pupil) { _pupil = pupil; ID = pupil.Id; Keystage = CheckingWindow.ToKeyStage(); URN = pupil.Urn; SchoolID = pupil.DfesNumber; UPN = pupil.Upn; ULN = pupil.Uln; FirstName = pupil.Forename; LastName = pupil.Surname; DateOfBirth = pupil.Dob.Date; Age = pupil.Age; Gender = pupil.Gender; DateOfAdmission = pupil.AdmissionDate?.Date; YearGroup = pupil.YearGroup; AllocationYears = GetAllocationYears(pupil.Allocations); Allocations = pupil.Allocations; PincludeCode = pupil.Pincl != null ? pupil.Pincl.Code : string.Empty; EthnicCodeGroup = pupil.Ethnicity; SEN = pupil.SpecialEducationNeed; FirstLanguage = pupil.FirstLanguage; FreeSchoolsInLast6Years = pupil.FreeSchoolMealsLast6Years; ChildrenLookedAfter = pupil.LookedAfterEver; PortlandStudendId = pupil.PortlandStudentID; }