@csmart/ngc-smart-victim 1.14.44 → 1.14.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/README.md +25 -25
  2. package/esm2020/lib/caseNote/caseNote.component.mjs +194 -0
  3. package/esm2020/lib/common-dialog/common-dialog.component.mjs +23 -0
  4. package/esm2020/lib/common-dialog/common-dialog.module.mjs +34 -0
  5. package/esm2020/lib/common-dialog/common-dialog.service.mjs +33 -0
  6. package/esm2020/lib/contact/contact.component.mjs +140 -0
  7. package/esm2020/lib/email.services.mjs +42 -0
  8. package/esm2020/lib/intake.service.mjs +57 -0
  9. package/esm2020/lib/safetyPlan/serviceProvider.component.mjs +99 -0
  10. package/esm2020/lib/safetyPlan/victimSafetyPlan.component.mjs +116 -0
  11. package/esm2020/lib/safetyPlan/victimSafetyPlanDetail.component.mjs +340 -0
  12. package/esm2020/lib/shared/app.shared.module.mjs +215 -0
  13. package/esm2020/lib/shared/validators/date.validator.mjs +59 -0
  14. package/esm2020/lib/smart-victim-delete-confirm.component.mjs +44 -0
  15. package/esm2020/lib/smart-victim-detail/smart-victim-detail.component.mjs +1104 -0
  16. package/esm2020/lib/smart-victim.component.mjs +314 -0
  17. package/esm2020/lib/smart-victim.model.mjs +133 -0
  18. package/esm2020/lib/smart-victim.module.mjs +128 -0
  19. package/esm2020/lib/smart-victim.service.mjs +352 -0
  20. package/{esm2022 → esm2020}/lib/victim-routing.module.mjs +5 -5
  21. package/esm2020/lib/victimSearch/VictimSearchFilter.mjs +3 -0
  22. package/esm2020/lib/victimSearch/victimSearchForm.component.mjs +38 -0
  23. package/{esm2022 → esm2020}/public-api.mjs +1 -1
  24. package/fesm2015/csmart-ngc-smart-victim.mjs +3273 -0
  25. package/fesm2015/csmart-ngc-smart-victim.mjs.map +1 -0
  26. package/fesm2020/csmart-ngc-smart-victim.mjs +3261 -0
  27. package/fesm2020/csmart-ngc-smart-victim.mjs.map +1 -0
  28. package/lib/caseNote/caseNote.component.d.ts +2 -2
  29. package/lib/common-dialog/common-dialog.component.d.ts +1 -1
  30. package/lib/contact/contact.component.d.ts +1 -1
  31. package/lib/safetyPlan/serviceProvider.component.d.ts +1 -1
  32. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +2 -2
  33. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +2 -2
  34. package/lib/smart-victim-delete-confirm.component.d.ts +1 -1
  35. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +2 -2
  36. package/lib/smart-victim.component.d.ts +2 -2
  37. package/lib/victimSearch/victimSearchForm.component.d.ts +1 -1
  38. package/package.json +11 -5
  39. package/esm2022/lib/caseNote/caseNote.component.mjs +0 -219
  40. package/esm2022/lib/common-dialog/common-dialog.component.mjs +0 -26
  41. package/esm2022/lib/common-dialog/common-dialog.module.mjs +0 -34
  42. package/esm2022/lib/common-dialog/common-dialog.service.mjs +0 -34
  43. package/esm2022/lib/contact/contact.component.mjs +0 -158
  44. package/esm2022/lib/email.services.mjs +0 -43
  45. package/esm2022/lib/intake.service.mjs +0 -59
  46. package/esm2022/lib/safetyPlan/serviceProvider.component.mjs +0 -105
  47. package/esm2022/lib/safetyPlan/victimSafetyPlan.component.mjs +0 -146
  48. package/esm2022/lib/safetyPlan/victimSafetyPlanDetail.component.mjs +0 -372
  49. package/esm2022/lib/shared/app.shared.module.mjs +0 -215
  50. package/esm2022/lib/shared/validators/date.validator.mjs +0 -59
  51. package/esm2022/lib/smart-victim-delete-confirm.component.mjs +0 -46
  52. package/esm2022/lib/smart-victim-detail/smart-victim-detail.component.mjs +0 -1141
  53. package/esm2022/lib/smart-victim.component.mjs +0 -343
  54. package/esm2022/lib/smart-victim.model.mjs +0 -233
  55. package/esm2022/lib/smart-victim.module.mjs +0 -128
  56. package/esm2022/lib/smart-victim.service.mjs +0 -357
  57. package/esm2022/lib/victimSearch/VictimSearchFilter.mjs +0 -8
  58. package/esm2022/lib/victimSearch/victimSearchForm.component.mjs +0 -37
  59. package/fesm2022/csmart-ngc-smart-victim.mjs +0 -3556
  60. package/fesm2022/csmart-ngc-smart-victim.mjs.map +0 -1
  61. /package/{esm2022 → esm2020}/csmart-ngc-smart-victim.mjs +0 -0
  62. /package/{esm2022 → esm2020}/lib/shared/validators/index.mjs +0 -0
