@byu-oit/vue-decision-processing-components 8.35.8 → 8.35.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +1 -0
- package/.github/workflows/deploy.yml +40 -50
- package/.repo-meta.yml +55 -55
- package/AdmitPeriodConfig.vue +115 -115
- package/ApiCallButton.vue +91 -91
- package/ApplicantInfo.vue +100 -100
- package/AssignmentBulkDialog.vue +153 -153
- package/AssignmentDialog.vue +117 -117
- package/AssignmentSummary.vue +75 -75
- package/BackgroundBadge.vue +83 -83
- package/BackgroundDetailCrime.vue +78 -78
- package/BackgroundDetailPluralMarriage.vue +43 -43
- package/BackgroundDetailSexRegistry.vue +43 -43
- package/BackgroundDetailUniversity.vue +37 -37
- package/CHANGELOG.md +676 -676
- package/Dashboard.vue +201 -201
- package/DashboardApplicationList.vue +50 -50
- package/DecisionDialog.vue +178 -178
- package/Details.vue +124 -124
- package/DetailsActivity.vue +59 -59
- package/DetailsBackground.vue +143 -143
- package/DetailsBackgroundDetail.vue +47 -47
- package/DetailsBackgroundSummary.vue +66 -66
- package/DetailsCesHold.vue +107 -107
- package/DetailsCollege.vue +93 -93
- package/DetailsContact.vue +65 -65
- package/DetailsDecision.vue +183 -183
- package/DetailsDecisionHistory.vue +56 -56
- package/DetailsEndorsement.vue +74 -74
- package/DetailsEssay.vue +59 -59
- package/DetailsFilenote.vue +62 -62
- package/DetailsFilenoteList.vue +109 -109
- package/DetailsFlagSection.vue +176 -176
- package/DetailsHeader.vue +263 -263
- package/DetailsHighSchool.vue +99 -99
- package/DetailsHsTranscript.vue +100 -100
- package/DetailsInstitute.vue +90 -90
- package/DetailsMission.vue +88 -88
- package/DetailsNewAppHistory.vue +50 -50
- package/DetailsNotes.vue +83 -83
- package/DetailsPathway.vue +45 -45
- package/DetailsScoringSection.vue +128 -128
- package/DetailsSection.vue +116 -116
- package/DetailsSeminary.vue +184 -184
- package/DetailsSrs.vue +52 -52
- package/DetailsSubnav.vue +54 -54
- package/DetailsTestScores.vue +131 -131
- package/ExpandIndicator.vue +75 -75
- package/ExternalLink.vue +34 -34
- package/FilterBreadcrumb.vue +85 -85
- package/FilterButton.vue +86 -86
- package/FilterButtonAdmitPeriod.vue +104 -104
- package/FilterButtonAppType.vue +103 -103
- package/FilterButtonAssignedTo.vue +96 -96
- package/FilterButtonClearFilters.vue +65 -65
- package/FilterButtonSex.vue +105 -105
- package/FlagButton.vue +59 -59
- package/FlagDialog.vue +129 -129
- package/Footer.vue +432 -432
- package/Header.vue +132 -132
- package/HighSchoolSummary.vue +60 -60
- package/InternationalIndicator.vue +44 -44
- package/InternationalStatus.vue +48 -48
- package/LICENSE +201 -201
- package/LoadingBadge.vue +58 -58
- package/ManageAssignments.vue +123 -123
- package/NoAuth.vue +14 -14
- package/NoteDialog.vue +106 -106
- package/ObjectViewer.vue +49 -49
- package/Queues.vue +278 -268
- package/QuickLinks.vue +25 -25
- package/README.md +2 -2
- package/RecentApplications.vue +53 -53
- package/Report.vue +340 -340
- package/ReportDetail.vue +279 -279
- package/ReportList.vue +87 -87
- package/ReportPhotos.vue +65 -65
- package/ReportSvg.vue +78 -78
- package/ReportViewer.vue +165 -165
- package/RequestAccess.vue +14 -14
- package/RequestAccessList.vue +45 -45
- package/RoleSelector.vue +29 -29
- package/Search.vue +22 -22
- package/ShowApplicantIds.vue +100 -100
- package/SortableHeader.vue +53 -53
- package/Spinner.vue +34 -34
- package/StarredIndicator.vue +36 -36
- package/StatBox.vue +73 -73
- package/StatCharts.vue +196 -196
- package/SupportDialog.vue +172 -172
- package/UserInfo.vue +52 -52
- package/YesNoIndicator.vue +48 -48
- package/dateTimeFormat.js +67 -67
- package/gpaCalculation.js +162 -162
- package/gpaFilter.js +5 -5
- package/hsSummary.json +2019 -2019
- package/package.json +37 -36
- package/parsers/application.js +396 -396
- package/parsers/decisionHistory.js +27 -27
- package/parsers/filenotes.js +27 -27
- package/parsers/notes.js +49 -49
- package/parsers/packet.js +88 -88
- package/parsers/packetList.js +57 -57
- package/parsers/reports.js +13 -13
- package/sat2Act.js +46 -46
- package/test.js +48 -48
- package/themes/ByuiFooter.vue +38 -38
- package/themes/ByuiHeader.vue +96 -96
- package/themes/LdsbcFooter.vue +38 -38
- package/themes/LdsbcHeader.vue +100 -100
- package/vuexModules/application/activity.js +32 -32
- package/vuexModules/application/applicationList.js +71 -71
- package/vuexModules/application/background.js +47 -47
- package/vuexModules/application/bio.js +38 -38
- package/vuexModules/application/citizenship.js +30 -30
- package/vuexModules/application/collegeSummaries.js +32 -32
- package/vuexModules/application/essay.js +26 -26
- package/vuexModules/application/highSchoolSummaries.js +40 -40
- package/vuexModules/application/index.js +157 -157
- package/vuexModules/application/institute.js +30 -30
- package/vuexModules/application/mission.js +48 -48
- package/vuexModules/application/personalRecords.js +24 -24
- package/vuexModules/application/questions.js +23 -23
- package/vuexModules/application/seminary.js +39 -39
- package/vuexModules/application/testScores.js +26 -26
- package/vuexModules/notes/index.js +22 -22
- package/vuexModules/packet/decision.js +43 -43
- package/vuexModules/packet/decisionHistory.js +28 -28
- package/vuexModules/packet/flags.js +174 -174
- package/vuexModules/packet/index.js +52 -52
- package/vuexModules/packet/packetList.js +127 -127
- package/vuexModules/packet/processes.js +28 -28
- package/vuexModules/reports/index.js +32 -32
- package/vuexModules/ui/index.js +56 -56
- package/vuexModules/users/index.js +46 -46
- package/yyyyMmFilter.js +7 -7
package/parsers/application.js
CHANGED
|
@@ -1,396 +1,396 @@
|
|
|
1
|
-
import get from 'lodash.get'
|
|
2
|
-
import ageFn from 's-age'
|
|
3
|
-
|
|
4
|
-
export const parseBasic = b => {
|
|
5
|
-
const admitPeriod = get(b, 'admit_period.value')
|
|
6
|
-
const applicantId = get(b, 'applicant_id.value')
|
|
7
|
-
const applicantMajor = get(b, 'admit_major.description')
|
|
8
|
-
const applicantType = get(b, 'applicant_type.value')
|
|
9
|
-
const firstname = get(b, 'first_name.value')
|
|
10
|
-
const surname = get(b, 'surname.value')
|
|
11
|
-
const applicantName = `${firstname} ${surname}`
|
|
12
|
-
const sortName = `${surname}, ${firstname}`
|
|
13
|
-
const preferredName = get(b, 'preferred_name.value')
|
|
14
|
-
const previousName = get(b, 'previous_name.value')
|
|
15
|
-
|
|
16
|
-
const emailAddress = get(b, 'email_address.value')
|
|
17
|
-
const phoneNumber = get(b, 'phone_number.value')
|
|
18
|
-
const countryCode = get(b, 'country_code.value')
|
|
19
|
-
const countryName = countryCode === 'USA' ? '' : get(b, 'country_code.description')
|
|
20
|
-
const addressLines = [
|
|
21
|
-
get(b, 'address_line_1.value', ''),
|
|
22
|
-
get(b, 'address_line_2.value', ''),
|
|
23
|
-
get(b, 'address_line_3.value', ''),
|
|
24
|
-
get(b, 'address_line_4.value', ''),
|
|
25
|
-
get(b, 'address_line_5.value', '')
|
|
26
|
-
].filter(v => !!(v.trim()))
|
|
27
|
-
if (!addressLines.find(l => l.includes(countryName))) {
|
|
28
|
-
addressLines.push(countryName)
|
|
29
|
-
}
|
|
30
|
-
const city = get(b, 'city.value')
|
|
31
|
-
const state = get(b, 'state_code.description')
|
|
32
|
-
const stateCode = get(b, 'state_code.value')
|
|
33
|
-
const zipCode = get(b, 'postal_code.value')
|
|
34
|
-
if (countryCode === 'USA' && !addressLines.find(l => l.includes(city))) {
|
|
35
|
-
addressLines.push(`${city}, ${stateCode} ${zipCode}`)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const schoolPreferenceOrder = get(b, 'school_preference_order.value')
|
|
39
|
-
|
|
40
|
-
const personId = get(b, 'institution_id.value')
|
|
41
|
-
const netId = get(b, 'net_id.value')
|
|
42
|
-
|
|
43
|
-
const applicationDecision = get(b, 'decision.description')
|
|
44
|
-
const applicationStatus = get(b, 'application_status.description')
|
|
45
|
-
const submittedOn = get(b, 'submitted_date_time.value')
|
|
46
|
-
return {
|
|
47
|
-
addressLines,
|
|
48
|
-
admitPeriod,
|
|
49
|
-
applicantId,
|
|
50
|
-
applicantMajor,
|
|
51
|
-
applicantName,
|
|
52
|
-
applicantType,
|
|
53
|
-
applicationStatus: get(b, 'decision.value', 'O') === 'O' ? applicationStatus : applicationDecision,
|
|
54
|
-
city,
|
|
55
|
-
emailAddress,
|
|
56
|
-
netId,
|
|
57
|
-
personId,
|
|
58
|
-
phoneNumber,
|
|
59
|
-
preferredName,
|
|
60
|
-
previousName,
|
|
61
|
-
schoolPreferenceOrder,
|
|
62
|
-
sortName,
|
|
63
|
-
state,
|
|
64
|
-
submittedOn,
|
|
65
|
-
zipCode
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const parseBioClassifications = b => {
|
|
70
|
-
const parseLanguages = ({ value }) => (value)
|
|
71
|
-
const parseRacialCategories = ({ value }) => (value)
|
|
72
|
-
const biographical = {
|
|
73
|
-
languages: get(b, 'languages', []).map(parseLanguages),
|
|
74
|
-
racialCategories: get(b, 'racial_categories', []).map(parseRacialCategories),
|
|
75
|
-
residingWith: get(b, 'residing_with.value'),
|
|
76
|
-
singleParent: get(b, 'single_parent.value'),
|
|
77
|
-
fathersLevelOfEducation: get(b, 'fathers_level_of_education.value'),
|
|
78
|
-
mothersLevelOfEducation: get(b, 'mothers_level_of_education.value'),
|
|
79
|
-
hispanicFlag: get(b, 'hispanic_flag.value'),
|
|
80
|
-
familyIncome: get(b, 'family_income.value'),
|
|
81
|
-
relatedAlumni: get(b, 'alumni.value')
|
|
82
|
-
}
|
|
83
|
-
return biographical
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const parseAppBackgroundQuestions = q => {
|
|
87
|
-
return {
|
|
88
|
-
convictionRecord: get(q, 'conviction_record.value'),
|
|
89
|
-
criminalConvictions: get(q, 'criminal_convictions', []).map(c => {
|
|
90
|
-
return {
|
|
91
|
-
crime: get(c, 'crime.value'),
|
|
92
|
-
crimeYear: get(c, 'crime_year.value'),
|
|
93
|
-
courts: get(c, 'courts.value'),
|
|
94
|
-
conditions: get(c, 'conditions.value'),
|
|
95
|
-
probation: get(c, 'probation.value'),
|
|
96
|
-
probationExplanation: get(c, 'probation_explanation.value'),
|
|
97
|
-
penalties: get(c, 'penalties.value'),
|
|
98
|
-
penaltiesExplanation: get(c, 'penalties_explanation.value'),
|
|
99
|
-
additionalExplanation: get(c, 'additional_explanation.value')
|
|
100
|
-
}
|
|
101
|
-
}),
|
|
102
|
-
universityDiscipline: get(q, 'university_discipline.value'),
|
|
103
|
-
disciplineExplanation: get(q, 'university_discipline_explanation.value'),
|
|
104
|
-
pluralMarriage: get(q, 'plural_marriage.value'),
|
|
105
|
-
pluralMarriageExplanation: get(q, 'plural_marriage_explanation.value'),
|
|
106
|
-
sexRegistry: get(q, 'sex_registry.value'),
|
|
107
|
-
sexRegistryExplanation: get(q, 'sex_registry_explanation.value')
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export const parseMissions = (mission, personal) => {
|
|
112
|
-
const convertType = type => {
|
|
113
|
-
switch (type) {
|
|
114
|
-
case 'F': return 'Full-Time'
|
|
115
|
-
case 'P': return 'Part-Time'
|
|
116
|
-
case 'S': return 'Service'
|
|
117
|
-
default: return ''
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
name: get(mission, 'mission_name.value'),
|
|
122
|
-
service: get(mission, 'mission_service.value'),
|
|
123
|
-
startMonth: get(mission, 'start_month.value'),
|
|
124
|
-
endMonth: get(mission, 'end_month.value'),
|
|
125
|
-
language: get(mission, 'mission_language.value'),
|
|
126
|
-
type: get(mission, 'mission_type.value'),
|
|
127
|
-
typeDisplay: convertType(get(mission, 'mission_type.value')),
|
|
128
|
-
unitNumber: get(mission, 'unit_number.value'),
|
|
129
|
-
unitName: get(mission, 'unit_name.value'),
|
|
130
|
-
missionEmail: get(mission, 'mission_email.value'),
|
|
131
|
-
religionTenure: get(personal, 'religion_tenure.value'),
|
|
132
|
-
religionCode: get(personal, 'religion_code.value'),
|
|
133
|
-
religion: get(personal, 'religion_code.description')
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export const parseCollegeCumulative = a => {
|
|
138
|
-
return {
|
|
139
|
-
cumulativeGpa: get(a, 'cumulative_gpa.value', ''),
|
|
140
|
-
cumulativeCredits: get(a, 'cumulative_credit.value', '')
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export const parseCollegeSummaries = a => {
|
|
145
|
-
const collegeSummaries = get(a, 'values', []).map(c => {
|
|
146
|
-
return {
|
|
147
|
-
college: get(c, 'college.description'),
|
|
148
|
-
collegeGpa: get(c, 'gpa_verified.value') || get(c, 'gpa.value'),
|
|
149
|
-
creditHoursGraded: get(c, 'credit_hours_graded.value'),
|
|
150
|
-
dateTimeVerified: get(c, 'date_time_verified.value'),
|
|
151
|
-
degree: get(c, 'degree.value'),
|
|
152
|
-
degreeDate: get(c, 'degree_date.value'),
|
|
153
|
-
endMonth: get(c, 'end_month.value'),
|
|
154
|
-
gradePointsEarned: get(c, 'grade_points_earned.value'),
|
|
155
|
-
major: get(c, 'degree_major.value'),
|
|
156
|
-
startMonth: get(c, 'start_month.value')
|
|
157
|
-
}
|
|
158
|
-
})
|
|
159
|
-
return collegeSummaries
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export const parseHighSchoolSummaries = a => {
|
|
163
|
-
const parseHsClass = c => {
|
|
164
|
-
return {
|
|
165
|
-
ap: get(c, 'ap_ib_flag.value') === 'Y',
|
|
166
|
-
courseName: get(c, 'course_name.value'),
|
|
167
|
-
credits: get(c, 'credits.value'),
|
|
168
|
-
gradeLevel: get(c, 'grade_level.value'),
|
|
169
|
-
grades: get(c, 'grades').map(g => g.value),
|
|
170
|
-
gradingTerms: get(c, 'grading_terms.value'),
|
|
171
|
-
repeated: get(c, 'repeated.value') === 'Y',
|
|
172
|
-
subject: get(c, 'subject.value')
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const sortHsClasses = (a, b) => {
|
|
176
|
-
return a.gradeLevel - b.gradeLevel
|
|
177
|
-
}
|
|
178
|
-
const highSchoolSummaries = get(a, 'values', []).map(h => {
|
|
179
|
-
return {
|
|
180
|
-
schoolCode: get(h, 'high_school.value'),
|
|
181
|
-
highSchool: get(h, 'high_school.description'),
|
|
182
|
-
highSchoolType: get(h, 'high_school_type.value'),
|
|
183
|
-
startMonth: get(h, 'start_month.value'),
|
|
184
|
-
endMonth: get(h, 'end_month.value'),
|
|
185
|
-
graduationStatus: get(h, 'graduation_status.value'),
|
|
186
|
-
graduationDate: get(h, 'graduation_date.value'),
|
|
187
|
-
highSchoolGpa: get(h, 'high_school_gpa.value'),
|
|
188
|
-
officialGpa: get(h, 'official_gpa.value'),
|
|
189
|
-
gpaCalculated: get(h, 'gpa_calculated.value'),
|
|
190
|
-
concurrentEnrollment: get(h, 'concurrent_enrollment.value'),
|
|
191
|
-
updatedDateTime: get(h, 'updated_date_time.value'),
|
|
192
|
-
updatedById: get(h, 'updated_by_id.value'),
|
|
193
|
-
dateTimeVerified: get(h, 'date_time_verified.value'),
|
|
194
|
-
highSchoolCountry: get(h, 'high_school_country.value'),
|
|
195
|
-
highSchoolState: get(h, 'high_school_state.value'),
|
|
196
|
-
highSchoolCity: get(h, 'high_school_city.value'),
|
|
197
|
-
linkToDocumentImage: get(h, 'link_to_document_image.value'),
|
|
198
|
-
linkToSecondaryDocumentImage: get(h, 'link_to_secondary_document_image.value'),
|
|
199
|
-
transcriptSource: get(h, 'transcript_source.value'),
|
|
200
|
-
apIbFullClasses: get(h, 'ap_ib_full_classes.value'),
|
|
201
|
-
apIbHalfClasses: get(h, 'ap_ib_half_classes.value'),
|
|
202
|
-
listOfClasses: get(h, 'list_of_classes').map(parseHsClass).sort(sortHsClasses)
|
|
203
|
-
}
|
|
204
|
-
})
|
|
205
|
-
return highSchoolSummaries
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export const parseTestScores = a => {
|
|
209
|
-
const parseTestComponents = list => {
|
|
210
|
-
return {
|
|
211
|
-
name: get(list, 'component_name.value'),
|
|
212
|
-
score: get(list, 'component_score.value')
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const testScores = get(a, 'values', []).map(t => {
|
|
216
|
-
return {
|
|
217
|
-
testDate: get(t, 'test_date.value'),
|
|
218
|
-
dateProcessed: get(t, 'date_time_reported.value'),
|
|
219
|
-
testName: get(t, 'test_name.value'),
|
|
220
|
-
testComponents: get(t, 'test_components').map(parseTestComponents),
|
|
221
|
-
compositeScore: get(t, 'composite_score.value'),
|
|
222
|
-
dateTimeReported: get(t, 'date_time_reported.value'),
|
|
223
|
-
selfReported: get(t, 'self_reported.value', false) === 'Y',
|
|
224
|
-
optIn: get(t, 'test_opt_in.value', 'Y') === 'Y',
|
|
225
|
-
verified: /^[YV]$/.test(get(t, 'verified_status.value', ''))
|
|
226
|
-
}
|
|
227
|
-
})
|
|
228
|
-
return testScores
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export const parseSeminarySummaries = (seminary, questions) => {
|
|
232
|
-
const convertFromQuestion = (q) => {
|
|
233
|
-
if (!q) return undefined
|
|
234
|
-
const findById = id => q.elements.find(e => e.id === id)
|
|
235
|
-
const comments = findById('seminary_comments')
|
|
236
|
-
const graduate = findById('graduate_flag')
|
|
237
|
-
const email = findById('teacher_email')
|
|
238
|
-
const name = findById('teacher_name')
|
|
239
|
-
const yearsTeaching = findById('teacher_years_teaching')
|
|
240
|
-
const responseCriteria = [
|
|
241
|
-
'No basis / Not applicable',
|
|
242
|
-
'Below Average',
|
|
243
|
-
'Average',
|
|
244
|
-
'Above Average <br/>(top 30%)',
|
|
245
|
-
'Excellent <br/>(top 10%)',
|
|
246
|
-
'Outstanding <br/>(top 5%)',
|
|
247
|
-
'One of the top few I\'ve encountered <br/>(top 1%)'
|
|
248
|
-
]
|
|
249
|
-
const questions = q.elements.filter(e => /^question_/.test(e.id)).map(
|
|
250
|
-
q => {
|
|
251
|
-
return {
|
|
252
|
-
prompt: q.prompt,
|
|
253
|
-
response: responseCriteria.findIndex(c => c === q.response)
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
)
|
|
257
|
-
return {
|
|
258
|
-
comments,
|
|
259
|
-
graduate,
|
|
260
|
-
instructor: {
|
|
261
|
-
name,
|
|
262
|
-
email,
|
|
263
|
-
yearsTeaching
|
|
264
|
-
},
|
|
265
|
-
questions,
|
|
266
|
-
responseCriteria
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
const parseTermInfo = i => {
|
|
270
|
-
return {
|
|
271
|
-
sessions: get(i, 'sessions.value'),
|
|
272
|
-
reading: get(i, 'reading.value'),
|
|
273
|
-
term: get(i, 'term.value'),
|
|
274
|
-
recognition: get(i, 'recognition.value'),
|
|
275
|
-
attendance: get(i, 'attendance.value'),
|
|
276
|
-
grade: get(i, 'grade.value'),
|
|
277
|
-
absences: get(i, 'absences.value'),
|
|
278
|
-
credit: get(i, 'credit.value')
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
const parseSeminaryClass = c => {
|
|
282
|
-
return {
|
|
283
|
-
seminaryClass: get(c, 'seminary_class.value'),
|
|
284
|
-
termInfo: get(c, 'term_info', []).map(parseTermInfo),
|
|
285
|
-
academicYear: get(c, 'academic_year.value')
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
const recommendation = convertFromQuestion(questions.SEMINARY)
|
|
289
|
-
return {
|
|
290
|
-
seminaryType: get(seminary, 'seminary_type.description'),
|
|
291
|
-
seminaryClasses: get(seminary, 'seminary_classes', []).map(parseSeminaryClass),
|
|
292
|
-
yearsCompleted: get(seminary, 'years_completed.value'),
|
|
293
|
-
graduationStatus: get(seminary, 'graduation_status.value'),
|
|
294
|
-
teacherEmail: get(seminary, 'teacher_email.value'),
|
|
295
|
-
teacherName: get(seminary, 'teacher_name.value'),
|
|
296
|
-
seminaryExplanation: get(seminary, 'seminary_explanation.value'),
|
|
297
|
-
attendancePercentage: get(seminary, 'attendance_percentage.value'),
|
|
298
|
-
dateTimeReported: get(seminary, 'date_time_reported.value'),
|
|
299
|
-
recommendation
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
export const parseInstituteSummaries = institute => {
|
|
304
|
-
const parseClass = c => {
|
|
305
|
-
return {
|
|
306
|
-
className: get(c, 'institute_class.value'),
|
|
307
|
-
academicYear: get(c, 'academic_year.value'),
|
|
308
|
-
grade: get(c, 'grade.value'),
|
|
309
|
-
forCredit: get(c, 'for_credit.value')
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return {
|
|
313
|
-
attendance: get(institute, 'institute_attendance.value'),
|
|
314
|
-
explanation: get(institute, 'institute_explanation.value'),
|
|
315
|
-
classes: get(institute, 'institute_classes', []).map(parseClass)
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export const parseGovernmentRecords = g => {
|
|
320
|
-
const citizenship = {
|
|
321
|
-
citizenshipStatus: get(g, 'citizenship_status.value'),
|
|
322
|
-
citizenshipStatusDescription: get(g, 'citizenship_status.description'),
|
|
323
|
-
visaTypeSource: get(g, 'visa_type_source.value'),
|
|
324
|
-
visaType: get(g, 'visa_type.value'),
|
|
325
|
-
birthCity: get(g, 'birth_city.value'),
|
|
326
|
-
citizenshipCountryCode: get(g, 'citizenship_country_code.value'),
|
|
327
|
-
citizenshipCountry: get(g, 'citizenship_country_code.description')
|
|
328
|
-
}
|
|
329
|
-
return citizenship
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export const parsePersonalRecords = p => {
|
|
333
|
-
const dateOfBirth = get(p, 'date_of_birth.value')
|
|
334
|
-
const age = dateOfBirth ? ageFn(dateOfBirth) : ''
|
|
335
|
-
return {
|
|
336
|
-
sex: get(p, 'sex.value'),
|
|
337
|
-
dateOfBirth,
|
|
338
|
-
age,
|
|
339
|
-
religion: get(p, 'religion_code.description'),
|
|
340
|
-
religionTenure: get(p, 'religion_tenure.value')
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export const parseQuestions = q => {
|
|
345
|
-
const parseElement = el => ({
|
|
346
|
-
id: get(el, 'id.value'),
|
|
347
|
-
type: get(el, 'type.value'),
|
|
348
|
-
prompt: get(el, 'prompt.value'),
|
|
349
|
-
explanation: get(el, 'explanation.value'),
|
|
350
|
-
response: get(el, 'response.value'),
|
|
351
|
-
responseSet: get(el, 'response_set'),
|
|
352
|
-
ordinal: get(el, 'ordinal.value'),
|
|
353
|
-
limit: get(el, 'limit.value'),
|
|
354
|
-
responseCriteria: get(el, 'response_criteria', []).map(({ value, label }) => ({ value, label })),
|
|
355
|
-
responseRange: get(el, 'response_range.value')
|
|
356
|
-
})
|
|
357
|
-
|
|
358
|
-
const parseGroup = el => ({
|
|
359
|
-
id: get(q, 'id.value'),
|
|
360
|
-
heading: get(q, 'heading.value'),
|
|
361
|
-
description: get(q, 'description.value'),
|
|
362
|
-
name: get(q, 'name.value'),
|
|
363
|
-
ordinal: get(q, 'ordinal.value'),
|
|
364
|
-
elements: get(el, 'elements', []).map(parseElement)
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
const questions = get(q, 'values', []).reduce((o, q) => {
|
|
368
|
-
const name = get(q, 'name.value')
|
|
369
|
-
if (!name) {
|
|
370
|
-
return o
|
|
371
|
-
}
|
|
372
|
-
return Object.assign(o, {
|
|
373
|
-
[name]: {
|
|
374
|
-
name,
|
|
375
|
-
description: get(q, 'description.value'),
|
|
376
|
-
type: get(q, 'type.value'),
|
|
377
|
-
uuid: get(q, 'uuid.value'),
|
|
378
|
-
elements: get(q, 'elements', []).map(parseElement),
|
|
379
|
-
groups: get(q, 'groups', []).map(parseGroup)
|
|
380
|
-
}
|
|
381
|
-
})
|
|
382
|
-
}, {})
|
|
383
|
-
return questions
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export const questionResponses = ({ elements = [] }) => elements.reduce((s, el) => s.concat(el.response), '')
|
|
387
|
-
export const wc = str => str.length > 0 ? str.split(/\s+/).length : 0
|
|
388
|
-
|
|
389
|
-
export const parsePathway = g => {
|
|
390
|
-
return {
|
|
391
|
-
credits: get(g, 'pw_credits.value'),
|
|
392
|
-
gpa: get(g, 'pw_gpa.value'),
|
|
393
|
-
completion: get(g, 'pw_completion.value'),
|
|
394
|
-
site: get(g, 'pw_site.value')
|
|
395
|
-
}
|
|
396
|
-
}
|
|
1
|
+
import get from 'lodash.get'
|
|
2
|
+
import ageFn from 's-age'
|
|
3
|
+
|
|
4
|
+
export const parseBasic = b => {
|
|
5
|
+
const admitPeriod = get(b, 'admit_period.value')
|
|
6
|
+
const applicantId = get(b, 'applicant_id.value')
|
|
7
|
+
const applicantMajor = get(b, 'admit_major.description')
|
|
8
|
+
const applicantType = get(b, 'applicant_type.value')
|
|
9
|
+
const firstname = get(b, 'first_name.value')
|
|
10
|
+
const surname = get(b, 'surname.value')
|
|
11
|
+
const applicantName = `${firstname} ${surname}`
|
|
12
|
+
const sortName = `${surname}, ${firstname}`
|
|
13
|
+
const preferredName = get(b, 'preferred_name.value')
|
|
14
|
+
const previousName = get(b, 'previous_name.value')
|
|
15
|
+
|
|
16
|
+
const emailAddress = get(b, 'email_address.value')
|
|
17
|
+
const phoneNumber = get(b, 'phone_number.value')
|
|
18
|
+
const countryCode = get(b, 'country_code.value')
|
|
19
|
+
const countryName = countryCode === 'USA' ? '' : get(b, 'country_code.description')
|
|
20
|
+
const addressLines = [
|
|
21
|
+
get(b, 'address_line_1.value', ''),
|
|
22
|
+
get(b, 'address_line_2.value', ''),
|
|
23
|
+
get(b, 'address_line_3.value', ''),
|
|
24
|
+
get(b, 'address_line_4.value', ''),
|
|
25
|
+
get(b, 'address_line_5.value', '')
|
|
26
|
+
].filter(v => !!(v.trim()))
|
|
27
|
+
if (!addressLines.find(l => l.includes(countryName))) {
|
|
28
|
+
addressLines.push(countryName)
|
|
29
|
+
}
|
|
30
|
+
const city = get(b, 'city.value')
|
|
31
|
+
const state = get(b, 'state_code.description')
|
|
32
|
+
const stateCode = get(b, 'state_code.value')
|
|
33
|
+
const zipCode = get(b, 'postal_code.value')
|
|
34
|
+
if (countryCode === 'USA' && !addressLines.find(l => l.includes(city))) {
|
|
35
|
+
addressLines.push(`${city}, ${stateCode} ${zipCode}`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const schoolPreferenceOrder = get(b, 'school_preference_order.value')
|
|
39
|
+
|
|
40
|
+
const personId = get(b, 'institution_id.value')
|
|
41
|
+
const netId = get(b, 'net_id.value')
|
|
42
|
+
|
|
43
|
+
const applicationDecision = get(b, 'decision.description')
|
|
44
|
+
const applicationStatus = get(b, 'application_status.description')
|
|
45
|
+
const submittedOn = get(b, 'submitted_date_time.value')
|
|
46
|
+
return {
|
|
47
|
+
addressLines,
|
|
48
|
+
admitPeriod,
|
|
49
|
+
applicantId,
|
|
50
|
+
applicantMajor,
|
|
51
|
+
applicantName,
|
|
52
|
+
applicantType,
|
|
53
|
+
applicationStatus: get(b, 'decision.value', 'O') === 'O' ? applicationStatus : applicationDecision,
|
|
54
|
+
city,
|
|
55
|
+
emailAddress,
|
|
56
|
+
netId,
|
|
57
|
+
personId,
|
|
58
|
+
phoneNumber,
|
|
59
|
+
preferredName,
|
|
60
|
+
previousName,
|
|
61
|
+
schoolPreferenceOrder,
|
|
62
|
+
sortName,
|
|
63
|
+
state,
|
|
64
|
+
submittedOn,
|
|
65
|
+
zipCode
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const parseBioClassifications = b => {
|
|
70
|
+
const parseLanguages = ({ value }) => (value)
|
|
71
|
+
const parseRacialCategories = ({ value }) => (value)
|
|
72
|
+
const biographical = {
|
|
73
|
+
languages: get(b, 'languages', []).map(parseLanguages),
|
|
74
|
+
racialCategories: get(b, 'racial_categories', []).map(parseRacialCategories),
|
|
75
|
+
residingWith: get(b, 'residing_with.value'),
|
|
76
|
+
singleParent: get(b, 'single_parent.value'),
|
|
77
|
+
fathersLevelOfEducation: get(b, 'fathers_level_of_education.value'),
|
|
78
|
+
mothersLevelOfEducation: get(b, 'mothers_level_of_education.value'),
|
|
79
|
+
hispanicFlag: get(b, 'hispanic_flag.value'),
|
|
80
|
+
familyIncome: get(b, 'family_income.value'),
|
|
81
|
+
relatedAlumni: get(b, 'alumni.value')
|
|
82
|
+
}
|
|
83
|
+
return biographical
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const parseAppBackgroundQuestions = q => {
|
|
87
|
+
return {
|
|
88
|
+
convictionRecord: get(q, 'conviction_record.value'),
|
|
89
|
+
criminalConvictions: get(q, 'criminal_convictions', []).map(c => {
|
|
90
|
+
return {
|
|
91
|
+
crime: get(c, 'crime.value'),
|
|
92
|
+
crimeYear: get(c, 'crime_year.value'),
|
|
93
|
+
courts: get(c, 'courts.value'),
|
|
94
|
+
conditions: get(c, 'conditions.value'),
|
|
95
|
+
probation: get(c, 'probation.value'),
|
|
96
|
+
probationExplanation: get(c, 'probation_explanation.value'),
|
|
97
|
+
penalties: get(c, 'penalties.value'),
|
|
98
|
+
penaltiesExplanation: get(c, 'penalties_explanation.value'),
|
|
99
|
+
additionalExplanation: get(c, 'additional_explanation.value')
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
universityDiscipline: get(q, 'university_discipline.value'),
|
|
103
|
+
disciplineExplanation: get(q, 'university_discipline_explanation.value'),
|
|
104
|
+
pluralMarriage: get(q, 'plural_marriage.value'),
|
|
105
|
+
pluralMarriageExplanation: get(q, 'plural_marriage_explanation.value'),
|
|
106
|
+
sexRegistry: get(q, 'sex_registry.value'),
|
|
107
|
+
sexRegistryExplanation: get(q, 'sex_registry_explanation.value')
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const parseMissions = (mission, personal) => {
|
|
112
|
+
const convertType = type => {
|
|
113
|
+
switch (type) {
|
|
114
|
+
case 'F': return 'Full-Time'
|
|
115
|
+
case 'P': return 'Part-Time'
|
|
116
|
+
case 'S': return 'Service'
|
|
117
|
+
default: return ''
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
name: get(mission, 'mission_name.value'),
|
|
122
|
+
service: get(mission, 'mission_service.value'),
|
|
123
|
+
startMonth: get(mission, 'start_month.value'),
|
|
124
|
+
endMonth: get(mission, 'end_month.value'),
|
|
125
|
+
language: get(mission, 'mission_language.value'),
|
|
126
|
+
type: get(mission, 'mission_type.value'),
|
|
127
|
+
typeDisplay: convertType(get(mission, 'mission_type.value')),
|
|
128
|
+
unitNumber: get(mission, 'unit_number.value'),
|
|
129
|
+
unitName: get(mission, 'unit_name.value'),
|
|
130
|
+
missionEmail: get(mission, 'mission_email.value'),
|
|
131
|
+
religionTenure: get(personal, 'religion_tenure.value'),
|
|
132
|
+
religionCode: get(personal, 'religion_code.value'),
|
|
133
|
+
religion: get(personal, 'religion_code.description')
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const parseCollegeCumulative = a => {
|
|
138
|
+
return {
|
|
139
|
+
cumulativeGpa: get(a, 'cumulative_gpa.value', ''),
|
|
140
|
+
cumulativeCredits: get(a, 'cumulative_credit.value', '')
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const parseCollegeSummaries = a => {
|
|
145
|
+
const collegeSummaries = get(a, 'values', []).map(c => {
|
|
146
|
+
return {
|
|
147
|
+
college: get(c, 'college.description'),
|
|
148
|
+
collegeGpa: get(c, 'gpa_verified.value') || get(c, 'gpa.value'),
|
|
149
|
+
creditHoursGraded: get(c, 'credit_hours_graded.value'),
|
|
150
|
+
dateTimeVerified: get(c, 'date_time_verified.value'),
|
|
151
|
+
degree: get(c, 'degree.value'),
|
|
152
|
+
degreeDate: get(c, 'degree_date.value'),
|
|
153
|
+
endMonth: get(c, 'end_month.value'),
|
|
154
|
+
gradePointsEarned: get(c, 'grade_points_earned.value'),
|
|
155
|
+
major: get(c, 'degree_major.value'),
|
|
156
|
+
startMonth: get(c, 'start_month.value')
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
return collegeSummaries
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export const parseHighSchoolSummaries = a => {
|
|
163
|
+
const parseHsClass = c => {
|
|
164
|
+
return {
|
|
165
|
+
ap: get(c, 'ap_ib_flag.value') === 'Y',
|
|
166
|
+
courseName: get(c, 'course_name.value'),
|
|
167
|
+
credits: get(c, 'credits.value'),
|
|
168
|
+
gradeLevel: get(c, 'grade_level.value'),
|
|
169
|
+
grades: get(c, 'grades').map(g => g.value),
|
|
170
|
+
gradingTerms: get(c, 'grading_terms.value'),
|
|
171
|
+
repeated: get(c, 'repeated.value') === 'Y',
|
|
172
|
+
subject: get(c, 'subject.value')
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const sortHsClasses = (a, b) => {
|
|
176
|
+
return a.gradeLevel - b.gradeLevel
|
|
177
|
+
}
|
|
178
|
+
const highSchoolSummaries = get(a, 'values', []).map(h => {
|
|
179
|
+
return {
|
|
180
|
+
schoolCode: get(h, 'high_school.value'),
|
|
181
|
+
highSchool: get(h, 'high_school.description'),
|
|
182
|
+
highSchoolType: get(h, 'high_school_type.value'),
|
|
183
|
+
startMonth: get(h, 'start_month.value'),
|
|
184
|
+
endMonth: get(h, 'end_month.value'),
|
|
185
|
+
graduationStatus: get(h, 'graduation_status.value'),
|
|
186
|
+
graduationDate: get(h, 'graduation_date.value'),
|
|
187
|
+
highSchoolGpa: get(h, 'high_school_gpa.value'),
|
|
188
|
+
officialGpa: get(h, 'official_gpa.value'),
|
|
189
|
+
gpaCalculated: get(h, 'gpa_calculated.value'),
|
|
190
|
+
concurrentEnrollment: get(h, 'concurrent_enrollment.value'),
|
|
191
|
+
updatedDateTime: get(h, 'updated_date_time.value'),
|
|
192
|
+
updatedById: get(h, 'updated_by_id.value'),
|
|
193
|
+
dateTimeVerified: get(h, 'date_time_verified.value'),
|
|
194
|
+
highSchoolCountry: get(h, 'high_school_country.value'),
|
|
195
|
+
highSchoolState: get(h, 'high_school_state.value'),
|
|
196
|
+
highSchoolCity: get(h, 'high_school_city.value'),
|
|
197
|
+
linkToDocumentImage: get(h, 'link_to_document_image.value'),
|
|
198
|
+
linkToSecondaryDocumentImage: get(h, 'link_to_secondary_document_image.value'),
|
|
199
|
+
transcriptSource: get(h, 'transcript_source.value'),
|
|
200
|
+
apIbFullClasses: get(h, 'ap_ib_full_classes.value'),
|
|
201
|
+
apIbHalfClasses: get(h, 'ap_ib_half_classes.value'),
|
|
202
|
+
listOfClasses: get(h, 'list_of_classes').map(parseHsClass).sort(sortHsClasses)
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
return highSchoolSummaries
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export const parseTestScores = a => {
|
|
209
|
+
const parseTestComponents = list => {
|
|
210
|
+
return {
|
|
211
|
+
name: get(list, 'component_name.value'),
|
|
212
|
+
score: get(list, 'component_score.value')
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const testScores = get(a, 'values', []).map(t => {
|
|
216
|
+
return {
|
|
217
|
+
testDate: get(t, 'test_date.value'),
|
|
218
|
+
dateProcessed: get(t, 'date_time_reported.value'),
|
|
219
|
+
testName: get(t, 'test_name.value'),
|
|
220
|
+
testComponents: get(t, 'test_components').map(parseTestComponents),
|
|
221
|
+
compositeScore: get(t, 'composite_score.value'),
|
|
222
|
+
dateTimeReported: get(t, 'date_time_reported.value'),
|
|
223
|
+
selfReported: get(t, 'self_reported.value', false) === 'Y',
|
|
224
|
+
optIn: get(t, 'test_opt_in.value', 'Y') === 'Y',
|
|
225
|
+
verified: /^[YV]$/.test(get(t, 'verified_status.value', ''))
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
return testScores
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export const parseSeminarySummaries = (seminary, questions) => {
|
|
232
|
+
const convertFromQuestion = (q) => {
|
|
233
|
+
if (!q) return undefined
|
|
234
|
+
const findById = id => q.elements.find(e => e.id === id)
|
|
235
|
+
const comments = findById('seminary_comments')
|
|
236
|
+
const graduate = findById('graduate_flag')
|
|
237
|
+
const email = findById('teacher_email')
|
|
238
|
+
const name = findById('teacher_name')
|
|
239
|
+
const yearsTeaching = findById('teacher_years_teaching')
|
|
240
|
+
const responseCriteria = [
|
|
241
|
+
'No basis / Not applicable',
|
|
242
|
+
'Below Average',
|
|
243
|
+
'Average',
|
|
244
|
+
'Above Average <br/>(top 30%)',
|
|
245
|
+
'Excellent <br/>(top 10%)',
|
|
246
|
+
'Outstanding <br/>(top 5%)',
|
|
247
|
+
'One of the top few I\'ve encountered <br/>(top 1%)'
|
|
248
|
+
]
|
|
249
|
+
const questions = q.elements.filter(e => /^question_/.test(e.id)).map(
|
|
250
|
+
q => {
|
|
251
|
+
return {
|
|
252
|
+
prompt: q.prompt,
|
|
253
|
+
response: responseCriteria.findIndex(c => c === q.response)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
return {
|
|
258
|
+
comments,
|
|
259
|
+
graduate,
|
|
260
|
+
instructor: {
|
|
261
|
+
name,
|
|
262
|
+
email,
|
|
263
|
+
yearsTeaching
|
|
264
|
+
},
|
|
265
|
+
questions,
|
|
266
|
+
responseCriteria
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const parseTermInfo = i => {
|
|
270
|
+
return {
|
|
271
|
+
sessions: get(i, 'sessions.value'),
|
|
272
|
+
reading: get(i, 'reading.value'),
|
|
273
|
+
term: get(i, 'term.value'),
|
|
274
|
+
recognition: get(i, 'recognition.value'),
|
|
275
|
+
attendance: get(i, 'attendance.value'),
|
|
276
|
+
grade: get(i, 'grade.value'),
|
|
277
|
+
absences: get(i, 'absences.value'),
|
|
278
|
+
credit: get(i, 'credit.value')
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const parseSeminaryClass = c => {
|
|
282
|
+
return {
|
|
283
|
+
seminaryClass: get(c, 'seminary_class.value'),
|
|
284
|
+
termInfo: get(c, 'term_info', []).map(parseTermInfo),
|
|
285
|
+
academicYear: get(c, 'academic_year.value')
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const recommendation = convertFromQuestion(questions.SEMINARY)
|
|
289
|
+
return {
|
|
290
|
+
seminaryType: get(seminary, 'seminary_type.description'),
|
|
291
|
+
seminaryClasses: get(seminary, 'seminary_classes', []).map(parseSeminaryClass),
|
|
292
|
+
yearsCompleted: get(seminary, 'years_completed.value'),
|
|
293
|
+
graduationStatus: get(seminary, 'graduation_status.value'),
|
|
294
|
+
teacherEmail: get(seminary, 'teacher_email.value'),
|
|
295
|
+
teacherName: get(seminary, 'teacher_name.value'),
|
|
296
|
+
seminaryExplanation: get(seminary, 'seminary_explanation.value'),
|
|
297
|
+
attendancePercentage: get(seminary, 'attendance_percentage.value'),
|
|
298
|
+
dateTimeReported: get(seminary, 'date_time_reported.value'),
|
|
299
|
+
recommendation
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export const parseInstituteSummaries = institute => {
|
|
304
|
+
const parseClass = c => {
|
|
305
|
+
return {
|
|
306
|
+
className: get(c, 'institute_class.value'),
|
|
307
|
+
academicYear: get(c, 'academic_year.value'),
|
|
308
|
+
grade: get(c, 'grade.value'),
|
|
309
|
+
forCredit: get(c, 'for_credit.value')
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
attendance: get(institute, 'institute_attendance.value'),
|
|
314
|
+
explanation: get(institute, 'institute_explanation.value'),
|
|
315
|
+
classes: get(institute, 'institute_classes', []).map(parseClass)
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export const parseGovernmentRecords = g => {
|
|
320
|
+
const citizenship = {
|
|
321
|
+
citizenshipStatus: get(g, 'citizenship_status.value'),
|
|
322
|
+
citizenshipStatusDescription: get(g, 'citizenship_status.description'),
|
|
323
|
+
visaTypeSource: get(g, 'visa_type_source.value'),
|
|
324
|
+
visaType: get(g, 'visa_type.value'),
|
|
325
|
+
birthCity: get(g, 'birth_city.value'),
|
|
326
|
+
citizenshipCountryCode: get(g, 'citizenship_country_code.value'),
|
|
327
|
+
citizenshipCountry: get(g, 'citizenship_country_code.description')
|
|
328
|
+
}
|
|
329
|
+
return citizenship
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export const parsePersonalRecords = p => {
|
|
333
|
+
const dateOfBirth = get(p, 'date_of_birth.value')
|
|
334
|
+
const age = dateOfBirth ? ageFn(dateOfBirth) : ''
|
|
335
|
+
return {
|
|
336
|
+
sex: get(p, 'sex.value'),
|
|
337
|
+
dateOfBirth,
|
|
338
|
+
age,
|
|
339
|
+
religion: get(p, 'religion_code.description'),
|
|
340
|
+
religionTenure: get(p, 'religion_tenure.value')
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export const parseQuestions = q => {
|
|
345
|
+
const parseElement = el => ({
|
|
346
|
+
id: get(el, 'id.value'),
|
|
347
|
+
type: get(el, 'type.value'),
|
|
348
|
+
prompt: get(el, 'prompt.value'),
|
|
349
|
+
explanation: get(el, 'explanation.value'),
|
|
350
|
+
response: get(el, 'response.value'),
|
|
351
|
+
responseSet: get(el, 'response_set'),
|
|
352
|
+
ordinal: get(el, 'ordinal.value'),
|
|
353
|
+
limit: get(el, 'limit.value'),
|
|
354
|
+
responseCriteria: get(el, 'response_criteria', []).map(({ value, label }) => ({ value, label })),
|
|
355
|
+
responseRange: get(el, 'response_range.value')
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
const parseGroup = el => ({
|
|
359
|
+
id: get(q, 'id.value'),
|
|
360
|
+
heading: get(q, 'heading.value'),
|
|
361
|
+
description: get(q, 'description.value'),
|
|
362
|
+
name: get(q, 'name.value'),
|
|
363
|
+
ordinal: get(q, 'ordinal.value'),
|
|
364
|
+
elements: get(el, 'elements', []).map(parseElement)
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
const questions = get(q, 'values', []).reduce((o, q) => {
|
|
368
|
+
const name = get(q, 'name.value')
|
|
369
|
+
if (!name) {
|
|
370
|
+
return o
|
|
371
|
+
}
|
|
372
|
+
return Object.assign(o, {
|
|
373
|
+
[name]: {
|
|
374
|
+
name,
|
|
375
|
+
description: get(q, 'description.value'),
|
|
376
|
+
type: get(q, 'type.value'),
|
|
377
|
+
uuid: get(q, 'uuid.value'),
|
|
378
|
+
elements: get(q, 'elements', []).map(parseElement),
|
|
379
|
+
groups: get(q, 'groups', []).map(parseGroup)
|
|
380
|
+
}
|
|
381
|
+
})
|
|
382
|
+
}, {})
|
|
383
|
+
return questions
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export const questionResponses = ({ elements = [] }) => elements.reduce((s, el) => s.concat(el.response), '')
|
|
387
|
+
export const wc = str => str.length > 0 ? str.split(/\s+/).length : 0
|
|
388
|
+
|
|
389
|
+
export const parsePathway = g => {
|
|
390
|
+
return {
|
|
391
|
+
credits: get(g, 'pw_credits.value'),
|
|
392
|
+
gpa: get(g, 'pw_gpa.value'),
|
|
393
|
+
completion: get(g, 'pw_completion.value'),
|
|
394
|
+
site: get(g, 'pw_site.value')
|
|
395
|
+
}
|
|
396
|
+
}
|