@@ -1,3556 +0,0 @@
1
- import * as i1 from '@angular/common/http';
2
- import { HttpHeaders } from '@angular/common/http';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, Injectable, Inject, Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
5
- import { throwError } from 'rxjs';
6
- import { map, catchError } from 'rxjs/operators';
7
- import * as i2 from 'apollo-angular';
8
- import { ApolloModule } from 'apollo-angular';
9
- import * as i8$1 from '@angular/common';
10
- import { DatePipe, DOCUMENT, CommonModule } from '@angular/common';
11
- import * as i5 from '@angular/router';
12
- import { RouterModule } from '@angular/router';
13
- import * as i11$1 from '@angular/material/table';
14
- import { MatTableDataSource, MatTableModule } from '@angular/material/table';
15
- import { MatSort, MatSortModule } from '@angular/material/sort';
16
- import * as i1$1 from '@angular/material/dialog';
17
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
18
- import * as i6 from '@csmart/ngc-smart-core';
19
- import { AccessType, LoginStaffResolverService, SelectedOffenderResolverService, SmartErrorComponent, NgcSmartCoreModule } from '@csmart/ngc-smart-core';
20
- import * as i10$1 from '@angular/material/paginator';
21
- import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
22
- import * as i4 from '@angular/material/snack-bar';
23
- import { MatSnackBarModule } from '@angular/material/snack-bar';
24
- import * as i2$1 from '@angular/material/button';
25
- import { MatButtonModule } from '@angular/material/button';
26
- import * as i8 from '@angular/material/card';
27
- import { MatCardModule } from '@angular/material/card';
28
- import * as i9$1 from '@angular/material/icon';
29
- import { MatIconModule } from '@angular/material/icon';
30
- import * as i1$2 from '@angular/forms';
31
- import { UntypedFormControl, Validators, UntypedFormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
32
- import * as i10 from '@angular/material/radio';
33
- import { MatRadioGroup, MatRadioModule } from '@angular/material/radio';
34
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
35
- import * as i20 from '@csmart/ngc-smart-address';
36
- import { SmartAddressModule } from '@csmart/ngc-smart-address';
37
- import * as i14 from '@angular/material/input';
38
- import { MatInput, MatInputModule } from '@angular/material/input';
39
- import * as i17 from '@angular/material/select';
40
- import { MatSelect, MatSelectModule } from '@angular/material/select';
41
- import * as i9 from '@angular/material/checkbox';
42
- import { MatCheckboxModule } from '@angular/material/checkbox';
43
- import * as i11 from '@angular/material/slider';
44
- import { MatSliderModule } from '@angular/material/slider';
45
- import * as i13 from '@angular/material/tabs';
46
- import { MatTabsModule } from '@angular/material/tabs';
47
- import * as i15 from '@angular/material/form-field';
48
- import * as i16 from '@angular/material/datepicker';
49
- import { MatDatepickerModule } from '@angular/material/datepicker';
50
- import * as i18 from '@angular/material/core';
51
- import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
52
- import * as i21 from '@csmart/smart-ui';
53
- import { SmartUiModule } from '@csmart/smart-ui';
54
- import * as i3 from '@angular/material/expansion';
55
- import { MatExpansionModule } from '@angular/material/expansion';
56
- import * as i12 from '@angular/material/list';
57
- import { MatListModule } from '@angular/material/list';
58
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
59
- import * as i11$2 from '@angular/material/toolbar';
60
- import { MatToolbarModule } from '@angular/material/toolbar';
61
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
62
- import { MatGridListModule } from '@angular/material/grid-list';
63
- import { CdkTableModule } from '@angular/cdk/table';
64
- import { LayoutModule } from '@angular/cdk/layout';
65
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
66
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
67
- import { MatSidenavModule } from '@angular/material/sidenav';
68
- import { MatStepperModule } from '@angular/material/stepper';
69
- import { MatChipsModule } from '@angular/material/chips';
70
- import { MsalGuard } from '@azure/msal-angular';
71
- import gql from 'graphql-tag';
72
- import * as i14$1 from '@angular/cdk/text-field';
73
- import { MatMenuModule } from '@angular/material/menu';
74
- import { MatProgressBarModule } from '@angular/material/progress-bar';
75
-
76
- const SMART_OFFENDER_SERVICE_URL = new InjectionToken('smart offender service url');
77
- const SMART_LOOKUP_SERVICE_URL = new InjectionToken('smart lookup service url');
78
- const SMART_VICTIM_SERVICE_URL = new InjectionToken('smart victim service url');
79
- const SMART_WARRANT_URL = new InjectionToken('smart warrant web url');
80
- let VictimListFilter$1 = class VictimListFilter {
81
- offenderId;
82
- lastName;
83
- firstName;
84
- pdid;
85
- birthDate;
86
- };
87
- class VictimAdvocate {
88
- victimAdvocateId;
89
- lastName;
90
- firstName;
91
- prefixId;
92
- suffixId;
93
- addressId;
94
- noPhoneFlag;
95
- homePhone;
96
- workPhone;
97
- cellPhone;
98
- email;
99
- modifiedBy;
100
- constructor(victimAdvocateId, lastName, firstName, prefixId, suffixId, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
101
- this.victimAdvocateId = victimAdvocateId;
102
- this.lastName = lastName;
103
- this.firstName = firstName;
104
- this.prefixId = prefixId;
105
- this.suffixId = suffixId;
106
- this.addressId = addressId;
107
- this.noPhoneFlag = noPhoneFlag;
108
- this.homePhone = homePhone;
109
- this.workPhone = workPhone;
110
- this.cellPhone = cellPhone;
111
- this.email = email;
112
- this.modifiedBy = modifiedBy;
113
- }
114
- }
115
- class VictimWeaponUse {
116
- victimId;
117
- weaponTypeId;
118
- otherWeapon;
119
- modifiedBy;
120
- constructor(
121
- // public victimWeaponUseId: number,
122
- victimId, weaponTypeId, otherWeapon, modifiedBy) {
123
- this.victimId = victimId;
124
- this.weaponTypeId = weaponTypeId;
125
- this.otherWeapon = otherWeapon;
126
- this.modifiedBy = modifiedBy;
127
- }
128
- }
129
- class VictimDrugUse {
130
- victimId;
131
- drugTypeId;
132
- otherDrug;
133
- modifiedBy;
134
- constructor(
135
- //public victimDrugUseId: number,
136
- victimId, drugTypeId, otherDrug, modifiedBy) {
137
- this.victimId = victimId;
138
- this.drugTypeId = drugTypeId;
139
- this.otherDrug = otherDrug;
140
- this.modifiedBy = modifiedBy;
141
- }
142
- }
143
- class VictimSupport {
144
- victimId;
145
- victimSupportTypeId;
146
- modifiedBy;
147
- constructor(
148
- // public victimSupportId: number,
149
- victimId, victimSupportTypeId, modifiedBy) {
150
- this.victimId = victimId;
151
- this.victimSupportTypeId = victimSupportTypeId;
152
- this.modifiedBy = modifiedBy;
153
- }
154
- }
155
- class VictimGuardian {
156
- victimGuardianId;
157
- lastName;
158
- firstName;
159
- prefixId;
160
- suffixId;
161
- birthDate;
162
- addressId;
163
- noPhoneFlag;
164
- homePhone;
165
- workPhone;
166
- cellPhone;
167
- email;
168
- modifiedBy;
169
- constructor(victimGuardianId, lastName, firstName, prefixId, suffixId, birthDate, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
170
- this.victimGuardianId = victimGuardianId;
171
- this.lastName = lastName;
172
- this.firstName = firstName;
173
- this.prefixId = prefixId;
174
- this.suffixId = suffixId;
175
- this.birthDate = birthDate;
176
- this.addressId = addressId;
177
- this.noPhoneFlag = noPhoneFlag;
178
- this.homePhone = homePhone;
179
- this.workPhone = workPhone;
180
- this.cellPhone = cellPhone;
181
- this.email = email;
182
- this.modifiedBy = modifiedBy;
183
- }
184
- }
185
- class Victim {
186
- victimId;
187
- offenderId;
188
- underSupervisionFlag;
189
- victimOffenderRelationshipTypeId;
190
- lastName;
191
- firstName;
192
- middleName;
193
- prefixId;
194
- suffixId;
195
- birthDate;
196
- genderCode;
197
- homePhone;
198
- workPhone;
199
- cellPhone;
200
- email;
201
- addressId;
202
- minorFlag;
203
- victimAdvocateFlag;
204
- guardianFirstName;
205
- guardianLastName;
206
- guardianPrefixId;
207
- guardianSuffixId;
208
- guardianNoPhoneFlag;
209
- guardianHomePhone;
210
- guardianWorkPhone;
211
- guardianCellPhone;
212
- guardianEmail;
213
- guardianAddressId;
214
- guardianBirthDate;
215
- advocateFirstName;
216
- advocateLastName;
217
- advocatePrefixId;
218
- advocateSuffixId;
219
- advocateNoPhoneFlag;
220
- advocateHomePhone;
221
- advocateWorkPhone;
222
- advocateCellPhone;
223
- advocateEmail;
224
- advocateAddressId;
225
- emergencyContact;
226
- emergencyContactPhone;
227
- commonChildrenFlag;
228
- commonChildrenNumber;
229
- cpoExpirationFlag;
230
- cpoExpirationDate;
231
- supportInPlaceFlag;
232
- weaponInvolvedFlag;
233
- drugUseFlag;
234
- alcoholUseFlag;
235
- accessRisk;
236
- modifiedBy;
237
- relationship;
238
- vVictimAdvocate;
239
- vVictimGuardian;
240
- victimSupports;
241
- victimWeaponUses;
242
- victimDrugUses;
243
- allowCsosaContactFlag;
244
- liveWithOffenderFlag;
245
- constructor(victimId, offenderId, underSupervisionFlag, victimOffenderRelationshipTypeId, lastName, firstName, middleName, prefixId, suffixId, birthDate, genderCode, homePhone, workPhone, cellPhone, email, addressId, minorFlag, victimAdvocateFlag, guardianFirstName, guardianLastName, guardianPrefixId, guardianSuffixId, guardianNoPhoneFlag, guardianHomePhone, guardianWorkPhone, guardianCellPhone, guardianEmail, guardianAddressId, guardianBirthDate, advocateFirstName, advocateLastName, advocatePrefixId, advocateSuffixId, advocateNoPhoneFlag, advocateHomePhone, advocateWorkPhone, advocateCellPhone, advocateEmail, advocateAddressId, emergencyContact, emergencyContactPhone, commonChildrenFlag, commonChildrenNumber, cpoExpirationFlag, cpoExpirationDate, supportInPlaceFlag, weaponInvolvedFlag, drugUseFlag, alcoholUseFlag, accessRisk, modifiedBy, relationship, vVictimAdvocate, vVictimGuardian, victimSupports, victimWeaponUses, victimDrugUses, allowCsosaContactFlag, liveWithOffenderFlag) {
246
- this.victimId = victimId;
247
- this.offenderId = offenderId;
248
- this.underSupervisionFlag = underSupervisionFlag;
249
- this.victimOffenderRelationshipTypeId = victimOffenderRelationshipTypeId;
250
- this.lastName = lastName;
251
- this.firstName = firstName;
252
- this.middleName = middleName;
253
- this.prefixId = prefixId;
254
- this.suffixId = suffixId;
255
- this.birthDate = birthDate;
256
- this.genderCode = genderCode;
257
- this.homePhone = homePhone;
258
- this.workPhone = workPhone;
259
- this.cellPhone = cellPhone;
260
- this.email = email;
261
- this.addressId = addressId;
262
- this.minorFlag = minorFlag;
263
- this.victimAdvocateFlag = victimAdvocateFlag;
264
- this.guardianFirstName = guardianFirstName;
265
- this.guardianLastName = guardianLastName;
266
- this.guardianPrefixId = guardianPrefixId;
267
- this.guardianSuffixId = guardianSuffixId;
268
- this.guardianNoPhoneFlag = guardianNoPhoneFlag;
269
- this.guardianHomePhone = guardianHomePhone;
270
- this.guardianWorkPhone = guardianWorkPhone;
271
- this.guardianCellPhone = guardianCellPhone;
272
- this.guardianEmail = guardianEmail;
273
- this.guardianAddressId = guardianAddressId;
274
- this.guardianBirthDate = guardianBirthDate;
275
- this.advocateFirstName = advocateFirstName;
276
- this.advocateLastName = advocateLastName;
277
- this.advocatePrefixId = advocatePrefixId;
278
- this.advocateSuffixId = advocateSuffixId;
279
- this.advocateNoPhoneFlag = advocateNoPhoneFlag;
280
- this.advocateHomePhone = advocateHomePhone;
281
- this.advocateWorkPhone = advocateWorkPhone;
282
- this.advocateCellPhone = advocateCellPhone;
283
- this.advocateEmail = advocateEmail;
284
- this.advocateAddressId = advocateAddressId;
285
- this.emergencyContact = emergencyContact;
286
- this.emergencyContactPhone = emergencyContactPhone;
287
- this.commonChildrenFlag = commonChildrenFlag;
288
- this.commonChildrenNumber = commonChildrenNumber;
289
- this.cpoExpirationFlag = cpoExpirationFlag;
290
- this.cpoExpirationDate = cpoExpirationDate;
291
- this.supportInPlaceFlag = supportInPlaceFlag;
292
- this.weaponInvolvedFlag = weaponInvolvedFlag;
293
- this.drugUseFlag = drugUseFlag;
294
- this.alcoholUseFlag = alcoholUseFlag;
295
- this.accessRisk = accessRisk;
296
- this.modifiedBy = modifiedBy;
297
- this.relationship = relationship;
298
- this.vVictimAdvocate = vVictimAdvocate;
299
- this.vVictimGuardian = vVictimGuardian;
300
- this.victimSupports = victimSupports;
301
- this.victimWeaponUses = victimWeaponUses;
302
- this.victimDrugUses = victimDrugUses;
303
- this.allowCsosaContactFlag = allowCsosaContactFlag;
304
- this.liveWithOffenderFlag = liveWithOffenderFlag;
305
- }
306
- }
307
-
308
- const headers$1 = new HttpHeaders({ 'Content-Type': 'application/json' });
309
- const options = { headers: headers$1 };
310
- class NgcSmartVictimService {
311
- http;
312
- smartOffenderServiceUrl;
313
- smartLookupServiceUrl;
314
- smartVictimServiceUrl;
315
- apollo;
316
- serviceApiUrl = 'https://smart-service-test.azurewebsites.net/graphql';
317
- constructor(http, smartOffenderServiceUrl, smartLookupServiceUrl, smartVictimServiceUrl, apollo) {
318
- this.http = http;
319
- this.smartOffenderServiceUrl = smartOffenderServiceUrl;
320
- this.smartLookupServiceUrl = smartLookupServiceUrl;
321
- this.smartVictimServiceUrl = smartVictimServiceUrl;
322
- this.apollo = apollo;
323
- }
324
- // getVictimInsurances(offenderId: any) {
325
- // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?offenderId=' + offenderId).pipe();
326
- // }
327
- // getVictimInsurance(id: any) {
328
- // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
329
- // }
330
- // postVictimInsurance(val: any) {
331
- // return this.http.post(this.smartOffenderServiceUrl + '/VictimInsurances', val).pipe();
332
- // }
333
- // putVictimInsurance(id: any, val: any) {
334
- // return this.http.put(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id, val).pipe();
335
- // }
336
- // deleteVictimInsurance(id: any) {
337
- // return this.http.delete(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
338
- // }
339
- // getVictimInsuranceTypes() {
340
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceTypes').pipe();
341
- // }
342
- // getVictimInsurancePolicyHolders() {
343
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsurancePolicyHolders').pipe();
344
- // }
345
- // getVictimInsuranceSwitchReasons() {
346
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceSwitchReasons').pipe();
347
- // }
348
- // getVictimInsuranceProviders() {
349
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProvider').pipe();
350
- // }
351
- // getVictimInsuranceProvider(id) {
352
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProviders/' + id).pipe();
353
- // }
354
- // postProviderInformation(val: any) {
355
- // return this.http.post(this.smartLookupServiceUrl + '/VictimInsuranceProviders', val).pipe();
356
- // }
357
- getCurrentHousing(offenderId) {
358
- return this.http
359
- .get(this.smartOffenderServiceUrl + 'Housings/current/' + offenderId)
360
- .pipe();
361
- }
362
- handleError(error) {
363
- console.error(error);
364
- return throwError(error.json().error || 'Server error');
365
- }
366
- getDrugsTypes() {
367
- return this.http.get(this.smartLookupServiceUrl + 'DrugTypes', options).pipe(map(res => res));
368
- }
369
- getDocketList(offenderId) {
370
- const queryString = `
371
- {
372
- findDockets(input: { where: { offenderId:${offenderId} } }) {
373
- totalCount
374
- message
375
- data {
376
- docketId
377
- docketNumber
378
-
379
- }
380
- }
381
- }`;
382
- return this.http.post(this.serviceApiUrl, { query: queryString }).pipe(map(({ data }) => {
383
- console.log('dockets for this offender:', data.findDockets.data);
384
- return data.findDockets.data;
385
- }));
386
- }
387
- getSupportTypes() {
388
- return this.http.get(this.smartLookupServiceUrl + 'VictimSupportTypes', options).pipe(map(res => res));
389
- }
390
- getPrefixes() {
391
- return this.http.get(this.smartLookupServiceUrl + 'Prefixes', options).pipe(map(res => res));
392
- }
393
- getSuffixes() {
394
- return this.http.get(this.smartLookupServiceUrl + 'Suffixes', options).pipe(map(res => res));
395
- }
396
- getRelationshipTypes() {
397
- return this.http.get(this.smartLookupServiceUrl + 'RelationshipTypes', options).pipe(map(res => res));
398
- }
399
- getGenders() {
400
- return this.http.get(this.smartLookupServiceUrl + 'Genders', options).pipe(map(res => res));
401
- }
402
- getWeaponTypes() {
403
- return this.http.get(this.smartLookupServiceUrl + 'WeaponTypes', options).pipe(map(res => res));
404
- }
405
- getFlagOptionYesNoUnknowns() {
406
- return this.http.get(this.smartLookupServiceUrl + 'FlagOptionYesNoUnknowns', options).pipe(map(res => {
407
- return res;
408
- }));
409
- }
410
- getContactTypes() {
411
- return this.http.get(this.smartLookupServiceUrl + 'ContactTypes', options).pipe(map(res => {
412
- return res;
413
- }));
414
- }
415
- getContactMethods() {
416
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactMethods', options).pipe(map(res => {
417
- return res;
418
- }));
419
- }
420
- getContactBys() {
421
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
422
- return res;
423
- }));
424
- }
425
- getVictimContactPurposes() {
426
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
427
- return res;
428
- }));
429
- }
430
- getVictimServiceTypes() {
431
- return this.http.get(this.smartLookupServiceUrl + 'VictimServiceTypes', options).pipe(map(res => {
432
- return res;
433
- }));
434
- }
435
- getVictimServiceStatus() {
436
- return this.http.get(this.smartLookupServiceUrl + 'VictimServiceStatus', options).pipe(map(res => {
437
- return res;
438
- }));
439
- }
440
- getvVictimServiceTypeProgramProviders() {
441
- return this.http.get(this.smartLookupServiceUrl + 'vVictimServiceTypeProgramProviders', options).pipe(map(res => {
442
- return res;
443
- }));
444
- }
445
- getVictim(val) {
446
- return this.http.get(this.smartVictimServiceUrl + 'Victims/' + val, options).pipe(map(res => {
447
- console.log('victim return data');
448
- console.log(res);
449
- return res;
450
- }));
451
- }
452
- getVictimAdvocate(val) {
453
- return this.http.get(this.smartVictimServiceUrl + 'VictimAdvocates/' + val, options).pipe(map(res => {
454
- return res;
455
- }));
456
- }
457
- getVictimGuardian(val) {
458
- return this.http.get(this.smartVictimServiceUrl + 'VictimGuardians/' + val, options).pipe(map(res => {
459
- return res;
460
- }));
461
- }
462
- postVictims(val) {
463
- const tempVal = JSON.stringify(val);
464
- return this.http.post(this.smartVictimServiceUrl + 'Victims', tempVal, options).pipe(map(res => { return res; }));
465
- }
466
- putVictims(id, val) {
467
- const tempVal = JSON.stringify(val);
468
- return this.http.put(this.smartVictimServiceUrl + 'Victims/' + id, tempVal, options).pipe(map(res => { return res; }));
469
- }
470
- putVictimAdvocate(id, val) {
471
- let body;
472
- body = JSON.stringify(val);
473
- return this.http.put(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, body, options).pipe(map(res => { return res; }));
474
- }
475
- postVictimAdvocate(id, val) {
476
- const tempVal = JSON.stringify(val);
477
- return this.http.post(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, tempVal, options).pipe(map(res => { return res; }));
478
- }
479
- putVictimGuardian(id, val) {
480
- console.log('update victim guardian');
481
- console.log(val);
482
- const tempVal = JSON.stringify(val);
483
- return this.http.put(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
484
- }
485
- postVictimGuardian(id, val) {
486
- const tempVal = JSON.stringify(val);
487
- return this.http.post(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
488
- }
489
- getVictimDrugUse(val) {
490
- return this.http.get(this.smartVictimServiceUrl + 'VictimDrugUses/' + val, options).pipe(map((res) => {
491
- return res;
492
- }));
493
- }
494
- putVictimDrugUse(id, val) {
495
- const tempVal = JSON.stringify(val);
496
- return this.http.put(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
497
- }
498
- postVictimDrugUse(id, val) {
499
- const tempVal = JSON.stringify(val);
500
- return this.http.post(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
501
- }
502
- putVictimWeaponUse(id, val) {
503
- const tempVal = JSON.stringify(val);
504
- return this.http.put(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
505
- }
506
- postVictimWeaponUse(id, val) {
507
- const tempVal = JSON.stringify(val);
508
- return this.http.post(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
509
- }
510
- putVictimSupport(id, val) {
511
- const tempVal = JSON.stringify(val);
512
- return this.http.put(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
513
- }
514
- postVictimSupport(id, val) {
515
- const tempVal = JSON.stringify(val);
516
- return this.http.post(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
517
- }
518
- deleteVictims(val, staffId) {
519
- return this.http.delete(this.smartVictimServiceUrl + 'Victims/' + val + '?staffId=' + staffId, options).pipe(map(res => { return res; }));
520
- }
521
- // //==============Victim Serive===================================
522
- getVictims(offenderId) {
523
- return this.http.get(this.smartVictimServiceUrl + 'Victims/offender/' + offenderId)
524
- .pipe(map((res) => {
525
- return res;
526
- }), catchError(this.handleError));
527
- }
528
- getVictimsByFilter(filter) {
529
- return this.http
530
- .post(this.smartVictimServiceUrl + '/Victims', JSON.stringify(filter), { headers: headers$1 })
531
- .pipe(map((res) => {
532
- return res;
533
- }), catchError(this.handleError));
534
- }
535
- getVictimListByFilter(filter) {
536
- console.log('filer in service');
537
- console.log(filter);
538
- return this.http
539
- .post(this.smartVictimServiceUrl + 'vVictims/Filter', JSON.stringify(filter), options)
540
- .pipe();
541
- }
542
- getCasetNotes(victimId) {
543
- return this.http.get(this.smartVictimServiceUrl + 'VictimCaseNotes/victim/' + victimId)
544
- .pipe(map((res) => {
545
- return res;
546
- }), catchError(this.handleError));
547
- }
548
- addCaseNote(caseNote) {
549
- let body;
550
- body = JSON.stringify(caseNote);
551
- return this.http
552
- .post(this.smartVictimServiceUrl + 'VictimCaseNotes/', body, options);
553
- }
554
- updateCaseNote(caseNote) {
555
- let body;
556
- body = JSON.stringify(caseNote);
557
- return this.http
558
- .put(this.smartVictimServiceUrl + 'VictimCaseNotes/' + caseNote.victimCaseNoteId, body, options);
559
- }
560
- deleteCaseNote(id, staffId) {
561
- return this.http.delete(`${this.smartVictimServiceUrl}VictimCaseNotes/${id}?staffId=${staffId}`);
562
- }
563
- getContacts(victimId) {
564
- return this.http.get(this.smartVictimServiceUrl + 'VictimContacts/victim/' + victimId)
565
- .pipe(map((res) => {
566
- return res;
567
- }), catchError(this.handleError));
568
- }
569
- addContact(contact) {
570
- let body;
571
- body = JSON.stringify(contact);
572
- return this.http
573
- .post(this.smartVictimServiceUrl + 'VictimContacts/', body, options);
574
- }
575
- updateContact(contact) {
576
- let body;
577
- body = JSON.stringify(contact);
578
- return this.http
579
- .put(this.smartVictimServiceUrl + 'VictimContacts/' + contact.victimContactId, body, options);
580
- }
581
- getSafetyPlans(victimId) {
582
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
583
- .pipe(map((res) => {
584
- return res;
585
- }), catchError(this.handleError));
586
- }
587
- getVictimServices(victimServiceId) {
588
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
589
- .pipe(map((res) => {
590
- return res;
591
- }), catchError(this.handleError));
592
- }
593
- getVictimServiceDetail(victimServiceId) {
594
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
595
- .pipe(map((res) => {
596
- return res;
597
- }), catchError(this.handleError));
598
- }
599
- addSafetyPlan(victimSafetyPlan) {
600
- let body;
601
- body = JSON.stringify(victimSafetyPlan);
602
- return this.http
603
- .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
604
- .pipe();
605
- }
606
- updateSafetyPlan(victimSafetyPlan) {
607
- let body;
608
- body = JSON.stringify(victimSafetyPlan);
609
- return this.http
610
- .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options);
611
- }
612
- addVictimServiceStatus(victimServiceStatusHistory) {
613
- let body;
614
- body = JSON.stringify(victimServiceStatusHistory);
615
- return this.http
616
- .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
617
- }
618
- getServiceStatusHistories(victimServiceId) {
619
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
620
- .pipe(map((res) => {
621
- return res;
622
- }), catchError(this.handleError));
623
- }
624
- deleteSafetyPlan(victimServiceId, staffId) {
625
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
626
- }
627
- addPlanProvider(victimServiceDetail) {
628
- let body;
629
- body = JSON.stringify(victimServiceDetail);
630
- return this.http
631
- .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
632
- .pipe();
633
- }
634
- deleteProvider(victimProgramProviderId, staffId) {
635
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
636
- }
637
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, deps: [{ token: i1.HttpClient }, { token: SMART_OFFENDER_SERVICE_URL }, { token: SMART_LOOKUP_SERVICE_URL }, { token: SMART_VICTIM_SERVICE_URL }, { token: i2.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
638
- /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, providedIn: 'root' });
639
- }
640
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, decorators: [{
641
- type: Injectable,
642
- args: [{
643
- providedIn: 'root'
644
- }]
645
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
646
- type: Inject,
647
- args: [SMART_OFFENDER_SERVICE_URL]
648
- }] }, { type: undefined, decorators: [{
649
- type: Inject,
650
- args: [SMART_LOOKUP_SERVICE_URL]
651
- }] }, { type: undefined, decorators: [{
652
- type: Inject,
653
- args: [SMART_VICTIM_SERVICE_URL]
654
- }] }, { type: i2.Apollo }] });
655
-
656
- const headers = new Headers({ 'Content-Type': 'application/json' });
657
- class IntakeServicesComponent {
658
- http;
659
- smartOffenderServiceUrl;
660
- //serviceData = environment.smartOffenderServiceUrl;
661
- constructor(http, smartOffenderServiceUrl) {
662
- this.http = http;
663
- this.smartOffenderServiceUrl = smartOffenderServiceUrl;
664
- }
665
- getIntakeByOffender(offenderId) {
666
- return this.http
667
- .get(this.smartOffenderServiceUrl + 'IntakeBasic/offender/' + offenderId)
668
- .pipe();
669
- }
670
- updateIntakeSteps(offenderId, intakeStepStatus) {
671
- return this.http.put(this.smartOffenderServiceUrl + '/IntakeStepStatus/' + offenderId, intakeStepStatus);
672
- }
673
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, deps: [{ token: i1.HttpClient }, { token: SMART_OFFENDER_SERVICE_URL }], target: i0.ɵɵFactoryTarget.Injectable });
674
- /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, providedIn: 'root' });
675
- }
676
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, decorators: [{
677
- type: Injectable,
678
- args: [{
679
- providedIn: 'root'
680
- }]
681
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
682
- type: Inject,
683
- args: [SMART_OFFENDER_SERVICE_URL]
684
- }] }] });
685
- class IntakeStep {
686
- static PhysicalInformation = "PHYSIN";
687
- static Photo = "PHOTOS";
688
- static HousingInformation = "HOUSE";
689
- static DocketInformation = "DOCKET";
690
- static Alias = "ALIAS";
691
- static IntakeBasicInformation = "INTKBI";
692
- static ContactInformation = "CONTCT";
693
- static DeceasedInformation = "DEATH";
694
- static DriversLicense = "DRVLIC";
695
- static EmploymentInformation = "EMPLOY";
696
- static GangAffiliation = "GANG";
697
- static HealthInsurance = "HLTHINS";
698
- static Identification = "IDNTFCTN";
699
- static InternetIdentifier = "INTERNETID";
700
- static MilitaryService = "MLTSVC";
701
- static School = "SCHOOL";
702
- static SelectiveService = "SLCTVSVC";
703
- static Vehicle = "VEHICLE";
704
- static VictimInformation = "VICTIM";
705
- static WarrantInformation = "WARRNT";
706
- static RunningRecord = "RUNREC";
707
- static Signature = "SIGN";
708
- }
709
-
710
- class CommonDialogComponent {
711
- commondialogRef;
712
- title;
713
- message;
714
- cmdYesTitle = "Yes";
715
- cmdNoTitle = "No";
716
- constructor(commondialogRef) {
717
- this.commondialogRef = commondialogRef;
718
- }
719
- ngOnInit() {
720
- }
721
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogComponent, deps: [{ token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
722
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: CommonDialogComponent, selector: "app-common-dialog", ngImport: i0, template: "\r\n \r\n <mat-card class=\"example-card\"> \r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class=\"inner\">\r\n <button type=\"button\" mat-raised-button color=\"primary\"\r\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\r\n <button type=\"button\" mat-raised-button color=\"primary\" \r\n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\r\n \r\n </div>\r\n \r\n \r\n </mat-card-content>\r\n </mat-card>", styles: [".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}\n"], dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
723
- }
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogComponent, decorators: [{
725
- type: Component,
726
- args: [{ selector: 'app-common-dialog', template: "\r\n \r\n <mat-card class=\"example-card\"> \r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class=\"inner\">\r\n <button type=\"button\" mat-raised-button color=\"primary\"\r\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\r\n <button type=\"button\" mat-raised-button color=\"primary\" \r\n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\r\n \r\n </div>\r\n \r\n \r\n </mat-card-content>\r\n </mat-card>", styles: [".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}\n"] }]
727
- }], ctorParameters: () => [{ type: i1$1.MatDialogRef }] });
728
-
729
- class CommonDialogService {
730
- dialog;
731
- constructor(dialog) {
732
- this.dialog = dialog;
733
- }
734
- confirm(title, message, cmdYesTitle, cmdNoTitle) {
735
- let dialogRef;
736
- dialogRef = this.dialog.open(CommonDialogComponent);
737
- dialogRef.componentInstance.title = title;
738
- dialogRef.componentInstance.message = message;
739
- dialogRef.componentInstance.cmdYesTitle = cmdYesTitle;
740
- dialogRef.componentInstance.cmdNoTitle = cmdNoTitle;
741
- return dialogRef.afterClosed();
742
- }
743
- warning(title, message, cmdOkTitle) {
744
- let dialogRef;
745
- dialogRef = this.dialog.open(CommonDialogComponent);
746
- dialogRef.componentInstance.title = title;
747
- dialogRef.componentInstance.message = message;
748
- dialogRef.componentInstance.cmdYesTitle = cmdOkTitle;
749
- return dialogRef.afterClosed();
750
- }
751
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
752
- /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService });
753
- }
754
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService, decorators: [{
755
- type: Injectable
756
- }], ctorParameters: () => [{ type: i1$1.MatDialog }] });
757
-
758
- function conditionalValidator(predicate, validator, errorNamespace) {
759
- return (formControl => {
760
- if (!formControl.parent) {
761
- return null;
762
- }
763
- let error = null;
764
- if (predicate()) {
765
- error = validator(formControl);
766
- }
767
- if (errorNamespace && error) {
768
- const customError = {};
769
- customError[errorNamespace] = error;
770
- error = customError;
771
- }
772
- return error;
773
- });
774
- }
775
- function stringConditionalValidator(predicate, validator, errorNamespace) {
776
- return (formControl => {
777
- if (!formControl.parent) {
778
- return null;
779
- }
780
- let error = null;
781
- if (predicate() == 'YS') {
782
- error = validator(formControl);
783
- }
784
- if (errorNamespace && error) {
785
- const customError = {};
786
- customError[errorNamespace] = error;
787
- error = customError;
788
- }
789
- return error;
790
- });
791
- }
792
- class SmartVictimDetailComponent {
793
- location;
794
- formBuilder;
795
- dialog;
796
- route;
797
- router;
798
- snackBar;
799
- commonDialogService;
800
- victimService;
801
- changeDetectorRefs;
802
- victimDetail = {};
803
- staffId;
804
- offenderId;
805
- isIntake;
806
- onSave = new EventEmitter();
807
- onCancel = new EventEmitter();
808
- addressComponent;
809
- victimId;
810
- victimForm;
811
- drugs;
812
- victimSupportTypes;
813
- prefixes;
814
- //victim: Victim = <Victim>{};
815
- suffixes;
816
- relationshipTypes;
817
- genders;
818
- docketlist;
819
- weaponTypes;
820
- flagOption;
821
- selectedWeaponTypes;
822
- selectedVictimSupportTypes;
823
- selectedDrugs;
824
- id;
825
- hidden = true;
826
- sub;
827
- victimAdvocate = {};
828
- victimGuardian = {};
829
- victimWeaponUse;
830
- victimSupport;
831
- victimDrugUse;
832
- result;
833
- editMode;
834
- guardianTabFlag = false;
835
- advocateTabFlag = false;
836
- commonChildrenDivFlag = false;
837
- cpoExpirationDivFlag = false;
838
- supportInPlaceDivFlag = false;
839
- weaponInvolvedDivFlag = false;
840
- drugUseDivFlag = false;
841
- showDelete = false;
842
- addressId = 0;
843
- advocateAddressId = 0;
844
- guardianAddressId = 0;
845
- datePipe = new DatePipe('en-US');
846
- emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
847
- phoneNumber = "\\d{10}";
848
- editVictim = {};
849
- victimAge;
850
- otherWeaponFlag = false;
851
- otherDrugFlag = false;
852
- contactDataSource = new MatTableDataSource();
853
- contactList;
854
- guardianPhoneExistFlag = false;
855
- advocatePhoneExistFlag = false;
856
- phoneValidationFlag = false;
857
- guaridanNoPhoneChkFlag = true;
858
- advocateNoPhoneChkFlag = true;
859
- addressValidators = {
860
- street: [],
861
- street2: [],
862
- city: [],
863
- stateCode: [],
864
- zipCode: [],
865
- psaCode: [],
866
- };
867
- homePhoneControl = new UntypedFormControl();
868
- cellPhoneControl = new UntypedFormControl();
869
- workPhoneControl = new UntypedFormControl();
870
- guardianHomePhoneControl = new UntypedFormControl();
871
- guardianCellPhoneControl = new UntypedFormControl();
872
- guardianWorkPhoneControl = new UntypedFormControl();
873
- advocateHomePhoneControl = new UntypedFormControl();
874
- advocateCellPhoneControl = new UntypedFormControl();
875
- advocateWorkPhoneControl = new UntypedFormControl();
876
- emergencyContactPhoneControl = new UntypedFormControl();
877
- constructor(location, formBuilder, dialog, route, router, snackBar, commonDialogService, victimService, changeDetectorRefs) {
878
- this.location = location;
879
- this.formBuilder = formBuilder;
880
- this.dialog = dialog;
881
- this.route = route;
882
- this.router = router;
883
- this.snackBar = snackBar;
884
- this.commonDialogService = commonDialogService;
885
- this.victimService = victimService;
886
- this.changeDetectorRefs = changeDetectorRefs;
887
- this.initForm();
888
- }
889
- initForm() {
890
- this.victimForm = this.formBuilder.group({
891
- underSupervisionFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
892
- victimOffenderRelationshipTypeId: new UntypedFormControl('', Validators.compose([Validators.required])),
893
- lastName: new UntypedFormControl('', Validators.compose([Validators.required])),
894
- firstName: new UntypedFormControl('', Validators.compose([Validators.required])),
895
- middleName: new UntypedFormControl(''),
896
- prefixId: new UntypedFormControl(''),
897
- suffixId: new UntypedFormControl(''),
898
- genderCode: new UntypedFormControl(''),
899
- birthDate: new UntypedFormControl(''),
900
- homePhone: new UntypedFormControl(''),
901
- cellPhone: new UntypedFormControl(''),
902
- workPhone: new UntypedFormControl(''),
903
- email: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
904
- minorFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
905
- victimAdvocateFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
906
- guardianLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
907
- guardianFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
908
- guardianPrefixId: new UntypedFormControl(''),
909
- guardianSuffixId: new UntypedFormControl(''),
910
- //guardianGender:new FormControl('', ),
911
- guardianBirthDate: new UntypedFormControl(''),
912
- guardianNoPhoneFlag: new UntypedFormControl(true),
913
- guardianHomePhone: new UntypedFormControl(''),
914
- guardianCellPhone: new UntypedFormControl(''),
915
- guardianWorkPhone: new UntypedFormControl(''),
916
- guardianEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
917
- advocateNoPhoneFlag: new UntypedFormControl(true),
918
- advocateWorkPhone: new UntypedFormControl(''),
919
- advocateHomePhone: new UntypedFormControl(''),
920
- advocateCellPhone: new UntypedFormControl(''),
921
- advocateSuffixId: new UntypedFormControl(''),
922
- advocatePrefixId: new UntypedFormControl(''),
923
- advocateFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
924
- advocateLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
925
- advocateEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
926
- emergencyContact: new UntypedFormControl(''),
927
- emergencyContactPhone: new UntypedFormControl(''),
928
- emergencyChildren: new UntypedFormControl(''),
929
- emergencyCpo: new UntypedFormControl(''),
930
- emergencyDrug: new UntypedFormControl(''),
931
- emergencySupport: new UntypedFormControl(''),
932
- emergencyWeapon: new UntypedFormControl(''),
933
- drug: new UntypedFormControl(''),
934
- weapon: new UntypedFormControl(''),
935
- support: new UntypedFormControl(''),
936
- commonChildrenFlag: new UntypedFormControl(''),
937
- commonChildrenNumber: new UntypedFormControl(''),
938
- cpoExpirationFlag: new UntypedFormControl(''),
939
- cpoExpirationDate: new UntypedFormControl(''),
940
- accessRisk: new UntypedFormControl(''),
941
- drugUseFlag: new UntypedFormControl(''),
942
- supportInPlaceFlag: new UntypedFormControl(''),
943
- weaponInvolvedFlag: new UntypedFormControl(''),
944
- otherWeapon: new UntypedFormControl(''),
945
- otherDrug: new UntypedFormControl(''),
946
- alcoholUseFlag: new UntypedFormControl(''),
947
- victimSupports: new UntypedFormControl(''),
948
- victimWeaponUses: new UntypedFormControl(''),
949
- victimDrugUses: new UntypedFormControl(''),
950
- allowCsosaContactFlag: new UntypedFormControl(''),
951
- liveWithOffenderFlag: new UntypedFormControl(''),
952
- });
953
- this.victimForm.markAsPristine();
954
- this.victimForm.markAsUntouched();
955
- }
956
- _getVictim() {
957
- if (this.victimId === 0) {
958
- return;
959
- }
960
- ;
961
- if (this.editMode == true) {
962
- console.log('find victim id inside getVictim');
963
- console.log(this.victimId);
964
- if (this.victimId === undefined) {
965
- this.sub = this.route.params.subscribe(params => {
966
- this.victimId = params['victimId'];
967
- console.log('my this.victimId');
968
- console.log(this.victimId);
969
- });
970
- }
971
- this.victimService.getVictim(this.victimId)
972
- .subscribe((victim) => {
973
- console.log('victim data 1');
974
- console.log(victim);
975
- this.editVictim = victim;
976
- var supportsData = [];
977
- this.editVictim.victimSupports.forEach(t => { supportsData.push(t.victimSupportTypeId); });
978
- const victimSupportsControl = this.victimForm.get('victimSupports');
979
- victimSupportsControl.setValue(supportsData);
980
- var weaponUsesData = [];
981
- var otherWeapon = "";
982
- this.editVictim.victimWeaponUses.forEach(t => {
983
- weaponUsesData.push(t.weaponTypeId);
984
- if (t.weaponTypeId == "OTHER") {
985
- otherWeapon = t.otherWeapon;
986
- this.otherWeaponFlag = true;
987
- }
988
- });
989
- const victimWeaponUsesControl = this.victimForm.get('victimWeaponUses');
990
- victimWeaponUsesControl.setValue(weaponUsesData);
991
- const otherWeaponControl = this.victimForm.get('otherWeapon');
992
- otherWeaponControl.setValue(otherWeapon);
993
- var drugUseData = [];
994
- var otherDrug = "";
995
- console.log('load this.editVictim.victimDrugUses');
996
- console.log(this.editVictim.victimDrugUses);
997
- this.editVictim.victimDrugUses.forEach(t => {
998
- if (t.drugTypeId === null) {
999
- otherDrug = t.otherDrug;
1000
- this.otherDrugFlag = true;
1001
- t.drugTypeId = 'OTHER';
1002
- }
1003
- drugUseData.push(t.drugTypeId);
1004
- });
1005
- console.log('this.editVictim.victimDrugUses after push');
1006
- console.log(drugUseData);
1007
- if (drugUseData) {
1008
- const victimDrugUsesControl = this.victimForm.get('victimDrugUses');
1009
- victimDrugUsesControl.setValue(drugUseData);
1010
- }
1011
- if (otherDrug) {
1012
- const otherDrugControl = this.victimForm.get('otherDrug');
1013
- otherDrugControl.setValue(otherDrug);
1014
- }
1015
- //contact
1016
- this.victimService.getContacts(this.victimId).subscribe(contactList => {
1017
- console.log('contactList');
1018
- console.log(contactList);
1019
- this.contactList = contactList;
1020
- this.contactDataSource.data = this.contactList;
1021
- });
1022
- //no phone field
1023
- if (this.editVictim.guardianNoPhoneFlag === false) {
1024
- this.victimForm.patchValue({ guardianNoPhoneFlag: false });
1025
- }
1026
- if (this.editVictim.advocateNoPhoneFlag === false) {
1027
- this.victimForm.patchValue({ advocateNoPhoneFlag: false });
1028
- }
1029
- this.homePhoneControl.setValue(!this.editVictim.homePhone ? "" : this.editVictim.homePhone);
1030
- this.cellPhoneControl.setValue(!this.editVictim.cellPhone ? "" : this.editVictim.cellPhone);
1031
- this.workPhoneControl.setValue(!this.editVictim.workPhone ? "" : this.editVictim.workPhone);
1032
- this.guardianHomePhoneControl.setValue(!this.editVictim.guardianHomePhone ? "" : this.editVictim.guardianHomePhone);
1033
- this.guardianCellPhoneControl.setValue(!this.editVictim.guardianCellPhone ? "" : this.editVictim.guardianCellPhone);
1034
- this.guardianWorkPhoneControl.setValue(!this.editVictim.guardianWorkPhone ? "" : this.editVictim.guardianWorkPhone);
1035
- this.advocateHomePhoneControl.setValue(!this.editVictim.advocateHomePhone ? "" : this.editVictim.advocateHomePhone);
1036
- this.advocateCellPhoneControl.setValue(!this.editVictim.advocateCellPhone ? "" : this.editVictim.advocateCellPhone);
1037
- this.advocateWorkPhoneControl.setValue(!this.editVictim.advocateWorkPhone ? "" : this.editVictim.advocateWorkPhone);
1038
- this.emergencyContactPhoneControl.setValue(!this.editVictim.emergencyContactPhone ? "" : this.editVictim.emergencyContactPhone);
1039
- }, error => {
1040
- this.snackBar.open("Error occured while retriving Victim Information. Please try again.");
1041
- });
1042
- return;
1043
- }
1044
- else {
1045
- //new
1046
- }
1047
- }
1048
- ngOnChanges() {
1049
- }
1050
- onClear() {
1051
- if (this.addressComponent)
1052
- this.addressComponent.reset();
1053
- }
1054
- showAddress(value) {
1055
- if (value.checked) {
1056
- this.victimService.getCurrentHousing(this.offenderId).subscribe((item) => {
1057
- this.addressId = item.housing.addressId;
1058
- this.victimForm.patchValue({ addressId: this.addressId });
1059
- });
1060
- }
1061
- else {
1062
- this.addressComponent.reset();
1063
- this.editVictim.allowCsosaContactFlag = false;
1064
- this.addressId = null;
1065
- }
1066
- }
1067
- onAddressChange(addressId) {
1068
- this.victimForm.patchValue({ addressId: addressId });
1069
- this.addressId = addressId;
1070
- }
1071
- onGuardianAddressChange(MyGuardianAddressId) {
1072
- this.victimForm.patchValue({ guardianAddressId: MyGuardianAddressId });
1073
- this.guardianAddressId = MyGuardianAddressId;
1074
- }
1075
- onAdvocateAddressChange(MyAdvocateAddressId) {
1076
- this.victimForm.patchValue({ advocateAddressId: MyAdvocateAddressId });
1077
- this.advocateAddressId = MyAdvocateAddressId;
1078
- }
1079
- cancel() {
1080
- this.victimForm.reset();
1081
- }
1082
- ngOnInit() {
1083
- this.homePhoneControl.valueChanges.subscribe((hpn) => {
1084
- const newValue = hpn.replace(/\D/g, '');
1085
- this.editVictim.homePhone = newValue;
1086
- });
1087
- this.cellPhoneControl.valueChanges.subscribe((hpn) => {
1088
- const newValue = hpn.replace(/\D/g, '');
1089
- this.editVictim.cellPhone = newValue;
1090
- });
1091
- this.workPhoneControl.valueChanges.subscribe((hpn) => {
1092
- const newValue = hpn.replace(/\D/g, '');
1093
- this.editVictim.workPhone = newValue;
1094
- });
1095
- this.guardianHomePhoneControl.valueChanges.subscribe((hpn) => {
1096
- const newValue = hpn.replace(/\D/g, '');
1097
- this.editVictim.guardianHomePhone = newValue;
1098
- });
1099
- this.guardianCellPhoneControl.valueChanges.subscribe((hpn) => {
1100
- const newValue = hpn.replace(/\D/g, '');
1101
- this.editVictim.guardianCellPhone = newValue;
1102
- });
1103
- this.guardianWorkPhoneControl.valueChanges.subscribe((hpn) => {
1104
- const newValue = hpn.replace(/\D/g, '');
1105
- this.editVictim.guardianWorkPhone = newValue;
1106
- });
1107
- this.advocateHomePhoneControl.valueChanges.subscribe((hpn) => {
1108
- const newValue = hpn.replace(/\D/g, '');
1109
- this.editVictim.advocateHomePhone = newValue;
1110
- });
1111
- this.advocateCellPhoneControl.valueChanges.subscribe((hpn) => {
1112
- const newValue = hpn.replace(/\D/g, '');
1113
- this.editVictim.advocateCellPhone = newValue;
1114
- });
1115
- this.advocateWorkPhoneControl.valueChanges.subscribe((hpn) => {
1116
- const newValue = hpn.replace(/\D/g, '');
1117
- this.editVictim.advocateWorkPhone = newValue;
1118
- });
1119
- this.emergencyContactPhoneControl.valueChanges.subscribe((hpn) => {
1120
- const newValue = hpn.replace(/\D/g, '');
1121
- this.editVictim.emergencyContactPhone = newValue;
1122
- });
1123
- console.log('show offenderId');
1124
- console.log(this.offenderId);
1125
- console.log('show staffId');
1126
- console.log(this.staffId);
1127
- console.log('show isIntake');
1128
- console.log(this.isIntake);
1129
- //required field
1130
- const requiredImplementation = { get: function () {
1131
- if (this._required) {
1132
- return this._required;
1133
- }
1134
- if (this.ngControl && this.ngControl.control && this.ngControl.control.validator) {
1135
- const emptyValueControl = Object.assign({}, this.ngControl.control);
1136
- emptyValueControl.value = null;
1137
- return ('required' in (this.ngControl.control.validator(emptyValueControl) || {}));
1138
- }
1139
- return false;
1140
- }, set: function (value) { this._required = coerceBooleanProperty(value); }, };
1141
- Object.defineProperty(MatInput.prototype, 'required', requiredImplementation);
1142
- Object.defineProperty(MatSelect.prototype, 'required', requiredImplementation);
1143
- Object.defineProperty(MatRadioGroup.prototype, 'required', requiredImplementation);
1144
- //required field end
1145
- if (this.victimDetail != null) {
1146
- // edit record
1147
- this.editMode = true;
1148
- this.showDelete = true;
1149
- this.victimId = this.victimDetail.victimId;
1150
- this.guardianTabFlag = this.victimDetail.minorFlag;
1151
- if (this.victimDetail.victimAdvocateFlag == 'YS') {
1152
- this.advocateTabFlag = true;
1153
- }
1154
- if (this.otherWeaponFlag == true) {
1155
- const otherWeaponControl = this.victimForm.get('otherWeapon');
1156
- otherWeaponControl.setValidators(Validators.required);
1157
- }
1158
- if (this.otherDrugFlag == true) {
1159
- const otherDrugControl = this.victimForm.get('otherDrug');
1160
- otherDrugControl.setValidators(Validators.required);
1161
- }
1162
- this.cpoExpirationDivFlag = this.victimDetail.cpoExpirationFlag;
1163
- this.commonChildrenDivFlag = this.victimDetail.commonChildrenFlag;
1164
- this.supportInPlaceDivFlag = this.victimDetail.supportInPlaceFlag;
1165
- this.weaponInvolvedDivFlag = this.victimDetail.weaponInvolvedFlag;
1166
- this.drugUseDivFlag = this.victimDetail.drugUseFlag;
1167
- this.addressId = this.victimDetail.addressId;
1168
- this.guardianAddressId = this.victimDetail.guardianAddressId;
1169
- this.advocateAddressId = this.victimDetail.advocateAddressId;
1170
- this._getVictim();
1171
- }
1172
- else {
1173
- //add new record
1174
- this.victimForm.patchValue({ guardianNoPhoneFlag: true });
1175
- this.victimForm.patchValue({ advocateNoPhoneFlag: true });
1176
- }
1177
- this.victimService.getFlagOptionYesNoUnknowns().subscribe((items) => {
1178
- this.flagOption = items;
1179
- });
1180
- this.victimService.getGenders().subscribe((items) => {
1181
- this.genders = items;
1182
- });
1183
- this.victimService.getPrefixes().subscribe((items) => {
1184
- this.prefixes = items;
1185
- });
1186
- this.victimService.getSuffixes().subscribe((items) => {
1187
- this.suffixes = items;
1188
- });
1189
- this.victimService.getRelationshipTypes().subscribe((items) => {
1190
- this.relationshipTypes = items.filter((y) => (y.relationshipCategoryId === 'ST' || y.relationshipCategoryId === 'FM'));
1191
- });
1192
- this.victimService.getSupportTypes().subscribe((items) => {
1193
- this.victimSupportTypes = items;
1194
- });
1195
- this.victimService.getWeaponTypes().subscribe((items) => {
1196
- this.weaponTypes = items;
1197
- });
1198
- this.victimService.getDrugsTypes().subscribe((items) => {
1199
- console.log('drug lookup items');
1200
- console.log(items);
1201
- this.drugs = items;
1202
- this.drugs.push({ drugTypeId: 'OTHER', name: 'Other' });
1203
- console.log(this.drugs);
1204
- });
1205
- // this.victimService.getDocketList(this.offenderId).subscribe(
1206
- // (items: any) => {
1207
- // this.docketlist = items;
1208
- // }
1209
- // );
1210
- this.victimForm.get('minorFlag').valueChanges
1211
- .subscribe(value => {
1212
- this.victimForm.get('guardianFirstName').updateValueAndValidity();
1213
- this.victimForm.get('guardianLastName').updateValueAndValidity();
1214
- this.victimForm.get('guardianWorkPhone').updateValueAndValidity();
1215
- this.victimForm.get('guardianHomePhone').updateValueAndValidity();
1216
- this.victimForm.get('guardianCellPhone').updateValueAndValidity();
1217
- });
1218
- this.victimForm.get('victimAdvocateFlag').valueChanges
1219
- .subscribe(value => {
1220
- this.victimForm.get('advocateFirstName').updateValueAndValidity();
1221
- this.victimForm.get('advocateLastName').updateValueAndValidity();
1222
- this.victimForm.get('advocateWorkPhone').updateValueAndValidity();
1223
- this.victimForm.get('advocateHomePhone').updateValueAndValidity();
1224
- this.victimForm.get('advocateCellPhone').updateValueAndValidity();
1225
- });
1226
- }
1227
- back() {
1228
- //this.onSave.emit(this.victimDetail);
1229
- this.router.navigate(['victimList']);
1230
- }
1231
- deleteVictim() {
1232
- this.commonDialogService
1233
- .confirm('', 'Do you want to delete this Victim?', 'Yes', 'No')
1234
- .subscribe(res => {
1235
- this.result = res;
1236
- if (this.result) {
1237
- this.victimService.deleteVictims(this.victimDetail.victimId, this.staffId)
1238
- .subscribe(result => {
1239
- this.snackBar.open('Delete Successfully!', '', {
1240
- duration: 3000,
1241
- });
1242
- });
1243
- // this.onSave.emit(this.victimDetail);
1244
- // this.router.navigate(['victim']);
1245
- setTimeout(() => {
1246
- window.location.reload();
1247
- }, 1500);
1248
- }
1249
- });
1250
- }
1251
- radioMinorChange($event) {
1252
- if ($event.value === true) {
1253
- this.guardianTabFlag = true;
1254
- }
1255
- else {
1256
- this.guardianTabFlag = false;
1257
- }
1258
- }
1259
- radioAdvocateChange($event) {
1260
- const advocateLastNameControl = this.victimForm.get('advocateLastName');
1261
- const advocateFirstNameControl = this.victimForm.get('advocateFirstName');
1262
- if ($event.value === "YS") {
1263
- this.advocateTabFlag = true;
1264
- advocateLastNameControl.setValidators(Validators.required);
1265
- advocateFirstNameControl.setValidators(Validators.required);
1266
- }
1267
- else {
1268
- this.advocateTabFlag = false;
1269
- advocateLastNameControl.clearValidators();
1270
- advocateFirstNameControl.clearValidators();
1271
- }
1272
- advocateLastNameControl.updateValueAndValidity();
1273
- advocateFirstNameControl.updateValueAndValidity();
1274
- }
1275
- radioCicChange($event) {
1276
- if ($event.value === true) {
1277
- this.commonChildrenDivFlag = true;
1278
- // requrie field
1279
- this.setValidators('commonChildren');
1280
- }
1281
- else {
1282
- this.commonChildrenDivFlag = false;
1283
- }
1284
- }
1285
- setValidators(type) {
1286
- if (type == 'commonChildren') {
1287
- this.victimForm.get('commonChildrenNumber').clearValidators();
1288
- this.victimForm.get('commonChildrenNumber').setValidators(Validators.required);
1289
- }
1290
- else if (type == 'cpo') {
1291
- this.victimForm.get('cpoExpirationDate').clearValidators();
1292
- this.victimForm.get('cpoExpirationDate').setValidators(Validators.required);
1293
- }
1294
- }
1295
- radioSupportChange($event) {
1296
- if ($event.value === true) {
1297
- this.supportInPlaceDivFlag = true;
1298
- }
1299
- else {
1300
- this.supportInPlaceDivFlag = false;
1301
- }
1302
- }
1303
- radioWeaponChange($event) {
1304
- if ($event.value === true) {
1305
- this.weaponInvolvedDivFlag = true;
1306
- }
1307
- else {
1308
- this.weaponInvolvedDivFlag = false;
1309
- }
1310
- }
1311
- radioDrugChange($event) {
1312
- if ($event.value === true) {
1313
- this.drugUseDivFlag = true;
1314
- }
1315
- else {
1316
- this.drugUseDivFlag = false;
1317
- }
1318
- }
1319
- radioCpoChange($event) {
1320
- if ($event.value === true) {
1321
- this.cpoExpirationDivFlag = true;
1322
- this.setValidators('cpo');
1323
- }
1324
- else {
1325
- this.cpoExpirationDivFlag = false;
1326
- }
1327
- }
1328
- handleDOBChange($event) {
1329
- var ageDifMs = Date.now() - $event.value;
1330
- var ageDate = new Date(ageDifMs);
1331
- if (Math.abs(ageDate.getUTCFullYear() - 1970) <= 18) {
1332
- this.snackBar.open('Victim is a Minor. This information is a sensitive and should not be disclosed to any unauthorized parties. Contact the legal guardian.', '', {
1333
- duration: 6000,
1334
- });
1335
- const minorControl = this.victimForm.get('minorFlag');
1336
- minorControl.setValue(true);
1337
- this.guardianTabFlag = true;
1338
- }
1339
- }
1340
- checkOtherWeapon(WeaponUse) {
1341
- const otherWeaponControl = this.victimForm.get('otherWeapon');
1342
- if (WeaponUse.includes("OTHER")) {
1343
- this.otherWeaponFlag = true;
1344
- otherWeaponControl.setValidators(Validators.required);
1345
- }
1346
- else {
1347
- this.otherWeaponFlag = false;
1348
- otherWeaponControl.clearValidators();
1349
- }
1350
- otherWeaponControl.updateValueAndValidity();
1351
- }
1352
- checkOtherDrug(DrugUse) {
1353
- const otherDrugControl = this.victimForm.get('otherDrug');
1354
- if (DrugUse.includes("OTHER")) {
1355
- this.otherDrugFlag = true;
1356
- otherDrugControl.setValidators(Validators.required);
1357
- }
1358
- else {
1359
- this.otherDrugFlag = false;
1360
- otherDrugControl.clearValidators();
1361
- }
1362
- otherDrugControl.updateValueAndValidity();
1363
- }
1364
- //#region "save victim"
1365
- saveVictim() {
1366
- //guardian phone logic
1367
- if (!this.victimForm.value.guardianNoPhoneFlag) {
1368
- if (this.guardianHomePhoneControl.value) {
1369
- if (this.guardianHomePhoneControl.value !== null) {
1370
- if (this.guardianHomePhoneControl.value !== "") {
1371
- this.guardianPhoneExistFlag = true;
1372
- }
1373
- }
1374
- }
1375
- if (this.guardianWorkPhoneControl.value !== undefined) {
1376
- if (this.guardianWorkPhoneControl.value !== null) {
1377
- if (this.guardianWorkPhoneControl.value !== "") {
1378
- this.guardianPhoneExistFlag = true;
1379
- }
1380
- }
1381
- }
1382
- if (this.guardianCellPhoneControl.value) {
1383
- if (this.guardianCellPhoneControl.value !== null) {
1384
- if (this.guardianCellPhoneControl.value !== "") {
1385
- this.guardianPhoneExistFlag = true;
1386
- }
1387
- }
1388
- }
1389
- }
1390
- console.log('this.victimForm.value.guardianNoPhoneFlag');
1391
- console.log(this.victimForm.value.guardianNoPhoneFlag);
1392
- console.log('this.guardianPhoneExistFlag');
1393
- console.log(this.guardianPhoneExistFlag);
1394
- if (this.guardianPhoneExistFlag === false && this.victimForm.value.guardianNoPhoneFlag === false) {
1395
- this.phoneValidationFlag = true;
1396
- this.commonDialogService
1397
- .warning('', 'Please check the guardian phone field. You have to fill one of the three phone fileds.', 'Ok')
1398
- .subscribe(res => {
1399
- this.result = res;
1400
- });
1401
- }
1402
- console.log('this.phoneValidationFlag');
1403
- console.log(this.phoneValidationFlag);
1404
- //advocate phone logic
1405
- if (!this.victimForm.value.advocateNoPhoneFlag) {
1406
- if (this.advocateHomePhoneControl.value) {
1407
- if (this.advocateHomePhoneControl.value !== null) {
1408
- if (this.advocateHomePhoneControl.value !== "") {
1409
- this.advocatePhoneExistFlag = true;
1410
- }
1411
- }
1412
- }
1413
- if (this.advocateWorkPhoneControl.value !== undefined) {
1414
- if (this.advocateWorkPhoneControl.value !== null) {
1415
- if (this.advocateWorkPhoneControl.value !== "") {
1416
- this.advocatePhoneExistFlag = true;
1417
- }
1418
- }
1419
- }
1420
- if (this.advocateCellPhoneControl.value) {
1421
- if (this.advocateCellPhoneControl.value !== null) {
1422
- if (this.advocateCellPhoneControl.value !== "") {
1423
- this.advocatePhoneExistFlag = true;
1424
- }
1425
- }
1426
- }
1427
- }
1428
- console.log('this.victimForm.value.advocateNoPhoneFlag');
1429
- console.log(this.victimForm.value.advocateNoPhoneFlag);
1430
- console.log('this.advocatePhoneExistFlag');
1431
- console.log(this.advocatePhoneExistFlag);
1432
- if (this.advocatePhoneExistFlag === false && this.victimForm.value.advocateNoPhoneFlag === false) {
1433
- this.phoneValidationFlag = true;
1434
- this.commonDialogService
1435
- .warning('', 'Please check the advocate phone field. You have to fill one of the three phone fileds.', 'Ok')
1436
- .subscribe(res => {
1437
- this.result = res;
1438
- });
1439
- }
1440
- if (this.homePhoneControl.value) {
1441
- this.victimForm.value.homePhone = this.homePhoneControl.value.replace(/[()\s-]/g, '');
1442
- }
1443
- else {
1444
- this.victimForm.value.homePhone = null;
1445
- }
1446
- if (this.cellPhoneControl.value) {
1447
- this.victimForm.value.cellPhone = this.cellPhoneControl.value.replace(/[()\s-]/g, '');
1448
- }
1449
- else {
1450
- this.victimForm.value.cellPhone = null;
1451
- }
1452
- if (this.workPhoneControl.value) {
1453
- this.victimForm.value.workPhone = this.workPhoneControl.value.replace(/[()\s-]/g, '');
1454
- }
1455
- else {
1456
- this.victimForm.value.workPhone = null;
1457
- }
1458
- if (this.guardianHomePhoneControl.value) {
1459
- this.victimForm.value.guardianHomePhone = this.guardianHomePhoneControl.value.replace(/[()\s-]/g, '');
1460
- }
1461
- else {
1462
- this.victimForm.value.guardianHomePhone = null;
1463
- }
1464
- if (this.guardianCellPhoneControl.value) {
1465
- this.victimForm.value.guardianCellPhone = this.guardianCellPhoneControl.value.replace(/[()\s-]/g, '');
1466
- }
1467
- else {
1468
- this.victimForm.value.guardianCellPhone = null;
1469
- }
1470
- if (this.guardianWorkPhoneControl.value) {
1471
- this.victimForm.value.guardianWorkPhone = this.guardianWorkPhoneControl.value.replace(/[()\s-]/g, '');
1472
- }
1473
- else {
1474
- this.victimForm.value.guardianWorkPhone = null;
1475
- }
1476
- if (this.advocateHomePhoneControl.value) {
1477
- this.victimForm.value.advocateHomePhone = this.advocateHomePhoneControl.value.replace(/[()\s-]/g, '');
1478
- }
1479
- else {
1480
- this.victimForm.value.advocateHomePhone = null;
1481
- }
1482
- if (this.advocateCellPhoneControl.value) {
1483
- this.victimForm.value.advocateCellPhone = this.advocateCellPhoneControl.value.replace(/[()\s-]/g, '');
1484
- }
1485
- else {
1486
- this.victimForm.value.advocateCellPhone = null;
1487
- }
1488
- if (this.advocateWorkPhoneControl.value) {
1489
- this.victimForm.value.advocateWorkPhone = this.advocateWorkPhoneControl.value.replace(/[()\s-]/g, '');
1490
- }
1491
- else {
1492
- this.victimForm.value.advocateWorkPhone = null;
1493
- }
1494
- if (this.emergencyContactPhoneControl.value) {
1495
- this.victimForm.value.emergencyContactPhone = this.emergencyContactPhoneControl.value.replace(/[()\s-]/g, '');
1496
- }
1497
- else {
1498
- this.victimForm.value.emergencyContactPhone = null;
1499
- }
1500
- //data process
1501
- console.log('this.phoneValidationFlag 1');
1502
- console.log(this.phoneValidationFlag);
1503
- if (this.phoneValidationFlag === false) {
1504
- if (this.victimDetail === null) {
1505
- //insert new victim
1506
- var myVictimSupports = [];
1507
- if (this.victimForm.value.victimSupports) {
1508
- this.victimForm.value.victimSupports.forEach(element => {
1509
- const victimSupport = {};
1510
- victimSupport.victimId = this.victimForm.value.victimId;
1511
- victimSupport.victimSupportTypeId = element;
1512
- victimSupport.modifiedBy = this.staffId;
1513
- myVictimSupports.push(victimSupport);
1514
- });
1515
- }
1516
- var myVictimDrugUses = [];
1517
- console.log('this.victimForm.value.victimDrugUses during save');
1518
- console.log(this.victimForm.value.victimDrugUses);
1519
- if (this.victimForm.value.victimDrugUses) {
1520
- this.victimForm.value.victimDrugUses.forEach(element => {
1521
- const victimDrugUse = {};
1522
- victimDrugUse.drugTypeId = element;
1523
- if (element === "OTHER" || element === "" || element === null) {
1524
- victimDrugUse.drugTypeId = null;
1525
- victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1526
- }
1527
- else {
1528
- victimDrugUse.drugTypeId = element;
1529
- victimDrugUse.otherDrug = null;
1530
- }
1531
- victimDrugUse.modifiedBy = this.staffId;
1532
- victimDrugUse.victimId = this.victimForm.value.victimId;
1533
- myVictimDrugUses.push(victimDrugUse);
1534
- });
1535
- }
1536
- console.log('this.victimForm.value.victimDrugUses during save 1');
1537
- console.log(this.victimForm.value.victimDrugUses);
1538
- var myVictimWeaponUses = [];
1539
- if (this.victimForm.value.victimWeaponUses) {
1540
- this.victimForm.value.victimWeaponUses.forEach(element => {
1541
- const victimWeaponUse = {};
1542
- victimWeaponUse.victimId = this.victimForm.value.victimId;
1543
- victimWeaponUse.weaponTypeId = element;
1544
- if (element == "OTHER") {
1545
- victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1546
- }
1547
- else {
1548
- victimWeaponUse.otherWeapon = null;
1549
- }
1550
- victimWeaponUse.modifiedBy = this.staffId;
1551
- myVictimWeaponUses.push(victimWeaponUse);
1552
- });
1553
- }
1554
- const newVictim = {
1555
- victimId: 0,
1556
- offenderId: this.offenderId,
1557
- victimOffenderRelationshipTypeId: this.victimForm.value.victimOffenderRelationshipTypeId,
1558
- lastName: this.victimForm.value.lastName,
1559
- firstName: this.victimForm.value.firstName,
1560
- middleName: this.victimForm.value.middleName
1561
- ? this.victimForm.value.middleName
1562
- : null,
1563
- prefixId: this.victimForm.value.prefixId
1564
- ? this.victimForm.value.prefixId
1565
- : null,
1566
- suffixId: this.victimForm.value.suffixId
1567
- ? this.victimForm.value.suffixId
1568
- : null,
1569
- birthDate: this.victimForm.value.birthDate
1570
- ? this.victimForm.value.birthDate
1571
- : null,
1572
- genderCode: this.victimForm.value.genderCode
1573
- ? this.victimForm.value.genderCode
1574
- : null,
1575
- underSupervisionFlag: this.victimForm.value.underSupervisionFlag,
1576
- minorFlag: this.victimForm.value.minorFlag,
1577
- victimAdvocateFlag: this.victimForm.value.victimAdvocateFlag,
1578
- homePhone: this.victimForm.value.homePhone,
1579
- workPhone: this.victimForm.value.workPhone,
1580
- cellPhone: this.victimForm.value.cellPhone,
1581
- email: this.victimForm.value.email ? this.victimForm.value.email : null,
1582
- addressId: this.victimForm.value.addressId
1583
- ? this.victimForm.value.addressId
1584
- : 1,
1585
- emergencyContact: this.victimForm.value.emergencyContact
1586
- ? this.victimForm.value.emergencyContact
1587
- : null,
1588
- emergencyContactPhone: this.victimForm.value.emergencyContactPhone,
1589
- commonChildrenFlag: this.victimForm.value.commonChildrenFlag,
1590
- commonChildrenNumber: this.victimForm.value.commonChildrenNumber,
1591
- cpoExpirationFlag: this.victimForm.value.cpoExpirationFlag,
1592
- cpoExpirationDate: this.victimForm.value.cpoExpirationDate
1593
- ? this.datePipe.transform(this.victimForm.value.cpoExpirationDate, "short")
1594
- : null,
1595
- supportInPlaceFlag: this.victimForm.value.supportInPlaceFlag,
1596
- weaponInvolvedFlag: this.victimForm.value.weaponInvolvedFlag,
1597
- drugUseFlag: this.victimForm.value.drugUseFlag,
1598
- alcoholUseFlag: this.victimForm.value.alcoholUseFlag,
1599
- accessRisk: this.victimForm.value.accessRisk,
1600
- modifiedBy: this.staffId,
1601
- vVictimAdvocate: null,
1602
- vVictimGuardian: null,
1603
- victimDrugUses: myVictimDrugUses,
1604
- victimSupports: myVictimSupports,
1605
- victimWeaponUses: myVictimWeaponUses,
1606
- advocateFirstName: null,
1607
- advocateLastName: null,
1608
- advocateEmail: null,
1609
- advocatePrefixId: null,
1610
- advocateSuffixId: null,
1611
- advocateNoPhoneFlag: null,
1612
- advocateHomePhone: null,
1613
- advocateWorkPhone: null,
1614
- advocateCellPhone: null,
1615
- advocateAddressId: null,
1616
- guardianFirstName: null,
1617
- guardianLastName: null,
1618
- guardianEmail: null,
1619
- guardianPrefixId: null,
1620
- guardianSuffixId: null,
1621
- guardianNoPhoneFlag: null,
1622
- guardianHomePhone: null,
1623
- guardianWorkPhone: null,
1624
- guardianCellPhone: null,
1625
- guardianAddressId: null,
1626
- guardianBirthDate: null,
1627
- relationship: null,
1628
- //relationship: this.victimForm.value.victimOffenderRelationshipTypeId? this.victimForm.value.victimOffenderRelationshipTypeId : null,
1629
- allowCsosaContactFlag: this.victimForm.value.allowCsosaContactFlag
1630
- ? this.victimForm.value.allowCsosaContactFlag
1631
- : null,
1632
- liveWithOffenderFlag: this.victimForm.value.liveWithOffenderFlag
1633
- ? this.victimForm.value.liveWithOffenderFlag
1634
- : null,
1635
- };
1636
- if (this.addressId == 0) {
1637
- newVictim.addressId = null;
1638
- }
1639
- else {
1640
- newVictim.addressId = this.addressId;
1641
- }
1642
- newVictim.advocateAddressId = this.advocateAddressId;
1643
- newVictim.guardianAddressId = this.guardianAddressId;
1644
- console.log('newVictim');
1645
- console.log(newVictim);
1646
- this.victimService.postVictims(newVictim).subscribe((items) => {
1647
- const id = items ? items.victimId : '';
1648
- if (this.victimForm.value.victimAdvocateFlag == "YS") {
1649
- console.log('add advocate');
1650
- const victimAdvocate = {
1651
- victimAdvocateId: id,
1652
- lastName: this.victimForm.value.advocateLastName,
1653
- firstName: this.victimForm.value.advocateFirstName,
1654
- prefixId: this.victimForm.value.advocatePrefixId,
1655
- suffixId: this.victimForm.value.advocateSuffixId,
1656
- addressId: this.advocateAddressId ? this.advocateAddressId : null,
1657
- noPhoneFlag: this.victimForm.value.advocateNoPhoneFlag ? this.victimForm.value.advocateNoPhoneFlag : null,
1658
- homePhone: this.victimForm.value.advocateHomePhone,
1659
- workPhone: this.victimForm.value.advocateWorkPhone,
1660
- cellPhone: this.victimForm.value.advocateCellPhone,
1661
- email: this.victimForm.value.advocateEmail,
1662
- modifiedBy: this.staffId
1663
- };
1664
- this.victimService.postVictimAdvocate(id, victimAdvocate).subscribe();
1665
- }
1666
- if (this.victimForm.value.minorFlag == true) {
1667
- const victimGuardian = {
1668
- victimGuardianId: id,
1669
- lastName: this.victimForm.value.guardianLastName,
1670
- firstName: this.victimForm.value.guardianFirstName,
1671
- prefixId: this.victimForm.value.guardianPrefixId,
1672
- suffixId: this.victimForm.value.guardianSuffixId,
1673
- birthDate: this.victimForm.value.guardianBirthDate,
1674
- addressId: this.guardianAddressId ? this.guardianAddressId : null,
1675
- noPhoneFlag: this.victimForm.value.guardianNoPhoneFlag ? this.victimForm.value.guardianNoPhoneFlag : null,
1676
- homePhone: this.victimForm.value.guardianHomePhone,
1677
- workPhone: this.victimForm.value.guardianWorkPhone,
1678
- cellPhone: this.victimForm.value.guardianCellPhone,
1679
- email: this.victimForm.value.guardianEmail,
1680
- modifiedBy: this.staffId
1681
- };
1682
- this.victimService.postVictimGuardian(id, victimGuardian).subscribe();
1683
- }
1684
- this.snackBar.open('Add Victim Successfully!', '', {
1685
- duration: 3000,
1686
- });
1687
- //insert new
1688
- if (this.isIntake === true) {
1689
- this.router.navigate(['victimHome']);
1690
- }
1691
- else {
1692
- this.router.navigate(['victimList']);
1693
- }
1694
- //this.onSave.emit(this.victimDetail);
1695
- });
1696
- }
1697
- else {
1698
- //update victim
1699
- this.victimDetail.underSupervisionFlag = this.victimForm.value.underSupervisionFlag;
1700
- this.victimDetail.victimOffenderRelationshipTypeId = this.victimForm.value.victimOffenderRelationshipTypeId;
1701
- this.victimDetail.lastName = this.victimForm.value.lastName;
1702
- this.victimDetail.firstName = this.victimForm.value.firstName;
1703
- this.victimDetail.middleName = this.victimForm.value.middleName;
1704
- this.victimDetail.prefixId = this.victimForm.value.prefixId ? this.victimForm.value.prefixId : null;
1705
- this.victimDetail.suffixId = this.victimForm.value.suffixId ? this.victimForm.value.suffixId : null;
1706
- this.victimDetail.birthDate = this.victimForm.value.birthDate;
1707
- this.victimDetail.genderCode = this.victimForm.value.genderCode;
1708
- this.victimDetail.minorFlag = this.victimForm.value.minorFlag;
1709
- this.victimDetail.homePhone = this.victimForm.value.homePhone;
1710
- this.victimDetail.workPhone = this.victimForm.value.workPhone;
1711
- this.victimDetail.cellPhone = this.victimForm.value.cellPhone;
1712
- this.victimDetail.email = this.victimForm.value.email;
1713
- this.victimDetail.victimAdvocateFlag = this.victimForm.value.victimAdvocateFlag;
1714
- this.victimDetail.emergencyContact = this.victimForm.value.emergencyContact;
1715
- this.victimDetail.emergencyContactPhone = this.victimForm.value.emergencyContactPhone;
1716
- this.victimDetail.commonChildrenFlag = this.victimForm.value.commonChildrenFlag;
1717
- this.victimDetail.commonChildrenNumber = this.victimForm.value.commonChildrenNumber;
1718
- this.victimDetail.cpoExpirationDate = this.victimForm.value.cpoExpirationDate;
1719
- this.victimDetail.cpoExpirationFlag = this.victimForm.value.cpoExpirationFlag;
1720
- this.victimDetail.supportInPlaceFlag = this.victimForm.value.supportInPlaceFlag;
1721
- this.victimDetail.weaponInvolvedFlag = this.victimForm.value.weaponInvolvedFlag;
1722
- this.victimDetail.drugUseFlag = this.victimForm.value.drugUseFlag;
1723
- this.victimDetail.alcoholUseFlag = this.victimForm.value.alcoholUseFlag;
1724
- this.victimDetail.accessRisk = this.victimForm.value.accessRisk;
1725
- this.victimDetail.addressId = this.addressId;
1726
- this.victimDetail.allowCsosaContactFlag = this.victimForm.value.allowCsosaContactFlag;
1727
- this.victimDetail.liveWithOffenderFlag = this.victimForm.value.liveWithOffenderFlag;
1728
- this.victimDetail.victimSupports = [];
1729
- this.victimForm.value.victimSupports.forEach(element => {
1730
- const victimSupport = {};
1731
- victimSupport.victimId = this.victimDetail.victimId;
1732
- victimSupport.victimSupportTypeId = element;
1733
- victimSupport.modifiedBy = this.staffId;
1734
- this.victimDetail.victimSupports.push(victimSupport);
1735
- });
1736
- this.victimDetail.victimDrugUses = [];
1737
- this.victimForm.value.victimDrugUses.forEach(element => {
1738
- const victimDrugUse = {};
1739
- victimDrugUse.drugTypeId = element;
1740
- console.log('this.victimForm.value.victimDrugUses before');
1741
- console.log(this.victimForm.value.victimDrugUses);
1742
- if (element === "OTHER" || element === "") {
1743
- victimDrugUse.drugTypeId = null;
1744
- victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1745
- }
1746
- else {
1747
- victimDrugUse.drugTypeId = element;
1748
- victimDrugUse.otherDrug = null;
1749
- }
1750
- victimDrugUse.modifiedBy = this.staffId;
1751
- victimDrugUse.victimId = this.victimDetail.victimId;
1752
- this.victimDetail.victimDrugUses.push(victimDrugUse);
1753
- });
1754
- this.victimForm.value.victimDrugUses.filter(word => (!(word.drugTypeId === null && word.otherDrug === null)));
1755
- this.victimDetail.victimWeaponUses = [];
1756
- this.victimForm.value.victimWeaponUses.forEach(element => {
1757
- const victimWeaponUse = {};
1758
- victimWeaponUse.victimId = this.victimDetail.victimId;
1759
- victimWeaponUse.weaponTypeId = element;
1760
- if (element == "OTHER") {
1761
- victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1762
- }
1763
- else {
1764
- victimWeaponUse.otherWeapon = null;
1765
- }
1766
- victimWeaponUse.modifiedBy = this.staffId;
1767
- this.victimDetail.victimWeaponUses.push(victimWeaponUse);
1768
- });
1769
- console.log('this.victimDetail before emit');
1770
- console.log(this.victimDetail);
1771
- this.victimService.putVictims(this.victimDetail.victimId, this.victimDetail).subscribe((items) => {
1772
- this.snackBar.open('Update Successfully!', '', {
1773
- duration: 3000,
1774
- });
1775
- //Advocate section
1776
- this.victimAdvocate.victimAdvocateId = this.victimDetail.victimId;
1777
- this.victimAdvocate.lastName = this.victimForm.value.advocateLastName;
1778
- this.victimAdvocate.firstName = this.victimForm.value.advocateFirstName;
1779
- this.victimAdvocate.prefixId = this.victimForm.value.advocatePrefixId ? this.victimForm.value.advocatePrefixId : null;
1780
- this.victimAdvocate.suffixId = this.victimForm.value.advocateSuffixId ? this.victimForm.value.advocateSuffixId : null;
1781
- this.victimAdvocate.addressId = this.advocateAddressId ? this.advocateAddressId : null;
1782
- this.victimAdvocate.noPhoneFlag = this.victimForm.value.advocateNoPhoneFlag ? true : false;
1783
- this.victimAdvocate.homePhone = this.victimForm.value.advocateHomePhone;
1784
- this.victimAdvocate.workPhone = this.victimForm.value.advocateWorkPhone;
1785
- this.victimAdvocate.cellPhone = this.victimForm.value.advocateCellPhone;
1786
- this.victimAdvocate.email = this.victimForm.value.advocateEmail ? this.victimForm.value.advocateEmail : null;
1787
- this.victimAdvocate.modifiedBy = this.staffId;
1788
- console.log('work on advocate part');
1789
- if (this.victimDetail.victimAdvocateFlag == 'YS') {
1790
- console.log('work on advocate flag is YS ');
1791
- if (this.victimDetail.advocateFirstName != null) {
1792
- console.log('check advocate fisrt name ');
1793
- console.log(this.victimDetail.advocateFirstName);
1794
- this.victimService.putVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe(resp => { });
1795
- }
1796
- else {
1797
- console.log('add advocate');
1798
- console.log(this.victimAdvocate);
1799
- this.victimService.postVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe();
1800
- }
1801
- }
1802
- // guardian section
1803
- this.victimGuardian.victimGuardianId = this.victimDetail.victimId;
1804
- this.victimGuardian.lastName = this.victimForm.value.guardianLastName;
1805
- this.victimGuardian.firstName = this.victimForm.value.guardianFirstName;
1806
- this.victimGuardian.prefixId = this.victimForm.value.guardianPrefixId ? this.victimForm.value.guardianPrefixId : null;
1807
- this.victimGuardian.suffixId = this.victimForm.value.guardianSuffixId ? this.victimForm.value.guardianSuffixId : null;
1808
- this.victimGuardian.addressId = this.guardianAddressId ? this.guardianAddressId : null;
1809
- this.victimGuardian.noPhoneFlag = this.victimForm.value.guardianNoPhoneFlag ? true : false;
1810
- this.victimGuardian.homePhone = this.victimForm.value.guardianHomePhone;
1811
- this.victimGuardian.workPhone = this.victimForm.value.guardianWorkPhone;
1812
- this.victimGuardian.cellPhone = this.victimForm.value.guardianCellPhone;
1813
- this.victimGuardian.email = this.victimForm.value.guardianEmail ? this.victimForm.value.guardianEmail : null;
1814
- this.victimGuardian.modifiedBy = this.staffId;
1815
- if (this.victimDetail.minorFlag == true) {
1816
- if (this.victimDetail.guardianFirstName != null)
1817
- this.victimService.putVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe(resp => {
1818
- });
1819
- else {
1820
- console.log('add gurdian');
1821
- console.log(this.victimGuardian);
1822
- this.victimService.postVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe();
1823
- }
1824
- }
1825
- });
1826
- }
1827
- } //end of this.phoneValidationFlag = false
1828
- console.log('this.victimDetail');
1829
- console.log(this.victimDetail);
1830
- this.onSave.emit(this.victimDetail);
1831
- }
1832
- //#endregion "save victim"
1833
- addContact() {
1834
- this.router.navigate(['victimContact', this.victimId]);
1835
- }
1836
- formatLabel(value) {
1837
- return value;
1838
- }
1839
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDetailComponent, deps: [{ token: i8$1.Location }, { token: i1$2.UntypedFormBuilder }, { token: i1$1.MatDialog }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i4.MatSnackBar }, { token: CommonDialogService }, { token: NgcSmartVictimService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1840
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SmartVictimDetailComponent, selector: "csmart-victim-detail", inputs: { victimDetail: "victimDetail", staffId: "staffId", offenderId: "offenderId", isIntake: "isIntake" }, outputs: { onSave: "onSave", onCancel: "onCancel" }, providers: [CommonDialogService], viewQueries: [{ propertyName: "addressComponent", first: true, predicate: ["addressComponent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]=\"victimForm\">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label=\"Victim Detail\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\r\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\r\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\r\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Sex:</mat-label>\r\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"victimBirthRef\"\r\n formControlName=\"birthDate\"\r\n [(ngModel)]=\"editVictim.birthDate\"\r\n (click)=\"victimBirthRef.open()\"\r\n (dateChange)=\"handleDOBChange($event)\"\r\n >\r\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.homePhone\"\r\n [phoneControl]=\"homePhoneControl\"\r\n [formControl]=\"homePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\r\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input\r\n id=\"tel1\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.cellPhone\"\r\n [phoneControl]=\"cellPhoneControl\"\r\n [formControl]=\"cellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\r\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input\r\n id=\"tel2\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.workPhone\"\r\n [phoneControl]=\"workPhoneControl\"\r\n [formControl]=\"workPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\r\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\r\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <app-smart-address\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"addressId\"\r\n [outline]=\"true\"\r\n [showPsa]=\"true\"\r\n [addressValidators]=\"addressValidators\"\r\n [readonly]=\"false\"\r\n (addressIdChange)=\"onAddressChange($event)\"\r\n #addressComponent >\r\n\r\n </app-smart-address>\r\n\r\n\r\n <!-- Docket:\r\n <div>\r\n <div *ngFor=\"let docket of docketlist; let i=index\">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> -->\r\n <div>\r\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\r\n <br>\r\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\r\n </div>\r\n\r\n </div>\r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"commonChildrenDivFlag\">\r\n\r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"cpoExpirationDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput\r\n [matDatepicker]=\"cpoDateRef\"\r\n formControlName=\"cpoExpirationDate\"\r\n (click)=\"cpoDateRef.open()\"\r\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\r\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"supportInPlaceDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\r\n <div (mouseleave)=\"supportSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n\r\n <div *ngIf=\"weaponInvolvedDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\r\n <div (mouseleave)=\"weaponSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf=\"otherWeaponFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName=\"otherWeapon\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"drugUseDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\r\n <div (mouseleave)=\"drugSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div *ngIf=\"otherDrugFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName=\"otherDrug\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n\r\n <mat-slider\r\n formControlName=\"accessRisk\"\r\n thumbLabel=\"true\"\r\n [displayWith]=\"formatLabel\"\r\n min=\"1\"\r\n max=\"10\"\r\n [(ngModel)]=\"editVictim.accessRisk\"\r\n ></mat-slider>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\r\n <div class='container'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <!-- <mat-form-field>\r\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> -->\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"guardianDateRef\"\r\n formControlName=\"guardianBirthDate\"\r\n [(ngModel)]=\"editVictim.guardianBirthDate\"\r\n (click)=\"guardianDateRef.open()\"\r\n >\r\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"guardianNoPhoneFlag\">\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianHomePhone\"\r\n [phoneControl]=\"guardianHomePhoneControl\"\r\n [formControl]=\"guardianHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\r\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input\r\n id=\"tel4\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianCellPhone\"\r\n [phoneControl]=\"guardianCellPhoneControl\"\r\n [formControl]=\"guardianCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\r\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n\r\n <input\r\n id=\"tel5\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianWorkPhone\"\r\n [phoneControl]=\"guardianWorkPhoneControl\"\r\n [formControl]=\"guardianWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\r\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\r\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n <div>\r\n <app-smart-address\r\n\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"guardianAddressId\"\r\n (addressIdChange)=\"onGuardianAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <!--advocate-->\r\n\r\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"advocateNoPhoneFlag\"\r\n\r\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateHomePhone\"\r\n [phoneControl]=\"advocateHomePhoneControl\"\r\n [formControl]=\"advocateHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\r\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input\r\n id=\"tel7\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateCellPhone\"\r\n [phoneControl]=\"advocateCellPhoneControl\"\r\n [formControl]=\"advocateCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\r\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input\r\n id=\"tel8\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateWorkPhone\"\r\n [phoneControl]=\"advocateWorkPhoneControl\"\r\n [formControl]=\"advocateWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\r\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\r\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n\r\n <div >\r\n <app-smart-address\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"advocateAddressId\"\r\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n\r\n <mat-tab label=\"Emergency Contact\">\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.emergencyContactPhone\"\r\n [phoneControl]=\"emergencyContactPhoneControl\"\r\n [formControl]=\"emergencyContactPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\r\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n </mat-tab-group>\r\n <div class='outer'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\r\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\r\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\r\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\r\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf=\"showDelete\" class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"cancel()\">Clear </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align=\"right\">\r\n <button mat-raised-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"contactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimContactMethod\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"nextContactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"staff\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"contactId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:100%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width: 1120px){.container{display:grid;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width: 675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: i11.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i20.SmartAddressComponent, selector: "app-smart-address", inputs: ["showPsa", "housingTypeId", "modifiedBy", "rowHeight", "id", "outline", "readonly", "addressValidators"], outputs: ["isValid", "addressIdChange"] }, { kind: "directive", type: i21.PhoneMaskDirective, selector: "[phoneMask]", inputs: ["phoneControl", "preValue"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] });
1841
- }
1842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDetailComponent, decorators: [{
1843
- type: Component,
1844
- args: [{ selector: 'csmart-victim-detail', providers: [CommonDialogService], template: "<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]=\"victimForm\">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label=\"Victim Detail\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\r\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\r\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\r\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Sex:</mat-label>\r\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"victimBirthRef\"\r\n formControlName=\"birthDate\"\r\n [(ngModel)]=\"editVictim.birthDate\"\r\n (click)=\"victimBirthRef.open()\"\r\n (dateChange)=\"handleDOBChange($event)\"\r\n >\r\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.homePhone\"\r\n [phoneControl]=\"homePhoneControl\"\r\n [formControl]=\"homePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\r\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input\r\n id=\"tel1\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.cellPhone\"\r\n [phoneControl]=\"cellPhoneControl\"\r\n [formControl]=\"cellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\r\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input\r\n id=\"tel2\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.workPhone\"\r\n [phoneControl]=\"workPhoneControl\"\r\n [formControl]=\"workPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\r\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\r\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <app-smart-address\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"addressId\"\r\n [outline]=\"true\"\r\n [showPsa]=\"true\"\r\n [addressValidators]=\"addressValidators\"\r\n [readonly]=\"false\"\r\n (addressIdChange)=\"onAddressChange($event)\"\r\n #addressComponent >\r\n\r\n </app-smart-address>\r\n\r\n\r\n <!-- Docket:\r\n <div>\r\n <div *ngFor=\"let docket of docketlist; let i=index\">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> -->\r\n <div>\r\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\r\n <br>\r\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\r\n </div>\r\n\r\n </div>\r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"commonChildrenDivFlag\">\r\n\r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"cpoExpirationDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput\r\n [matDatepicker]=\"cpoDateRef\"\r\n formControlName=\"cpoExpirationDate\"\r\n (click)=\"cpoDateRef.open()\"\r\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\r\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"supportInPlaceDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\r\n <div (mouseleave)=\"supportSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n\r\n <div *ngIf=\"weaponInvolvedDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\r\n <div (mouseleave)=\"weaponSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf=\"otherWeaponFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName=\"otherWeapon\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"drugUseDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\r\n <div (mouseleave)=\"drugSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div *ngIf=\"otherDrugFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName=\"otherDrug\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n\r\n <mat-slider\r\n formControlName=\"accessRisk\"\r\n thumbLabel=\"true\"\r\n [displayWith]=\"formatLabel\"\r\n min=\"1\"\r\n max=\"10\"\r\n [(ngModel)]=\"editVictim.accessRisk\"\r\n ></mat-slider>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\r\n <div class='container'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <!-- <mat-form-field>\r\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> -->\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"guardianDateRef\"\r\n formControlName=\"guardianBirthDate\"\r\n [(ngModel)]=\"editVictim.guardianBirthDate\"\r\n (click)=\"guardianDateRef.open()\"\r\n >\r\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"guardianNoPhoneFlag\">\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianHomePhone\"\r\n [phoneControl]=\"guardianHomePhoneControl\"\r\n [formControl]=\"guardianHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\r\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input\r\n id=\"tel4\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianCellPhone\"\r\n [phoneControl]=\"guardianCellPhoneControl\"\r\n [formControl]=\"guardianCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\r\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n\r\n <input\r\n id=\"tel5\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianWorkPhone\"\r\n [phoneControl]=\"guardianWorkPhoneControl\"\r\n [formControl]=\"guardianWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\r\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\r\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n <div>\r\n <app-smart-address\r\n\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"guardianAddressId\"\r\n (addressIdChange)=\"onGuardianAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <!--advocate-->\r\n\r\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"advocateNoPhoneFlag\"\r\n\r\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateHomePhone\"\r\n [phoneControl]=\"advocateHomePhoneControl\"\r\n [formControl]=\"advocateHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\r\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input\r\n id=\"tel7\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateCellPhone\"\r\n [phoneControl]=\"advocateCellPhoneControl\"\r\n [formControl]=\"advocateCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\r\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input\r\n id=\"tel8\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateWorkPhone\"\r\n [phoneControl]=\"advocateWorkPhoneControl\"\r\n [formControl]=\"advocateWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\r\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\r\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n\r\n <div >\r\n <app-smart-address\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"advocateAddressId\"\r\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n\r\n <mat-tab label=\"Emergency Contact\">\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.emergencyContactPhone\"\r\n [phoneControl]=\"emergencyContactPhoneControl\"\r\n [formControl]=\"emergencyContactPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\r\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n </mat-tab-group>\r\n <div class='outer'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\r\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\r\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\r\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\r\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf=\"showDelete\" class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div class=\"inner\">\r\n <button mat-raised-button color=\"primary\" (click)=\"cancel()\">Clear </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align=\"right\">\r\n <button mat-raised-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"contactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimContactMethod\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"nextContactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"staff\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"contactId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:100%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width: 1120px){.container{display:grid;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width: 675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}\n"] }]
1845
- }], ctorParameters: () => [{ type: i8$1.Location }, { type: i1$2.UntypedFormBuilder }, { type: i1$1.MatDialog }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.MatSnackBar }, { type: CommonDialogService }, { type: NgcSmartVictimService }, { type: i0.ChangeDetectorRef }], propDecorators: { victimDetail: [{
1846
- type: Input
1847
- }], staffId: [{
1848
- type: Input
1849
- }], offenderId: [{
1850
- type: Input
1851
- }], isIntake: [{
1852
- type: Input
1853
- }], onSave: [{
1854
- type: Output
1855
- }], onCancel: [{
1856
- type: Output
1857
- }], addressComponent: [{
1858
- type: ViewChild,
1859
- args: ["addressComponent"]
1860
- }] } });
1861
-
1862
- class VictimListFilter {
1863
- offenderId;
1864
- lastName;
1865
- firstName;
1866
- pdid;
1867
- birthDate;
1868
- }
1869
-
1870
- class VictimSearchFormComponent {
1871
- onSearch = new EventEmitter();
1872
- change = new EventEmitter();
1873
- filter = new VictimListFilter();
1874
- constructor() { }
1875
- ngOnInit() {
1876
- }
1877
- ngAfterViewInit() {
1878
- // var element = <HTMLInputElement> document.getElementById("victimSearchButton");
1879
- // element.disabled = true;
1880
- // setTimeout(function() {
1881
- // element.disabled = false;
1882
- // }, 10000);
1883
- }
1884
- onChange() {
1885
- console.log('this.filter in serach form.');
1886
- console.log(this.filter);
1887
- this.onSearch.emit(this.filter);
1888
- }
1889
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSearchFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1890
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSearchFormComponent, selector: "app-victim-search-form", outputs: { onSearch: "onSearch" }, ngImport: i0, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\r\n<mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"victimSearch\">\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\r\n </mat-form-field>\r\n \r\n \r\n <section>\r\n <button id=\"victimSearchButton\" mat-raised-button color=\"primary\" (click)=\"onChange()\">Search</button>\r\n <span style=\"padding-right: 5px;\"></span>\r\n <button mat-raised-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}\n"], dependencies: [{ kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], encapsulation: i0.ViewEncapsulation.None });
1891
- }
1892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSearchFormComponent, decorators: [{
1893
- type: Component,
1894
- args: [{ selector: 'app-victim-search-form', encapsulation: ViewEncapsulation.None, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\r\n<mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"victimSearch\">\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\r\n </mat-form-field>\r\n \r\n \r\n <section>\r\n <button id=\"victimSearchButton\" mat-raised-button color=\"primary\" (click)=\"onChange()\">Search</button>\r\n <span style=\"padding-right: 5px;\"></span>\r\n <button mat-raised-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}\n"] }]
1895
- }], ctorParameters: () => [], propDecorators: { onSearch: [{
1896
- type: Output
1897
- }] } });
1898
-
1899
- class NgcSmartVictimComponent {
1900
- dialog;
1901
- victimService;
1902
- router;
1903
- route;
1904
- snackBar;
1905
- intakeService;
1906
- smartWarrantUrl;
1907
- document;
1908
- offenderId;
1909
- staffId;
1910
- staffRole;
1911
- showCaseNote;
1912
- showSafetyPlan;
1913
- //@Input() showAdd: string;
1914
- showAdd;
1915
- showEdit;
1916
- showRelationshipColumn;
1917
- showOffenderNameColumn;
1918
- showOffenderPhoneColumn;
1919
- showSearchForm;
1920
- accessByModule;
1921
- intakeFlag;
1922
- appModuleId = '';
1923
- activatedRoute = null;
1924
- paginator;
1925
- sort;
1926
- // @ViewChild(SmartVictimDetailComponent) child;
1927
- displayedColumns;
1928
- victims = [];
1929
- victimDetail = {};
1930
- showDetail = false;
1931
- victimListFilter = new VictimListFilter$1();
1932
- victimListDataSource = new MatTableDataSource();
1933
- doSpin = false;
1934
- showListFlag = false;
1935
- msg = "";
1936
- isIntake = false;
1937
- updateAccessControlConfig;
1938
- createAccessControlConfig;
1939
- deleteAccessControlConfig;
1940
- constructor(dialog, victimService, router, route, snackBar, intakeService, smartWarrantUrl, document) {
1941
- this.dialog = dialog;
1942
- this.victimService = victimService;
1943
- this.router = router;
1944
- this.route = route;
1945
- this.snackBar = snackBar;
1946
- this.intakeService = intakeService;
1947
- this.smartWarrantUrl = smartWarrantUrl;
1948
- this.document = document;
1949
- }
1950
- // private onChange(filter: VictimListFilter) {
1951
- // console.log('filter in onchange');
1952
- // console.log(filter);
1953
- // this.getVictimList(filter);
1954
- // }
1955
- applyFilter(filterValue) {
1956
- this.victimListDataSource.filter = filterValue.trim().toLowerCase();
1957
- }
1958
- addRecord() {
1959
- this.showDetail = true;
1960
- this.showAdd = false;
1961
- this.victimDetail = null;
1962
- this.showListFlag = false;
1963
- }
1964
- editVictimDetail(record) {
1965
- console.log("victim edit record");
1966
- console.log(record);
1967
- console.log(record.victimId);
1968
- this.victimDetail = record;
1969
- this.showDetail = true;
1970
- this.showAdd = false;
1971
- this.showListFlag = false;
1972
- }
1973
- save(detail) {
1974
- this.showDetail = false;
1975
- this.showAdd = true;
1976
- this.showListFlag = true;
1977
- }
1978
- cancel() {
1979
- this.showDetail = false;
1980
- this.victimDetail = {};
1981
- }
1982
- ngAfterViewInit() {
1983
- this.victimListDataSource.paginator = this.paginator;
1984
- this.victimListDataSource.sort = this.sort;
1985
- }
1986
- ngOnChanges() {
1987
- this.updateAccessControlConfig = {
1988
- accessType: AccessType.UPDATE,
1989
- appModuleId: this.appModuleId,
1990
- roleId: null,
1991
- route: this.activatedRoute.snapshot,
1992
- };
1993
- this.createAccessControlConfig = {
1994
- accessType: AccessType.CREATE,
1995
- appModuleId: this.appModuleId,
1996
- roleId: null,
1997
- route: this.activatedRoute.snapshot,
1998
- };
1999
- this.deleteAccessControlConfig = {
2000
- accessType: AccessType.DELETE,
2001
- appModuleId: this.appModuleId,
2002
- roleId: null,
2003
- route: this.activatedRoute.snapshot,
2004
- };
2005
- }
2006
- ngOnInit() {
2007
- const queryParams = this.route.snapshot.queryParams;
2008
- if (queryParams['routeTo']) {
2009
- this.router.navigate([queryParams['routeTo']]);
2010
- }
2011
- var data = this.route.snapshot.data;
2012
- var myPath = this.router.url.slice(-10);
2013
- console.log("offender id at smart-victim");
2014
- console.log(this.offenderId);
2015
- console.log("staff id at smart-victim");
2016
- console.log(this.staffId);
2017
- console.log("insakeFlag at smart-victim");
2018
- console.log(this.intakeFlag);
2019
- console.log("smart-victim ngOnInit");
2020
- console.log(this.intakeFlag);
2021
- console.log(myPath);
2022
- if (this.intakeFlag == "true") {
2023
- this.isIntake = true;
2024
- }
2025
- this.displayedColumns = ["lastName", "firstName"];
2026
- if (this.showRelationshipColumn == true ||
2027
- myPath == "victimList" ||
2028
- myPath == "victimHome") {
2029
- this.displayedColumns.push("relationship");
2030
- }
2031
- if (this.showOffenderNameColumn == true) {
2032
- this.displayedColumns.push("offenderName");
2033
- }
2034
- if (this.showOffenderPhoneColumn == true ||
2035
- myPath == "victimList" ||
2036
- myPath == "victimHome") {
2037
- this.displayedColumns.push("homePhone");
2038
- }
2039
- this.displayedColumns.push("victimId");
2040
- if (this.showSearchForm == true) {
2041
- this.showListFlag = false;
2042
- }
2043
- console.log("this.showSearchForm");
2044
- console.log(this.showSearchForm);
2045
- console.log("myPath");
2046
- console.log(myPath);
2047
- if (this.showSearchForm == false ||
2048
- myPath == "victimList" ||
2049
- myPath == "victimHome") {
2050
- var myOffenderId;
2051
- if (this.offenderId) {
2052
- myOffenderId = this.offenderId;
2053
- }
2054
- else {
2055
- console.log("back from previous page");
2056
- this.showAdd = true;
2057
- this.showRelationshipColumn = true;
2058
- //this.displayedColumns.push("relationship");
2059
- this.showOffenderPhoneColumn = true;
2060
- // this.displayedColumns.push("homePhone");
2061
- this.accessByModule = "true";
2062
- this.showEdit = "true";
2063
- this.showCaseNote = "true";
2064
- this.showSafetyPlan = "true";
2065
- myOffenderId = data.selectedOffender.offenderId;
2066
- }
2067
- const victimListFilter = {
2068
- offenderId: myOffenderId,
2069
- lastName: null,
2070
- firstName: null,
2071
- pdid: null,
2072
- birthDate: null,
2073
- };
2074
- console.log("victimListFilter in smar-victim componenet");
2075
- console.log(victimListFilter);
2076
- this.victimService
2077
- .getVictimListByFilter(victimListFilter)
2078
- .subscribe((data) => {
2079
- this.victims = data;
2080
- this.victimListDataSource.data = data;
2081
- console.log("victim data at line 245");
2082
- console.log(this.victims);
2083
- console.log("showListFlag");
2084
- console.log(this.showListFlag);
2085
- this.showListFlag = true;
2086
- if (data.length == 0) {
2087
- this.msg = "No Record Found!";
2088
- }
2089
- });
2090
- }
2091
- else {
2092
- console.log("find filter");
2093
- console.log(this.victimListFilter);
2094
- if (this.showListFlag === true) {
2095
- if (this.victimListFilter != null) {
2096
- this.victimService
2097
- .getVictimListByFilter(this.victimListFilter)
2098
- .subscribe((data) => {
2099
- this.victims = data;
2100
- this.victimListDataSource.data = data;
2101
- console.log("victim data at line 279");
2102
- console.log(data);
2103
- });
2104
- }
2105
- }
2106
- }
2107
- }
2108
- // phone number format on the victim list
2109
- formatPhoneNumber(phoneNumberString) {
2110
- if (!phoneNumberString)
2111
- return "";
2112
- var cleaned = ("" + phoneNumberString).replace(/\D/g, "");
2113
- var match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
2114
- if (match) {
2115
- return "(" + match[1] + ") " + match[2] + "-" + match[3];
2116
- }
2117
- return "";
2118
- }
2119
- saveIntake() {
2120
- if (!this.isIntake) {
2121
- return;
2122
- }
2123
- const intakeStep = {
2124
- intakeStepId: IntakeStep.VictimInformation,
2125
- offenderId: this.offenderId,
2126
- modifiedBy: this.staffId,
2127
- };
2128
- this.intakeService
2129
- .updateIntakeSteps(this.offenderId, intakeStep)
2130
- .subscribe((res) => {
2131
- console.log("save intake step.");
2132
- this.snackBar.open("Status Saved.", "", {
2133
- duration: 3000,
2134
- });
2135
- //this.router.navigate(['/warrant '], { queryParams: { intake: 1 } });
2136
- this.document.location.href =
2137
- `${this.smartWarrantUrl}/?offenderId=${this.offenderId}&intakeFlag=${this.isIntake}&routeTo=warrant`;
2138
- });
2139
- }
2140
- goToCaseNote(victimId) {
2141
- this.router.navigate(["casenote", victimId, this.offenderId]);
2142
- }
2143
- goToSaftyPlan(victimId) {
2144
- this.router.navigate(["saftyPlan", victimId]);
2145
- }
2146
- getVictimList(filter) {
2147
- this.victimListFilter = filter;
2148
- console.log("this.victimListFilter inside getVictimList");
2149
- console.log(this.victimListFilter);
2150
- this.doSpin = true;
2151
- this.victimService.getVictimListByFilter(filter).subscribe((data) => {
2152
- this.doSpin = !this.doSpin;
2153
- if (data.length > 0) {
2154
- this.showListFlag = true;
2155
- this.victimListDataSource.data = data;
2156
- }
2157
- else {
2158
- this.msg = "No record found!";
2159
- }
2160
- }, (err) => {
2161
- this.doSpin = !this.doSpin;
2162
- });
2163
- }
2164
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimComponent, deps: [{ token: i1$1.MatDialog }, { token: NgcSmartVictimService }, { token: i5.Router }, { token: i5.ActivatedRoute }, { token: i4.MatSnackBar }, { token: IntakeServicesComponent }, { token: SMART_WARRANT_URL }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
2165
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: NgcSmartVictimComponent, selector: "csmart-victim", inputs: { offenderId: "offenderId", staffId: "staffId", staffRole: "staffRole", showCaseNote: "showCaseNote", showSafetyPlan: "showSafetyPlan", showAdd: "showAdd", showEdit: "showEdit", showRelationshipColumn: "showRelationshipColumn", showOffenderNameColumn: "showOffenderNameColumn", showOffenderPhoneColumn: "showOffenderPhoneColumn", showSearchForm: "showSearchForm", accessByModule: "accessByModule", intakeFlag: "intakeFlag", appModuleId: "appModuleId", activatedRoute: "activatedRoute" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"showSearchForm\">\r\n <app-victim-search-form\r\n (onSearch)=\"getVictimList($event)\">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf=\"showDetail\">\r\n <csmart-victim-detail [victimDetail]=\"victimDetail\" \r\n [staffId]=\"staffId\"\r\n [offenderId] =\"offenderId\"\r\n [isIntake]=\"isIntake\"\r\n (onSave)=\"save($event)\" \r\n (onCancel)=\"cancel()\" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class=\"main-container\">\r\n \r\n <div class=\"add-action\" *ngIf=\"showAdd\">\r\n <button mat-raised-button color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"createAccessControlConfig\" \r\n (click)=\"addRecord()\">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"isIntake\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"saveIntake()\">\r\n Continue\r\n </button> \r\n </div>\r\n\r\n </div>\r\n <div *ngIf=\"showListFlag\">\r\n <mat-card id=\"divVictim\" >\r\n <mat-card-content >\r\n <mat-table #table [dataSource]=\"victimListDataSource\" >\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n \r\n <div *ngIf=\"showRelationshipColumn\">\r\n <ng-container matColumnDef=\"relationship\">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderPhoneColumn\">\r\n <ng-container matColumnDef=\"homePhone\">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > \r\n Home phone: {{formatPhoneNumber(row.homePhone)}}<br> \r\n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\r\n Work Phone: {{formatPhoneNumber(row.workPhone)}} \r\n\r\n </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <div *ngIf=\"showOffenderNameColumn\">\r\n <ng-container matColumnDef=\"offenderName\">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <ng-container matColumnDef=\"victimId\">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n \r\n <!-- <div *ngIf=\"accessByModule\">\r\n <mat-checkbox></mat-checkbox>\r\n </div> -->\r\n \r\n <div *ngIf=\"showEdit\">\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"editVictimDetail(row)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n \r\n\r\n &nbsp;&nbsp; \r\n\r\n <div *ngIf=\"showCaseNote\">\r\n <button type=\"button\" matTooltip=\"CaseNote\" mat-raised-button color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"goToCaseNote(row.victimId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\r\n </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf=\"showSafetyPlan\">\r\n <button type=\"button\" matTooltip=\"safety plan\" mat-raised-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"goToSaftyPlan(row.victimId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator> \r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}\n"], dependencies: [{ kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i9$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i6.SmartAccessControlDirective, selector: "[accessControl]", inputs: ["accessControlConfig"] }, { kind: "component", type: SmartVictimDetailComponent, selector: "csmart-victim-detail", inputs: ["victimDetail", "staffId", "offenderId", "isIntake"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: VictimSearchFormComponent, selector: "app-victim-search-form", outputs: ["onSearch"] }] });
2166
- }
2167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimComponent, decorators: [{
2168
- type: Component,
2169
- args: [{ selector: "csmart-victim", template: "<div *ngIf=\"showSearchForm\">\r\n <app-victim-search-form\r\n (onSearch)=\"getVictimList($event)\">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf=\"showDetail\">\r\n <csmart-victim-detail [victimDetail]=\"victimDetail\" \r\n [staffId]=\"staffId\"\r\n [offenderId] =\"offenderId\"\r\n [isIntake]=\"isIntake\"\r\n (onSave)=\"save($event)\" \r\n (onCancel)=\"cancel()\" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class=\"main-container\">\r\n \r\n <div class=\"add-action\" *ngIf=\"showAdd\">\r\n <button mat-raised-button color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"createAccessControlConfig\" \r\n (click)=\"addRecord()\">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"isIntake\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"saveIntake()\">\r\n Continue\r\n </button> \r\n </div>\r\n\r\n </div>\r\n <div *ngIf=\"showListFlag\">\r\n <mat-card id=\"divVictim\" >\r\n <mat-card-content >\r\n <mat-table #table [dataSource]=\"victimListDataSource\" >\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n \r\n <div *ngIf=\"showRelationshipColumn\">\r\n <ng-container matColumnDef=\"relationship\">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderPhoneColumn\">\r\n <ng-container matColumnDef=\"homePhone\">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > \r\n Home phone: {{formatPhoneNumber(row.homePhone)}}<br> \r\n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\r\n Work Phone: {{formatPhoneNumber(row.workPhone)}} \r\n\r\n </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <div *ngIf=\"showOffenderNameColumn\">\r\n <ng-container matColumnDef=\"offenderName\">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <ng-container matColumnDef=\"victimId\">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n \r\n <!-- <div *ngIf=\"accessByModule\">\r\n <mat-checkbox></mat-checkbox>\r\n </div> -->\r\n \r\n <div *ngIf=\"showEdit\">\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"editVictimDetail(row)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n \r\n\r\n &nbsp;&nbsp; \r\n\r\n <div *ngIf=\"showCaseNote\">\r\n <button type=\"button\" matTooltip=\"CaseNote\" mat-raised-button color=\"primary\" \r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"goToCaseNote(row.victimId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\r\n </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf=\"showSafetyPlan\">\r\n <button type=\"button\" matTooltip=\"safety plan\" mat-raised-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\" \r\n (click)=\"goToSaftyPlan(row.victimId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator> \r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}\n"] }]
2170
- }], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i5.Router }, { type: i5.ActivatedRoute }, { type: i4.MatSnackBar }, { type: IntakeServicesComponent }, { type: undefined, decorators: [{
2171
- type: Inject,
2172
- args: [SMART_WARRANT_URL]
2173
- }] }, { type: undefined, decorators: [{
2174
- type: Inject,
2175
- args: [DOCUMENT]
2176
- }] }], propDecorators: { offenderId: [{
2177
- type: Input
2178
- }], staffId: [{
2179
- type: Input
2180
- }], staffRole: [{
2181
- type: Input
2182
- }], showCaseNote: [{
2183
- type: Input
2184
- }], showSafetyPlan: [{
2185
- type: Input
2186
- }], showAdd: [{
2187
- type: Input
2188
- }], showEdit: [{
2189
- type: Input
2190
- }], showRelationshipColumn: [{
2191
- type: Input
2192
- }], showOffenderNameColumn: [{
2193
- type: Input
2194
- }], showOffenderPhoneColumn: [{
2195
- type: Input
2196
- }], showSearchForm: [{
2197
- type: Input
2198
- }], accessByModule: [{
2199
- type: Input
2200
- }], intakeFlag: [{
2201
- type: Input
2202
- }], appModuleId: [{
2203
- type: Input
2204
- }], activatedRoute: [{
2205
- type: Input
2206
- }], paginator: [{
2207
- type: ViewChild,
2208
- args: [MatPaginator]
2209
- }], sort: [{
2210
- type: ViewChild,
2211
- args: [MatSort]
2212
- }] } });
2213
-
2214
- class SmartVictimDeleteConfirmComponent {
2215
- dialogRef;
2216
- data;
2217
- constructor(dialogRef, data) {
2218
- this.dialogRef = dialogRef;
2219
- this.data = data;
2220
- }
2221
- onNoClick() {
2222
- this.dialogRef.close();
2223
- }
2224
- ngOnInit() {
2225
- }
2226
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2227
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SmartVictimDeleteConfirmComponent, selector: "csmart-victim-delete-confirm", ngImport: i0, template: `
2228
- <h1 mat-dialog-title>Delete Confirmation</h1>
2229
- <div mat-dialog-content>
2230
- <p>Are you sure you want to delete this item?</p>
2231
- </div>
2232
- <div mat-dialog-actions class="actions">
2233
- <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2234
- <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2235
- </div>
2236
- `, isInline: true, styles: [".actions{display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
2237
- }
2238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, decorators: [{
2239
- type: Component,
2240
- args: [{ selector: 'csmart-victim-delete-confirm', template: `
2241
- <h1 mat-dialog-title>Delete Confirmation</h1>
2242
- <div mat-dialog-content>
2243
- <p>Are you sure you want to delete this item?</p>
2244
- </div>
2245
- <div mat-dialog-actions class="actions">
2246
- <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2247
- <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2248
- </div>
2249
- `, styles: [".actions{display:flex;justify-content:space-between}\n"] }]
2250
- }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
2251
- type: Inject,
2252
- args: [MAT_DIALOG_DATA]
2253
- }] }] });
2254
-
2255
- class SharedModule {
2256
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2257
- /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2258
- MatCardModule,
2259
- MatCheckboxModule,
2260
- MatToolbarModule,
2261
- MatSelectModule,
2262
- MatDatepickerModule,
2263
- MatNativeDateModule,
2264
- MatDialogModule,
2265
- MatTabsModule,
2266
- MatListModule,
2267
- MatInputModule,
2268
- MatStepperModule,
2269
- BrowserAnimationsModule,
2270
- MatGridListModule,
2271
- MatProgressSpinnerModule,
2272
- MatTableModule,
2273
- MatSidenavModule,
2274
- MatRadioModule,
2275
- MatIconModule,
2276
- MatSliderModule,
2277
- MatChipsModule,
2278
- MatSnackBarModule,
2279
- CdkTableModule,
2280
- MatSortModule,
2281
- MatPaginatorModule,
2282
- MatExpansionModule,
2283
- MatRippleModule,
2284
- SmartUiModule], exports: [MatButtonModule,
2285
- MatCardModule,
2286
- MatCheckboxModule,
2287
- MatToolbarModule,
2288
- MatSelectModule,
2289
- MatDatepickerModule,
2290
- MatNativeDateModule,
2291
- MatDialogModule,
2292
- MatTabsModule,
2293
- MatListModule,
2294
- MatInputModule,
2295
- MatStepperModule,
2296
- BrowserAnimationsModule,
2297
- MatGridListModule,
2298
- MatProgressSpinnerModule,
2299
- MatTableModule,
2300
- MatSidenavModule,
2301
- MatRadioModule,
2302
- MatIconModule,
2303
- MatSliderModule,
2304
- MatChipsModule,
2305
- MatSnackBarModule,
2306
- CdkTableModule,
2307
- MatSortModule,
2308
- MatPaginatorModule,
2309
- MatExpansionModule,
2310
- MatRippleModule,
2311
- SmartUiModule] });
2312
- /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2313
- MatCardModule,
2314
- MatCheckboxModule,
2315
- MatToolbarModule,
2316
- MatSelectModule,
2317
- MatDatepickerModule,
2318
- MatNativeDateModule,
2319
- MatDialogModule,
2320
- MatTabsModule,
2321
- MatListModule,
2322
- MatInputModule,
2323
- MatStepperModule,
2324
- BrowserAnimationsModule,
2325
- MatGridListModule,
2326
- MatProgressSpinnerModule,
2327
- MatTableModule,
2328
- MatSidenavModule,
2329
- MatRadioModule,
2330
- MatIconModule,
2331
- MatSliderModule,
2332
- MatChipsModule,
2333
- MatSnackBarModule,
2334
- CdkTableModule,
2335
- MatSortModule,
2336
- MatPaginatorModule,
2337
- MatExpansionModule,
2338
- MatRippleModule,
2339
- SmartUiModule, MatButtonModule,
2340
- MatCardModule,
2341
- MatCheckboxModule,
2342
- MatToolbarModule,
2343
- MatSelectModule,
2344
- MatDatepickerModule,
2345
- MatNativeDateModule,
2346
- MatDialogModule,
2347
- MatTabsModule,
2348
- MatListModule,
2349
- MatInputModule,
2350
- MatStepperModule,
2351
- BrowserAnimationsModule,
2352
- MatGridListModule,
2353
- MatProgressSpinnerModule,
2354
- MatTableModule,
2355
- MatSidenavModule,
2356
- MatRadioModule,
2357
- MatIconModule,
2358
- MatSliderModule,
2359
- MatChipsModule,
2360
- MatSnackBarModule,
2361
- CdkTableModule,
2362
- MatSortModule,
2363
- MatPaginatorModule,
2364
- MatExpansionModule,
2365
- MatRippleModule,
2366
- SmartUiModule] });
2367
- }
2368
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, decorators: [{
2369
- type: NgModule,
2370
- args: [{
2371
- imports: [
2372
- MatButtonModule,
2373
- MatCardModule,
2374
- MatCheckboxModule,
2375
- MatToolbarModule,
2376
- MatSelectModule,
2377
- MatDatepickerModule,
2378
- MatNativeDateModule,
2379
- MatDialogModule,
2380
- MatTabsModule,
2381
- MatListModule,
2382
- MatInputModule,
2383
- MatStepperModule,
2384
- BrowserAnimationsModule,
2385
- MatGridListModule,
2386
- MatProgressSpinnerModule,
2387
- MatTableModule,
2388
- MatSidenavModule,
2389
- MatRadioModule,
2390
- MatIconModule,
2391
- MatSliderModule,
2392
- MatChipsModule,
2393
- MatSnackBarModule,
2394
- CdkTableModule,
2395
- MatSortModule,
2396
- MatPaginatorModule,
2397
- MatExpansionModule,
2398
- MatRippleModule,
2399
- SmartUiModule
2400
- ],
2401
- exports: [
2402
- MatButtonModule,
2403
- MatCardModule,
2404
- MatCheckboxModule,
2405
- MatToolbarModule,
2406
- MatSelectModule,
2407
- MatDatepickerModule,
2408
- MatNativeDateModule,
2409
- MatDialogModule,
2410
- MatTabsModule,
2411
- MatListModule,
2412
- MatInputModule,
2413
- MatStepperModule,
2414
- BrowserAnimationsModule,
2415
- MatGridListModule,
2416
- MatProgressSpinnerModule,
2417
- MatTableModule,
2418
- MatSidenavModule,
2419
- MatRadioModule,
2420
- MatIconModule,
2421
- MatSliderModule,
2422
- MatChipsModule,
2423
- MatSnackBarModule,
2424
- CdkTableModule,
2425
- MatSortModule,
2426
- MatPaginatorModule,
2427
- MatExpansionModule,
2428
- MatRippleModule,
2429
- SmartUiModule
2430
- ]
2431
- }]
2432
- }] });
2433
-
2434
- class CommonDialogModule {
2435
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2436
- /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, declarations: [CommonDialogComponent], imports: [
2437
- // MaterialModule.forRoot(),
2438
- SharedModule], exports: [CommonDialogComponent] });
2439
- /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, providers: [
2440
- CommonDialogComponent,
2441
- ], imports: [
2442
- // MaterialModule.forRoot(),
2443
- SharedModule] });
2444
- }
2445
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, decorators: [{
2446
- type: NgModule,
2447
- args: [{
2448
- imports: [
2449
- // MaterialModule.forRoot(),
2450
- SharedModule
2451
- ],
2452
- exports: [
2453
- CommonDialogComponent,
2454
- ],
2455
- declarations: [
2456
- CommonDialogComponent,
2457
- ],
2458
- providers: [
2459
- CommonDialogComponent,
2460
- ]
2461
- }]
2462
- }] });
2463
-
2464
- function dateValidator() {
2465
- return (control) => {
2466
- const dateStr = control.value;
2467
- const invalidObj = { 'date': 'future Date is Not Allowed' };
2468
- const date = new Date(dateStr);
2469
- if (date > new Date()) {
2470
- return invalidObj;
2471
- }
2472
- return null;
2473
- };
2474
- }
2475
- function passDateValidator() {
2476
- return (control) => {
2477
- const dateStr = control.value;
2478
- const invalidObj = { 'date': 'Pass Date is Not Allowed' };
2479
- const date = new Date(dateStr);
2480
- if (date < new Date()) {
2481
- return invalidObj;
2482
- }
2483
- return null;
2484
- };
2485
- }
2486
- function dateLessThan(dateField1, dateField2, validatorField) {
2487
- return (c) => {
2488
- const date1 = c.get(dateField1).value;
2489
- const date2 = c.get(dateField2).value;
2490
- console.log('date1');
2491
- console.log(date1);
2492
- console.log('date2');
2493
- console.log(date2);
2494
- //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2495
- if ((date1 !== null && date2 !== null) && date1 > date2) {
2496
- console.log(validatorField);
2497
- return validatorField;
2498
- //return invalidObj;
2499
- }
2500
- console.log('return null');
2501
- return null;
2502
- };
2503
- }
2504
- function greaterLessThan(dateField1, dateField2, validatorField) {
2505
- return (c) => {
2506
- const date1 = c.get(dateField1).value;
2507
- const date2 = c.get(dateField2).value;
2508
- console.log('end date');
2509
- console.log(date1);
2510
- console.log('ver date');
2511
- console.log(date2);
2512
- //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2513
- if ((date1 !== null && date2 !== null) && date1 < date2) {
2514
- console.log(validatorField);
2515
- return validatorField;
2516
- //return invalidObj;
2517
- }
2518
- console.log('return null');
2519
- return null;
2520
- };
2521
- }
2522
-
2523
- class EmailService {
2524
- apollo;
2525
- constructor(apollo) {
2526
- this.apollo = apollo;
2527
- }
2528
- createCaseNoteEmail(templateId, offenderId, modifiedBy) {
2529
- return this.createEmail(templateId, `{\\"offenderId\\": ${offenderId}}`, modifiedBy);
2530
- }
2531
- createEmail(emailTemplateId, parameters, modifiedBy) {
2532
- const mutation = `mutation {
2533
- createEmail(input: {
2534
- emailTemplateId: "${emailTemplateId}"
2535
- parameters: "${parameters}"
2536
- modifiedBy: ${modifiedBy}
2537
- }) {
2538
- message
2539
- data {
2540
- emailQueueId
2541
- }
2542
- }
2543
- }`;
2544
- console.log(mutation);
2545
- return this.apollo.mutate({
2546
- mutation: gql `
2547
- ${mutation}
2548
- `,
2549
- });
2550
- }
2551
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, deps: [{ token: i2.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
2552
- /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, providedIn: 'root' });
2553
- }
2554
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, decorators: [{
2555
- type: Injectable,
2556
- args: [{
2557
- providedIn: 'root',
2558
- }]
2559
- }], ctorParameters: () => [{ type: i2.Apollo }] });
2560
-
2561
- class CaseNoteComponent {
2562
- formBuilder;
2563
- _victimServicesComponent;
2564
- commonDialogService;
2565
- snackBar;
2566
- route;
2567
- router;
2568
- smartAuthService;
2569
- emailService;
2570
- // @Input() isIntake: boolean;
2571
- offenderId;
2572
- loginStaff;
2573
- hiddenDetailFlag;
2574
- caseNoteList;
2575
- caseNote;
2576
- editCaseNote = {};
2577
- errorMessage;
2578
- contactTypes;
2579
- contactPurposes;
2580
- result;
2581
- victimName;
2582
- staffId;
2583
- victimId;
2584
- sub;
2585
- caseNoteDataSource = new MatTableDataSource();
2586
- addDisableFlag;
2587
- hiddenAddNewFlag;
2588
- caseNoteForm;
2589
- constructor(formBuilder, _victimServicesComponent, commonDialogService, snackBar, route, router, smartAuthService, emailService) {
2590
- this.formBuilder = formBuilder;
2591
- this._victimServicesComponent = _victimServicesComponent;
2592
- this.commonDialogService = commonDialogService;
2593
- this.snackBar = snackBar;
2594
- this.route = route;
2595
- this.router = router;
2596
- this.smartAuthService = smartAuthService;
2597
- this.emailService = emailService;
2598
- this.initForm();
2599
- }
2600
- initForm() {
2601
- this.caseNoteForm = this.formBuilder.group({
2602
- caseNoteDate: new UntypedFormControl('', Validators.compose([
2603
- Validators.required, dateValidator()
2604
- ])),
2605
- contactType: new UntypedFormControl('', Validators.required),
2606
- contactPurpose: new UntypedFormControl('', Validators.required),
2607
- comment: new UntypedFormControl('', Validators.required)
2608
- });
2609
- this.caseNoteForm.markAsPristine();
2610
- this.caseNoteForm.markAsUntouched();
2611
- }
2612
- ngAfterViewInit() {
2613
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2614
- }
2615
- ngOnInit() {
2616
- var data = this.route.snapshot.data;
2617
- this.loginStaff = data.loginStaff;
2618
- this.staffId = this.loginStaff.staffId;
2619
- this.sub = this.route.params.subscribe(params => {
2620
- this.victimId = params['victimId'];
2621
- this.offenderId = params['offenderId'];
2622
- });
2623
- this.addDisableFlag = false;
2624
- this.hiddenDetailFlag = true;
2625
- this.hiddenAddNewFlag = false;
2626
- this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
2627
- this.victimName = items.firstName + ', ' + items.lastName;
2628
- });
2629
- this._victimServicesComponent.getContactTypes().subscribe((items) => {
2630
- this.contactTypes = items;
2631
- });
2632
- this._victimServicesComponent.getVictimContactPurposes().subscribe((items) => {
2633
- this.contactPurposes = items;
2634
- });
2635
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2636
- console.log('caseNoteList');
2637
- console.log(caseNoteList);
2638
- this.caseNoteList = caseNoteList;
2639
- this.caseNoteDataSource.data = this.caseNoteList;
2640
- });
2641
- // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2642
- // (itms: any) => {
2643
- // const ELEMENT_DATA: Element[] = itms;
2644
- // this.caseNoteDataSource.data = ELEMENT_DATA;
2645
- // })
2646
- }
2647
- onEditCaseNote(victimCaseNoteId) {
2648
- this.hiddenDetailFlag = false;
2649
- this.hiddenAddNewFlag = true;
2650
- this.addDisableFlag = true;
2651
- this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2652
- }
2653
- onDeleteCaseNote(victimCaseNoteId) {
2654
- this.commonDialogService
2655
- .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2656
- .subscribe(res => {
2657
- this.result = res;
2658
- if (this.result) {
2659
- this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2660
- .subscribe(result => {
2661
- this.snackBar.open('delete Successfully !', '', { duration: 3000, });
2662
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2663
- this.caseNoteList = caseNoteList;
2664
- this.caseNoteDataSource.data = this.caseNoteList;
2665
- });
2666
- });
2667
- }
2668
- });
2669
- }
2670
- onAddNew() {
2671
- this.hiddenDetailFlag = false;
2672
- this.editCaseNote.victimCaseNoteId = 0;
2673
- const caseNoteDateControl = this.caseNoteForm.get('caseNoteDate');
2674
- caseNoteDateControl.setValue(null);
2675
- caseNoteDateControl.setErrors(null);
2676
- caseNoteDateControl.markAsPristine();
2677
- caseNoteDateControl.markAsPristine();
2678
- const contactTypeControl = this.caseNoteForm.get('contactType');
2679
- contactTypeControl.setValue(null);
2680
- contactTypeControl.setErrors(null);
2681
- contactTypeControl.markAsPristine();
2682
- contactTypeControl.markAsUntouched();
2683
- const contactPurposeControl = this.caseNoteForm.get('contactPurpose');
2684
- contactPurposeControl.setValue(null);
2685
- contactPurposeControl.setErrors(null);
2686
- contactPurposeControl.markAsPristine();
2687
- contactPurposeControl.markAsUntouched();
2688
- const commentControl = this.caseNoteForm.get('comment');
2689
- commentControl.setValue(null);
2690
- commentControl.setErrors(null);
2691
- commentControl.markAsPristine();
2692
- commentControl.markAsUntouched();
2693
- }
2694
- back() {
2695
- this.router.navigate(['victimHome']);
2696
- }
2697
- saveCaseNote() {
2698
- this.emailService
2699
- .createCaseNoteEmail("VictimCaseNoteReminders", this.offenderId, this.staffId)
2700
- .subscribe();
2701
- if (this.editCaseNote.victimCaseNoteId === undefined || this.editCaseNote.victimCaseNoteId === 0) {
2702
- const castNote = {
2703
- victimId: this.victimId,
2704
- victimCaseNoteId: 0,
2705
- caseNoteDate: this.editCaseNote.caseNoteDate,
2706
- contactTypeId: this.editCaseNote.contactTypeId,
2707
- contactType: null,
2708
- victimContactPurposeId: this.editCaseNote.victimContactPurposeId,
2709
- victimContactPurpose: null,
2710
- comment: this.editCaseNote.comment,
2711
- modifiedBy: this.staffId,
2712
- victimFirstName: null,
2713
- victimLastName: null
2714
- };
2715
- this._victimServicesComponent.addCaseNote(castNote).subscribe(result => {
2716
- this.snackBar.open('Saved Successfully !', '', {
2717
- duration: 3000,
2718
- });
2719
- // this._victimServicesComponent.sendEmail('', {referralId: 0, offenderId: this.offenderId }, this.loginStaff.staffId);
2720
- this.hiddenDetailFlag = true;
2721
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2722
- this.caseNoteList = caseNoteList;
2723
- this.caseNoteDataSource.data = this.caseNoteList;
2724
- });
2725
- });
2726
- }
2727
- else {
2728
- this._victimServicesComponent.updateCaseNote(this.editCaseNote).subscribe(result => {
2729
- this.snackBar.open('Update Successfully !', '', {
2730
- duration: 3000,
2731
- });
2732
- this.hiddenDetailFlag = true;
2733
- this.hiddenAddNewFlag = false;
2734
- this.addDisableFlag = false;
2735
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2736
- this.caseNoteList = caseNoteList;
2737
- this.caseNoteDataSource.data = this.caseNoteList;
2738
- });
2739
- });
2740
- }
2741
- //email
2742
- }
2743
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CaseNoteComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: NgcSmartVictimService }, { token: CommonDialogService }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i6.SmartAuthService }, { token: EmailService }], target: i0.ɵɵFactoryTarget.Component });
2744
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: CaseNoteComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class=\"row\" >\r\n <div [hidden]=\"hiddenAddNewFlag\">\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]=\"hiddenDetailFlag\" >\r\n <mat-card >\r\n <div class='container'> \r\n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\r\n \r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}} \r\n </div>\r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName=\"caseNoteDate\" \r\n (click)=\"caseNoteDate.open()\" \r\n [matDatepicker]=\"caseNoteDate\" \r\n placeholder=\"Choose a start date\" \r\n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors \r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class=\"help-block\" \r\n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date') \r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\r\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors \r\n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors \r\n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class=\"textarea-content\"\r\n matInput \r\n placeholder=\"\" \r\n required formControlName=\"comment\" \r\n [(ngModel)]=\"editCaseNote.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea> \r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors \r\n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"caseNoteDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactType\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef=\"contactPurpose\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimCaseNoteId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n \r\n <button \r\n class=\"sac-cso-read sac-vsp-read\" \r\n mat-icon-button \r\n color=\"primary\" \r\n matTooltip=\"Edit Case Note\" \r\n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n \r\n\r\n <button\r\n class=\"sac-vsp-read\"\r\n matTooltip=\"Delete Case Note\" \r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>", styles: [".container{width:800px;margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] });
2745
- }
2746
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CaseNoteComponent, decorators: [{
2747
- type: Component,
2748
- args: [{ providers: [CommonDialogService], template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class=\"row\" >\r\n <div [hidden]=\"hiddenAddNewFlag\">\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]=\"hiddenDetailFlag\" >\r\n <mat-card >\r\n <div class='container'> \r\n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\r\n \r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}} \r\n </div>\r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName=\"caseNoteDate\" \r\n (click)=\"caseNoteDate.open()\" \r\n [matDatepicker]=\"caseNoteDate\" \r\n placeholder=\"Choose a start date\" \r\n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors \r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class=\"help-block\" \r\n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date') \r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\r\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors \r\n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors \r\n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class=\"textarea-content\"\r\n matInput \r\n placeholder=\"\" \r\n required formControlName=\"comment\" \r\n [(ngModel)]=\"editCaseNote.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea> \r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors \r\n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"caseNoteDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactType\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef=\"contactPurpose\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimCaseNoteId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n \r\n <button \r\n class=\"sac-cso-read sac-vsp-read\" \r\n mat-icon-button \r\n color=\"primary\" \r\n matTooltip=\"Edit Case Note\" \r\n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n \r\n\r\n <button\r\n class=\"sac-vsp-read\"\r\n matTooltip=\"Delete Case Note\" \r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>", styles: [".container{width:800px;margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}\n"] }]
2749
- }], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }, { type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }, { type: EmailService }] });
2750
-
2751
- class ContactComponent {
2752
- _victimServicesComponent;
2753
- snackBar;
2754
- route;
2755
- router;
2756
- smartAuthService;
2757
- offenderId;
2758
- loginStaff;
2759
- contact;
2760
- editContact = {};
2761
- errorMessage;
2762
- contactMethods;
2763
- contactBy;
2764
- result;
2765
- victimName;
2766
- staffId;
2767
- victimId;
2768
- hiddenAddNewFlag;
2769
- contactForm;
2770
- sub;
2771
- staff = {};
2772
- constructor(_victimServicesComponent,
2773
- //private commonDialogService: CommonDialogService,
2774
- snackBar, route, router, smartAuthService) {
2775
- this._victimServicesComponent = _victimServicesComponent;
2776
- this.snackBar = snackBar;
2777
- this.route = route;
2778
- this.router = router;
2779
- this.smartAuthService = smartAuthService;
2780
- this.contactForm = new UntypedFormGroup({
2781
- //contactDate: new FormControl(),
2782
- contactDate: new UntypedFormControl('', Validators.compose([
2783
- dateValidator()
2784
- ])),
2785
- contactMethod: new UntypedFormControl(),
2786
- contactBy: new UntypedFormControl(),
2787
- comment: new UntypedFormControl(),
2788
- nextContactDate: new UntypedFormControl()
2789
- });
2790
- }
2791
- ngAfterViewInit() {
2792
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2793
- }
2794
- ngOnInit() {
2795
- var data = this.route.snapshot.data;
2796
- this.loginStaff = data.loginStaff;
2797
- this.staffId = this.loginStaff.staffId;
2798
- this.staff = [
2799
- {
2800
- staffId: this.loginStaff.staffId,
2801
- fullName: this.loginStaff.firstName + ' ' + this.loginStaff.lastName,
2802
- },
2803
- ];
2804
- this.sub = this.route.params.subscribe(params => {
2805
- this.victimId = params['victimId'];
2806
- console.log('my this.victimId');
2807
- console.log(this.victimId);
2808
- });
2809
- this._victimServicesComponent.getContactMethods().subscribe((items) => {
2810
- this.contactMethods = items;
2811
- console.log('this.contactMethods');
2812
- console.log(this.contactMethods);
2813
- });
2814
- // this._victimServicesComponent.getContactBys().subscribe(
2815
- // (items: any) => {
2816
- // this.contactBy= items;
2817
- // }
2818
- // );
2819
- // this._victimServicesComponent.getContacts(this.victimId).subscribe(
2820
- // caseNoteList => {
2821
- // this.caseNoteList = caseNoteList;
2822
- // }
2823
- // );
2824
- }
2825
- onEditContact(victimContactId) {
2826
- // this.hiddenDetailFlag =false;
2827
- // this.hiddenAddNewFlag = true;
2828
- // this.addDisableFlag = true;
2829
- // this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2830
- }
2831
- // onDeleteCaseNote(victimCaseNoteId: number){
2832
- // this.commonDialogService
2833
- // .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2834
- // .subscribe(res => {this.result = res;
2835
- // if (this.result) {
2836
- // this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2837
- // .subscribe(result => {
2838
- // this.snackBar.open('delete Successfully !', '', { duration: 3000,});
2839
- // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2840
- // caseNoteList => {
2841
- // this.caseNoteList = caseNoteList;
2842
- // }
2843
- // );
2844
- // }
2845
- // );
2846
- // }
2847
- // });
2848
- // }
2849
- onAddNew() {
2850
- // this.editCas.caseNoteDate = null;
2851
- // this.editCaseNote.contactTypeId = null;
2852
- // this.editCaseNote.victimContactPurposeId = null;
2853
- // this.editCaseNote.comment = null;
2854
- }
2855
- back() {
2856
- this.router.navigate(['victimDetail', this.victimId]);
2857
- }
2858
- saveContact() {
2859
- const contact = {
2860
- victimId: this.victimId,
2861
- victimContactId: 0,
2862
- contactDate: this.editContact.contactDate,
2863
- victimContactMethodId: this.editContact.victimContactMethodId,
2864
- contactMethod: null,
2865
- contactedByName: null,
2866
- contactedBy: this.editContact.contactedBy,
2867
- comment: this.editContact.comment,
2868
- nextContactDate: this.editContact.nextContactDate,
2869
- modifiedBy: this.staffId,
2870
- };
2871
- this._victimServicesComponent.addContact(contact).subscribe(result => {
2872
- this.snackBar.open('Saved Successfully !', '', {
2873
- duration: 3000,
2874
- });
2875
- this.router.navigate(['victimDetail', this.victimId]);
2876
- });
2877
- }
2878
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ContactComponent, deps: [{ token: NgcSmartVictimService }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i6.SmartAuthService }], target: i0.ɵɵFactoryTarget.Component });
2879
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: ContactComponent, selector: "ng-component", ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n \r\n\r\n \r\n <mat-card >\r\n <div class='container'> \r\n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\r\n \r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName=\"contactDate\" \r\n (click)=\"contactDate.open()\" \r\n [matDatepicker]=\"contactDate\" \r\n placeholder=\"Choose a contact date\" \r\n [(ngModel)]=\"editContact.contactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div class=\"validation-errors\">\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm\r\n .get('contactDate')\r\n .hasError('required') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error>Contact date is\r\n <strong>required</strong></mat-error>\r\n </div>\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm.get('contactDate').hasError('date') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\r\n </div>\r\n </div>\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\r\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea \r\n matInput \r\n placeholder=\"\" \r\n required formControlName=\"comment\" \r\n [(ngModel)]=\"editContact.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n cdkAutosizeMaxRows=\"5\">\r\n </textarea> \r\n </mat-form-field>\r\n </div>\r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName=\"nextContactDate\" \r\n (click)=\"nextContactDate.open()\" \r\n [matDatepicker]=\"nextContactDate\" \r\n placeholder=\"Choose a next contact date\" \r\n [(ngModel)]=\"editContact.nextContactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n <!-- <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n \r\n <br>\r\n \r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>", styles: ["mat-form-field{width:50%}.container{margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
2880
- }
2881
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ContactComponent, decorators: [{
2882
- type: Component,
2883
- args: [{ template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n \r\n\r\n \r\n <mat-card >\r\n <div class='container'> \r\n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\r\n \r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName=\"contactDate\" \r\n (click)=\"contactDate.open()\" \r\n [matDatepicker]=\"contactDate\" \r\n placeholder=\"Choose a contact date\" \r\n [(ngModel)]=\"editContact.contactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div class=\"validation-errors\">\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm\r\n .get('contactDate')\r\n .hasError('required') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error>Contact date is\r\n <strong>required</strong></mat-error>\r\n </div>\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm.get('contactDate').hasError('date') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\r\n </div>\r\n </div>\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\r\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea \r\n matInput \r\n placeholder=\"\" \r\n required formControlName=\"comment\" \r\n [(ngModel)]=\"editContact.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n cdkAutosizeMaxRows=\"5\">\r\n </textarea> \r\n </mat-form-field>\r\n </div>\r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName=\"nextContactDate\" \r\n (click)=\"nextContactDate.open()\" \r\n [matDatepicker]=\"nextContactDate\" \r\n placeholder=\"Choose a next contact date\" \r\n [(ngModel)]=\"editContact.nextContactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n <!-- <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n \r\n <br>\r\n \r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>", styles: ["mat-form-field{width:50%}.container{margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}\n"] }]
2884
- }], ctorParameters: () => [{ type: NgcSmartVictimService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }] });
2885
-
2886
- class VictimSafetyPlanComponent {
2887
- _victimServicesComponent;
2888
- commonDialogService;
2889
- http;
2890
- dialog;
2891
- route;
2892
- router;
2893
- snackBar;
2894
- smartAuthService;
2895
- //selectedOffender: SelectedOffender;
2896
- loginStaff;
2897
- offenderId;
2898
- hiddenDetailFlag;
2899
- hiddenAddNewFlag;
2900
- safetyPlans;
2901
- safetyPlan;
2902
- editSafetyPlan = {};
2903
- errorMessage;
2904
- contactTypes;
2905
- contactPurposes;
2906
- victimServiceTypes;
2907
- victimSafetyPlans;
2908
- victimServiceStatus;
2909
- victimServiceStatusHistories;
2910
- queryString;
2911
- victimServiceDetail;
2912
- myVictimServiceId;
2913
- result;
2914
- victimName;
2915
- staffId;
2916
- victimId;
2917
- sub;
2918
- safetyPlanDataSource = new MatTableDataSource();
2919
- constructor(_victimServicesComponent, commonDialogService, http, dialog, route, router, snackBar, smartAuthService) {
2920
- this._victimServicesComponent = _victimServicesComponent;
2921
- this.commonDialogService = commonDialogService;
2922
- this.http = http;
2923
- this.dialog = dialog;
2924
- this.route = route;
2925
- this.router = router;
2926
- this.snackBar = snackBar;
2927
- this.smartAuthService = smartAuthService;
2928
- }
2929
- ngAfterViewInit() {
2930
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2931
- }
2932
- ngOnInit() {
2933
- var data = this.route.snapshot.data;
2934
- this.loginStaff = data.loginStaff;
2935
- this.staffId = this.loginStaff.staffId;
2936
- this.sub = this.route.params.subscribe(params => {
2937
- this.victimId = params['victimId'];
2938
- });
2939
- this.hiddenAddNewFlag = false;
2940
- this.victimName = this.victimName;
2941
- this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2942
- this.victimSafetyPlans = victimSafetyPlans;
2943
- this.safetyPlanDataSource.data = this.victimSafetyPlans;
2944
- console.log('this.victimSafetyPlans');
2945
- console.log(this.victimSafetyPlans);
2946
- });
2947
- // this.myVictimServiceId =1;
2948
- // this._victimServicesComponent.getVictimServiceDetail(this.myVictimServiceId).subscribe(
2949
- // victimServiceDetail => {
2950
- // this.victimServiceDetail = victimServiceDetail;
2951
- // console.log('service detail');
2952
- // console.log(this.victimServiceDetail);
2953
- // }
2954
- // );
2955
- this._victimServicesComponent.getServiceStatusHistories(1).subscribe(victimServiceStatusHistories => {
2956
- // this.victimServiceStatusHistories = victimServiceStatusHistories;
2957
- });
2958
- }
2959
- //---------------graphQL--------------------------------------
2960
- // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
2961
- // const queryString = `
2962
- // {
2963
- // findVictimServiceTypeProgramProviders {
2964
- // data {
2965
- // victimServiceTypeProgramProviderId
2966
- // victimServiceType
2967
- // victimProgramProvider
2968
- // }
2969
- // }
2970
- // }`;
2971
- // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
2972
- // .map(result => {
2973
- // return result.data.findVictimServiceTypeProgramProviders.data;
2974
- // });
2975
- // }
2976
- goToSafetyPlanDetail(victimServiceId) {
2977
- this.router.navigate(['saftyPlanDetail', victimServiceId, this.victimId]);
2978
- }
2979
- onAddNew() {
2980
- this.hiddenDetailFlag = false;
2981
- }
2982
- onDeleteSafetyPlan(victimServiceId) {
2983
- this.commonDialogService
2984
- .confirm('', 'Do you want to delete this safety plan?', 'Yes', 'No')
2985
- .subscribe(res => {
2986
- this.result = res;
2987
- if (this.result) {
2988
- this._victimServicesComponent.deleteSafetyPlan(victimServiceId, this.staffId)
2989
- .subscribe(result => {
2990
- this.snackBar.open('delete safety plan Successfully !', '', { duration: 3000, });
2991
- this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2992
- this.victimSafetyPlans = victimSafetyPlans;
2993
- this.safetyPlanDataSource.data = this.victimSafetyPlans;
2994
- });
2995
- });
2996
- }
2997
- });
2998
- }
2999
- back() {
3000
- this.router.navigate(['victimHome']);
3001
- }
3002
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanComponent, deps: [{ token: NgcSmartVictimService }, { token: CommonDialogService }, { token: i1.HttpClient }, { token: i1$1.MatDialog }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i4.MatSnackBar }, { token: i6.SmartAuthService }], target: i0.ɵɵFactoryTarget.Component });
3003
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSafetyPlanComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"goal\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"victimServiceStatus\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimServiceId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon> \r\n </button> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\"> \r\n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\r\n </button> \r\n </mat-cell> -->\r\n\r\n <mat-cell *matCellDef=\"let element\">\r\n \r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n <button\r\n class=\"delete-btn\"\r\n matTooltip=\"Delete Safety Plan\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n \r\n </mat-cell>\r\n\r\n \r\n \r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n \r\n \r\n</mat-card-content>\r\n</mat-card>", dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] });
3004
- }
3005
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanComponent, decorators: [{
3006
- type: Component,
3007
- args: [{ providers: [CommonDialogService], template: "\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"goal\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"victimServiceStatus\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimServiceId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\"> \r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon> \r\n </button> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\"> \r\n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\r\n </button> \r\n </mat-cell> -->\r\n\r\n <mat-cell *matCellDef=\"let element\">\r\n \r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n <button\r\n class=\"delete-btn\"\r\n matTooltip=\"Delete Safety Plan\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n \r\n </mat-cell>\r\n\r\n \r\n \r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n \r\n \r\n</mat-card-content>\r\n</mat-card>" }]
3008
- }], ctorParameters: () => [{ type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i1.HttpClient }, { type: i1$1.MatDialog }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.MatSnackBar }, { type: i6.SmartAuthService }] });
3009
-
3010
- class SeriveProviderComponent {
3011
- formBuilder;
3012
- dialogRef;
3013
- _victimServicesComponent;
3014
- data;
3015
- spForm;
3016
- programProviders;
3017
- constructor(formBuilder, dialogRef, _victimServicesComponent, data) {
3018
- this.formBuilder = formBuilder;
3019
- this.dialogRef = dialogRef;
3020
- this._victimServicesComponent = _victimServicesComponent;
3021
- this.data = data;
3022
- this.spForm = this.formBuilder.group({
3023
- voteeProviderId: [''],
3024
- });
3025
- }
3026
- cancel() {
3027
- this.dialogRef.close();
3028
- }
3029
- ngOnInit() {
3030
- console.log('data.providerCollections');
3031
- console.log(this.data);
3032
- console.log(this.data.serviceTypeId);
3033
- this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((items) => {
3034
- this.programProviders = items.filter((y) => (y.victimServiceTypeId === this.data.serviceTypeId));
3035
- console.log('this.programProviders');
3036
- console.log(this.programProviders);
3037
- });
3038
- this.spForm.get('voteeProviderId').valueChanges.subscribe(voteeProviderId => {
3039
- console.log('voteeProviderId in service provider component.');
3040
- console.log(voteeProviderId);
3041
- });
3042
- }
3043
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SeriveProviderComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: i1$1.MatDialogRef }, { token: NgcSmartVictimService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3044
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SeriveProviderComponent, selector: "app-service-provider", ngImport: i0, template: `
3045
- <h1 mat-dialog-title> {{data.serviceType}}</h1>
3046
- <div mat-dialog-content class="main" [formGroup]="spForm">
3047
- <mat-form-field>
3048
- <mat-label>service provider</mat-label>
3049
-
3050
- <mat-select formControlName="voteeProviderId">
3051
- <mat-option
3052
- *ngFor="let providerOption of programProviders"
3053
- [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
3054
- </mat-option>
3055
- </mat-select>
3056
-
3057
- </mat-form-field>
3058
-
3059
- </div>
3060
- <div mat-dialog-actions class="actions">
3061
- <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>
3062
- Cancel Change
3063
- </button>
3064
- <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >
3065
- Save Change
3066
- </button>
3067
- </div>
3068
- `, isInline: true, styles: [".main{width:100%;display:flex;flex-direction:column}.actions{display:flex}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
3069
- }
3070
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SeriveProviderComponent, decorators: [{
3071
- type: Component,
3072
- args: [{ selector: 'app-service-provider', template: `
3073
- <h1 mat-dialog-title> {{data.serviceType}}</h1>
3074
- <div mat-dialog-content class="main" [formGroup]="spForm">
3075
- <mat-form-field>
3076
- <mat-label>service provider</mat-label>
3077
-
3078
- <mat-select formControlName="voteeProviderId">
3079
- <mat-option
3080
- *ngFor="let providerOption of programProviders"
3081
- [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
3082
- </mat-option>
3083
- </mat-select>
3084
-
3085
- </mat-form-field>
3086
-
3087
- </div>
3088
- <div mat-dialog-actions class="actions">
3089
- <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>
3090
- Cancel Change
3091
- </button>
3092
- <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >
3093
- Save Change
3094
- </button>
3095
- </div>
3096
- `, styles: [".main{width:100%;display:flex;flex-direction:column}.actions{display:flex}\n"] }]
3097
- }], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }, { type: i1$1.MatDialogRef }, { type: NgcSmartVictimService }, { type: undefined, decorators: [{
3098
- type: Inject,
3099
- args: [MAT_DIALOG_DATA]
3100
- }] }] });
3101
-
3102
- class VictimSafetyPlanDetailComponent {
3103
- dialog;
3104
- _victimServicesComponent;
3105
- http;
3106
- snackBar;
3107
- route;
3108
- router;
3109
- commonDialogService;
3110
- formBuilder;
3111
- hiddenAddNewFlag;
3112
- safetyPlans;
3113
- safetyPlan;
3114
- editSafetyPlan = {};
3115
- errorMessage;
3116
- contactTypes;
3117
- contactPurposes;
3118
- victimServiceTypes;
3119
- victimSafetyPlans;
3120
- victimServiceStatus;
3121
- providerList;
3122
- providerListCollection = [];
3123
- victimServiceDetail;
3124
- indx;
3125
- serviceCheck = [];
3126
- victimName;
3127
- isDisplay;
3128
- staffId;
3129
- victimId;
3130
- victimServiceId;
3131
- offenderId;
3132
- loginStaff;
3133
- sub;
3134
- result;
3135
- victimServiceStatusHistoriesDataSource = new MatTableDataSource();
3136
- providerId;
3137
- selected;
3138
- spForm;
3139
- constructor(dialog, _victimServicesComponent, http, snackBar, route, router, commonDialogService, formBuilder) {
3140
- this.dialog = dialog;
3141
- this._victimServicesComponent = _victimServicesComponent;
3142
- this.http = http;
3143
- this.snackBar = snackBar;
3144
- this.route = route;
3145
- this.router = router;
3146
- this.commonDialogService = commonDialogService;
3147
- this.formBuilder = formBuilder;
3148
- this.initForm();
3149
- }
3150
- initForm() {
3151
- this.spForm = this.formBuilder.group({
3152
- serviceGoal: new UntypedFormControl('', Validators.compose([
3153
- Validators.required
3154
- ])),
3155
- goalStatus: new UntypedFormControl('', Validators.compose([
3156
- Validators.required
3157
- ])),
3158
- goalStatusDate: new UntypedFormControl('', Validators.compose([
3159
- Validators.required, dateValidator()
3160
- ])),
3161
- comment: new UntypedFormControl('', Validators.required)
3162
- });
3163
- this.spForm.markAsPristine();
3164
- this.spForm.markAsUntouched();
3165
- }
3166
- ngOnInit() {
3167
- var data = this.route.snapshot.data;
3168
- this.loginStaff = data.loginStaff;
3169
- this.staffId = this.loginStaff.staffId;
3170
- this.sub = this.route.params.subscribe(params => {
3171
- this.victimServiceId = params['victimServiceId'];
3172
- this.victimId = params['victimId'];
3173
- });
3174
- this.hiddenAddNewFlag = false;
3175
- this.isDisplay = false;
3176
- this._victimServicesComponent.getVictimServiceTypes().subscribe((items) => {
3177
- this.victimServiceTypes = items;
3178
- });
3179
- this._victimServicesComponent.getVictimServiceStatus().subscribe((items) => {
3180
- this.victimServiceStatus = items;
3181
- });
3182
- this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
3183
- this.victimName = items.firstName + ', ' + items.lastName;
3184
- });
3185
- //---------------graphQL--------------------------------------
3186
- // this.getVictimServiceTypeProgramProviders().subscribe(result => {
3187
- // this.providerList = result;
3188
- // });
3189
- // console.log('this.victimServiceId');
3190
- // console.log(this.victimServiceId);
3191
- if (this.victimServiceId != 0) {
3192
- this._victimServicesComponent.getVictimServices(this.victimServiceId).subscribe(victimSafetyPlans => {
3193
- console.log('victimSafetyPlans');
3194
- console.log(victimSafetyPlans);
3195
- this.editSafetyPlan = victimSafetyPlans[0];
3196
- this.victimId = victimSafetyPlans[0].victimId;
3197
- console.log('this.editSafetyPlan');
3198
- console.log(this.editSafetyPlan);
3199
- // console.log('this.editSafetyPlan.goal');
3200
- // console.log(this.editSafetyPlan.goal);
3201
- // console.log('this.editSafetyPlan[0].goal');
3202
- // console.log(this.editSafetyPlan[0].goal);
3203
- });
3204
- this._victimServicesComponent.getServiceStatusHistories(this.victimServiceId).subscribe(victimServiceStatusHistories => {
3205
- // this.victimServiceStatusHistories = victimServiceStatusHistories;
3206
- this.victimServiceStatusHistoriesDataSource.data = victimServiceStatusHistories;
3207
- });
3208
- }
3209
- this.loadProvider();
3210
- }
3211
- //pass in id
3212
- isInArray(providerListCollectionKey, serviceTypeName, event) {
3213
- console.log('providerListCollectionKey');
3214
- console.log(providerListCollectionKey);
3215
- console.log('serviceTypeName');
3216
- console.log(serviceTypeName);
3217
- console.log('event.source.value');
3218
- console.log(event.checked);
3219
- if (event.checked == true) {
3220
- for (let j = 0; j < this.providerListCollection.length; j++) {
3221
- if (providerListCollectionKey == this.providerListCollection[j].groupId) {
3222
- this.providerListCollection[j].isDisplay = !this.providerListCollection[j].isDisplay;
3223
- const dialogRef = this.dialog.open(SeriveProviderComponent, {
3224
- width: '500px',
3225
- data: {
3226
- serviceType: serviceTypeName,
3227
- serviceTypeId: providerListCollectionKey,
3228
- providerCollections: [...this.providerListCollection],
3229
- },
3230
- panelClass: 'formFieldWidth480',
3231
- });
3232
- dialogRef.afterClosed().subscribe((result) => {
3233
- console.log('The dialog was closed');
3234
- console.log(result);
3235
- if (result) {
3236
- console.log('The dialog was closed, inside result');
3237
- this.savePlanProvider(providerListCollectionKey, result.voteeProviderId);
3238
- }
3239
- });
3240
- // return;
3241
- }
3242
- }
3243
- } //if event.checked == true
3244
- //this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId ]);
3245
- }
3246
- loadProvider() {
3247
- this.providerListCollection = [];
3248
- this._victimServicesComponent.getvVictimServiceTypeProgramProviders()
3249
- .subscribe((providerList) => {
3250
- if (providerList) {
3251
- let providers = Object.create(null);
3252
- for (let i = 0; i < providerList.length; i++) {
3253
- if (!providers[providerList[i].victimServiceTypeId]) {
3254
- providers[providerList[i].victimServiceTypeId] = [];
3255
- if (this.editSafetyPlan.vVictimServiceDetails != null) {
3256
- for (let j = 0; j < this.editSafetyPlan.vVictimServiceDetails.length; j++) {
3257
- if (providerList[i].victimServiceTypeId == this.editSafetyPlan.vVictimServiceDetails[j].victimServiceId.toString()) {
3258
- this.isDisplay = true;
3259
- }
3260
- }
3261
- }
3262
- this.providerListCollection.push({ groupId: providerList[i].victimServiceTypeId, isDisplay: this.isDisplay, collection: providers[providerList[i].victimServiceTypeId] });
3263
- }
3264
- providers[providerList[i].victimServiceTypeId].push(providerList[i]);
3265
- }
3266
- }
3267
- });
3268
- }
3269
- //---------------graphQL--------------------------------------
3270
- // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
3271
- // const queryString = `
3272
- // {
3273
- // findVictimServiceTypeProgramProviders {
3274
- // data {
3275
- // victimServiceTypeProgramProviderId
3276
- // victimServiceType
3277
- // victimProgramProvider
3278
- // }
3279
- // }
3280
- // }`;
3281
- // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
3282
- // .map(result => {
3283
- // return result.data.findVictimServiceTypeProgramProviders.data;
3284
- // });
3285
- // }
3286
- evaluateSelection(victimServiceTypeId) {
3287
- if (this.editSafetyPlan.vVictimServiceDetails) {
3288
- return this.editSafetyPlan.vVictimServiceDetails.findIndex(r => r.victimServiceTypeId === victimServiceTypeId) >= 0;
3289
- }
3290
- }
3291
- savePlanProvider(victimServiceTypeId, victimProgramProviderId) {
3292
- console.log('savePlanProvider');
3293
- console.log(victimServiceTypeId);
3294
- console.log(victimProgramProviderId);
3295
- if (victimProgramProviderId === "" || victimProgramProviderId === null || victimProgramProviderId === undefined) {
3296
- this.snackBar.open('Please pick a program on the drop down list !', '', { duration: 120, });
3297
- // alert('Please pick a program on the drop down list !');
3298
- }
3299
- else {
3300
- if (this.victimServiceId == 0) {
3301
- //insert
3302
- console.log('insert new plan');
3303
- const safetyPlan = {
3304
- victimId: this.victimId,
3305
- fullName: null,
3306
- victimServiceId: 0,
3307
- goal: this.editSafetyPlan.goal,
3308
- comment: this.editSafetyPlan.comment,
3309
- modifiedBy: this.staffId,
3310
- victimServiceStatusId: null,
3311
- status: null,
3312
- startDate: null,
3313
- vVictimServiceDetails: null,
3314
- victimName: null
3315
- };
3316
- this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3317
- const victimServiceStatus = {
3318
- victimServiceStatusHistoryId: 0,
3319
- victimServiceId: itms.victimServiceId,
3320
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3321
- startDate: this.editSafetyPlan.startDate,
3322
- modifiedBy: this.staffId,
3323
- comment: 'test add safety plan'
3324
- };
3325
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(() => {
3326
- console.log('check itms.victimServiceId iniside add victim serive status');
3327
- console.log(itms.victimServiceId);
3328
- const victimServiceDetail = {
3329
- victimServiceId: itms.victimServiceId,
3330
- victimServiceDetailId: 0,
3331
- victimServiceTypeId: victimServiceTypeId,
3332
- victimProgramProviderId: victimProgramProviderId,
3333
- modifiedBy: this.staffId,
3334
- victimProgramProvider: null
3335
- };
3336
- console.log('add plan provider here at insert');
3337
- this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3338
- this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3339
- });
3340
- });
3341
- });
3342
- }
3343
- else //update
3344
- {
3345
- const victimServiceDetail = {
3346
- victimServiceId: this.victimServiceId,
3347
- victimServiceDetailId: 0,
3348
- victimServiceTypeId: victimServiceTypeId,
3349
- victimProgramProviderId: victimProgramProviderId,
3350
- modifiedBy: this.staffId,
3351
- victimProgramProvider: null
3352
- };
3353
- console.log('add plan provider here at update');
3354
- this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3355
- this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId]);
3356
- });
3357
- }
3358
- }
3359
- }
3360
- deleteProvider(victimProgramProviderId) {
3361
- this.commonDialogService
3362
- .confirm('', 'Do you want to delete this provider?', 'Yes', 'No')
3363
- .subscribe(res => {
3364
- this.result = res;
3365
- if (this.result) {
3366
- this._victimServicesComponent.deleteProvider(victimProgramProviderId, this.staffId)
3367
- .subscribe(result => {
3368
- this.snackBar.open('delete provider Successfully !', '', {
3369
- duration: 3000,
3370
- });
3371
- location.reload();
3372
- });
3373
- }
3374
- });
3375
- // location.reload();
3376
- }
3377
- saveSafetyPlan() {
3378
- if (this.editSafetyPlan.victimServiceId === undefined) {
3379
- const safetyPlan = {
3380
- victimId: this.victimId,
3381
- fullName: null,
3382
- victimServiceId: 0,
3383
- goal: this.editSafetyPlan.goal,
3384
- comment: this.editSafetyPlan.comment,
3385
- modifiedBy: this.staffId,
3386
- victimServiceStatusId: null,
3387
- status: null,
3388
- startDate: null,
3389
- vVictimServiceDetails: null,
3390
- victimName: null
3391
- };
3392
- this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3393
- const victimServiceStatus = {
3394
- victimServiceStatusHistoryId: 0,
3395
- victimServiceId: itms.victimServiceId,
3396
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3397
- startDate: this.editSafetyPlan.startDate,
3398
- modifiedBy: this.staffId,
3399
- comment: 'test add safety Plan'
3400
- };
3401
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(resp => {
3402
- this.snackBar.open('Insert status successfully!', '', {
3403
- duration: 3000,
3404
- });
3405
- });
3406
- this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3407
- });
3408
- }
3409
- else {
3410
- // this.editSafetyPlan.modifiedBy=this.loginStaff.staffId;
3411
- this.editSafetyPlan.modifiedBy = this.staffId;
3412
- this._victimServicesComponent.updateSafetyPlan(this.editSafetyPlan).subscribe(resp => {
3413
- // this.snackBar.open('update Successfully!', '', {
3414
- // duration: 3000,
3415
- // });
3416
- const victimServiceStatus = {
3417
- victimServiceStatusHistoryId: 0,
3418
- victimServiceId: this.editSafetyPlan.victimServiceId.toString(),
3419
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3420
- startDate: this.editSafetyPlan.startDate,
3421
- modifiedBy: this.staffId,
3422
- comment: 'test update safety Plan'
3423
- };
3424
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe();
3425
- this.router.navigate(['saftyPlanDetail', this.editSafetyPlan.victimServiceId, this.victimId]);
3426
- });
3427
- }
3428
- }
3429
- back() {
3430
- console.log('this.victimId');
3431
- console.log(this.victimId);
3432
- this.router.navigate(['saftyPlan', this.victimId]);
3433
- }
3434
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanDetailComponent, deps: [{ token: i1$1.MatDialog }, { token: NgcSmartVictimService }, { token: i1.HttpClient }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: CommonDialogService }, { token: i1$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component });
3435
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSafetyPlanDetailComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n \r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n \r\n \r\n <div class='container'>\r\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\r\n \r\n \r\n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\r\n \r\n\r\n <div class=\"row\" > \r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n <div class=\"row\"> \r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select> \r\n </mat-form-field>\r\n </div>\r\n \r\n \r\n <div class=\"row\"> \r\n \r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput \r\n formControlName=\"goalStatusDate\" \r\n [matDatepicker]=\"goalStatusDate\" \r\n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" \r\n (click)=\"goalStatusDate.open()\" \r\n >\r\n \r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </mat-form-field> \r\n\r\n\r\n <div class=\"help-block\" \r\n *ngIf=\"spForm.get('goalStatusDate').hasError('date') \r\n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <div class=\"row\" > \r\n <!-- <mat-form-field style=\"width: 200px;\"> -->\r\n <!-- <mat-label>Comment:</mat-label> \r\n <textarea mdInput \r\n class=\"textarea-content\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n formControlName=\"comment\" \r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\"\r\n >\r\n </textarea> -->\r\n <!-- </mat-form-field> -->\r\n\r\n\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class=\"textarea-content\"\r\n matInput \r\n placeholder=\"\" \r\n formControlName=\"comment\" \r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea> \r\n\r\n \r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div><!--end form-->\r\n \r\n \r\n <br>\r\n\r\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n \r\n <mat-list>\r\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\r\n <mat-checkbox class=\"example-margin\" name=\"victimService\" color =\"primary\" [checked]=\"evaluateSelection(serviceType.victimServiceTypeId)\" (change)=\"isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);\" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\r\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\r\n \r\n <div class=\"serviceSelect\"> -->\r\n <!-- <mat-form-field> -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" > \r\n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> -->\r\n <!-- </mat-form-field> -->\r\n \r\n <!-- </div>\r\n\r\n <div class=\"serviceButton\">\r\n <button mat-raised-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\r\n </div>\r\n </div> -->\r\n </div>\r\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\r\n \r\n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\r\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\r\n <div class=\"serviceSelect\" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class=\"serviceButton\">\r\n <button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> \r\n </div>\r\n \r\n </div>\r\n \r\n </div>\r\n \r\n </mat-list-item> \r\n \r\n </mat-list>\r\n </div>\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class='col-md-7'> \r\n \r\n </div> \r\n </div> -->\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <mat-form-field >\r\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\r\n </mat-form-field>\r\n </div> \r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div> \r\n </div>\r\n \r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </div> \r\n </div>\r\n \r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\r\n <div class='col-md-7'> \r\n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea> \r\n </div> \r\n </div> -->\r\n\r\n \r\n <div class='row' >\r\n <div class='col-md-12 text-center'>\r\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\r\n <!-- &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div> \r\n </div> \r\n\r\n <!--status hisotry-->\r\n \r\n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimServiceStatusId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n \r\n \r\n\r\n</mat-card-content>\r\n</mat-card>", styles: ["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-list-item{height:auto}.textarea-content{width:500px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i12.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i12.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] });
3436
- }
3437
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanDetailComponent, decorators: [{
3438
- type: Component,
3439
- args: [{ providers: [CommonDialogService], template: "<mat-card>\r\n <mat-card-header>\r\n \r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n \r\n \r\n <div class='container'>\r\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\r\n \r\n \r\n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\r\n \r\n\r\n <div class=\"row\" > \r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n <div class=\"row\"> \r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select> \r\n </mat-form-field>\r\n </div>\r\n \r\n \r\n <div class=\"row\"> \r\n \r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput \r\n formControlName=\"goalStatusDate\" \r\n [matDatepicker]=\"goalStatusDate\" \r\n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" \r\n (click)=\"goalStatusDate.open()\" \r\n >\r\n \r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </mat-form-field> \r\n\r\n\r\n <div class=\"help-block\" \r\n *ngIf=\"spForm.get('goalStatusDate').hasError('date') \r\n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <div class=\"row\" > \r\n <!-- <mat-form-field style=\"width: 200px;\"> -->\r\n <!-- <mat-label>Comment:</mat-label> \r\n <textarea mdInput \r\n class=\"textarea-content\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n formControlName=\"comment\" \r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\"\r\n >\r\n </textarea> -->\r\n <!-- </mat-form-field> -->\r\n\r\n\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class=\"textarea-content\"\r\n matInput \r\n placeholder=\"\" \r\n formControlName=\"comment\" \r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea> \r\n\r\n \r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div><!--end form-->\r\n \r\n \r\n <br>\r\n\r\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n \r\n <mat-list>\r\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\r\n <mat-checkbox class=\"example-margin\" name=\"victimService\" color =\"primary\" [checked]=\"evaluateSelection(serviceType.victimServiceTypeId)\" (change)=\"isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);\" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\r\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\r\n \r\n <div class=\"serviceSelect\"> -->\r\n <!-- <mat-form-field> -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" > \r\n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> -->\r\n <!-- </mat-form-field> -->\r\n \r\n <!-- </div>\r\n\r\n <div class=\"serviceButton\">\r\n <button mat-raised-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\r\n </div>\r\n </div> -->\r\n </div>\r\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\r\n \r\n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\r\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\r\n <div class=\"serviceSelect\" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class=\"serviceButton\">\r\n <button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> \r\n </div>\r\n \r\n </div>\r\n \r\n </div>\r\n \r\n </mat-list-item> \r\n \r\n </mat-list>\r\n </div>\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class='col-md-7'> \r\n \r\n </div> \r\n </div> -->\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <mat-form-field >\r\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\r\n </mat-form-field>\r\n </div> \r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div> \r\n </div>\r\n \r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'> \r\n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </div> \r\n </div>\r\n \r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\r\n <div class='col-md-7'> \r\n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea> \r\n </div> \r\n </div> -->\r\n\r\n \r\n <div class='row' >\r\n <div class='col-md-12 text-center'>\r\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\r\n <button mat-raised-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\r\n <!-- &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\r\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div> \r\n </div> \r\n\r\n <!--status hisotry-->\r\n \r\n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimServiceStatusId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n \r\n \r\n\r\n</mat-card-content>\r\n</mat-card>", styles: ["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-list-item{height:auto}.textarea-content{width:500px}\n"] }]
3440
- }], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i1.HttpClient }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: CommonDialogService }, { type: i1$2.UntypedFormBuilder }] });
3441
-
3442
- const routes = [
3443
- //{path: 'casenote/:victimId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
3444
- { path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent, pathMatch: 'full', canActivate: [MsalGuard], resolve: { loginStaff: LoginStaffResolverService } },
3445
- { path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3446
- { path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3447
- { path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3448
- { path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3449
- { path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3450
- { path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3451
- { path: 'smart-error', component: SmartErrorComponent }
3452
- ];
3453
- class VictimRoutingModule {
3454
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3455
- /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, imports: [i5.RouterModule], exports: [RouterModule] });
3456
- /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
3457
- }
3458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, decorators: [{
3459
- type: NgModule,
3460
- args: [{
3461
- imports: [
3462
- RouterModule.forChild(routes)
3463
- ],
3464
- exports: [
3465
- RouterModule
3466
- ]
3467
- }]
3468
- }] });
3469
-
3470
- const COMPONENTS = [
3471
- NgcSmartVictimComponent,
3472
- SmartVictimDetailComponent,
3473
- SmartVictimDeleteConfirmComponent,
3474
- ];
3475
- const ENTRY_COMPONENTS = [
3476
- SmartVictimDeleteConfirmComponent,
3477
- ];
3478
- const BASE_MODULES = [
3479
- CommonModule,
3480
- ReactiveFormsModule
3481
- ];
3482
- const CORE_MODULES = [NgcSmartCoreModule, SmartAddressModule, SmartUiModule,];
3483
- const MATERIAL_MODULES = [
3484
- MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3485
- MatCardModule, MatSlideToggleModule,
3486
- MatListModule, MatIconModule, MatButtonToggleModule,
3487
- MatToolbarModule, MatTabsModule, MatExpansionModule,
3488
- MatMenuModule, MatInputModule, MatProgressBarModule,
3489
- MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3490
- MatDialogModule, MatSidenavModule, MatSelectModule,
3491
- MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule,
3492
- ];
3493
- class NgcSmartVictimModule {
3494
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3495
- /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, declarations: [NgcSmartVictimComponent,
3496
- SmartVictimDetailComponent,
3497
- SmartVictimDeleteConfirmComponent, CaseNoteComponent,
3498
- ContactComponent,
3499
- VictimSafetyPlanComponent,
3500
- VictimSafetyPlanDetailComponent,
3501
- VictimSearchFormComponent,
3502
- SeriveProviderComponent], imports: [CommonModule,
3503
- ReactiveFormsModule, MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3504
- MatCardModule, MatSlideToggleModule,
3505
- MatListModule, MatIconModule, MatButtonToggleModule,
3506
- MatToolbarModule, MatTabsModule, MatExpansionModule,
3507
- MatMenuModule, MatInputModule, MatProgressBarModule,
3508
- MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3509
- MatDialogModule, MatSidenavModule, MatSelectModule,
3510
- MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule, NgcSmartCoreModule, SmartAddressModule, SmartUiModule, CommonDialogModule,
3511
- FormsModule,
3512
- VictimRoutingModule,
3513
- ApolloModule], exports: [NgcSmartVictimComponent,
3514
- SmartVictimDetailComponent,
3515
- SmartVictimDeleteConfirmComponent, ApolloModule] });
3516
- /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, providers: [NgcSmartVictimService], imports: [BASE_MODULES, MATERIAL_MODULES, CORE_MODULES, CommonDialogModule,
3517
- FormsModule,
3518
- VictimRoutingModule,
3519
- ApolloModule, ApolloModule] });
3520
- }
3521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, decorators: [{
3522
- type: NgModule,
3523
- args: [{
3524
- declarations: [...COMPONENTS,
3525
- CaseNoteComponent,
3526
- ContactComponent,
3527
- VictimSafetyPlanComponent,
3528
- VictimSafetyPlanDetailComponent,
3529
- VictimSearchFormComponent,
3530
- SeriveProviderComponent
3531
- ],
3532
- imports: [
3533
- ...BASE_MODULES,
3534
- ...MATERIAL_MODULES,
3535
- ...CORE_MODULES,
3536
- CommonDialogModule,
3537
- FormsModule,
3538
- VictimRoutingModule,
3539
- ApolloModule,
3540
- //SharedModule
3541
- ],
3542
- exports: [...COMPONENTS, ApolloModule],
3543
- providers: [NgcSmartVictimService]
3544
- }]
3545
- }] });
3546
-
3547
- /*
3548
- * Public API Surface of ngc-smart-victim
3549
- */
3550
-
3551
- /**
3552
- * Generated bundle index. Do not edit.
3553
- */
3554
-
3555
- export { CaseNoteComponent, NgcSmartVictimComponent, NgcSmartVictimModule, NgcSmartVictimService, SMART_LOOKUP_SERVICE_URL, SMART_OFFENDER_SERVICE_URL, SMART_VICTIM_SERVICE_URL, SMART_WARRANT_URL, SmartVictimDeleteConfirmComponent, SmartVictimDetailComponent, Victim, VictimAdvocate, VictimDrugUse, VictimGuardian, VictimListFilter$1 as VictimListFilter, VictimSupport, VictimWeaponUse, conditionalValidator, stringConditionalValidator };
3556
- //# sourceMappingURL=csmart-ngc-smart-victim.mjs.map