@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
@@ -0,0 +1,3273 @@
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 i11$1 from '@angular/material/table';
12
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
13
+ import { MatSort, MatSortModule } from '@angular/material/sort';
14
+ import * as i6 from '@csmart/ngc-smart-core';
15
+ import { AccessType, LoginStaffResolverService, SelectedOffenderResolverService, SmartErrorComponent, NgcSmartCoreModule } from '@csmart/ngc-smart-core';
16
+ import * as i10$1 from '@angular/material/paginator';
17
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
18
+ import * as i1$1 from '@angular/material/dialog';
19
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
20
+ import * as i5 from '@angular/router';
21
+ import { RouterModule } from '@angular/router';
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 i15 from '@angular/material/input';
36
+ import { MatInput, MatInputModule } from '@angular/material/input';
37
+ import * as i17 from '@angular/material/select';
38
+ import { MatSelect, MatSelectModule } from '@angular/material/select';
39
+ import * as i9 from '@angular/material/checkbox';
40
+ import { MatCheckboxModule } from '@angular/material/checkbox';
41
+ import * as i11 from '@angular/material/slider';
42
+ import { MatSliderModule } from '@angular/material/slider';
43
+ import * as i13 from '@angular/material/tabs';
44
+ import { MatTabsModule } from '@angular/material/tabs';
45
+ import * as i14 from '@angular/material/form-field';
46
+ import * as i16 from '@angular/material/datepicker';
47
+ import { MatDatepickerModule } from '@angular/material/datepicker';
48
+ import * as i18 from '@angular/material/core';
49
+ import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
50
+ import * as i20 from '@csmart/ngc-smart-address';
51
+ import { SmartAddressModule } from '@csmart/ngc-smart-address';
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$1 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 i12 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
+ class VictimListFilter$1 {
81
+ }
82
+ class VictimAdvocate {
83
+ constructor(victimAdvocateId, lastName, firstName, prefixId, suffixId, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
84
+ this.victimAdvocateId = victimAdvocateId;
85
+ this.lastName = lastName;
86
+ this.firstName = firstName;
87
+ this.prefixId = prefixId;
88
+ this.suffixId = suffixId;
89
+ this.addressId = addressId;
90
+ this.noPhoneFlag = noPhoneFlag;
91
+ this.homePhone = homePhone;
92
+ this.workPhone = workPhone;
93
+ this.cellPhone = cellPhone;
94
+ this.email = email;
95
+ this.modifiedBy = modifiedBy;
96
+ }
97
+ }
98
+ class VictimWeaponUse {
99
+ constructor(
100
+ // public victimWeaponUseId: number,
101
+ victimId, weaponTypeId, otherWeapon, modifiedBy) {
102
+ this.victimId = victimId;
103
+ this.weaponTypeId = weaponTypeId;
104
+ this.otherWeapon = otherWeapon;
105
+ this.modifiedBy = modifiedBy;
106
+ }
107
+ }
108
+ class VictimDrugUse {
109
+ constructor(
110
+ //public victimDrugUseId: number,
111
+ victimId, drugTypeId, otherDrug, modifiedBy) {
112
+ this.victimId = victimId;
113
+ this.drugTypeId = drugTypeId;
114
+ this.otherDrug = otherDrug;
115
+ this.modifiedBy = modifiedBy;
116
+ }
117
+ }
118
+ class VictimSupport {
119
+ constructor(
120
+ // public victimSupportId: number,
121
+ victimId, victimSupportTypeId, modifiedBy) {
122
+ this.victimId = victimId;
123
+ this.victimSupportTypeId = victimSupportTypeId;
124
+ this.modifiedBy = modifiedBy;
125
+ }
126
+ }
127
+ class VictimGuardian {
128
+ constructor(victimGuardianId, lastName, firstName, prefixId, suffixId, birthDate, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
129
+ this.victimGuardianId = victimGuardianId;
130
+ this.lastName = lastName;
131
+ this.firstName = firstName;
132
+ this.prefixId = prefixId;
133
+ this.suffixId = suffixId;
134
+ this.birthDate = birthDate;
135
+ this.addressId = addressId;
136
+ this.noPhoneFlag = noPhoneFlag;
137
+ this.homePhone = homePhone;
138
+ this.workPhone = workPhone;
139
+ this.cellPhone = cellPhone;
140
+ this.email = email;
141
+ this.modifiedBy = modifiedBy;
142
+ }
143
+ }
144
+ class Victim {
145
+ 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) {
146
+ this.victimId = victimId;
147
+ this.offenderId = offenderId;
148
+ this.underSupervisionFlag = underSupervisionFlag;
149
+ this.victimOffenderRelationshipTypeId = victimOffenderRelationshipTypeId;
150
+ this.lastName = lastName;
151
+ this.firstName = firstName;
152
+ this.middleName = middleName;
153
+ this.prefixId = prefixId;
154
+ this.suffixId = suffixId;
155
+ this.birthDate = birthDate;
156
+ this.genderCode = genderCode;
157
+ this.homePhone = homePhone;
158
+ this.workPhone = workPhone;
159
+ this.cellPhone = cellPhone;
160
+ this.email = email;
161
+ this.addressId = addressId;
162
+ this.minorFlag = minorFlag;
163
+ this.victimAdvocateFlag = victimAdvocateFlag;
164
+ this.guardianFirstName = guardianFirstName;
165
+ this.guardianLastName = guardianLastName;
166
+ this.guardianPrefixId = guardianPrefixId;
167
+ this.guardianSuffixId = guardianSuffixId;
168
+ this.guardianNoPhoneFlag = guardianNoPhoneFlag;
169
+ this.guardianHomePhone = guardianHomePhone;
170
+ this.guardianWorkPhone = guardianWorkPhone;
171
+ this.guardianCellPhone = guardianCellPhone;
172
+ this.guardianEmail = guardianEmail;
173
+ this.guardianAddressId = guardianAddressId;
174
+ this.guardianBirthDate = guardianBirthDate;
175
+ this.advocateFirstName = advocateFirstName;
176
+ this.advocateLastName = advocateLastName;
177
+ this.advocatePrefixId = advocatePrefixId;
178
+ this.advocateSuffixId = advocateSuffixId;
179
+ this.advocateNoPhoneFlag = advocateNoPhoneFlag;
180
+ this.advocateHomePhone = advocateHomePhone;
181
+ this.advocateWorkPhone = advocateWorkPhone;
182
+ this.advocateCellPhone = advocateCellPhone;
183
+ this.advocateEmail = advocateEmail;
184
+ this.advocateAddressId = advocateAddressId;
185
+ this.emergencyContact = emergencyContact;
186
+ this.emergencyContactPhone = emergencyContactPhone;
187
+ this.commonChildrenFlag = commonChildrenFlag;
188
+ this.commonChildrenNumber = commonChildrenNumber;
189
+ this.cpoExpirationFlag = cpoExpirationFlag;
190
+ this.cpoExpirationDate = cpoExpirationDate;
191
+ this.supportInPlaceFlag = supportInPlaceFlag;
192
+ this.weaponInvolvedFlag = weaponInvolvedFlag;
193
+ this.drugUseFlag = drugUseFlag;
194
+ this.alcoholUseFlag = alcoholUseFlag;
195
+ this.accessRisk = accessRisk;
196
+ this.modifiedBy = modifiedBy;
197
+ this.relationship = relationship;
198
+ this.vVictimAdvocate = vVictimAdvocate;
199
+ this.vVictimGuardian = vVictimGuardian;
200
+ this.victimSupports = victimSupports;
201
+ this.victimWeaponUses = victimWeaponUses;
202
+ this.victimDrugUses = victimDrugUses;
203
+ this.allowCsosaContactFlag = allowCsosaContactFlag;
204
+ this.liveWithOffenderFlag = liveWithOffenderFlag;
205
+ }
206
+ }
207
+
208
+ const headers$1 = new HttpHeaders({ 'Content-Type': 'application/json' });
209
+ const options = { headers: headers$1 };
210
+ class NgcSmartVictimService {
211
+ constructor(http, smartOffenderServiceUrl, smartLookupServiceUrl, smartVictimServiceUrl, apollo) {
212
+ this.http = http;
213
+ this.smartOffenderServiceUrl = smartOffenderServiceUrl;
214
+ this.smartLookupServiceUrl = smartLookupServiceUrl;
215
+ this.smartVictimServiceUrl = smartVictimServiceUrl;
216
+ this.apollo = apollo;
217
+ this.serviceApiUrl = 'https://smart-service-test.azurewebsites.net/graphql';
218
+ }
219
+ // getVictimInsurances(offenderId: any) {
220
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?offenderId=' + offenderId).pipe();
221
+ // }
222
+ // getVictimInsurance(id: any) {
223
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
224
+ // }
225
+ // postVictimInsurance(val: any) {
226
+ // return this.http.post(this.smartOffenderServiceUrl + '/VictimInsurances', val).pipe();
227
+ // }
228
+ // putVictimInsurance(id: any, val: any) {
229
+ // return this.http.put(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id, val).pipe();
230
+ // }
231
+ // deleteVictimInsurance(id: any) {
232
+ // return this.http.delete(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
233
+ // }
234
+ // getVictimInsuranceTypes() {
235
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceTypes').pipe();
236
+ // }
237
+ // getVictimInsurancePolicyHolders() {
238
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsurancePolicyHolders').pipe();
239
+ // }
240
+ // getVictimInsuranceSwitchReasons() {
241
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceSwitchReasons').pipe();
242
+ // }
243
+ // getVictimInsuranceProviders() {
244
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProvider').pipe();
245
+ // }
246
+ // getVictimInsuranceProvider(id) {
247
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProviders/' + id).pipe();
248
+ // }
249
+ // postProviderInformation(val: any) {
250
+ // return this.http.post(this.smartLookupServiceUrl + '/VictimInsuranceProviders', val).pipe();
251
+ // }
252
+ getCurrentHousing(offenderId) {
253
+ return this.http
254
+ .get(this.smartOffenderServiceUrl + 'Housings/current/' + offenderId)
255
+ .pipe();
256
+ }
257
+ handleError(error) {
258
+ console.error(error);
259
+ return throwError(error.json().error || 'Server error');
260
+ }
261
+ getDrugsTypes() {
262
+ return this.http.get(this.smartLookupServiceUrl + 'DrugTypes', options).pipe(map(res => res));
263
+ }
264
+ getDocketList(offenderId) {
265
+ const queryString = `
266
+ {
267
+ findDockets(input: { where: { offenderId:${offenderId} } }) {
268
+ totalCount
269
+ message
270
+ data {
271
+ docketId
272
+ docketNumber
273
+
274
+ }
275
+ }
276
+ }`;
277
+ return this.http.post(this.serviceApiUrl, { query: queryString }).pipe(map(({ data }) => {
278
+ console.log('dockets for this offender:', data.findDockets.data);
279
+ return data.findDockets.data;
280
+ }));
281
+ }
282
+ getSupportTypes() {
283
+ return this.http.get(this.smartLookupServiceUrl + 'VictimSupportTypes', options).pipe(map(res => res));
284
+ }
285
+ getPrefixes() {
286
+ return this.http.get(this.smartLookupServiceUrl + 'Prefixes', options).pipe(map(res => res));
287
+ }
288
+ getSuffixes() {
289
+ return this.http.get(this.smartLookupServiceUrl + 'Suffixes', options).pipe(map(res => res));
290
+ }
291
+ getRelationshipTypes() {
292
+ return this.http.get(this.smartLookupServiceUrl + 'RelationshipTypes', options).pipe(map(res => res));
293
+ }
294
+ getGenders() {
295
+ return this.http.get(this.smartLookupServiceUrl + 'Genders', options).pipe(map(res => res));
296
+ }
297
+ getWeaponTypes() {
298
+ return this.http.get(this.smartLookupServiceUrl + 'WeaponTypes', options).pipe(map(res => res));
299
+ }
300
+ getFlagOptionYesNoUnknowns() {
301
+ return this.http.get(this.smartLookupServiceUrl + 'FlagOptionYesNoUnknowns', options).pipe(map(res => {
302
+ return res;
303
+ }));
304
+ }
305
+ getContactTypes() {
306
+ return this.http.get(this.smartLookupServiceUrl + 'ContactTypes', options).pipe(map(res => {
307
+ return res;
308
+ }));
309
+ }
310
+ getContactMethods() {
311
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactMethods', options).pipe(map(res => {
312
+ return res;
313
+ }));
314
+ }
315
+ getContactBys() {
316
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
317
+ return res;
318
+ }));
319
+ }
320
+ getVictimContactPurposes() {
321
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
322
+ return res;
323
+ }));
324
+ }
325
+ getVictimServiceTypes() {
326
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceTypes', options).pipe(map(res => {
327
+ return res;
328
+ }));
329
+ }
330
+ getVictimServiceStatus() {
331
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceStatus', options).pipe(map(res => {
332
+ return res;
333
+ }));
334
+ }
335
+ getvVictimServiceTypeProgramProviders() {
336
+ return this.http.get(this.smartLookupServiceUrl + 'vVictimServiceTypeProgramProviders', options).pipe(map(res => {
337
+ return res;
338
+ }));
339
+ }
340
+ getVictim(val) {
341
+ return this.http.get(this.smartVictimServiceUrl + 'Victims/' + val, options).pipe(map(res => {
342
+ console.log('victim return data');
343
+ console.log(res);
344
+ return res;
345
+ }));
346
+ }
347
+ getVictimAdvocate(val) {
348
+ return this.http.get(this.smartVictimServiceUrl + 'VictimAdvocates/' + val, options).pipe(map(res => {
349
+ return res;
350
+ }));
351
+ }
352
+ getVictimGuardian(val) {
353
+ return this.http.get(this.smartVictimServiceUrl + 'VictimGuardians/' + val, options).pipe(map(res => {
354
+ return res;
355
+ }));
356
+ }
357
+ postVictims(val) {
358
+ const tempVal = JSON.stringify(val);
359
+ return this.http.post(this.smartVictimServiceUrl + 'Victims', tempVal, options).pipe(map(res => { return res; }));
360
+ }
361
+ putVictims(id, val) {
362
+ const tempVal = JSON.stringify(val);
363
+ return this.http.put(this.smartVictimServiceUrl + 'Victims/' + id, tempVal, options).pipe(map(res => { return res; }));
364
+ }
365
+ putVictimAdvocate(id, val) {
366
+ let body;
367
+ body = JSON.stringify(val);
368
+ return this.http.put(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, body, options).pipe(map(res => { return res; }));
369
+ }
370
+ postVictimAdvocate(id, val) {
371
+ const tempVal = JSON.stringify(val);
372
+ return this.http.post(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, tempVal, options).pipe(map(res => { return res; }));
373
+ }
374
+ putVictimGuardian(id, val) {
375
+ console.log('update victim guardian');
376
+ console.log(val);
377
+ const tempVal = JSON.stringify(val);
378
+ return this.http.put(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
379
+ }
380
+ postVictimGuardian(id, val) {
381
+ const tempVal = JSON.stringify(val);
382
+ return this.http.post(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
383
+ }
384
+ getVictimDrugUse(val) {
385
+ return this.http.get(this.smartVictimServiceUrl + 'VictimDrugUses/' + val, options).pipe(map((res) => {
386
+ return res;
387
+ }));
388
+ }
389
+ putVictimDrugUse(id, val) {
390
+ const tempVal = JSON.stringify(val);
391
+ return this.http.put(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
392
+ }
393
+ postVictimDrugUse(id, val) {
394
+ const tempVal = JSON.stringify(val);
395
+ return this.http.post(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
396
+ }
397
+ putVictimWeaponUse(id, val) {
398
+ const tempVal = JSON.stringify(val);
399
+ return this.http.put(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
400
+ }
401
+ postVictimWeaponUse(id, val) {
402
+ const tempVal = JSON.stringify(val);
403
+ return this.http.post(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
404
+ }
405
+ putVictimSupport(id, val) {
406
+ const tempVal = JSON.stringify(val);
407
+ return this.http.put(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
408
+ }
409
+ postVictimSupport(id, val) {
410
+ const tempVal = JSON.stringify(val);
411
+ return this.http.post(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
412
+ }
413
+ deleteVictims(val, staffId) {
414
+ return this.http.delete(this.smartVictimServiceUrl + 'Victims/' + val + '?staffId=' + staffId, options).pipe(map(res => { return res; }));
415
+ }
416
+ // //==============Victim Serive===================================
417
+ getVictims(offenderId) {
418
+ return this.http.get(this.smartVictimServiceUrl + 'Victims/offender/' + offenderId)
419
+ .pipe(map((res) => {
420
+ return res;
421
+ }), catchError(this.handleError));
422
+ }
423
+ getVictimsByFilter(filter) {
424
+ return this.http
425
+ .post(this.smartVictimServiceUrl + '/Victims', JSON.stringify(filter), { headers: headers$1 })
426
+ .pipe(map((res) => {
427
+ return res;
428
+ }), catchError(this.handleError));
429
+ }
430
+ getVictimListByFilter(filter) {
431
+ console.log('filer in service');
432
+ console.log(filter);
433
+ return this.http
434
+ .post(this.smartVictimServiceUrl + 'vVictims/Filter', JSON.stringify(filter), options)
435
+ .pipe();
436
+ }
437
+ getCasetNotes(victimId) {
438
+ return this.http.get(this.smartVictimServiceUrl + 'VictimCaseNotes/victim/' + victimId)
439
+ .pipe(map((res) => {
440
+ return res;
441
+ }), catchError(this.handleError));
442
+ }
443
+ addCaseNote(caseNote) {
444
+ let body;
445
+ body = JSON.stringify(caseNote);
446
+ return this.http
447
+ .post(this.smartVictimServiceUrl + 'VictimCaseNotes/', body, options);
448
+ }
449
+ updateCaseNote(caseNote) {
450
+ let body;
451
+ body = JSON.stringify(caseNote);
452
+ return this.http
453
+ .put(this.smartVictimServiceUrl + 'VictimCaseNotes/' + caseNote.victimCaseNoteId, body, options);
454
+ }
455
+ deleteCaseNote(id, staffId) {
456
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimCaseNotes/${id}?staffId=${staffId}`);
457
+ }
458
+ getContacts(victimId) {
459
+ return this.http.get(this.smartVictimServiceUrl + 'VictimContacts/victim/' + victimId)
460
+ .pipe(map((res) => {
461
+ return res;
462
+ }), catchError(this.handleError));
463
+ }
464
+ addContact(contact) {
465
+ let body;
466
+ body = JSON.stringify(contact);
467
+ return this.http
468
+ .post(this.smartVictimServiceUrl + 'VictimContacts/', body, options);
469
+ }
470
+ updateContact(contact) {
471
+ let body;
472
+ body = JSON.stringify(contact);
473
+ return this.http
474
+ .put(this.smartVictimServiceUrl + 'VictimContacts/' + contact.victimContactId, body, options);
475
+ }
476
+ getSafetyPlans(victimId) {
477
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
478
+ .pipe(map((res) => {
479
+ return res;
480
+ }), catchError(this.handleError));
481
+ }
482
+ getVictimServices(victimServiceId) {
483
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
484
+ .pipe(map((res) => {
485
+ return res;
486
+ }), catchError(this.handleError));
487
+ }
488
+ getVictimServiceDetail(victimServiceId) {
489
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
490
+ .pipe(map((res) => {
491
+ return res;
492
+ }), catchError(this.handleError));
493
+ }
494
+ addSafetyPlan(victimSafetyPlan) {
495
+ let body;
496
+ body = JSON.stringify(victimSafetyPlan);
497
+ return this.http
498
+ .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
499
+ .pipe();
500
+ }
501
+ updateSafetyPlan(victimSafetyPlan) {
502
+ let body;
503
+ body = JSON.stringify(victimSafetyPlan);
504
+ return this.http
505
+ .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options);
506
+ }
507
+ addVictimServiceStatus(victimServiceStatusHistory) {
508
+ let body;
509
+ body = JSON.stringify(victimServiceStatusHistory);
510
+ return this.http
511
+ .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
512
+ }
513
+ getServiceStatusHistories(victimServiceId) {
514
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
515
+ .pipe(map((res) => {
516
+ return res;
517
+ }), catchError(this.handleError));
518
+ }
519
+ deleteSafetyPlan(victimServiceId, staffId) {
520
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
521
+ }
522
+ addPlanProvider(victimServiceDetail) {
523
+ let body;
524
+ body = JSON.stringify(victimServiceDetail);
525
+ return this.http
526
+ .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
527
+ .pipe();
528
+ }
529
+ deleteProvider(victimProgramProviderId, staffId) {
530
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
531
+ }
532
+ }
533
+ /** @nocollapse */ NgcSmartVictimService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
534
+ /** @nocollapse */ NgcSmartVictimService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimService, providedIn: 'root' });
535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimService, decorators: [{
536
+ type: Injectable,
537
+ args: [{
538
+ providedIn: 'root'
539
+ }]
540
+ }], ctorParameters: function () {
541
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
542
+ type: Inject,
543
+ args: [SMART_OFFENDER_SERVICE_URL]
544
+ }] }, { type: undefined, decorators: [{
545
+ type: Inject,
546
+ args: [SMART_LOOKUP_SERVICE_URL]
547
+ }] }, { type: undefined, decorators: [{
548
+ type: Inject,
549
+ args: [SMART_VICTIM_SERVICE_URL]
550
+ }] }, { type: i2.Apollo }];
551
+ } });
552
+
553
+ const headers = new Headers({ 'Content-Type': 'application/json' });
554
+ class IntakeServicesComponent {
555
+ //serviceData = environment.smartOffenderServiceUrl;
556
+ constructor(http, smartOffenderServiceUrl) {
557
+ this.http = http;
558
+ this.smartOffenderServiceUrl = smartOffenderServiceUrl;
559
+ }
560
+ getIntakeByOffender(offenderId) {
561
+ return this.http
562
+ .get(this.smartOffenderServiceUrl + 'IntakeBasic/offender/' + offenderId)
563
+ .pipe();
564
+ }
565
+ updateIntakeSteps(offenderId, intakeStepStatus) {
566
+ return this.http.put(this.smartOffenderServiceUrl + '/IntakeStepStatus/' + offenderId, intakeStepStatus);
567
+ }
568
+ }
569
+ /** @nocollapse */ IntakeServicesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IntakeServicesComponent, deps: [{ token: i1.HttpClient }, { token: SMART_OFFENDER_SERVICE_URL }], target: i0.ɵɵFactoryTarget.Injectable });
570
+ /** @nocollapse */ IntakeServicesComponent.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IntakeServicesComponent, providedIn: 'root' });
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IntakeServicesComponent, decorators: [{
572
+ type: Injectable,
573
+ args: [{
574
+ providedIn: 'root'
575
+ }]
576
+ }], ctorParameters: function () {
577
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
578
+ type: Inject,
579
+ args: [SMART_OFFENDER_SERVICE_URL]
580
+ }] }];
581
+ } });
582
+ class IntakeStep {
583
+ }
584
+ IntakeStep.PhysicalInformation = "PHYSIN";
585
+ IntakeStep.Photo = "PHOTOS";
586
+ IntakeStep.HousingInformation = "HOUSE";
587
+ IntakeStep.DocketInformation = "DOCKET";
588
+ IntakeStep.Alias = "ALIAS";
589
+ IntakeStep.IntakeBasicInformation = "INTKBI";
590
+ IntakeStep.ContactInformation = "CONTCT";
591
+ IntakeStep.DeceasedInformation = "DEATH";
592
+ IntakeStep.DriversLicense = "DRVLIC";
593
+ IntakeStep.EmploymentInformation = "EMPLOY";
594
+ IntakeStep.GangAffiliation = "GANG";
595
+ IntakeStep.HealthInsurance = "HLTHINS";
596
+ IntakeStep.Identification = "IDNTFCTN";
597
+ IntakeStep.InternetIdentifier = "INTERNETID";
598
+ IntakeStep.MilitaryService = "MLTSVC";
599
+ IntakeStep.School = "SCHOOL";
600
+ IntakeStep.SelectiveService = "SLCTVSVC";
601
+ IntakeStep.Vehicle = "VEHICLE";
602
+ IntakeStep.VictimInformation = "VICTIM";
603
+ IntakeStep.WarrantInformation = "WARRNT";
604
+ IntakeStep.RunningRecord = "RUNREC";
605
+ IntakeStep.Signature = "SIGN";
606
+
607
+ class CommonDialogComponent {
608
+ constructor(commondialogRef) {
609
+ this.commondialogRef = commondialogRef;
610
+ this.cmdYesTitle = "Yes";
611
+ this.cmdNoTitle = "No";
612
+ }
613
+ ngOnInit() {
614
+ }
615
+ }
616
+ /** @nocollapse */ CommonDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogComponent, deps: [{ token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
617
+ /** @nocollapse */ CommonDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CommonDialogComponent, selector: "app-common-dialog", ngImport: i0, template: "\n \n <mat-card class=\"example-card\"> \n <mat-card-content>\n <p>{{ title }}</p>\n <p>{{ message }}</p>\n <br>\n\n <div class=\"inner\">\n <button type=\"button\" mat-raised-button color=\"primary\"\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\n </div>\n &nbsp;&nbsp;\n \n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\n <button type=\"button\" mat-raised-button color=\"primary\" \n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\n \n </div>\n \n \n </mat-card-content>\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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogComponent, decorators: [{
619
+ type: Component,
620
+ args: [{ selector: 'app-common-dialog', template: "\n \n <mat-card class=\"example-card\"> \n <mat-card-content>\n <p>{{ title }}</p>\n <p>{{ message }}</p>\n <br>\n\n <div class=\"inner\">\n <button type=\"button\" mat-raised-button color=\"primary\"\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\n </div>\n &nbsp;&nbsp;\n \n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\n <button type=\"button\" mat-raised-button color=\"primary\" \n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\n \n </div>\n \n \n </mat-card-content>\n </mat-card>", styles: [".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}\n"] }]
621
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }]; } });
622
+
623
+ class CommonDialogService {
624
+ constructor(dialog) {
625
+ this.dialog = dialog;
626
+ }
627
+ confirm(title, message, cmdYesTitle, cmdNoTitle) {
628
+ let dialogRef;
629
+ dialogRef = this.dialog.open(CommonDialogComponent);
630
+ dialogRef.componentInstance.title = title;
631
+ dialogRef.componentInstance.message = message;
632
+ dialogRef.componentInstance.cmdYesTitle = cmdYesTitle;
633
+ dialogRef.componentInstance.cmdNoTitle = cmdNoTitle;
634
+ return dialogRef.afterClosed();
635
+ }
636
+ warning(title, message, cmdOkTitle) {
637
+ let dialogRef;
638
+ dialogRef = this.dialog.open(CommonDialogComponent);
639
+ dialogRef.componentInstance.title = title;
640
+ dialogRef.componentInstance.message = message;
641
+ dialogRef.componentInstance.cmdYesTitle = cmdOkTitle;
642
+ return dialogRef.afterClosed();
643
+ }
644
+ }
645
+ /** @nocollapse */ CommonDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogService, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
646
+ /** @nocollapse */ CommonDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogService });
647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogService, decorators: [{
648
+ type: Injectable
649
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }]; } });
650
+
651
+ function conditionalValidator(predicate, validator, errorNamespace) {
652
+ return (formControl => {
653
+ if (!formControl.parent) {
654
+ return null;
655
+ }
656
+ let error = null;
657
+ if (predicate()) {
658
+ error = validator(formControl);
659
+ }
660
+ if (errorNamespace && error) {
661
+ const customError = {};
662
+ customError[errorNamespace] = error;
663
+ error = customError;
664
+ }
665
+ return error;
666
+ });
667
+ }
668
+ function stringConditionalValidator(predicate, validator, errorNamespace) {
669
+ return (formControl => {
670
+ if (!formControl.parent) {
671
+ return null;
672
+ }
673
+ let error = null;
674
+ if (predicate() == 'YS') {
675
+ error = validator(formControl);
676
+ }
677
+ if (errorNamespace && error) {
678
+ const customError = {};
679
+ customError[errorNamespace] = error;
680
+ error = customError;
681
+ }
682
+ return error;
683
+ });
684
+ }
685
+ class SmartVictimDetailComponent {
686
+ constructor(location, formBuilder, dialog, route, router, snackBar, commonDialogService, victimService, changeDetectorRefs) {
687
+ this.location = location;
688
+ this.formBuilder = formBuilder;
689
+ this.dialog = dialog;
690
+ this.route = route;
691
+ this.router = router;
692
+ this.snackBar = snackBar;
693
+ this.commonDialogService = commonDialogService;
694
+ this.victimService = victimService;
695
+ this.changeDetectorRefs = changeDetectorRefs;
696
+ this.victimDetail = {};
697
+ this.onSave = new EventEmitter();
698
+ this.onCancel = new EventEmitter();
699
+ this.hidden = true;
700
+ this.victimAdvocate = {};
701
+ this.victimGuardian = {};
702
+ this.guardianTabFlag = false;
703
+ this.advocateTabFlag = false;
704
+ this.commonChildrenDivFlag = false;
705
+ this.cpoExpirationDivFlag = false;
706
+ this.supportInPlaceDivFlag = false;
707
+ this.weaponInvolvedDivFlag = false;
708
+ this.drugUseDivFlag = false;
709
+ this.showDelete = false;
710
+ this.addressId = 0;
711
+ this.advocateAddressId = 0;
712
+ this.guardianAddressId = 0;
713
+ this.datePipe = new DatePipe('en-US');
714
+ this.emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
715
+ this.phoneNumber = "\\d{10}";
716
+ this.editVictim = {};
717
+ this.otherWeaponFlag = false;
718
+ this.otherDrugFlag = false;
719
+ this.contactDataSource = new MatTableDataSource();
720
+ this.guardianPhoneExistFlag = false;
721
+ this.advocatePhoneExistFlag = false;
722
+ this.phoneValidationFlag = false;
723
+ this.guaridanNoPhoneChkFlag = true;
724
+ this.advocateNoPhoneChkFlag = true;
725
+ this.addressValidators = {
726
+ street: [],
727
+ street2: [],
728
+ city: [],
729
+ stateCode: [],
730
+ zipCode: [],
731
+ psaCode: [],
732
+ };
733
+ this.homePhoneControl = new UntypedFormControl();
734
+ this.cellPhoneControl = new UntypedFormControl();
735
+ this.workPhoneControl = new UntypedFormControl();
736
+ this.guardianHomePhoneControl = new UntypedFormControl();
737
+ this.guardianCellPhoneControl = new UntypedFormControl();
738
+ this.guardianWorkPhoneControl = new UntypedFormControl();
739
+ this.advocateHomePhoneControl = new UntypedFormControl();
740
+ this.advocateCellPhoneControl = new UntypedFormControl();
741
+ this.advocateWorkPhoneControl = new UntypedFormControl();
742
+ this.emergencyContactPhoneControl = new UntypedFormControl();
743
+ this.initForm();
744
+ }
745
+ initForm() {
746
+ this.victimForm = this.formBuilder.group({
747
+ underSupervisionFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
748
+ victimOffenderRelationshipTypeId: new UntypedFormControl('', Validators.compose([Validators.required])),
749
+ lastName: new UntypedFormControl('', Validators.compose([Validators.required])),
750
+ firstName: new UntypedFormControl('', Validators.compose([Validators.required])),
751
+ middleName: new UntypedFormControl(''),
752
+ prefixId: new UntypedFormControl(''),
753
+ suffixId: new UntypedFormControl(''),
754
+ genderCode: new UntypedFormControl(''),
755
+ birthDate: new UntypedFormControl(''),
756
+ homePhone: new UntypedFormControl(''),
757
+ cellPhone: new UntypedFormControl(''),
758
+ workPhone: new UntypedFormControl(''),
759
+ email: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
760
+ minorFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
761
+ victimAdvocateFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
762
+ guardianLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
763
+ guardianFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
764
+ guardianPrefixId: new UntypedFormControl(''),
765
+ guardianSuffixId: new UntypedFormControl(''),
766
+ //guardianGender:new FormControl('', ),
767
+ guardianBirthDate: new UntypedFormControl(''),
768
+ guardianNoPhoneFlag: new UntypedFormControl(true),
769
+ guardianHomePhone: new UntypedFormControl(''),
770
+ guardianCellPhone: new UntypedFormControl(''),
771
+ guardianWorkPhone: new UntypedFormControl(''),
772
+ guardianEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
773
+ advocateNoPhoneFlag: new UntypedFormControl(true),
774
+ advocateWorkPhone: new UntypedFormControl(''),
775
+ advocateHomePhone: new UntypedFormControl(''),
776
+ advocateCellPhone: new UntypedFormControl(''),
777
+ advocateSuffixId: new UntypedFormControl(''),
778
+ advocatePrefixId: new UntypedFormControl(''),
779
+ advocateFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
780
+ advocateLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
781
+ advocateEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
782
+ emergencyContact: new UntypedFormControl(''),
783
+ emergencyContactPhone: new UntypedFormControl(''),
784
+ emergencyChildren: new UntypedFormControl(''),
785
+ emergencyCpo: new UntypedFormControl(''),
786
+ emergencyDrug: new UntypedFormControl(''),
787
+ emergencySupport: new UntypedFormControl(''),
788
+ emergencyWeapon: new UntypedFormControl(''),
789
+ drug: new UntypedFormControl(''),
790
+ weapon: new UntypedFormControl(''),
791
+ support: new UntypedFormControl(''),
792
+ commonChildrenFlag: new UntypedFormControl(''),
793
+ commonChildrenNumber: new UntypedFormControl(''),
794
+ cpoExpirationFlag: new UntypedFormControl(''),
795
+ cpoExpirationDate: new UntypedFormControl(''),
796
+ accessRisk: new UntypedFormControl(''),
797
+ drugUseFlag: new UntypedFormControl(''),
798
+ supportInPlaceFlag: new UntypedFormControl(''),
799
+ weaponInvolvedFlag: new UntypedFormControl(''),
800
+ otherWeapon: new UntypedFormControl(''),
801
+ otherDrug: new UntypedFormControl(''),
802
+ alcoholUseFlag: new UntypedFormControl(''),
803
+ victimSupports: new UntypedFormControl(''),
804
+ victimWeaponUses: new UntypedFormControl(''),
805
+ victimDrugUses: new UntypedFormControl(''),
806
+ allowCsosaContactFlag: new UntypedFormControl(''),
807
+ liveWithOffenderFlag: new UntypedFormControl(''),
808
+ });
809
+ this.victimForm.markAsPristine();
810
+ this.victimForm.markAsUntouched();
811
+ }
812
+ _getVictim() {
813
+ if (this.victimId === 0) {
814
+ return;
815
+ }
816
+ ;
817
+ if (this.editMode == true) {
818
+ console.log('find victim id inside getVictim');
819
+ console.log(this.victimId);
820
+ if (this.victimId === undefined) {
821
+ this.sub = this.route.params.subscribe(params => {
822
+ this.victimId = params['victimId'];
823
+ console.log('my this.victimId');
824
+ console.log(this.victimId);
825
+ });
826
+ }
827
+ this.victimService.getVictim(this.victimId)
828
+ .subscribe((victim) => {
829
+ console.log('victim data 1');
830
+ console.log(victim);
831
+ this.editVictim = victim;
832
+ var supportsData = [];
833
+ this.editVictim.victimSupports.forEach(t => { supportsData.push(t.victimSupportTypeId); });
834
+ const victimSupportsControl = this.victimForm.get('victimSupports');
835
+ victimSupportsControl.setValue(supportsData);
836
+ var weaponUsesData = [];
837
+ var otherWeapon = "";
838
+ this.editVictim.victimWeaponUses.forEach(t => {
839
+ weaponUsesData.push(t.weaponTypeId);
840
+ if (t.weaponTypeId == "OTHER") {
841
+ otherWeapon = t.otherWeapon;
842
+ this.otherWeaponFlag = true;
843
+ }
844
+ });
845
+ const victimWeaponUsesControl = this.victimForm.get('victimWeaponUses');
846
+ victimWeaponUsesControl.setValue(weaponUsesData);
847
+ const otherWeaponControl = this.victimForm.get('otherWeapon');
848
+ otherWeaponControl.setValue(otherWeapon);
849
+ var drugUseData = [];
850
+ var otherDrug = "";
851
+ console.log('load this.editVictim.victimDrugUses');
852
+ console.log(this.editVictim.victimDrugUses);
853
+ this.editVictim.victimDrugUses.forEach(t => {
854
+ if (t.drugTypeId === null) {
855
+ otherDrug = t.otherDrug;
856
+ this.otherDrugFlag = true;
857
+ t.drugTypeId = 'OTHER';
858
+ }
859
+ drugUseData.push(t.drugTypeId);
860
+ });
861
+ console.log('this.editVictim.victimDrugUses after push');
862
+ console.log(drugUseData);
863
+ if (drugUseData) {
864
+ const victimDrugUsesControl = this.victimForm.get('victimDrugUses');
865
+ victimDrugUsesControl.setValue(drugUseData);
866
+ }
867
+ if (otherDrug) {
868
+ const otherDrugControl = this.victimForm.get('otherDrug');
869
+ otherDrugControl.setValue(otherDrug);
870
+ }
871
+ //contact
872
+ this.victimService.getContacts(this.victimId).subscribe(contactList => {
873
+ console.log('contactList');
874
+ console.log(contactList);
875
+ this.contactList = contactList;
876
+ this.contactDataSource.data = this.contactList;
877
+ });
878
+ //no phone field
879
+ if (this.editVictim.guardianNoPhoneFlag === false) {
880
+ this.victimForm.patchValue({ guardianNoPhoneFlag: false });
881
+ }
882
+ if (this.editVictim.advocateNoPhoneFlag === false) {
883
+ this.victimForm.patchValue({ advocateNoPhoneFlag: false });
884
+ }
885
+ this.homePhoneControl.setValue(!this.editVictim.homePhone ? "" : this.editVictim.homePhone);
886
+ this.cellPhoneControl.setValue(!this.editVictim.cellPhone ? "" : this.editVictim.cellPhone);
887
+ this.workPhoneControl.setValue(!this.editVictim.workPhone ? "" : this.editVictim.workPhone);
888
+ this.guardianHomePhoneControl.setValue(!this.editVictim.guardianHomePhone ? "" : this.editVictim.guardianHomePhone);
889
+ this.guardianCellPhoneControl.setValue(!this.editVictim.guardianCellPhone ? "" : this.editVictim.guardianCellPhone);
890
+ this.guardianWorkPhoneControl.setValue(!this.editVictim.guardianWorkPhone ? "" : this.editVictim.guardianWorkPhone);
891
+ this.advocateHomePhoneControl.setValue(!this.editVictim.advocateHomePhone ? "" : this.editVictim.advocateHomePhone);
892
+ this.advocateCellPhoneControl.setValue(!this.editVictim.advocateCellPhone ? "" : this.editVictim.advocateCellPhone);
893
+ this.advocateWorkPhoneControl.setValue(!this.editVictim.advocateWorkPhone ? "" : this.editVictim.advocateWorkPhone);
894
+ this.emergencyContactPhoneControl.setValue(!this.editVictim.emergencyContactPhone ? "" : this.editVictim.emergencyContactPhone);
895
+ }, error => {
896
+ this.snackBar.open("Error occured while retriving Victim Information. Please try again.");
897
+ });
898
+ return;
899
+ }
900
+ else {
901
+ //new
902
+ }
903
+ }
904
+ ngOnChanges() {
905
+ }
906
+ onClear() {
907
+ if (this.addressComponent)
908
+ this.addressComponent.reset();
909
+ }
910
+ showAddress(value) {
911
+ if (value.checked) {
912
+ this.victimService.getCurrentHousing(this.offenderId).subscribe((item) => {
913
+ this.addressId = item.housing.addressId;
914
+ this.victimForm.patchValue({ addressId: this.addressId });
915
+ });
916
+ }
917
+ else {
918
+ this.addressComponent.reset();
919
+ this.editVictim.allowCsosaContactFlag = false;
920
+ this.addressId = null;
921
+ }
922
+ }
923
+ onAddressChange(addressId) {
924
+ this.victimForm.patchValue({ addressId: addressId });
925
+ this.addressId = addressId;
926
+ }
927
+ onGuardianAddressChange(MyGuardianAddressId) {
928
+ this.victimForm.patchValue({ guardianAddressId: MyGuardianAddressId });
929
+ this.guardianAddressId = MyGuardianAddressId;
930
+ }
931
+ onAdvocateAddressChange(MyAdvocateAddressId) {
932
+ this.victimForm.patchValue({ advocateAddressId: MyAdvocateAddressId });
933
+ this.advocateAddressId = MyAdvocateAddressId;
934
+ }
935
+ cancel() {
936
+ this.victimForm.reset();
937
+ }
938
+ ngOnInit() {
939
+ this.homePhoneControl.valueChanges.subscribe((hpn) => {
940
+ const newValue = hpn.replace(/\D/g, '');
941
+ this.editVictim.homePhone = newValue;
942
+ });
943
+ this.cellPhoneControl.valueChanges.subscribe((hpn) => {
944
+ const newValue = hpn.replace(/\D/g, '');
945
+ this.editVictim.cellPhone = newValue;
946
+ });
947
+ this.workPhoneControl.valueChanges.subscribe((hpn) => {
948
+ const newValue = hpn.replace(/\D/g, '');
949
+ this.editVictim.workPhone = newValue;
950
+ });
951
+ this.guardianHomePhoneControl.valueChanges.subscribe((hpn) => {
952
+ const newValue = hpn.replace(/\D/g, '');
953
+ this.editVictim.guardianHomePhone = newValue;
954
+ });
955
+ this.guardianCellPhoneControl.valueChanges.subscribe((hpn) => {
956
+ const newValue = hpn.replace(/\D/g, '');
957
+ this.editVictim.guardianCellPhone = newValue;
958
+ });
959
+ this.guardianWorkPhoneControl.valueChanges.subscribe((hpn) => {
960
+ const newValue = hpn.replace(/\D/g, '');
961
+ this.editVictim.guardianWorkPhone = newValue;
962
+ });
963
+ this.advocateHomePhoneControl.valueChanges.subscribe((hpn) => {
964
+ const newValue = hpn.replace(/\D/g, '');
965
+ this.editVictim.advocateHomePhone = newValue;
966
+ });
967
+ this.advocateCellPhoneControl.valueChanges.subscribe((hpn) => {
968
+ const newValue = hpn.replace(/\D/g, '');
969
+ this.editVictim.advocateCellPhone = newValue;
970
+ });
971
+ this.advocateWorkPhoneControl.valueChanges.subscribe((hpn) => {
972
+ const newValue = hpn.replace(/\D/g, '');
973
+ this.editVictim.advocateWorkPhone = newValue;
974
+ });
975
+ this.emergencyContactPhoneControl.valueChanges.subscribe((hpn) => {
976
+ const newValue = hpn.replace(/\D/g, '');
977
+ this.editVictim.emergencyContactPhone = newValue;
978
+ });
979
+ console.log('show offenderId');
980
+ console.log(this.offenderId);
981
+ console.log('show staffId');
982
+ console.log(this.staffId);
983
+ console.log('show isIntake');
984
+ console.log(this.isIntake);
985
+ //required field
986
+ const requiredImplementation = { get: function () {
987
+ if (this._required) {
988
+ return this._required;
989
+ }
990
+ if (this.ngControl && this.ngControl.control && this.ngControl.control.validator) {
991
+ const emptyValueControl = Object.assign({}, this.ngControl.control);
992
+ emptyValueControl.value = null;
993
+ return ('required' in (this.ngControl.control.validator(emptyValueControl) || {}));
994
+ }
995
+ return false;
996
+ }, set: function (value) { this._required = coerceBooleanProperty(value); }, };
997
+ Object.defineProperty(MatInput.prototype, 'required', requiredImplementation);
998
+ Object.defineProperty(MatSelect.prototype, 'required', requiredImplementation);
999
+ Object.defineProperty(MatRadioGroup.prototype, 'required', requiredImplementation);
1000
+ //required field end
1001
+ if (this.victimDetail != null) {
1002
+ // edit record
1003
+ this.editMode = true;
1004
+ this.showDelete = true;
1005
+ this.victimId = this.victimDetail.victimId;
1006
+ this.guardianTabFlag = this.victimDetail.minorFlag;
1007
+ if (this.victimDetail.victimAdvocateFlag == 'YS') {
1008
+ this.advocateTabFlag = true;
1009
+ }
1010
+ if (this.otherWeaponFlag == true) {
1011
+ const otherWeaponControl = this.victimForm.get('otherWeapon');
1012
+ otherWeaponControl.setValidators(Validators.required);
1013
+ }
1014
+ if (this.otherDrugFlag == true) {
1015
+ const otherDrugControl = this.victimForm.get('otherDrug');
1016
+ otherDrugControl.setValidators(Validators.required);
1017
+ }
1018
+ this.cpoExpirationDivFlag = this.victimDetail.cpoExpirationFlag;
1019
+ this.commonChildrenDivFlag = this.victimDetail.commonChildrenFlag;
1020
+ this.supportInPlaceDivFlag = this.victimDetail.supportInPlaceFlag;
1021
+ this.weaponInvolvedDivFlag = this.victimDetail.weaponInvolvedFlag;
1022
+ this.drugUseDivFlag = this.victimDetail.drugUseFlag;
1023
+ this.addressId = this.victimDetail.addressId;
1024
+ this.guardianAddressId = this.victimDetail.guardianAddressId;
1025
+ this.advocateAddressId = this.victimDetail.advocateAddressId;
1026
+ this._getVictim();
1027
+ }
1028
+ else {
1029
+ //add new record
1030
+ this.victimForm.patchValue({ guardianNoPhoneFlag: true });
1031
+ this.victimForm.patchValue({ advocateNoPhoneFlag: true });
1032
+ }
1033
+ this.victimService.getFlagOptionYesNoUnknowns().subscribe((items) => {
1034
+ this.flagOption = items;
1035
+ });
1036
+ this.victimService.getGenders().subscribe((items) => {
1037
+ this.genders = items;
1038
+ });
1039
+ this.victimService.getPrefixes().subscribe((items) => {
1040
+ this.prefixes = items;
1041
+ });
1042
+ this.victimService.getSuffixes().subscribe((items) => {
1043
+ this.suffixes = items;
1044
+ });
1045
+ this.victimService.getRelationshipTypes().subscribe((items) => {
1046
+ this.relationshipTypes = items.filter((y) => (y.relationshipCategoryId === 'ST' || y.relationshipCategoryId === 'FM'));
1047
+ });
1048
+ this.victimService.getSupportTypes().subscribe((items) => {
1049
+ this.victimSupportTypes = items;
1050
+ });
1051
+ this.victimService.getWeaponTypes().subscribe((items) => {
1052
+ this.weaponTypes = items;
1053
+ });
1054
+ this.victimService.getDrugsTypes().subscribe((items) => {
1055
+ console.log('drug lookup items');
1056
+ console.log(items);
1057
+ this.drugs = items;
1058
+ this.drugs.push({ drugTypeId: 'OTHER', name: 'Other' });
1059
+ console.log(this.drugs);
1060
+ });
1061
+ // this.victimService.getDocketList(this.offenderId).subscribe(
1062
+ // (items: any) => {
1063
+ // this.docketlist = items;
1064
+ // }
1065
+ // );
1066
+ this.victimForm.get('minorFlag').valueChanges
1067
+ .subscribe(value => {
1068
+ this.victimForm.get('guardianFirstName').updateValueAndValidity();
1069
+ this.victimForm.get('guardianLastName').updateValueAndValidity();
1070
+ this.victimForm.get('guardianWorkPhone').updateValueAndValidity();
1071
+ this.victimForm.get('guardianHomePhone').updateValueAndValidity();
1072
+ this.victimForm.get('guardianCellPhone').updateValueAndValidity();
1073
+ });
1074
+ this.victimForm.get('victimAdvocateFlag').valueChanges
1075
+ .subscribe(value => {
1076
+ this.victimForm.get('advocateFirstName').updateValueAndValidity();
1077
+ this.victimForm.get('advocateLastName').updateValueAndValidity();
1078
+ this.victimForm.get('advocateWorkPhone').updateValueAndValidity();
1079
+ this.victimForm.get('advocateHomePhone').updateValueAndValidity();
1080
+ this.victimForm.get('advocateCellPhone').updateValueAndValidity();
1081
+ });
1082
+ }
1083
+ back() {
1084
+ //this.onSave.emit(this.victimDetail);
1085
+ this.router.navigate(['victimList']);
1086
+ }
1087
+ deleteVictim() {
1088
+ this.commonDialogService
1089
+ .confirm('', 'Do you want to delete this Victim?', 'Yes', 'No')
1090
+ .subscribe(res => {
1091
+ this.result = res;
1092
+ if (this.result) {
1093
+ this.victimService.deleteVictims(this.victimDetail.victimId, this.staffId)
1094
+ .subscribe(result => {
1095
+ this.snackBar.open('Delete Successfully!', '', {
1096
+ duration: 3000,
1097
+ });
1098
+ });
1099
+ // this.onSave.emit(this.victimDetail);
1100
+ // this.router.navigate(['victim']);
1101
+ setTimeout(() => {
1102
+ window.location.reload();
1103
+ }, 1500);
1104
+ }
1105
+ });
1106
+ }
1107
+ radioMinorChange($event) {
1108
+ if ($event.value === true) {
1109
+ this.guardianTabFlag = true;
1110
+ }
1111
+ else {
1112
+ this.guardianTabFlag = false;
1113
+ }
1114
+ }
1115
+ radioAdvocateChange($event) {
1116
+ const advocateLastNameControl = this.victimForm.get('advocateLastName');
1117
+ const advocateFirstNameControl = this.victimForm.get('advocateFirstName');
1118
+ if ($event.value === "YS") {
1119
+ this.advocateTabFlag = true;
1120
+ advocateLastNameControl.setValidators(Validators.required);
1121
+ advocateFirstNameControl.setValidators(Validators.required);
1122
+ }
1123
+ else {
1124
+ this.advocateTabFlag = false;
1125
+ advocateLastNameControl.clearValidators();
1126
+ advocateFirstNameControl.clearValidators();
1127
+ }
1128
+ advocateLastNameControl.updateValueAndValidity();
1129
+ advocateFirstNameControl.updateValueAndValidity();
1130
+ }
1131
+ radioCicChange($event) {
1132
+ if ($event.value === true) {
1133
+ this.commonChildrenDivFlag = true;
1134
+ // requrie field
1135
+ this.setValidators('commonChildren');
1136
+ }
1137
+ else {
1138
+ this.commonChildrenDivFlag = false;
1139
+ }
1140
+ }
1141
+ setValidators(type) {
1142
+ if (type == 'commonChildren') {
1143
+ this.victimForm.get('commonChildrenNumber').clearValidators();
1144
+ this.victimForm.get('commonChildrenNumber').setValidators(Validators.required);
1145
+ }
1146
+ else if (type == 'cpo') {
1147
+ this.victimForm.get('cpoExpirationDate').clearValidators();
1148
+ this.victimForm.get('cpoExpirationDate').setValidators(Validators.required);
1149
+ }
1150
+ }
1151
+ radioSupportChange($event) {
1152
+ if ($event.value === true) {
1153
+ this.supportInPlaceDivFlag = true;
1154
+ }
1155
+ else {
1156
+ this.supportInPlaceDivFlag = false;
1157
+ }
1158
+ }
1159
+ radioWeaponChange($event) {
1160
+ if ($event.value === true) {
1161
+ this.weaponInvolvedDivFlag = true;
1162
+ }
1163
+ else {
1164
+ this.weaponInvolvedDivFlag = false;
1165
+ }
1166
+ }
1167
+ radioDrugChange($event) {
1168
+ if ($event.value === true) {
1169
+ this.drugUseDivFlag = true;
1170
+ }
1171
+ else {
1172
+ this.drugUseDivFlag = false;
1173
+ }
1174
+ }
1175
+ radioCpoChange($event) {
1176
+ if ($event.value === true) {
1177
+ this.cpoExpirationDivFlag = true;
1178
+ this.setValidators('cpo');
1179
+ }
1180
+ else {
1181
+ this.cpoExpirationDivFlag = false;
1182
+ }
1183
+ }
1184
+ handleDOBChange($event) {
1185
+ var ageDifMs = Date.now() - $event.value;
1186
+ var ageDate = new Date(ageDifMs);
1187
+ if (Math.abs(ageDate.getUTCFullYear() - 1970) <= 18) {
1188
+ 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.', '', {
1189
+ duration: 6000,
1190
+ });
1191
+ const minorControl = this.victimForm.get('minorFlag');
1192
+ minorControl.setValue(true);
1193
+ this.guardianTabFlag = true;
1194
+ }
1195
+ }
1196
+ checkOtherWeapon(WeaponUse) {
1197
+ const otherWeaponControl = this.victimForm.get('otherWeapon');
1198
+ if (WeaponUse.includes("OTHER")) {
1199
+ this.otherWeaponFlag = true;
1200
+ otherWeaponControl.setValidators(Validators.required);
1201
+ }
1202
+ else {
1203
+ this.otherWeaponFlag = false;
1204
+ otherWeaponControl.clearValidators();
1205
+ }
1206
+ otherWeaponControl.updateValueAndValidity();
1207
+ }
1208
+ checkOtherDrug(DrugUse) {
1209
+ const otherDrugControl = this.victimForm.get('otherDrug');
1210
+ if (DrugUse.includes("OTHER")) {
1211
+ this.otherDrugFlag = true;
1212
+ otherDrugControl.setValidators(Validators.required);
1213
+ }
1214
+ else {
1215
+ this.otherDrugFlag = false;
1216
+ otherDrugControl.clearValidators();
1217
+ }
1218
+ otherDrugControl.updateValueAndValidity();
1219
+ }
1220
+ //#region "save victim"
1221
+ saveVictim() {
1222
+ //guardian phone logic
1223
+ if (!this.victimForm.value.guardianNoPhoneFlag) {
1224
+ if (this.guardianHomePhoneControl.value) {
1225
+ if (this.guardianHomePhoneControl.value !== null) {
1226
+ if (this.guardianHomePhoneControl.value !== "") {
1227
+ this.guardianPhoneExistFlag = true;
1228
+ }
1229
+ }
1230
+ }
1231
+ if (this.guardianWorkPhoneControl.value !== undefined) {
1232
+ if (this.guardianWorkPhoneControl.value !== null) {
1233
+ if (this.guardianWorkPhoneControl.value !== "") {
1234
+ this.guardianPhoneExistFlag = true;
1235
+ }
1236
+ }
1237
+ }
1238
+ if (this.guardianCellPhoneControl.value) {
1239
+ if (this.guardianCellPhoneControl.value !== null) {
1240
+ if (this.guardianCellPhoneControl.value !== "") {
1241
+ this.guardianPhoneExistFlag = true;
1242
+ }
1243
+ }
1244
+ }
1245
+ }
1246
+ console.log('this.victimForm.value.guardianNoPhoneFlag');
1247
+ console.log(this.victimForm.value.guardianNoPhoneFlag);
1248
+ console.log('this.guardianPhoneExistFlag');
1249
+ console.log(this.guardianPhoneExistFlag);
1250
+ if (this.guardianPhoneExistFlag === false && this.victimForm.value.guardianNoPhoneFlag === false) {
1251
+ this.phoneValidationFlag = true;
1252
+ this.commonDialogService
1253
+ .warning('', 'Please check the guardian phone field. You have to fill one of the three phone fileds.', 'Ok')
1254
+ .subscribe(res => {
1255
+ this.result = res;
1256
+ });
1257
+ }
1258
+ console.log('this.phoneValidationFlag');
1259
+ console.log(this.phoneValidationFlag);
1260
+ //advocate phone logic
1261
+ if (!this.victimForm.value.advocateNoPhoneFlag) {
1262
+ if (this.advocateHomePhoneControl.value) {
1263
+ if (this.advocateHomePhoneControl.value !== null) {
1264
+ if (this.advocateHomePhoneControl.value !== "") {
1265
+ this.advocatePhoneExistFlag = true;
1266
+ }
1267
+ }
1268
+ }
1269
+ if (this.advocateWorkPhoneControl.value !== undefined) {
1270
+ if (this.advocateWorkPhoneControl.value !== null) {
1271
+ if (this.advocateWorkPhoneControl.value !== "") {
1272
+ this.advocatePhoneExistFlag = true;
1273
+ }
1274
+ }
1275
+ }
1276
+ if (this.advocateCellPhoneControl.value) {
1277
+ if (this.advocateCellPhoneControl.value !== null) {
1278
+ if (this.advocateCellPhoneControl.value !== "") {
1279
+ this.advocatePhoneExistFlag = true;
1280
+ }
1281
+ }
1282
+ }
1283
+ }
1284
+ console.log('this.victimForm.value.advocateNoPhoneFlag');
1285
+ console.log(this.victimForm.value.advocateNoPhoneFlag);
1286
+ console.log('this.advocatePhoneExistFlag');
1287
+ console.log(this.advocatePhoneExistFlag);
1288
+ if (this.advocatePhoneExistFlag === false && this.victimForm.value.advocateNoPhoneFlag === false) {
1289
+ this.phoneValidationFlag = true;
1290
+ this.commonDialogService
1291
+ .warning('', 'Please check the advocate phone field. You have to fill one of the three phone fileds.', 'Ok')
1292
+ .subscribe(res => {
1293
+ this.result = res;
1294
+ });
1295
+ }
1296
+ if (this.homePhoneControl.value) {
1297
+ this.victimForm.value.homePhone = this.homePhoneControl.value.replace(/[()\s-]/g, '');
1298
+ }
1299
+ else {
1300
+ this.victimForm.value.homePhone = null;
1301
+ }
1302
+ if (this.cellPhoneControl.value) {
1303
+ this.victimForm.value.cellPhone = this.cellPhoneControl.value.replace(/[()\s-]/g, '');
1304
+ }
1305
+ else {
1306
+ this.victimForm.value.cellPhone = null;
1307
+ }
1308
+ if (this.workPhoneControl.value) {
1309
+ this.victimForm.value.workPhone = this.workPhoneControl.value.replace(/[()\s-]/g, '');
1310
+ }
1311
+ else {
1312
+ this.victimForm.value.workPhone = null;
1313
+ }
1314
+ if (this.guardianHomePhoneControl.value) {
1315
+ this.victimForm.value.guardianHomePhone = this.guardianHomePhoneControl.value.replace(/[()\s-]/g, '');
1316
+ }
1317
+ else {
1318
+ this.victimForm.value.guardianHomePhone = null;
1319
+ }
1320
+ if (this.guardianCellPhoneControl.value) {
1321
+ this.victimForm.value.guardianCellPhone = this.guardianCellPhoneControl.value.replace(/[()\s-]/g, '');
1322
+ }
1323
+ else {
1324
+ this.victimForm.value.guardianCellPhone = null;
1325
+ }
1326
+ if (this.guardianWorkPhoneControl.value) {
1327
+ this.victimForm.value.guardianWorkPhone = this.guardianWorkPhoneControl.value.replace(/[()\s-]/g, '');
1328
+ }
1329
+ else {
1330
+ this.victimForm.value.guardianWorkPhone = null;
1331
+ }
1332
+ if (this.advocateHomePhoneControl.value) {
1333
+ this.victimForm.value.advocateHomePhone = this.advocateHomePhoneControl.value.replace(/[()\s-]/g, '');
1334
+ }
1335
+ else {
1336
+ this.victimForm.value.advocateHomePhone = null;
1337
+ }
1338
+ if (this.advocateCellPhoneControl.value) {
1339
+ this.victimForm.value.advocateCellPhone = this.advocateCellPhoneControl.value.replace(/[()\s-]/g, '');
1340
+ }
1341
+ else {
1342
+ this.victimForm.value.advocateCellPhone = null;
1343
+ }
1344
+ if (this.advocateWorkPhoneControl.value) {
1345
+ this.victimForm.value.advocateWorkPhone = this.advocateWorkPhoneControl.value.replace(/[()\s-]/g, '');
1346
+ }
1347
+ else {
1348
+ this.victimForm.value.advocateWorkPhone = null;
1349
+ }
1350
+ if (this.emergencyContactPhoneControl.value) {
1351
+ this.victimForm.value.emergencyContactPhone = this.emergencyContactPhoneControl.value.replace(/[()\s-]/g, '');
1352
+ }
1353
+ else {
1354
+ this.victimForm.value.emergencyContactPhone = null;
1355
+ }
1356
+ //data process
1357
+ console.log('this.phoneValidationFlag 1');
1358
+ console.log(this.phoneValidationFlag);
1359
+ if (this.phoneValidationFlag === false) {
1360
+ if (this.victimDetail === null) {
1361
+ //insert new victim
1362
+ var myVictimSupports = [];
1363
+ if (this.victimForm.value.victimSupports) {
1364
+ this.victimForm.value.victimSupports.forEach(element => {
1365
+ const victimSupport = {};
1366
+ victimSupport.victimId = this.victimForm.value.victimId;
1367
+ victimSupport.victimSupportTypeId = element;
1368
+ victimSupport.modifiedBy = this.staffId;
1369
+ myVictimSupports.push(victimSupport);
1370
+ });
1371
+ }
1372
+ var myVictimDrugUses = [];
1373
+ console.log('this.victimForm.value.victimDrugUses during save');
1374
+ console.log(this.victimForm.value.victimDrugUses);
1375
+ if (this.victimForm.value.victimDrugUses) {
1376
+ this.victimForm.value.victimDrugUses.forEach(element => {
1377
+ const victimDrugUse = {};
1378
+ victimDrugUse.drugTypeId = element;
1379
+ if (element === "OTHER" || element === "" || element === null) {
1380
+ victimDrugUse.drugTypeId = null;
1381
+ victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1382
+ }
1383
+ else {
1384
+ victimDrugUse.drugTypeId = element;
1385
+ victimDrugUse.otherDrug = null;
1386
+ }
1387
+ victimDrugUse.modifiedBy = this.staffId;
1388
+ victimDrugUse.victimId = this.victimForm.value.victimId;
1389
+ myVictimDrugUses.push(victimDrugUse);
1390
+ });
1391
+ }
1392
+ console.log('this.victimForm.value.victimDrugUses during save 1');
1393
+ console.log(this.victimForm.value.victimDrugUses);
1394
+ var myVictimWeaponUses = [];
1395
+ if (this.victimForm.value.victimWeaponUses) {
1396
+ this.victimForm.value.victimWeaponUses.forEach(element => {
1397
+ const victimWeaponUse = {};
1398
+ victimWeaponUse.victimId = this.victimForm.value.victimId;
1399
+ victimWeaponUse.weaponTypeId = element;
1400
+ if (element == "OTHER") {
1401
+ victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1402
+ }
1403
+ else {
1404
+ victimWeaponUse.otherWeapon = null;
1405
+ }
1406
+ victimWeaponUse.modifiedBy = this.staffId;
1407
+ myVictimWeaponUses.push(victimWeaponUse);
1408
+ });
1409
+ }
1410
+ const newVictim = {
1411
+ victimId: 0,
1412
+ offenderId: this.offenderId,
1413
+ victimOffenderRelationshipTypeId: this.victimForm.value.victimOffenderRelationshipTypeId,
1414
+ lastName: this.victimForm.value.lastName,
1415
+ firstName: this.victimForm.value.firstName,
1416
+ middleName: this.victimForm.value.middleName
1417
+ ? this.victimForm.value.middleName
1418
+ : null,
1419
+ prefixId: this.victimForm.value.prefixId
1420
+ ? this.victimForm.value.prefixId
1421
+ : null,
1422
+ suffixId: this.victimForm.value.suffixId
1423
+ ? this.victimForm.value.suffixId
1424
+ : null,
1425
+ birthDate: this.victimForm.value.birthDate
1426
+ ? this.victimForm.value.birthDate
1427
+ : null,
1428
+ genderCode: this.victimForm.value.genderCode
1429
+ ? this.victimForm.value.genderCode
1430
+ : null,
1431
+ underSupervisionFlag: this.victimForm.value.underSupervisionFlag,
1432
+ minorFlag: this.victimForm.value.minorFlag,
1433
+ victimAdvocateFlag: this.victimForm.value.victimAdvocateFlag,
1434
+ homePhone: this.victimForm.value.homePhone,
1435
+ workPhone: this.victimForm.value.workPhone,
1436
+ cellPhone: this.victimForm.value.cellPhone,
1437
+ email: this.victimForm.value.email ? this.victimForm.value.email : null,
1438
+ addressId: this.victimForm.value.addressId
1439
+ ? this.victimForm.value.addressId
1440
+ : 1,
1441
+ emergencyContact: this.victimForm.value.emergencyContact
1442
+ ? this.victimForm.value.emergencyContact
1443
+ : null,
1444
+ emergencyContactPhone: this.victimForm.value.emergencyContactPhone,
1445
+ commonChildrenFlag: this.victimForm.value.commonChildrenFlag,
1446
+ commonChildrenNumber: this.victimForm.value.commonChildrenNumber,
1447
+ cpoExpirationFlag: this.victimForm.value.cpoExpirationFlag,
1448
+ cpoExpirationDate: this.victimForm.value.cpoExpirationDate
1449
+ ? this.datePipe.transform(this.victimForm.value.cpoExpirationDate, "short")
1450
+ : null,
1451
+ supportInPlaceFlag: this.victimForm.value.supportInPlaceFlag,
1452
+ weaponInvolvedFlag: this.victimForm.value.weaponInvolvedFlag,
1453
+ drugUseFlag: this.victimForm.value.drugUseFlag,
1454
+ alcoholUseFlag: this.victimForm.value.alcoholUseFlag,
1455
+ accessRisk: this.victimForm.value.accessRisk,
1456
+ modifiedBy: this.staffId,
1457
+ vVictimAdvocate: null,
1458
+ vVictimGuardian: null,
1459
+ victimDrugUses: myVictimDrugUses,
1460
+ victimSupports: myVictimSupports,
1461
+ victimWeaponUses: myVictimWeaponUses,
1462
+ advocateFirstName: null,
1463
+ advocateLastName: null,
1464
+ advocateEmail: null,
1465
+ advocatePrefixId: null,
1466
+ advocateSuffixId: null,
1467
+ advocateNoPhoneFlag: null,
1468
+ advocateHomePhone: null,
1469
+ advocateWorkPhone: null,
1470
+ advocateCellPhone: null,
1471
+ advocateAddressId: null,
1472
+ guardianFirstName: null,
1473
+ guardianLastName: null,
1474
+ guardianEmail: null,
1475
+ guardianPrefixId: null,
1476
+ guardianSuffixId: null,
1477
+ guardianNoPhoneFlag: null,
1478
+ guardianHomePhone: null,
1479
+ guardianWorkPhone: null,
1480
+ guardianCellPhone: null,
1481
+ guardianAddressId: null,
1482
+ guardianBirthDate: null,
1483
+ relationship: null,
1484
+ //relationship: this.victimForm.value.victimOffenderRelationshipTypeId? this.victimForm.value.victimOffenderRelationshipTypeId : null,
1485
+ allowCsosaContactFlag: this.victimForm.value.allowCsosaContactFlag
1486
+ ? this.victimForm.value.allowCsosaContactFlag
1487
+ : null,
1488
+ liveWithOffenderFlag: this.victimForm.value.liveWithOffenderFlag
1489
+ ? this.victimForm.value.liveWithOffenderFlag
1490
+ : null,
1491
+ };
1492
+ if (this.addressId == 0) {
1493
+ newVictim.addressId = null;
1494
+ }
1495
+ else {
1496
+ newVictim.addressId = this.addressId;
1497
+ }
1498
+ newVictim.advocateAddressId = this.advocateAddressId;
1499
+ newVictim.guardianAddressId = this.guardianAddressId;
1500
+ console.log('newVictim');
1501
+ console.log(newVictim);
1502
+ this.victimService.postVictims(newVictim).subscribe((items) => {
1503
+ const id = items ? items.victimId : '';
1504
+ if (this.victimForm.value.victimAdvocateFlag == "YS") {
1505
+ console.log('add advocate');
1506
+ const victimAdvocate = {
1507
+ victimAdvocateId: id,
1508
+ lastName: this.victimForm.value.advocateLastName,
1509
+ firstName: this.victimForm.value.advocateFirstName,
1510
+ prefixId: this.victimForm.value.advocatePrefixId,
1511
+ suffixId: this.victimForm.value.advocateSuffixId,
1512
+ addressId: this.advocateAddressId ? this.advocateAddressId : null,
1513
+ noPhoneFlag: this.victimForm.value.advocateNoPhoneFlag ? this.victimForm.value.advocateNoPhoneFlag : null,
1514
+ homePhone: this.victimForm.value.advocateHomePhone,
1515
+ workPhone: this.victimForm.value.advocateWorkPhone,
1516
+ cellPhone: this.victimForm.value.advocateCellPhone,
1517
+ email: this.victimForm.value.advocateEmail,
1518
+ modifiedBy: this.staffId
1519
+ };
1520
+ this.victimService.postVictimAdvocate(id, victimAdvocate).subscribe();
1521
+ }
1522
+ if (this.victimForm.value.minorFlag == true) {
1523
+ const victimGuardian = {
1524
+ victimGuardianId: id,
1525
+ lastName: this.victimForm.value.guardianLastName,
1526
+ firstName: this.victimForm.value.guardianFirstName,
1527
+ prefixId: this.victimForm.value.guardianPrefixId,
1528
+ suffixId: this.victimForm.value.guardianSuffixId,
1529
+ birthDate: this.victimForm.value.guardianBirthDate,
1530
+ addressId: this.guardianAddressId ? this.guardianAddressId : null,
1531
+ noPhoneFlag: this.victimForm.value.guardianNoPhoneFlag ? this.victimForm.value.guardianNoPhoneFlag : null,
1532
+ homePhone: this.victimForm.value.guardianHomePhone,
1533
+ workPhone: this.victimForm.value.guardianWorkPhone,
1534
+ cellPhone: this.victimForm.value.guardianCellPhone,
1535
+ email: this.victimForm.value.guardianEmail,
1536
+ modifiedBy: this.staffId
1537
+ };
1538
+ this.victimService.postVictimGuardian(id, victimGuardian).subscribe();
1539
+ }
1540
+ this.snackBar.open('Add Victim Successfully!', '', {
1541
+ duration: 3000,
1542
+ });
1543
+ //insert new
1544
+ if (this.isIntake === true) {
1545
+ this.router.navigate(['victimHome']);
1546
+ }
1547
+ else {
1548
+ this.router.navigate(['victimList']);
1549
+ }
1550
+ //this.onSave.emit(this.victimDetail);
1551
+ });
1552
+ }
1553
+ else {
1554
+ //update victim
1555
+ this.victimDetail.underSupervisionFlag = this.victimForm.value.underSupervisionFlag;
1556
+ this.victimDetail.victimOffenderRelationshipTypeId = this.victimForm.value.victimOffenderRelationshipTypeId;
1557
+ this.victimDetail.lastName = this.victimForm.value.lastName;
1558
+ this.victimDetail.firstName = this.victimForm.value.firstName;
1559
+ this.victimDetail.middleName = this.victimForm.value.middleName;
1560
+ this.victimDetail.prefixId = this.victimForm.value.prefixId ? this.victimForm.value.prefixId : null;
1561
+ this.victimDetail.suffixId = this.victimForm.value.suffixId ? this.victimForm.value.suffixId : null;
1562
+ this.victimDetail.birthDate = this.victimForm.value.birthDate;
1563
+ this.victimDetail.genderCode = this.victimForm.value.genderCode;
1564
+ this.victimDetail.minorFlag = this.victimForm.value.minorFlag;
1565
+ this.victimDetail.homePhone = this.victimForm.value.homePhone;
1566
+ this.victimDetail.workPhone = this.victimForm.value.workPhone;
1567
+ this.victimDetail.cellPhone = this.victimForm.value.cellPhone;
1568
+ this.victimDetail.email = this.victimForm.value.email;
1569
+ this.victimDetail.victimAdvocateFlag = this.victimForm.value.victimAdvocateFlag;
1570
+ this.victimDetail.emergencyContact = this.victimForm.value.emergencyContact;
1571
+ this.victimDetail.emergencyContactPhone = this.victimForm.value.emergencyContactPhone;
1572
+ this.victimDetail.commonChildrenFlag = this.victimForm.value.commonChildrenFlag;
1573
+ this.victimDetail.commonChildrenNumber = this.victimForm.value.commonChildrenNumber;
1574
+ this.victimDetail.cpoExpirationDate = this.victimForm.value.cpoExpirationDate;
1575
+ this.victimDetail.cpoExpirationFlag = this.victimForm.value.cpoExpirationFlag;
1576
+ this.victimDetail.supportInPlaceFlag = this.victimForm.value.supportInPlaceFlag;
1577
+ this.victimDetail.weaponInvolvedFlag = this.victimForm.value.weaponInvolvedFlag;
1578
+ this.victimDetail.drugUseFlag = this.victimForm.value.drugUseFlag;
1579
+ this.victimDetail.alcoholUseFlag = this.victimForm.value.alcoholUseFlag;
1580
+ this.victimDetail.accessRisk = this.victimForm.value.accessRisk;
1581
+ this.victimDetail.addressId = this.addressId;
1582
+ this.victimDetail.allowCsosaContactFlag = this.victimForm.value.allowCsosaContactFlag;
1583
+ this.victimDetail.liveWithOffenderFlag = this.victimForm.value.liveWithOffenderFlag;
1584
+ this.victimDetail.victimSupports = [];
1585
+ this.victimForm.value.victimSupports.forEach(element => {
1586
+ const victimSupport = {};
1587
+ victimSupport.victimId = this.victimDetail.victimId;
1588
+ victimSupport.victimSupportTypeId = element;
1589
+ victimSupport.modifiedBy = this.staffId;
1590
+ this.victimDetail.victimSupports.push(victimSupport);
1591
+ });
1592
+ this.victimDetail.victimDrugUses = [];
1593
+ this.victimForm.value.victimDrugUses.forEach(element => {
1594
+ const victimDrugUse = {};
1595
+ victimDrugUse.drugTypeId = element;
1596
+ console.log('this.victimForm.value.victimDrugUses before');
1597
+ console.log(this.victimForm.value.victimDrugUses);
1598
+ if (element === "OTHER" || element === "") {
1599
+ victimDrugUse.drugTypeId = null;
1600
+ victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1601
+ }
1602
+ else {
1603
+ victimDrugUse.drugTypeId = element;
1604
+ victimDrugUse.otherDrug = null;
1605
+ }
1606
+ victimDrugUse.modifiedBy = this.staffId;
1607
+ victimDrugUse.victimId = this.victimDetail.victimId;
1608
+ this.victimDetail.victimDrugUses.push(victimDrugUse);
1609
+ });
1610
+ this.victimForm.value.victimDrugUses.filter(word => (!(word.drugTypeId === null && word.otherDrug === null)));
1611
+ this.victimDetail.victimWeaponUses = [];
1612
+ this.victimForm.value.victimWeaponUses.forEach(element => {
1613
+ const victimWeaponUse = {};
1614
+ victimWeaponUse.victimId = this.victimDetail.victimId;
1615
+ victimWeaponUse.weaponTypeId = element;
1616
+ if (element == "OTHER") {
1617
+ victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1618
+ }
1619
+ else {
1620
+ victimWeaponUse.otherWeapon = null;
1621
+ }
1622
+ victimWeaponUse.modifiedBy = this.staffId;
1623
+ this.victimDetail.victimWeaponUses.push(victimWeaponUse);
1624
+ });
1625
+ console.log('this.victimDetail before emit');
1626
+ console.log(this.victimDetail);
1627
+ this.victimService.putVictims(this.victimDetail.victimId, this.victimDetail).subscribe((items) => {
1628
+ this.snackBar.open('Update Successfully!', '', {
1629
+ duration: 3000,
1630
+ });
1631
+ //Advocate section
1632
+ this.victimAdvocate.victimAdvocateId = this.victimDetail.victimId;
1633
+ this.victimAdvocate.lastName = this.victimForm.value.advocateLastName;
1634
+ this.victimAdvocate.firstName = this.victimForm.value.advocateFirstName;
1635
+ this.victimAdvocate.prefixId = this.victimForm.value.advocatePrefixId ? this.victimForm.value.advocatePrefixId : null;
1636
+ this.victimAdvocate.suffixId = this.victimForm.value.advocateSuffixId ? this.victimForm.value.advocateSuffixId : null;
1637
+ this.victimAdvocate.addressId = this.advocateAddressId ? this.advocateAddressId : null;
1638
+ this.victimAdvocate.noPhoneFlag = this.victimForm.value.advocateNoPhoneFlag ? true : false;
1639
+ this.victimAdvocate.homePhone = this.victimForm.value.advocateHomePhone;
1640
+ this.victimAdvocate.workPhone = this.victimForm.value.advocateWorkPhone;
1641
+ this.victimAdvocate.cellPhone = this.victimForm.value.advocateCellPhone;
1642
+ this.victimAdvocate.email = this.victimForm.value.advocateEmail ? this.victimForm.value.advocateEmail : null;
1643
+ this.victimAdvocate.modifiedBy = this.staffId;
1644
+ console.log('work on advocate part');
1645
+ if (this.victimDetail.victimAdvocateFlag == 'YS') {
1646
+ console.log('work on advocate flag is YS ');
1647
+ if (this.victimDetail.advocateFirstName != null) {
1648
+ console.log('check advocate fisrt name ');
1649
+ console.log(this.victimDetail.advocateFirstName);
1650
+ this.victimService.putVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe(resp => { });
1651
+ }
1652
+ else {
1653
+ console.log('add advocate');
1654
+ console.log(this.victimAdvocate);
1655
+ this.victimService.postVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe();
1656
+ }
1657
+ }
1658
+ // guardian section
1659
+ this.victimGuardian.victimGuardianId = this.victimDetail.victimId;
1660
+ this.victimGuardian.lastName = this.victimForm.value.guardianLastName;
1661
+ this.victimGuardian.firstName = this.victimForm.value.guardianFirstName;
1662
+ this.victimGuardian.prefixId = this.victimForm.value.guardianPrefixId ? this.victimForm.value.guardianPrefixId : null;
1663
+ this.victimGuardian.suffixId = this.victimForm.value.guardianSuffixId ? this.victimForm.value.guardianSuffixId : null;
1664
+ this.victimGuardian.addressId = this.guardianAddressId ? this.guardianAddressId : null;
1665
+ this.victimGuardian.noPhoneFlag = this.victimForm.value.guardianNoPhoneFlag ? true : false;
1666
+ this.victimGuardian.homePhone = this.victimForm.value.guardianHomePhone;
1667
+ this.victimGuardian.workPhone = this.victimForm.value.guardianWorkPhone;
1668
+ this.victimGuardian.cellPhone = this.victimForm.value.guardianCellPhone;
1669
+ this.victimGuardian.email = this.victimForm.value.guardianEmail ? this.victimForm.value.guardianEmail : null;
1670
+ this.victimGuardian.modifiedBy = this.staffId;
1671
+ if (this.victimDetail.minorFlag == true) {
1672
+ if (this.victimDetail.guardianFirstName != null)
1673
+ this.victimService.putVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe(resp => {
1674
+ });
1675
+ else {
1676
+ console.log('add gurdian');
1677
+ console.log(this.victimGuardian);
1678
+ this.victimService.postVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe();
1679
+ }
1680
+ }
1681
+ });
1682
+ }
1683
+ } //end of this.phoneValidationFlag = false
1684
+ console.log('this.victimDetail');
1685
+ console.log(this.victimDetail);
1686
+ this.onSave.emit(this.victimDetail);
1687
+ }
1688
+ //#endregion "save victim"
1689
+ addContact() {
1690
+ this.router.navigate(['victimContact', this.victimId]);
1691
+ }
1692
+ formatLabel(value) {
1693
+ return value;
1694
+ }
1695
+ }
1696
+ /** @nocollapse */ SmartVictimDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
1697
+ /** @nocollapse */ SmartVictimDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.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>\n <mat-card-content>\n\n <div [formGroup]=\"victimForm\">\n\n <mat-tab-group dynamicHeight mat-stretch-tabs>\n <mat-tab label=\"Victim Detail\" >\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\n <br>\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\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>\n <br>\n <br>\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Victim Currently Under Supervision:</mat-label>\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\n {{item.name}}</mat-option>\n </mat-select>\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\n <mat-error>under supervision field is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Relationship to Offender:</mat-label>\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\n </mat-select>\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\n <mat-error>relationship is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Victim Last Name:</mat-label>\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\n <mat-error>victim last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim First Name: </mat-label>\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\n <mat-error>victim first name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Middle Name:</mat-label>\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Prefix:</mat-label>\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Suffix:</mat-label>\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Sex:</mat-label>\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Date of Birth:</mat-label>\n <input matInput\n [matDatepicker]=\"victimBirthRef\"\n formControlName=\"birthDate\"\n [(ngModel)]=\"editVictim.birthDate\"\n (click)=\"victimBirthRef.open()\"\n (dateChange)=\"handleDOBChange($event)\"\n >\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #victimBirthRef></mat-datepicker>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.homePhone\"\n [phoneControl]=\"homePhoneControl\"\n [formControl]=\"homePhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Victim Cell Phone:</mat-label>\n <input\n id=\"tel1\"\n matInput\n phoneMask\n [preValue]=\"editVictim.cellPhone\"\n [phoneControl]=\"cellPhoneControl\"\n [formControl]=\"cellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field >\n <mat-label>Victim Work Phone:</mat-label>\n <input\n id=\"tel2\"\n matInput\n phoneMask\n [preValue]=\"editVictim.workPhone\"\n [phoneControl]=\"workPhoneControl\"\n [formControl]=\"workPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Victim Email:</mat-label>\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n <app-smart-address\n [modifiedBy]=\"staffId\"\n [id]=\"addressId\"\n [outline]=\"true\"\n [showPsa]=\"true\"\n [addressValidators]=\"addressValidators\"\n [readonly]=\"false\"\n (addressIdChange)=\"onAddressChange($event)\"\n #addressComponent >\n\n </app-smart-address>\n\n\n <!-- Docket:\n <div>\n <div *ngFor=\"let docket of docketlist; let i=index\">\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\n </div>\n </div> -->\n <div>\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\n <br>\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\n </div>\n\n </div>\n\n <mat-card>\n <mat-form-field>\n <mat-label> Children in Common</mat-label>\n <br>\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"commonChildrenDivFlag\">\n\n <mat-form-field >\n <mat-label>\n Children number\n </mat-label>\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\n </mat-form-field>\n\n </div>\n\n <mat-form-field>\n <mat-label>CPO: </mat-label>\n <br>\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"cpoExpirationDivFlag\">\n <mat-form-field>\n <mat-label>Expiration Date: </mat-label>\n <input matInput\n [matDatepicker]=\"cpoDateRef\"\n formControlName=\"cpoExpirationDate\"\n (click)=\"cpoDateRef.open()\"\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #cpoDateRef></mat-datepicker>\n </mat-form-field>\n\n </div>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Victim has a Support System in Place? </mat-label>\n <br>\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"supportInPlaceDivFlag\">\n <mat-form-field>\n <mat-label>Support type? </mat-label>\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\n <div (mouseleave)=\"supportSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\n {{item.name}}\n </mat-option>\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n </div>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Weapons Involved?</mat-label>\n <br>\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n\n <div *ngIf=\"weaponInvolvedDivFlag\">\n <mat-form-field>\n <mat-label>Weapon Type</mat-label>\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\n <div (mouseleave)=\"weaponSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\n {{item.name}}\n </mat-option>\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n </div>\n\n <div *ngIf=\"otherWeaponFlag\">\n <mat-form-field>\n <mat-label>Other Weapon:* </mat-label>\n <input matInput formControlName=\"otherWeapon\" >\n </mat-form-field>\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\n <mat-error><strong>Other weapon is required.</strong></mat-error>\n </div>\n </div>\n\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\n <br>\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\n <br>\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"drugUseDivFlag\">\n <mat-form-field>\n <mat-label>Drug:</mat-label>\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\n <div (mouseleave)=\"drugSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\n {{item.name}}\n </mat-option>\n\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n </div>\n\n <div *ngIf=\"otherDrugFlag\">\n <mat-form-field>\n <mat-label>Other Drug:* </mat-label>\n <input matInput formControlName=\"otherDrug\" >\n </mat-form-field>\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\n <mat-error><strong>Other drug is required.</strong></mat-error>\n </div>\n </div>\n <br>\n <br>\n\n <div>\n <div>\n <mat-label>\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\n </mat-label>\n </div>\n <div>\n\n <mat-slider\n formControlName=\"accessRisk\"\n thumbLabel=\"true\"\n [displayWith]=\"formatLabel\"\n min=\"1\"\n max=\"10\"\n [(ngModel)]=\"editVictim.accessRisk\"\n ></mat-slider>\n\n </div>\n\n </div>\n\n </mat-card>\n\n\n <br><br><br>\n </mat-tab>\n\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\n <div class='container'>\n <mat-form-field>\n <mat-label>Guardian Last Name:</mat-label>\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian First Name:</mat-label>\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian Prefix:</mat-label>\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian Suffix:</mat-label>\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n\n <!-- <mat-form-field>\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field> -->\n\n\n <mat-form-field>\n <mat-label>Date of Birth:</mat-label>\n <input matInput\n [matDatepicker]=\"guardianDateRef\"\n formControlName=\"guardianBirthDate\"\n [(ngModel)]=\"editVictim.guardianBirthDate\"\n (click)=\"guardianDateRef.open()\"\n >\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #guardianDateRef></mat-datepicker>\n </mat-form-field>\n\n <div></div>\n <mat-form-field >\n <mat-checkbox\n color = \"primary\"\n formControlName=\"guardianNoPhoneFlag\">\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\n <input matInput placeholder=\"\" style=\"display: none;\">\n </mat-form-field>\n\n\n <div></div>\n <mat-card>\n <mat-form-field >\n <mat-label>Guardian Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianHomePhone\"\n [phoneControl]=\"guardianHomePhoneControl\"\n [formControl]=\"guardianHomePhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Guardian Cell Phone:</mat-label>\n <input\n id=\"tel4\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianCellPhone\"\n [phoneControl]=\"guardianCellPhoneControl\"\n [formControl]=\"guardianCellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Guardian Work Phone:</mat-label>\n\n <input\n id=\"tel5\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianWorkPhone\"\n [phoneControl]=\"guardianWorkPhoneControl\"\n [formControl]=\"guardianWorkPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n </mat-card>\n\n <div></div>\n\n <mat-form-field>\n <mat-label>Guardian Email:</mat-label>\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n\n <div>\n <app-smart-address\n\n [showPsa]=\"true\"\n [modifiedBy]=\"staffId\"\n [id]=\"guardianAddressId\"\n (addressIdChange)=\"onGuardianAddressChange($event)\"\n [outline]=\"true\"\n readonly=\"false\"\n [rowHeight]=\"80\"\n (isValid)=\"false\"\n [addressValidators]=\"addressValidators\"\n #guardianAddressComponent\n >\n </app-smart-address>\n </div>\n </div>\n\n <br><br><br>\n </mat-tab>\n\n <!--advocate-->\n\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Advocate Last Name:</mat-label>\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate First Name:</mat-label>\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Prefix:</mat-label>\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Suffix:</mat-label>\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-checkbox\n color = \"primary\"\n formControlName=\"advocateNoPhoneFlag\"\n\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\n <input matInput placeholder=\"\" style=\"display: none;\">\n </mat-form-field>\n\n <div></div>\n <mat-card>\n <mat-form-field >\n <mat-label>Advocate Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateHomePhone\"\n [phoneControl]=\"advocateHomePhoneControl\"\n [formControl]=\"advocateHomePhoneControl\"\n maxlength=\"14\"/>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Cell Phone:</mat-label>\n <input\n id=\"tel7\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateCellPhone\"\n [phoneControl]=\"advocateCellPhoneControl\"\n [formControl]=\"advocateCellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Work Phone:</mat-label>\n <input\n id=\"tel8\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateWorkPhone\"\n [phoneControl]=\"advocateWorkPhoneControl\"\n [formControl]=\"advocateWorkPhoneControl\"\n maxlength=\"14\"/>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\n </div>\n\n </mat-form-field>\n </mat-card>\n\n <div></div>\n\n <mat-form-field>\n <mat-label>Advocate Email:</mat-label>\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n\n\n <div >\n <app-smart-address\n [showPsa]=\"true\"\n [modifiedBy]=\"staffId\"\n [id]=\"advocateAddressId\"\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\n [outline]=\"true\"\n readonly=\"false\"\n [rowHeight]=\"80\"\n (isValid)=\"false\"\n [addressValidators]=\"addressValidators\"\n #advocateAddressComponent >\n </app-smart-address>\n </div>\n </div>\n <br><br><br>\n </mat-tab>\n\n\n <mat-tab label=\"Emergency Contact\">\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Emergency Contact Name:</mat-label>\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Emergency Phone Number:</mat-label>\n\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.emergencyContactPhone\"\n [phoneControl]=\"emergencyContactPhoneControl\"\n [formControl]=\"emergencyContactPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n </div>\n <br><br><br>\n </mat-tab>\n\n </mat-tab-group>\n <div class='outer'>\n <div>\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>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\n <mat-error>Relationship is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\n <mat-error>Victim last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\n <mat-error>victim first name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\n </div>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\n <mat-error>Other drug field is <strong>required</strong></mat-error>\n </div>\n\n\n </div>\n\n <div class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\n </div>\n &nbsp;&nbsp;\n <div *ngIf=\"showDelete\" class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\n </div>\n &nbsp;&nbsp;\n <div class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"cancel()\">Clear </button>\n </div>\n &nbsp;&nbsp;\n <button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n\n </div>\n\n </div>\n <br>\n <br>\n\n <div align=\"right\">\n <button mat-raised-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\n </div>\n\n <div>\n\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"contactDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"victimContactMethod\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"nextContactDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"staff\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"contactId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n\n </div>\n\n </mat-card-content>\n</mat-card>\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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: i11.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "component", type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i14.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i14.MatLabel, selector: "mat-label" }, { kind: "directive", type: i14.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i15.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: 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: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", 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: ["sticky", "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" }] });
1698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartVictimDetailComponent, decorators: [{
1699
+ type: Component,
1700
+ args: [{ selector: 'csmart-victim-detail', providers: [CommonDialogService], template: "<mat-card>\n <mat-card-content>\n\n <div [formGroup]=\"victimForm\">\n\n <mat-tab-group dynamicHeight mat-stretch-tabs>\n <mat-tab label=\"Victim Detail\" >\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\n <br>\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\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>\n <br>\n <br>\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Victim Currently Under Supervision:</mat-label>\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\n {{item.name}}</mat-option>\n </mat-select>\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\n <mat-error>under supervision field is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Relationship to Offender:</mat-label>\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\n </mat-select>\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\n <mat-error>relationship is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-label>Victim Last Name:</mat-label>\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\n <mat-error>victim last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim First Name: </mat-label>\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\n <mat-error>victim first name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Middle Name:</mat-label>\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Prefix:</mat-label>\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Suffix:</mat-label>\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Sex:</mat-label>\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Date of Birth:</mat-label>\n <input matInput\n [matDatepicker]=\"victimBirthRef\"\n formControlName=\"birthDate\"\n [(ngModel)]=\"editVictim.birthDate\"\n (click)=\"victimBirthRef.open()\"\n (dateChange)=\"handleDOBChange($event)\"\n >\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #victimBirthRef></mat-datepicker>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Victim Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.homePhone\"\n [phoneControl]=\"homePhoneControl\"\n [formControl]=\"homePhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Victim Cell Phone:</mat-label>\n <input\n id=\"tel1\"\n matInput\n phoneMask\n [preValue]=\"editVictim.cellPhone\"\n [phoneControl]=\"cellPhoneControl\"\n [formControl]=\"cellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n\n <mat-form-field >\n <mat-label>Victim Work Phone:</mat-label>\n <input\n id=\"tel2\"\n matInput\n phoneMask\n [preValue]=\"editVictim.workPhone\"\n [phoneControl]=\"workPhoneControl\"\n [formControl]=\"workPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Victim Email:</mat-label>\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n <app-smart-address\n [modifiedBy]=\"staffId\"\n [id]=\"addressId\"\n [outline]=\"true\"\n [showPsa]=\"true\"\n [addressValidators]=\"addressValidators\"\n [readonly]=\"false\"\n (addressIdChange)=\"onAddressChange($event)\"\n #addressComponent >\n\n </app-smart-address>\n\n\n <!-- Docket:\n <div>\n <div *ngFor=\"let docket of docketlist; let i=index\">\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\n </div>\n </div> -->\n <div>\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\n <br>\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\n </div>\n\n </div>\n\n <mat-card>\n <mat-form-field>\n <mat-label> Children in Common</mat-label>\n <br>\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"commonChildrenDivFlag\">\n\n <mat-form-field >\n <mat-label>\n Children number\n </mat-label>\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\n </mat-form-field>\n\n </div>\n\n <mat-form-field>\n <mat-label>CPO: </mat-label>\n <br>\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"cpoExpirationDivFlag\">\n <mat-form-field>\n <mat-label>Expiration Date: </mat-label>\n <input matInput\n [matDatepicker]=\"cpoDateRef\"\n formControlName=\"cpoExpirationDate\"\n (click)=\"cpoDateRef.open()\"\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #cpoDateRef></mat-datepicker>\n </mat-form-field>\n\n </div>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Victim has a Support System in Place? </mat-label>\n <br>\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"supportInPlaceDivFlag\">\n <mat-form-field>\n <mat-label>Support type? </mat-label>\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\n <div (mouseleave)=\"supportSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\n {{item.name}}\n </mat-option>\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n </div>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Weapons Involved?</mat-label>\n <br>\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n\n <div *ngIf=\"weaponInvolvedDivFlag\">\n <mat-form-field>\n <mat-label>Weapon Type</mat-label>\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\n <div (mouseleave)=\"weaponSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\n {{item.name}}\n </mat-option>\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n </div>\n\n <div *ngIf=\"otherWeaponFlag\">\n <mat-form-field>\n <mat-label>Other Weapon:* </mat-label>\n <input matInput formControlName=\"otherWeapon\" >\n </mat-form-field>\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\n <mat-error><strong>Other weapon is required.</strong></mat-error>\n </div>\n </div>\n\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\n <br>\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <br>\n <br>\n\n <mat-form-field>\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\n <br>\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\n </mat-radio-group>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n <div *ngIf=\"drugUseDivFlag\">\n <mat-form-field>\n <mat-label>Drug:</mat-label>\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\n <div (mouseleave)=\"drugSel.close()\">\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\n {{item.name}}\n </mat-option>\n\n </div>\n </mat-select>\n <input matInput placeholder=\"\" style=\"display: none\">\n </mat-form-field>\n\n </div>\n\n <div *ngIf=\"otherDrugFlag\">\n <mat-form-field>\n <mat-label>Other Drug:* </mat-label>\n <input matInput formControlName=\"otherDrug\" >\n </mat-form-field>\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\n <mat-error><strong>Other drug is required.</strong></mat-error>\n </div>\n </div>\n <br>\n <br>\n\n <div>\n <div>\n <mat-label>\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\n </mat-label>\n </div>\n <div>\n\n <mat-slider\n formControlName=\"accessRisk\"\n thumbLabel=\"true\"\n [displayWith]=\"formatLabel\"\n min=\"1\"\n max=\"10\"\n [(ngModel)]=\"editVictim.accessRisk\"\n ></mat-slider>\n\n </div>\n\n </div>\n\n </mat-card>\n\n\n <br><br><br>\n </mat-tab>\n\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\n <div class='container'>\n <mat-form-field>\n <mat-label>Guardian Last Name:</mat-label>\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian First Name:</mat-label>\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian Prefix:</mat-label>\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Guardian Suffix:</mat-label>\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n\n <!-- <mat-form-field>\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field> -->\n\n\n <mat-form-field>\n <mat-label>Date of Birth:</mat-label>\n <input matInput\n [matDatepicker]=\"guardianDateRef\"\n formControlName=\"guardianBirthDate\"\n [(ngModel)]=\"editVictim.guardianBirthDate\"\n (click)=\"guardianDateRef.open()\"\n >\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #guardianDateRef></mat-datepicker>\n </mat-form-field>\n\n <div></div>\n <mat-form-field >\n <mat-checkbox\n color = \"primary\"\n formControlName=\"guardianNoPhoneFlag\">\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\n <input matInput placeholder=\"\" style=\"display: none;\">\n </mat-form-field>\n\n\n <div></div>\n <mat-card>\n <mat-form-field >\n <mat-label>Guardian Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianHomePhone\"\n [phoneControl]=\"guardianHomePhoneControl\"\n [formControl]=\"guardianHomePhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Guardian Cell Phone:</mat-label>\n <input\n id=\"tel4\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianCellPhone\"\n [phoneControl]=\"guardianCellPhoneControl\"\n [formControl]=\"guardianCellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field >\n <mat-label>Guardian Work Phone:</mat-label>\n\n <input\n id=\"tel5\"\n matInput\n phoneMask\n [preValue]=\"editVictim.guardianWorkPhone\"\n [phoneControl]=\"guardianWorkPhoneControl\"\n [formControl]=\"guardianWorkPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n </mat-card>\n\n <div></div>\n\n <mat-form-field>\n <mat-label>Guardian Email:</mat-label>\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n\n <div>\n <app-smart-address\n\n [showPsa]=\"true\"\n [modifiedBy]=\"staffId\"\n [id]=\"guardianAddressId\"\n (addressIdChange)=\"onGuardianAddressChange($event)\"\n [outline]=\"true\"\n readonly=\"false\"\n [rowHeight]=\"80\"\n (isValid)=\"false\"\n [addressValidators]=\"addressValidators\"\n #guardianAddressComponent\n >\n </app-smart-address>\n </div>\n </div>\n\n <br><br><br>\n </mat-tab>\n\n <!--advocate-->\n\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Advocate Last Name:</mat-label>\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate First Name:</mat-label>\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\n </div>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Prefix:</mat-label>\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Suffix:</mat-label>\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n\n <mat-form-field>\n <mat-checkbox\n color = \"primary\"\n formControlName=\"advocateNoPhoneFlag\"\n\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\n <input matInput placeholder=\"\" style=\"display: none;\">\n </mat-form-field>\n\n <div></div>\n <mat-card>\n <mat-form-field >\n <mat-label>Advocate Home Phone:</mat-label>\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateHomePhone\"\n [phoneControl]=\"advocateHomePhoneControl\"\n [formControl]=\"advocateHomePhoneControl\"\n maxlength=\"14\"/>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Cell Phone:</mat-label>\n <input\n id=\"tel7\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateCellPhone\"\n [phoneControl]=\"advocateCellPhoneControl\"\n [formControl]=\"advocateCellPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\n </div>\n\n\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Advocate Work Phone:</mat-label>\n <input\n id=\"tel8\"\n matInput\n phoneMask\n [preValue]=\"editVictim.advocateWorkPhone\"\n [phoneControl]=\"advocateWorkPhoneControl\"\n [formControl]=\"advocateWorkPhoneControl\"\n maxlength=\"14\"/>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\n </div>\n\n </mat-form-field>\n </mat-card>\n\n <div></div>\n\n <mat-form-field>\n <mat-label>Advocate Email:</mat-label>\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n <div></div>\n\n\n <div >\n <app-smart-address\n [showPsa]=\"true\"\n [modifiedBy]=\"staffId\"\n [id]=\"advocateAddressId\"\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\n [outline]=\"true\"\n readonly=\"false\"\n [rowHeight]=\"80\"\n (isValid)=\"false\"\n [addressValidators]=\"addressValidators\"\n #advocateAddressComponent >\n </app-smart-address>\n </div>\n </div>\n <br><br><br>\n </mat-tab>\n\n\n <mat-tab label=\"Emergency Contact\">\n <div class='container'>\n\n <mat-form-field>\n <mat-label>Emergency Contact Name:</mat-label>\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Emergency Phone Number:</mat-label>\n\n <input\n id=\"tel\"\n matInput\n phoneMask\n [preValue]=\"editVictim.emergencyContactPhone\"\n [phoneControl]=\"emergencyContactPhoneControl\"\n [formControl]=\"emergencyContactPhoneControl\"\n maxlength=\"14\"/>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\n </div>\n </mat-form-field>\n\n </div>\n <br><br><br>\n </mat-tab>\n\n </mat-tab-group>\n <div class='outer'>\n <div>\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>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\n <mat-error>Relationship is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\n <mat-error>Victim last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\n <mat-error>victim first name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\n </div>\n\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\n </div>\n\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\n <mat-error>Other drug field is <strong>required</strong></mat-error>\n </div>\n\n\n </div>\n\n <div class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\n </div>\n &nbsp;&nbsp;\n <div *ngIf=\"showDelete\" class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\n </div>\n &nbsp;&nbsp;\n <div class=\"inner\">\n <button mat-raised-button color=\"primary\" (click)=\"cancel()\">Clear </button>\n </div>\n &nbsp;&nbsp;\n <button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n\n </div>\n\n </div>\n <br>\n <br>\n\n <div align=\"right\">\n <button mat-raised-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\n </div>\n\n <div>\n\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"contactDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"victimContactMethod\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"nextContactDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"staff\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"contactId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n\n </div>\n\n </mat-card-content>\n</mat-card>\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"] }]
1701
+ }], ctorParameters: function () { return [{ 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: [{
1702
+ type: Input
1703
+ }], staffId: [{
1704
+ type: Input
1705
+ }], offenderId: [{
1706
+ type: Input
1707
+ }], isIntake: [{
1708
+ type: Input
1709
+ }], onSave: [{
1710
+ type: Output
1711
+ }], onCancel: [{
1712
+ type: Output
1713
+ }], addressComponent: [{
1714
+ type: ViewChild,
1715
+ args: ["addressComponent"]
1716
+ }] } });
1717
+
1718
+ class VictimListFilter {
1719
+ }
1720
+
1721
+ class VictimSearchFormComponent {
1722
+ constructor() {
1723
+ this.onSearch = new EventEmitter();
1724
+ this.change = new EventEmitter();
1725
+ this.filter = new VictimListFilter();
1726
+ }
1727
+ ngOnInit() {
1728
+ }
1729
+ ngAfterViewInit() {
1730
+ // var element = <HTMLInputElement> document.getElementById("victimSearchButton");
1731
+ // element.disabled = true;
1732
+ // setTimeout(function() {
1733
+ // element.disabled = false;
1734
+ // }, 10000);
1735
+ }
1736
+ onChange() {
1737
+ console.log('this.filter in serach form.');
1738
+ console.log(this.filter);
1739
+ this.onSearch.emit(this.filter);
1740
+ }
1741
+ }
1742
+ /** @nocollapse */ VictimSearchFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimSearchFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1743
+ /** @nocollapse */ VictimSearchFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: VictimSearchFormComponent, selector: "app-victim-search-form", outputs: { onSearch: "onSearch" }, ngImport: i0, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\n<mat-expansion-panel [expanded]=\"true\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n Search for Victims\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"victimSearch\">\n <mat-form-field>\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\n </mat-form-field>\n \n \n <section>\n <button id=\"victimSearchButton\" mat-raised-button color=\"primary\" (click)=\"onChange()\">Search</button>\n <span style=\"padding-right: 5px;\"></span>\n <button mat-raised-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\n </section>\n </div>\n </mat-expansion-panel>\n</form>\n\n\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;-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;-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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.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: "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 });
1744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimSearchFormComponent, decorators: [{
1745
+ type: Component,
1746
+ args: [{ selector: 'app-victim-search-form', encapsulation: ViewEncapsulation.None, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\n<mat-expansion-panel [expanded]=\"true\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n Search for Victims\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"victimSearch\">\n <mat-form-field>\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\n </mat-form-field>\n <mat-form-field>\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\n </mat-form-field>\n \n \n <section>\n <button id=\"victimSearchButton\" mat-raised-button color=\"primary\" (click)=\"onChange()\">Search</button>\n <span style=\"padding-right: 5px;\"></span>\n <button mat-raised-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\n </section>\n </div>\n </mat-expansion-panel>\n</form>\n\n\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;-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;-webkit-hyphens:auto;hyphens:auto}\n"] }]
1747
+ }], ctorParameters: function () { return []; }, propDecorators: { onSearch: [{
1748
+ type: Output
1749
+ }] } });
1750
+
1751
+ class NgcSmartVictimComponent {
1752
+ constructor(dialog, victimService, router, route, snackBar, intakeService, smartWarrantUrl, document) {
1753
+ this.dialog = dialog;
1754
+ this.victimService = victimService;
1755
+ this.router = router;
1756
+ this.route = route;
1757
+ this.snackBar = snackBar;
1758
+ this.intakeService = intakeService;
1759
+ this.smartWarrantUrl = smartWarrantUrl;
1760
+ this.document = document;
1761
+ this.appModuleId = '';
1762
+ this.activatedRoute = null;
1763
+ this.victims = [];
1764
+ this.victimDetail = {};
1765
+ this.showDetail = false;
1766
+ this.victimListFilter = new VictimListFilter$1();
1767
+ this.victimListDataSource = new MatTableDataSource();
1768
+ this.doSpin = false;
1769
+ this.showListFlag = false;
1770
+ this.msg = "";
1771
+ this.isIntake = false;
1772
+ }
1773
+ // private onChange(filter: VictimListFilter) {
1774
+ // console.log('filter in onchange');
1775
+ // console.log(filter);
1776
+ // this.getVictimList(filter);
1777
+ // }
1778
+ applyFilter(filterValue) {
1779
+ this.victimListDataSource.filter = filterValue.trim().toLowerCase();
1780
+ }
1781
+ addRecord() {
1782
+ this.showDetail = true;
1783
+ this.showAdd = false;
1784
+ this.victimDetail = null;
1785
+ this.showListFlag = false;
1786
+ }
1787
+ editVictimDetail(record) {
1788
+ console.log("victim edit record");
1789
+ console.log(record);
1790
+ console.log(record.victimId);
1791
+ this.victimDetail = record;
1792
+ this.showDetail = true;
1793
+ this.showAdd = false;
1794
+ this.showListFlag = false;
1795
+ }
1796
+ save(detail) {
1797
+ this.showDetail = false;
1798
+ this.showAdd = true;
1799
+ this.showListFlag = true;
1800
+ }
1801
+ cancel() {
1802
+ this.showDetail = false;
1803
+ this.victimDetail = {};
1804
+ }
1805
+ ngAfterViewInit() {
1806
+ this.victimListDataSource.paginator = this.paginator;
1807
+ this.victimListDataSource.sort = this.sort;
1808
+ }
1809
+ ngOnChanges() {
1810
+ this.updateAccessControlConfig = {
1811
+ accessType: AccessType.UPDATE,
1812
+ appModuleId: this.appModuleId,
1813
+ roleId: null,
1814
+ route: this.activatedRoute.snapshot,
1815
+ };
1816
+ this.createAccessControlConfig = {
1817
+ accessType: AccessType.CREATE,
1818
+ appModuleId: this.appModuleId,
1819
+ roleId: null,
1820
+ route: this.activatedRoute.snapshot,
1821
+ };
1822
+ this.deleteAccessControlConfig = {
1823
+ accessType: AccessType.DELETE,
1824
+ appModuleId: this.appModuleId,
1825
+ roleId: null,
1826
+ route: this.activatedRoute.snapshot,
1827
+ };
1828
+ }
1829
+ ngOnInit() {
1830
+ const queryParams = this.route.snapshot.queryParams;
1831
+ if (queryParams['routeTo']) {
1832
+ this.router.navigate([queryParams['routeTo']]);
1833
+ }
1834
+ var data = this.route.snapshot.data;
1835
+ var myPath = this.router.url.slice(-10);
1836
+ console.log("offender id at smart-victim");
1837
+ console.log(this.offenderId);
1838
+ console.log("staff id at smart-victim");
1839
+ console.log(this.staffId);
1840
+ console.log("insakeFlag at smart-victim");
1841
+ console.log(this.intakeFlag);
1842
+ console.log("smart-victim ngOnInit");
1843
+ console.log(this.intakeFlag);
1844
+ console.log(myPath);
1845
+ if (this.intakeFlag == "true") {
1846
+ this.isIntake = true;
1847
+ }
1848
+ this.displayedColumns = ["lastName", "firstName"];
1849
+ if (this.showRelationshipColumn == true ||
1850
+ myPath == "victimList" ||
1851
+ myPath == "victimHome") {
1852
+ this.displayedColumns.push("relationship");
1853
+ }
1854
+ if (this.showOffenderNameColumn == true) {
1855
+ this.displayedColumns.push("offenderName");
1856
+ }
1857
+ if (this.showOffenderPhoneColumn == true ||
1858
+ myPath == "victimList" ||
1859
+ myPath == "victimHome") {
1860
+ this.displayedColumns.push("homePhone");
1861
+ }
1862
+ this.displayedColumns.push("victimId");
1863
+ if (this.showSearchForm == true) {
1864
+ this.showListFlag = false;
1865
+ }
1866
+ console.log("this.showSearchForm");
1867
+ console.log(this.showSearchForm);
1868
+ console.log("myPath");
1869
+ console.log(myPath);
1870
+ if (this.showSearchForm == false ||
1871
+ myPath == "victimList" ||
1872
+ myPath == "victimHome") {
1873
+ var myOffenderId;
1874
+ if (this.offenderId) {
1875
+ myOffenderId = this.offenderId;
1876
+ }
1877
+ else {
1878
+ console.log("back from previous page");
1879
+ this.showAdd = true;
1880
+ this.showRelationshipColumn = true;
1881
+ //this.displayedColumns.push("relationship");
1882
+ this.showOffenderPhoneColumn = true;
1883
+ // this.displayedColumns.push("homePhone");
1884
+ this.accessByModule = "true";
1885
+ this.showEdit = "true";
1886
+ this.showCaseNote = "true";
1887
+ this.showSafetyPlan = "true";
1888
+ myOffenderId = data.selectedOffender.offenderId;
1889
+ }
1890
+ const victimListFilter = {
1891
+ offenderId: myOffenderId,
1892
+ lastName: null,
1893
+ firstName: null,
1894
+ pdid: null,
1895
+ birthDate: null,
1896
+ };
1897
+ console.log("victimListFilter in smar-victim componenet");
1898
+ console.log(victimListFilter);
1899
+ this.victimService
1900
+ .getVictimListByFilter(victimListFilter)
1901
+ .subscribe((data) => {
1902
+ this.victims = data;
1903
+ this.victimListDataSource.data = data;
1904
+ console.log("victim data at line 245");
1905
+ console.log(this.victims);
1906
+ console.log("showListFlag");
1907
+ console.log(this.showListFlag);
1908
+ this.showListFlag = true;
1909
+ if (data.length == 0) {
1910
+ this.msg = "No Record Found!";
1911
+ }
1912
+ });
1913
+ }
1914
+ else {
1915
+ console.log("find filter");
1916
+ console.log(this.victimListFilter);
1917
+ if (this.showListFlag === true) {
1918
+ if (this.victimListFilter != null) {
1919
+ this.victimService
1920
+ .getVictimListByFilter(this.victimListFilter)
1921
+ .subscribe((data) => {
1922
+ this.victims = data;
1923
+ this.victimListDataSource.data = data;
1924
+ console.log("victim data at line 279");
1925
+ console.log(data);
1926
+ });
1927
+ }
1928
+ }
1929
+ }
1930
+ }
1931
+ // phone number format on the victim list
1932
+ formatPhoneNumber(phoneNumberString) {
1933
+ if (!phoneNumberString)
1934
+ return "";
1935
+ var cleaned = ("" + phoneNumberString).replace(/\D/g, "");
1936
+ var match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
1937
+ if (match) {
1938
+ return "(" + match[1] + ") " + match[2] + "-" + match[3];
1939
+ }
1940
+ return "";
1941
+ }
1942
+ saveIntake() {
1943
+ if (!this.isIntake) {
1944
+ return;
1945
+ }
1946
+ const intakeStep = {
1947
+ intakeStepId: IntakeStep.VictimInformation,
1948
+ offenderId: this.offenderId,
1949
+ modifiedBy: this.staffId,
1950
+ };
1951
+ this.intakeService
1952
+ .updateIntakeSteps(this.offenderId, intakeStep)
1953
+ .subscribe((res) => {
1954
+ console.log("save intake step.");
1955
+ this.snackBar.open("Status Saved.", "", {
1956
+ duration: 3000,
1957
+ });
1958
+ //this.router.navigate(['/warrant '], { queryParams: { intake: 1 } });
1959
+ this.document.location.href =
1960
+ `${this.smartWarrantUrl}/?offenderId=${this.offenderId}&intakeFlag=${this.isIntake}&routeTo=warrant`;
1961
+ });
1962
+ }
1963
+ goToCaseNote(victimId) {
1964
+ this.router.navigate(["casenote", victimId, this.offenderId]);
1965
+ }
1966
+ goToSaftyPlan(victimId) {
1967
+ this.router.navigate(["saftyPlan", victimId]);
1968
+ }
1969
+ getVictimList(filter) {
1970
+ this.victimListFilter = filter;
1971
+ console.log("this.victimListFilter inside getVictimList");
1972
+ console.log(this.victimListFilter);
1973
+ this.doSpin = true;
1974
+ this.victimService.getVictimListByFilter(filter).subscribe((data) => {
1975
+ this.doSpin = !this.doSpin;
1976
+ if (data.length > 0) {
1977
+ this.showListFlag = true;
1978
+ this.victimListDataSource.data = data;
1979
+ }
1980
+ else {
1981
+ this.msg = "No record found!";
1982
+ }
1983
+ }, (err) => {
1984
+ this.doSpin = !this.doSpin;
1985
+ });
1986
+ }
1987
+ }
1988
+ /** @nocollapse */ NgcSmartVictimComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
1989
+ /** @nocollapse */ NgcSmartVictimComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.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\">\n <app-victim-search-form\n (onSearch)=\"getVictimList($event)\">\n </app-victim-search-form>\n</div>\n\n<div *ngIf=\"showDetail\">\n <csmart-victim-detail [victimDetail]=\"victimDetail\" \n [staffId]=\"staffId\"\n [offenderId] =\"offenderId\"\n [isIntake]=\"isIntake\"\n (onSave)=\"save($event)\" \n (onCancel)=\"cancel()\" >\n</csmart-victim-detail>\n</div>\n<div class=\"main-container\">\n \n <div class=\"add-action\" *ngIf=\"showAdd\">\n <button mat-raised-button color=\"primary\" \n accessControl\n [accessControlConfig]=\"createAccessControlConfig\" \n (click)=\"addRecord()\">\n <mat-icon>add</mat-icon>\n Add Victim\n </button>\n &nbsp;&nbsp;\n\n <div *ngIf=\"isIntake\">\n <button \n mat-raised-button \n color=\"primary\" \n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"saveIntake()\">\n Continue\n </button> \n </div>\n\n </div>\n <div *ngIf=\"showListFlag\">\n <mat-card id=\"divVictim\" >\n <mat-card-content >\n <mat-table #table [dataSource]=\"victimListDataSource\" >\n\n <ng-container matColumnDef=\"lastName\">\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"firstName\">\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\n </ng-container>\n \n <div *ngIf=\"showRelationshipColumn\">\n <ng-container matColumnDef=\"relationship\">\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\n </ng-container>\n </div>\n\n <div *ngIf=\"showOffenderPhoneColumn\">\n <ng-container matColumnDef=\"homePhone\">\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > \n Home phone: {{formatPhoneNumber(row.homePhone)}}<br> \n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\n Work Phone: {{formatPhoneNumber(row.workPhone)}} \n\n </mat-cell>\n </ng-container>\n </div>\n \n <div *ngIf=\"showOffenderNameColumn\">\n <ng-container matColumnDef=\"offenderName\">\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\n </ng-container>\n </div>\n \n <ng-container matColumnDef=\"victimId\">\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" >\n \n <!-- <div *ngIf=\"accessByModule\">\n <mat-checkbox></mat-checkbox>\n </div> -->\n \n <div *ngIf=\"showEdit\">\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"editVictimDetail(row)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n </div>\n\n \n\n &nbsp;&nbsp; \n\n <div *ngIf=\"showCaseNote\">\n <button type=\"button\" matTooltip=\"CaseNote\" mat-raised-button color=\"primary\" \n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"goToCaseNote(row.victimId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\n </button> \n </div>\n &nbsp;&nbsp;\n \n <div *ngIf=\"showSafetyPlan\">\n <button type=\"button\" matTooltip=\"safety plan\" mat-raised-button color=\"primary\"\n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"goToSaftyPlan(row.victimId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\n </button>\n </div>\n &nbsp;&nbsp;\n \n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\n </mat-table>\n\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator> \n </mat-card-content>\n </mat-card>\n </div>\n\n <div>\n <b>{{msg}}</b>\n </div>\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;-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;-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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { 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: ["disabled"], 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: ["sticky", "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"] }] });
1990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimComponent, decorators: [{
1991
+ type: Component,
1992
+ args: [{ selector: "csmart-victim", template: "<div *ngIf=\"showSearchForm\">\n <app-victim-search-form\n (onSearch)=\"getVictimList($event)\">\n </app-victim-search-form>\n</div>\n\n<div *ngIf=\"showDetail\">\n <csmart-victim-detail [victimDetail]=\"victimDetail\" \n [staffId]=\"staffId\"\n [offenderId] =\"offenderId\"\n [isIntake]=\"isIntake\"\n (onSave)=\"save($event)\" \n (onCancel)=\"cancel()\" >\n</csmart-victim-detail>\n</div>\n<div class=\"main-container\">\n \n <div class=\"add-action\" *ngIf=\"showAdd\">\n <button mat-raised-button color=\"primary\" \n accessControl\n [accessControlConfig]=\"createAccessControlConfig\" \n (click)=\"addRecord()\">\n <mat-icon>add</mat-icon>\n Add Victim\n </button>\n &nbsp;&nbsp;\n\n <div *ngIf=\"isIntake\">\n <button \n mat-raised-button \n color=\"primary\" \n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"saveIntake()\">\n Continue\n </button> \n </div>\n\n </div>\n <div *ngIf=\"showListFlag\">\n <mat-card id=\"divVictim\" >\n <mat-card-content >\n <mat-table #table [dataSource]=\"victimListDataSource\" >\n\n <ng-container matColumnDef=\"lastName\">\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"firstName\">\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\n </ng-container>\n \n <div *ngIf=\"showRelationshipColumn\">\n <ng-container matColumnDef=\"relationship\">\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\n </ng-container>\n </div>\n\n <div *ngIf=\"showOffenderPhoneColumn\">\n <ng-container matColumnDef=\"homePhone\">\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > \n Home phone: {{formatPhoneNumber(row.homePhone)}}<br> \n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\n Work Phone: {{formatPhoneNumber(row.workPhone)}} \n\n </mat-cell>\n </ng-container>\n </div>\n \n <div *ngIf=\"showOffenderNameColumn\">\n <ng-container matColumnDef=\"offenderName\">\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\n </ng-container>\n </div>\n \n <ng-container matColumnDef=\"victimId\">\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" >\n \n <!-- <div *ngIf=\"accessByModule\">\n <mat-checkbox></mat-checkbox>\n </div> -->\n \n <div *ngIf=\"showEdit\">\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"editVictimDetail(row)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n </div>\n\n \n\n &nbsp;&nbsp; \n\n <div *ngIf=\"showCaseNote\">\n <button type=\"button\" matTooltip=\"CaseNote\" mat-raised-button color=\"primary\" \n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"goToCaseNote(row.victimId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\n </button> \n </div>\n &nbsp;&nbsp;\n \n <div *ngIf=\"showSafetyPlan\">\n <button type=\"button\" matTooltip=\"safety plan\" mat-raised-button color=\"primary\"\n accessControl\n [accessControlConfig]=\"updateAccessControlConfig\" \n (click)=\"goToSaftyPlan(row.victimId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\n </button>\n </div>\n &nbsp;&nbsp;\n \n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\n </mat-table>\n\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator> \n </mat-card-content>\n </mat-card>\n </div>\n\n <div>\n <b>{{msg}}</b>\n </div>\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;-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;-webkit-hyphens:auto;hyphens:auto}\n"] }]
1993
+ }], ctorParameters: function () {
1994
+ return [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i5.Router }, { type: i5.ActivatedRoute }, { type: i4.MatSnackBar }, { type: IntakeServicesComponent }, { type: undefined, decorators: [{
1995
+ type: Inject,
1996
+ args: [SMART_WARRANT_URL]
1997
+ }] }, { type: undefined, decorators: [{
1998
+ type: Inject,
1999
+ args: [DOCUMENT]
2000
+ }] }];
2001
+ }, propDecorators: { offenderId: [{
2002
+ type: Input
2003
+ }], staffId: [{
2004
+ type: Input
2005
+ }], staffRole: [{
2006
+ type: Input
2007
+ }], showCaseNote: [{
2008
+ type: Input
2009
+ }], showSafetyPlan: [{
2010
+ type: Input
2011
+ }], showAdd: [{
2012
+ type: Input
2013
+ }], showEdit: [{
2014
+ type: Input
2015
+ }], showRelationshipColumn: [{
2016
+ type: Input
2017
+ }], showOffenderNameColumn: [{
2018
+ type: Input
2019
+ }], showOffenderPhoneColumn: [{
2020
+ type: Input
2021
+ }], showSearchForm: [{
2022
+ type: Input
2023
+ }], accessByModule: [{
2024
+ type: Input
2025
+ }], intakeFlag: [{
2026
+ type: Input
2027
+ }], appModuleId: [{
2028
+ type: Input
2029
+ }], activatedRoute: [{
2030
+ type: Input
2031
+ }], paginator: [{
2032
+ type: ViewChild,
2033
+ args: [MatPaginator]
2034
+ }], sort: [{
2035
+ type: ViewChild,
2036
+ args: [MatSort]
2037
+ }] } });
2038
+
2039
+ class SmartVictimDeleteConfirmComponent {
2040
+ constructor(dialogRef, data) {
2041
+ this.dialogRef = dialogRef;
2042
+ this.data = data;
2043
+ }
2044
+ onNoClick() {
2045
+ this.dialogRef.close();
2046
+ }
2047
+ ngOnInit() {
2048
+ }
2049
+ }
2050
+ /** @nocollapse */ SmartVictimDeleteConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2051
+ /** @nocollapse */ SmartVictimDeleteConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SmartVictimDeleteConfirmComponent, selector: "csmart-victim-delete-confirm", ngImport: i0, template: `
2052
+ <h1 mat-dialog-title>Delete Confirmation</h1>
2053
+ <div mat-dialog-content>
2054
+ <p>Are you sure you want to delete this item?</p>
2055
+ </div>
2056
+ <div mat-dialog-actions class="actions">
2057
+ <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2058
+ <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2059
+ </div>
2060
+ `, 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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], 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.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
2061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, decorators: [{
2062
+ type: Component,
2063
+ args: [{ selector: 'csmart-victim-delete-confirm', template: `
2064
+ <h1 mat-dialog-title>Delete Confirmation</h1>
2065
+ <div mat-dialog-content>
2066
+ <p>Are you sure you want to delete this item?</p>
2067
+ </div>
2068
+ <div mat-dialog-actions class="actions">
2069
+ <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2070
+ <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2071
+ </div>
2072
+ `, styles: [".actions{display:flex;justify-content:space-between}\n"] }]
2073
+ }], ctorParameters: function () {
2074
+ return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
2075
+ type: Inject,
2076
+ args: [MAT_DIALOG_DATA]
2077
+ }] }];
2078
+ } });
2079
+
2080
+ class SharedModule {
2081
+ }
2082
+ /** @nocollapse */ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2083
+ /** @nocollapse */ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2084
+ MatCardModule,
2085
+ MatCheckboxModule,
2086
+ MatToolbarModule,
2087
+ MatSelectModule,
2088
+ MatDatepickerModule,
2089
+ MatNativeDateModule,
2090
+ MatDialogModule,
2091
+ MatTabsModule,
2092
+ MatListModule,
2093
+ MatInputModule,
2094
+ MatStepperModule,
2095
+ BrowserAnimationsModule,
2096
+ MatGridListModule,
2097
+ MatProgressSpinnerModule,
2098
+ MatTableModule,
2099
+ MatSidenavModule,
2100
+ MatRadioModule,
2101
+ MatIconModule,
2102
+ MatSliderModule,
2103
+ MatChipsModule,
2104
+ MatSnackBarModule,
2105
+ CdkTableModule,
2106
+ MatSortModule,
2107
+ MatPaginatorModule,
2108
+ MatExpansionModule,
2109
+ MatRippleModule,
2110
+ SmartUiModule], exports: [MatButtonModule,
2111
+ MatCardModule,
2112
+ MatCheckboxModule,
2113
+ MatToolbarModule,
2114
+ MatSelectModule,
2115
+ MatDatepickerModule,
2116
+ MatNativeDateModule,
2117
+ MatDialogModule,
2118
+ MatTabsModule,
2119
+ MatListModule,
2120
+ MatInputModule,
2121
+ MatStepperModule,
2122
+ BrowserAnimationsModule,
2123
+ MatGridListModule,
2124
+ MatProgressSpinnerModule,
2125
+ MatTableModule,
2126
+ MatSidenavModule,
2127
+ MatRadioModule,
2128
+ MatIconModule,
2129
+ MatSliderModule,
2130
+ MatChipsModule,
2131
+ MatSnackBarModule,
2132
+ CdkTableModule,
2133
+ MatSortModule,
2134
+ MatPaginatorModule,
2135
+ MatExpansionModule,
2136
+ MatRippleModule,
2137
+ SmartUiModule] });
2138
+ /** @nocollapse */ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2139
+ MatCardModule,
2140
+ MatCheckboxModule,
2141
+ MatToolbarModule,
2142
+ MatSelectModule,
2143
+ MatDatepickerModule,
2144
+ MatNativeDateModule,
2145
+ MatDialogModule,
2146
+ MatTabsModule,
2147
+ MatListModule,
2148
+ MatInputModule,
2149
+ MatStepperModule,
2150
+ BrowserAnimationsModule,
2151
+ MatGridListModule,
2152
+ MatProgressSpinnerModule,
2153
+ MatTableModule,
2154
+ MatSidenavModule,
2155
+ MatRadioModule,
2156
+ MatIconModule,
2157
+ MatSliderModule,
2158
+ MatChipsModule,
2159
+ MatSnackBarModule,
2160
+ CdkTableModule,
2161
+ MatSortModule,
2162
+ MatPaginatorModule,
2163
+ MatExpansionModule,
2164
+ MatRippleModule,
2165
+ SmartUiModule, MatButtonModule,
2166
+ MatCardModule,
2167
+ MatCheckboxModule,
2168
+ MatToolbarModule,
2169
+ MatSelectModule,
2170
+ MatDatepickerModule,
2171
+ MatNativeDateModule,
2172
+ MatDialogModule,
2173
+ MatTabsModule,
2174
+ MatListModule,
2175
+ MatInputModule,
2176
+ MatStepperModule,
2177
+ BrowserAnimationsModule,
2178
+ MatGridListModule,
2179
+ MatProgressSpinnerModule,
2180
+ MatTableModule,
2181
+ MatSidenavModule,
2182
+ MatRadioModule,
2183
+ MatIconModule,
2184
+ MatSliderModule,
2185
+ MatChipsModule,
2186
+ MatSnackBarModule,
2187
+ CdkTableModule,
2188
+ MatSortModule,
2189
+ MatPaginatorModule,
2190
+ MatExpansionModule,
2191
+ MatRippleModule,
2192
+ SmartUiModule] });
2193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SharedModule, decorators: [{
2194
+ type: NgModule,
2195
+ args: [{
2196
+ imports: [
2197
+ MatButtonModule,
2198
+ MatCardModule,
2199
+ MatCheckboxModule,
2200
+ MatToolbarModule,
2201
+ MatSelectModule,
2202
+ MatDatepickerModule,
2203
+ MatNativeDateModule,
2204
+ MatDialogModule,
2205
+ MatTabsModule,
2206
+ MatListModule,
2207
+ MatInputModule,
2208
+ MatStepperModule,
2209
+ BrowserAnimationsModule,
2210
+ MatGridListModule,
2211
+ MatProgressSpinnerModule,
2212
+ MatTableModule,
2213
+ MatSidenavModule,
2214
+ MatRadioModule,
2215
+ MatIconModule,
2216
+ MatSliderModule,
2217
+ MatChipsModule,
2218
+ MatSnackBarModule,
2219
+ CdkTableModule,
2220
+ MatSortModule,
2221
+ MatPaginatorModule,
2222
+ MatExpansionModule,
2223
+ MatRippleModule,
2224
+ SmartUiModule
2225
+ ],
2226
+ exports: [
2227
+ MatButtonModule,
2228
+ MatCardModule,
2229
+ MatCheckboxModule,
2230
+ MatToolbarModule,
2231
+ MatSelectModule,
2232
+ MatDatepickerModule,
2233
+ MatNativeDateModule,
2234
+ MatDialogModule,
2235
+ MatTabsModule,
2236
+ MatListModule,
2237
+ MatInputModule,
2238
+ MatStepperModule,
2239
+ BrowserAnimationsModule,
2240
+ MatGridListModule,
2241
+ MatProgressSpinnerModule,
2242
+ MatTableModule,
2243
+ MatSidenavModule,
2244
+ MatRadioModule,
2245
+ MatIconModule,
2246
+ MatSliderModule,
2247
+ MatChipsModule,
2248
+ MatSnackBarModule,
2249
+ CdkTableModule,
2250
+ MatSortModule,
2251
+ MatPaginatorModule,
2252
+ MatExpansionModule,
2253
+ MatRippleModule,
2254
+ SmartUiModule
2255
+ ]
2256
+ }]
2257
+ }] });
2258
+
2259
+ class CommonDialogModule {
2260
+ }
2261
+ /** @nocollapse */ CommonDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2262
+ /** @nocollapse */ CommonDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogModule, declarations: [CommonDialogComponent], imports: [
2263
+ // MaterialModule.forRoot(),
2264
+ SharedModule
2265
+ ], exports: [CommonDialogComponent] });
2266
+ /** @nocollapse */ CommonDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogModule, providers: [
2267
+ CommonDialogComponent,
2268
+ ], imports: [
2269
+ // MaterialModule.forRoot(),
2270
+ SharedModule
2271
+ ] });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonDialogModule, decorators: [{
2273
+ type: NgModule,
2274
+ args: [{
2275
+ imports: [
2276
+ // MaterialModule.forRoot(),
2277
+ SharedModule
2278
+ ],
2279
+ exports: [
2280
+ CommonDialogComponent,
2281
+ ],
2282
+ declarations: [
2283
+ CommonDialogComponent,
2284
+ ],
2285
+ providers: [
2286
+ CommonDialogComponent,
2287
+ ]
2288
+ }]
2289
+ }] });
2290
+
2291
+ function dateValidator() {
2292
+ return (control) => {
2293
+ const dateStr = control.value;
2294
+ const invalidObj = { 'date': 'future Date is Not Allowed' };
2295
+ const date = new Date(dateStr);
2296
+ if (date > new Date()) {
2297
+ return invalidObj;
2298
+ }
2299
+ return null;
2300
+ };
2301
+ }
2302
+ function passDateValidator() {
2303
+ return (control) => {
2304
+ const dateStr = control.value;
2305
+ const invalidObj = { 'date': 'Pass Date is Not Allowed' };
2306
+ const date = new Date(dateStr);
2307
+ if (date < new Date()) {
2308
+ return invalidObj;
2309
+ }
2310
+ return null;
2311
+ };
2312
+ }
2313
+ function dateLessThan(dateField1, dateField2, validatorField) {
2314
+ return (c) => {
2315
+ const date1 = c.get(dateField1).value;
2316
+ const date2 = c.get(dateField2).value;
2317
+ console.log('date1');
2318
+ console.log(date1);
2319
+ console.log('date2');
2320
+ console.log(date2);
2321
+ //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2322
+ if ((date1 !== null && date2 !== null) && date1 > date2) {
2323
+ console.log(validatorField);
2324
+ return validatorField;
2325
+ //return invalidObj;
2326
+ }
2327
+ console.log('return null');
2328
+ return null;
2329
+ };
2330
+ }
2331
+ function greaterLessThan(dateField1, dateField2, validatorField) {
2332
+ return (c) => {
2333
+ const date1 = c.get(dateField1).value;
2334
+ const date2 = c.get(dateField2).value;
2335
+ console.log('end date');
2336
+ console.log(date1);
2337
+ console.log('ver date');
2338
+ console.log(date2);
2339
+ //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2340
+ if ((date1 !== null && date2 !== null) && date1 < date2) {
2341
+ console.log(validatorField);
2342
+ return validatorField;
2343
+ //return invalidObj;
2344
+ }
2345
+ console.log('return null');
2346
+ return null;
2347
+ };
2348
+ }
2349
+
2350
+ class EmailService {
2351
+ constructor(apollo) {
2352
+ this.apollo = apollo;
2353
+ }
2354
+ createCaseNoteEmail(templateId, offenderId, modifiedBy) {
2355
+ return this.createEmail(templateId, `{\\"offenderId\\": ${offenderId}}`, modifiedBy);
2356
+ }
2357
+ createEmail(emailTemplateId, parameters, modifiedBy) {
2358
+ const mutation = `mutation {
2359
+ createEmail(input: {
2360
+ emailTemplateId: "${emailTemplateId}"
2361
+ parameters: "${parameters}"
2362
+ modifiedBy: ${modifiedBy}
2363
+ }) {
2364
+ message
2365
+ data {
2366
+ emailQueueId
2367
+ }
2368
+ }
2369
+ }`;
2370
+ console.log(mutation);
2371
+ return this.apollo.mutate({
2372
+ mutation: gql `
2373
+ ${mutation}
2374
+ `,
2375
+ });
2376
+ }
2377
+ }
2378
+ /** @nocollapse */ EmailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EmailService, deps: [{ token: i2.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
2379
+ /** @nocollapse */ EmailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EmailService, providedIn: 'root' });
2380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EmailService, decorators: [{
2381
+ type: Injectable,
2382
+ args: [{
2383
+ providedIn: 'root',
2384
+ }]
2385
+ }], ctorParameters: function () { return [{ type: i2.Apollo }]; } });
2386
+
2387
+ class CaseNoteComponent {
2388
+ constructor(formBuilder, _victimServicesComponent, commonDialogService, snackBar, route, router, smartAuthService, emailService) {
2389
+ this.formBuilder = formBuilder;
2390
+ this._victimServicesComponent = _victimServicesComponent;
2391
+ this.commonDialogService = commonDialogService;
2392
+ this.snackBar = snackBar;
2393
+ this.route = route;
2394
+ this.router = router;
2395
+ this.smartAuthService = smartAuthService;
2396
+ this.emailService = emailService;
2397
+ this.editCaseNote = {};
2398
+ this.caseNoteDataSource = new MatTableDataSource();
2399
+ this.initForm();
2400
+ }
2401
+ initForm() {
2402
+ this.caseNoteForm = this.formBuilder.group({
2403
+ caseNoteDate: new UntypedFormControl('', Validators.compose([
2404
+ Validators.required, dateValidator()
2405
+ ])),
2406
+ contactType: new UntypedFormControl('', Validators.required),
2407
+ contactPurpose: new UntypedFormControl('', Validators.required),
2408
+ comment: new UntypedFormControl('', Validators.required)
2409
+ });
2410
+ this.caseNoteForm.markAsPristine();
2411
+ this.caseNoteForm.markAsUntouched();
2412
+ }
2413
+ ngAfterViewInit() {
2414
+ this.smartAuthService.setPermission('Victim', this.route.snapshot);
2415
+ }
2416
+ ngOnInit() {
2417
+ var data = this.route.snapshot.data;
2418
+ this.loginStaff = data.loginStaff;
2419
+ this.staffId = this.loginStaff.staffId;
2420
+ this.sub = this.route.params.subscribe(params => {
2421
+ this.victimId = params['victimId'];
2422
+ this.offenderId = params['offenderId'];
2423
+ });
2424
+ this.addDisableFlag = false;
2425
+ this.hiddenDetailFlag = true;
2426
+ this.hiddenAddNewFlag = false;
2427
+ this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
2428
+ this.victimName = items.firstName + ', ' + items.lastName;
2429
+ });
2430
+ this._victimServicesComponent.getContactTypes().subscribe((items) => {
2431
+ this.contactTypes = items;
2432
+ });
2433
+ this._victimServicesComponent.getVictimContactPurposes().subscribe((items) => {
2434
+ this.contactPurposes = items;
2435
+ });
2436
+ this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2437
+ console.log('caseNoteList');
2438
+ console.log(caseNoteList);
2439
+ this.caseNoteList = caseNoteList;
2440
+ this.caseNoteDataSource.data = this.caseNoteList;
2441
+ });
2442
+ // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2443
+ // (itms: any) => {
2444
+ // const ELEMENT_DATA: Element[] = itms;
2445
+ // this.caseNoteDataSource.data = ELEMENT_DATA;
2446
+ // })
2447
+ }
2448
+ onEditCaseNote(victimCaseNoteId) {
2449
+ this.hiddenDetailFlag = false;
2450
+ this.hiddenAddNewFlag = true;
2451
+ this.addDisableFlag = true;
2452
+ this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2453
+ }
2454
+ onDeleteCaseNote(victimCaseNoteId) {
2455
+ this.commonDialogService
2456
+ .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2457
+ .subscribe(res => {
2458
+ this.result = res;
2459
+ if (this.result) {
2460
+ this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2461
+ .subscribe(result => {
2462
+ this.snackBar.open('delete Successfully !', '', { duration: 3000, });
2463
+ this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2464
+ this.caseNoteList = caseNoteList;
2465
+ this.caseNoteDataSource.data = this.caseNoteList;
2466
+ });
2467
+ });
2468
+ }
2469
+ });
2470
+ }
2471
+ onAddNew() {
2472
+ this.hiddenDetailFlag = false;
2473
+ this.editCaseNote.victimCaseNoteId = 0;
2474
+ const caseNoteDateControl = this.caseNoteForm.get('caseNoteDate');
2475
+ caseNoteDateControl.setValue(null);
2476
+ caseNoteDateControl.setErrors(null);
2477
+ caseNoteDateControl.markAsPristine();
2478
+ caseNoteDateControl.markAsPristine();
2479
+ const contactTypeControl = this.caseNoteForm.get('contactType');
2480
+ contactTypeControl.setValue(null);
2481
+ contactTypeControl.setErrors(null);
2482
+ contactTypeControl.markAsPristine();
2483
+ contactTypeControl.markAsUntouched();
2484
+ const contactPurposeControl = this.caseNoteForm.get('contactPurpose');
2485
+ contactPurposeControl.setValue(null);
2486
+ contactPurposeControl.setErrors(null);
2487
+ contactPurposeControl.markAsPristine();
2488
+ contactPurposeControl.markAsUntouched();
2489
+ const commentControl = this.caseNoteForm.get('comment');
2490
+ commentControl.setValue(null);
2491
+ commentControl.setErrors(null);
2492
+ commentControl.markAsPristine();
2493
+ commentControl.markAsUntouched();
2494
+ }
2495
+ back() {
2496
+ this.router.navigate(['victimHome']);
2497
+ }
2498
+ saveCaseNote() {
2499
+ this.emailService
2500
+ .createCaseNoteEmail("VictimCaseNoteReminders", this.offenderId, this.staffId)
2501
+ .subscribe();
2502
+ if (this.editCaseNote.victimCaseNoteId === undefined || this.editCaseNote.victimCaseNoteId === 0) {
2503
+ const castNote = {
2504
+ victimId: this.victimId,
2505
+ victimCaseNoteId: 0,
2506
+ caseNoteDate: this.editCaseNote.caseNoteDate,
2507
+ contactTypeId: this.editCaseNote.contactTypeId,
2508
+ contactType: null,
2509
+ victimContactPurposeId: this.editCaseNote.victimContactPurposeId,
2510
+ victimContactPurpose: null,
2511
+ comment: this.editCaseNote.comment,
2512
+ modifiedBy: this.staffId,
2513
+ victimFirstName: null,
2514
+ victimLastName: null
2515
+ };
2516
+ this._victimServicesComponent.addCaseNote(castNote).subscribe(result => {
2517
+ this.snackBar.open('Saved Successfully !', '', {
2518
+ duration: 3000,
2519
+ });
2520
+ // this._victimServicesComponent.sendEmail('', {referralId: 0, offenderId: this.offenderId }, this.loginStaff.staffId);
2521
+ this.hiddenDetailFlag = true;
2522
+ this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2523
+ this.caseNoteList = caseNoteList;
2524
+ this.caseNoteDataSource.data = this.caseNoteList;
2525
+ });
2526
+ });
2527
+ }
2528
+ else {
2529
+ this._victimServicesComponent.updateCaseNote(this.editCaseNote).subscribe(result => {
2530
+ this.snackBar.open('Update Successfully !', '', {
2531
+ duration: 3000,
2532
+ });
2533
+ this.hiddenDetailFlag = true;
2534
+ this.hiddenAddNewFlag = false;
2535
+ this.addDisableFlag = false;
2536
+ this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2537
+ this.caseNoteList = caseNoteList;
2538
+ this.caseNoteDataSource.data = this.caseNoteList;
2539
+ });
2540
+ });
2541
+ }
2542
+ //email
2543
+ }
2544
+ }
2545
+ /** @nocollapse */ CaseNoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
2546
+ /** @nocollapse */ CaseNoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CaseNoteComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\n <mat-card>\n <mat-card-header>\n\n </mat-card-header>\n <mat-card-content>\n \n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" >Case Note</h4>\n </mat-toolbar>\n <br>\n <div class=\"row\" >\n <div [hidden]=\"hiddenAddNewFlag\">\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\n\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n </div>\n </div>\n\n <div [hidden]=\"hiddenDetailFlag\" >\n <mat-card >\n <div class='container'> \n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\n \n <div>\n <mat-label>Victim Name:</mat-label>\n {{victimName}} \n </div>\n \n\n <div> \n <mat-form-field>\n <mat-label>Date of Case Note: </mat-label>\n <input matInput formControlName=\"caseNoteDate\" \n (click)=\"caseNoteDate.open()\" \n [matDatepicker]=\"caseNoteDate\" \n placeholder=\"Choose a start date\" \n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\n <mat-datepicker #caseNoteDate></mat-datepicker>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors \n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\n <mat-error>case note date is <strong>required</strong></mat-error>\n </div> \n\n <div class=\"help-block\" \n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date') \n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n </div> \n \n \n\n <div>\n <mat-form-field>\n <mat-label>Contact Type:</mat-label>\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\n </mat-select>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors \n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n </mat-form-field>\n </div>\n \n <div> \n <mat-form-field class=\"mat-select-content\">\n <mat-label>Contact Purpose:</mat-label>\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\n </mat-select>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors \n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n \n </mat-form-field>\n </div> \n \n <div>\n\n <mat-form-field style=\"width: 400px;\">\n <mat-label>Comment:</mat-label>\n <textarea \n class=\"textarea-content\"\n matInput \n placeholder=\"\" \n required formControlName=\"comment\" \n [(ngModel)]=\"editCaseNote.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\">\n </textarea> \n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors \n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n </mat-form-field>\n </div>\n \n <div>\n <button mat-raised-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\n\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\n </div>\n\n </form>\n </div>\n </mat-card>\n \n </div>\n <br>\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"caseNoteDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"contactType\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\n </ng-container>\n \n \n <ng-container matColumnDef=\"contactPurpose\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"victimCaseNoteId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n \n <button \n class=\"sac-cso-read sac-vsp-read\" \n mat-icon-button \n color=\"primary\" \n matTooltip=\"Edit Case Note\" \n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n\n &nbsp;&nbsp;\n \n \n\n <button\n class=\"sac-vsp-read\"\n matTooltip=\"Delete Case Note\" \n mat-icon-button\n color=\"primary\"\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\n <i class=\"material-icons\">delete</i>\n </button>\n\n\n\n\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n\n\n\n\n\n\n</mat-card-content>\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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i12.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i14.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i14.MatLabel, selector: "mat-label" }, { kind: "directive", type: i14.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i15.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: 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: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", 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: ["sticky", "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" }] });
2547
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CaseNoteComponent, decorators: [{
2548
+ type: Component,
2549
+ args: [{ providers: [CommonDialogService], template: "\n <mat-card>\n <mat-card-header>\n\n </mat-card-header>\n <mat-card-content>\n \n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" >Case Note</h4>\n </mat-toolbar>\n <br>\n <div class=\"row\" >\n <div [hidden]=\"hiddenAddNewFlag\">\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\n\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n </div>\n </div>\n\n <div [hidden]=\"hiddenDetailFlag\" >\n <mat-card >\n <div class='container'> \n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\n \n <div>\n <mat-label>Victim Name:</mat-label>\n {{victimName}} \n </div>\n \n\n <div> \n <mat-form-field>\n <mat-label>Date of Case Note: </mat-label>\n <input matInput formControlName=\"caseNoteDate\" \n (click)=\"caseNoteDate.open()\" \n [matDatepicker]=\"caseNoteDate\" \n placeholder=\"Choose a start date\" \n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\n <mat-datepicker #caseNoteDate></mat-datepicker>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors \n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\n <mat-error>case note date is <strong>required</strong></mat-error>\n </div> \n\n <div class=\"help-block\" \n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date') \n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\n </div>\n\n </mat-form-field>\n\n </div> \n \n \n\n <div>\n <mat-form-field>\n <mat-label>Contact Type:</mat-label>\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\n </mat-select>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors \n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n </mat-form-field>\n </div>\n \n <div> \n <mat-form-field class=\"mat-select-content\">\n <mat-label>Contact Purpose:</mat-label>\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\n </mat-select>\n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors \n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n \n </mat-form-field>\n </div> \n \n <div>\n\n <mat-form-field style=\"width: 400px;\">\n <mat-label>Comment:</mat-label>\n <textarea \n class=\"textarea-content\"\n matInput \n placeholder=\"\" \n required formControlName=\"comment\" \n [(ngModel)]=\"editCaseNote.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\">\n </textarea> \n\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors \n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\n <mat-error>comment is <strong>required</strong></mat-error>\n </div> \n </mat-form-field>\n </div>\n \n <div>\n <button mat-raised-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\n\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\n </div>\n\n </form>\n </div>\n </mat-card>\n \n </div>\n <br>\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"caseNoteDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"contactType\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\n </ng-container>\n \n \n <ng-container matColumnDef=\"contactPurpose\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"victimCaseNoteId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n \n <button \n class=\"sac-cso-read sac-vsp-read\" \n mat-icon-button \n color=\"primary\" \n matTooltip=\"Edit Case Note\" \n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n\n &nbsp;&nbsp;\n \n \n\n <button\n class=\"sac-vsp-read\"\n matTooltip=\"Delete Case Note\" \n mat-icon-button\n color=\"primary\"\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\n <i class=\"material-icons\">delete</i>\n </button>\n\n\n\n\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n\n\n\n\n\n\n</mat-card-content>\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"] }]
2550
+ }], ctorParameters: function () { return [{ type: i1$2.UntypedFormBuilder }, { type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }, { type: EmailService }]; } });
2551
+
2552
+ class ContactComponent {
2553
+ constructor(_victimServicesComponent,
2554
+ //private commonDialogService: CommonDialogService,
2555
+ snackBar, route, router, smartAuthService) {
2556
+ this._victimServicesComponent = _victimServicesComponent;
2557
+ this.snackBar = snackBar;
2558
+ this.route = route;
2559
+ this.router = router;
2560
+ this.smartAuthService = smartAuthService;
2561
+ this.editContact = {};
2562
+ this.staff = {};
2563
+ this.contactForm = new UntypedFormGroup({
2564
+ //contactDate: new FormControl(),
2565
+ contactDate: new UntypedFormControl('', Validators.compose([
2566
+ dateValidator()
2567
+ ])),
2568
+ contactMethod: new UntypedFormControl(),
2569
+ contactBy: new UntypedFormControl(),
2570
+ comment: new UntypedFormControl(),
2571
+ nextContactDate: new UntypedFormControl()
2572
+ });
2573
+ }
2574
+ ngAfterViewInit() {
2575
+ this.smartAuthService.setPermission('Victim', this.route.snapshot);
2576
+ }
2577
+ ngOnInit() {
2578
+ var data = this.route.snapshot.data;
2579
+ this.loginStaff = data.loginStaff;
2580
+ this.staffId = this.loginStaff.staffId;
2581
+ this.staff = [
2582
+ {
2583
+ staffId: this.loginStaff.staffId,
2584
+ fullName: this.loginStaff.firstName + ' ' + this.loginStaff.lastName,
2585
+ },
2586
+ ];
2587
+ this.sub = this.route.params.subscribe(params => {
2588
+ this.victimId = params['victimId'];
2589
+ console.log('my this.victimId');
2590
+ console.log(this.victimId);
2591
+ });
2592
+ this._victimServicesComponent.getContactMethods().subscribe((items) => {
2593
+ this.contactMethods = items;
2594
+ console.log('this.contactMethods');
2595
+ console.log(this.contactMethods);
2596
+ });
2597
+ // this._victimServicesComponent.getContactBys().subscribe(
2598
+ // (items: any) => {
2599
+ // this.contactBy= items;
2600
+ // }
2601
+ // );
2602
+ // this._victimServicesComponent.getContacts(this.victimId).subscribe(
2603
+ // caseNoteList => {
2604
+ // this.caseNoteList = caseNoteList;
2605
+ // }
2606
+ // );
2607
+ }
2608
+ onEditContact(victimContactId) {
2609
+ // this.hiddenDetailFlag =false;
2610
+ // this.hiddenAddNewFlag = true;
2611
+ // this.addDisableFlag = true;
2612
+ // this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2613
+ }
2614
+ // onDeleteCaseNote(victimCaseNoteId: number){
2615
+ // this.commonDialogService
2616
+ // .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2617
+ // .subscribe(res => {this.result = res;
2618
+ // if (this.result) {
2619
+ // this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2620
+ // .subscribe(result => {
2621
+ // this.snackBar.open('delete Successfully !', '', { duration: 3000,});
2622
+ // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2623
+ // caseNoteList => {
2624
+ // this.caseNoteList = caseNoteList;
2625
+ // }
2626
+ // );
2627
+ // }
2628
+ // );
2629
+ // }
2630
+ // });
2631
+ // }
2632
+ onAddNew() {
2633
+ // this.editCas.caseNoteDate = null;
2634
+ // this.editCaseNote.contactTypeId = null;
2635
+ // this.editCaseNote.victimContactPurposeId = null;
2636
+ // this.editCaseNote.comment = null;
2637
+ }
2638
+ back() {
2639
+ this.router.navigate(['victimDetail', this.victimId]);
2640
+ }
2641
+ saveContact() {
2642
+ const contact = {
2643
+ victimId: this.victimId,
2644
+ victimContactId: 0,
2645
+ contactDate: this.editContact.contactDate,
2646
+ victimContactMethodId: this.editContact.victimContactMethodId,
2647
+ contactMethod: null,
2648
+ contactedByName: null,
2649
+ contactedBy: this.editContact.contactedBy,
2650
+ comment: this.editContact.comment,
2651
+ nextContactDate: this.editContact.nextContactDate,
2652
+ modifiedBy: this.staffId,
2653
+ };
2654
+ this._victimServicesComponent.addContact(contact).subscribe(result => {
2655
+ this.snackBar.open('Saved Successfully !', '', {
2656
+ duration: 3000,
2657
+ });
2658
+ this.router.navigate(['victimDetail', this.victimId]);
2659
+ });
2660
+ }
2661
+ }
2662
+ /** @nocollapse */ ContactComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ContactComponent, deps: [{ token: NgcSmartVictimService }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i6.SmartAuthService }], target: i0.ɵɵFactoryTarget.Component });
2663
+ /** @nocollapse */ ContactComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ContactComponent, selector: "ng-component", ngImport: i0, template: "\n <mat-card>\n <mat-card-header>\n\n </mat-card-header>\n <mat-card-content>\n \n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" >Contact detail</h4>\n </mat-toolbar>\n <br>\n \n\n \n <mat-card >\n <div class='container'> \n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\n \n \n\n <div> \n <mat-form-field>\n <mat-label>Contact Date:</mat-label>\n <input matInput formControlName=\"contactDate\" \n (click)=\"contactDate.open()\" \n [matDatepicker]=\"contactDate\" \n placeholder=\"Choose a contact date\" \n [(ngModel)]=\"editContact.contactDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\n <mat-datepicker #contactDate></mat-datepicker>\n </mat-form-field>\n\n <div class=\"validation-errors\">\n <div\n class=\"help-block\"\n *ngIf=\"\n contactForm\n .get('contactDate')\n .hasError('required') &&\n (contactForm.get('contactDate').dirty ||\n contactForm.get('contactDate').touched)\">\n <mat-error>Contact date is\n <strong>required</strong></mat-error>\n </div>\n <div\n class=\"help-block\"\n *ngIf=\"\n contactForm.get('contactDate').hasError('date') &&\n (contactForm.get('contactDate').dirty ||\n contactForm.get('contactDate').touched)\">\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\n </div>\n </div>\n </div> \n \n \n\n <div>\n <mat-form-field>\n <mat-label>Contact Method:</mat-label>\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n \n <div> \n <mat-form-field class=\"mat-select-content\">\n <mat-label>Contact By:</mat-label>\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\n </mat-select>\n </mat-form-field>\n </div> \n \n <div>\n\n <mat-form-field>\n <mat-label>Comments </mat-label>\n <textarea \n matInput \n placeholder=\"\" \n required formControlName=\"comment\" \n [(ngModel)]=\"editContact.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n cdkAutosizeMaxRows=\"5\">\n </textarea> \n </mat-form-field>\n </div>\n\n <div> \n <mat-form-field>\n <mat-label>Next Contact Date: </mat-label>\n <input matInput formControlName=\"nextContactDate\" \n (click)=\"nextContactDate.open()\" \n [matDatepicker]=\"nextContactDate\" \n placeholder=\"Choose a next contact date\" \n [(ngModel)]=\"editContact.nextContactDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\n <mat-datepicker #nextContactDate></mat-datepicker>\n </mat-form-field>\n </div> \n \n <div>\n <!-- <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\n <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" >Cancel</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\" >Back</button>\n </div>\n\n </form>\n </div>\n </mat-card>\n \n \n <br>\n \n\n\n\n</mat-card-content>\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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i12.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i14.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i14.MatLabel, selector: "mat-label" }, { kind: "directive", type: i14.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i15.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: 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: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
2664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ContactComponent, decorators: [{
2665
+ type: Component,
2666
+ args: [{ template: "\n <mat-card>\n <mat-card-header>\n\n </mat-card-header>\n <mat-card-content>\n \n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" >Contact detail</h4>\n </mat-toolbar>\n <br>\n \n\n \n <mat-card >\n <div class='container'> \n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\n \n \n\n <div> \n <mat-form-field>\n <mat-label>Contact Date:</mat-label>\n <input matInput formControlName=\"contactDate\" \n (click)=\"contactDate.open()\" \n [matDatepicker]=\"contactDate\" \n placeholder=\"Choose a contact date\" \n [(ngModel)]=\"editContact.contactDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\n <mat-datepicker #contactDate></mat-datepicker>\n </mat-form-field>\n\n <div class=\"validation-errors\">\n <div\n class=\"help-block\"\n *ngIf=\"\n contactForm\n .get('contactDate')\n .hasError('required') &&\n (contactForm.get('contactDate').dirty ||\n contactForm.get('contactDate').touched)\">\n <mat-error>Contact date is\n <strong>required</strong></mat-error>\n </div>\n <div\n class=\"help-block\"\n *ngIf=\"\n contactForm.get('contactDate').hasError('date') &&\n (contactForm.get('contactDate').dirty ||\n contactForm.get('contactDate').touched)\">\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\n </div>\n </div>\n </div> \n \n \n\n <div>\n <mat-form-field>\n <mat-label>Contact Method:</mat-label>\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n \n <div> \n <mat-form-field class=\"mat-select-content\">\n <mat-label>Contact By:</mat-label>\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\n </mat-select>\n </mat-form-field>\n </div> \n \n <div>\n\n <mat-form-field>\n <mat-label>Comments </mat-label>\n <textarea \n matInput \n placeholder=\"\" \n required formControlName=\"comment\" \n [(ngModel)]=\"editContact.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n cdkAutosizeMaxRows=\"5\">\n </textarea> \n </mat-form-field>\n </div>\n\n <div> \n <mat-form-field>\n <mat-label>Next Contact Date: </mat-label>\n <input matInput formControlName=\"nextContactDate\" \n (click)=\"nextContactDate.open()\" \n [matDatepicker]=\"nextContactDate\" \n placeholder=\"Choose a next contact date\" \n [(ngModel)]=\"editContact.nextContactDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\n <mat-datepicker #nextContactDate></mat-datepicker>\n </mat-form-field>\n </div> \n \n <div>\n <!-- <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\n <button mat-raised-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" >Cancel</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\" >Back</button>\n </div>\n\n </form>\n </div>\n </mat-card>\n \n \n <br>\n \n\n\n\n</mat-card-content>\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"] }]
2667
+ }], ctorParameters: function () { return [{ type: NgcSmartVictimService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }]; } });
2668
+
2669
+ class VictimSafetyPlanComponent {
2670
+ constructor(_victimServicesComponent, commonDialogService, http, dialog, route, router, snackBar, smartAuthService) {
2671
+ this._victimServicesComponent = _victimServicesComponent;
2672
+ this.commonDialogService = commonDialogService;
2673
+ this.http = http;
2674
+ this.dialog = dialog;
2675
+ this.route = route;
2676
+ this.router = router;
2677
+ this.snackBar = snackBar;
2678
+ this.smartAuthService = smartAuthService;
2679
+ this.editSafetyPlan = {};
2680
+ this.safetyPlanDataSource = new MatTableDataSource();
2681
+ }
2682
+ ngAfterViewInit() {
2683
+ this.smartAuthService.setPermission('Victim', this.route.snapshot);
2684
+ }
2685
+ ngOnInit() {
2686
+ var data = this.route.snapshot.data;
2687
+ this.loginStaff = data.loginStaff;
2688
+ this.staffId = this.loginStaff.staffId;
2689
+ this.sub = this.route.params.subscribe(params => {
2690
+ this.victimId = params['victimId'];
2691
+ });
2692
+ this.hiddenAddNewFlag = false;
2693
+ this.victimName = this.victimName;
2694
+ this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2695
+ this.victimSafetyPlans = victimSafetyPlans;
2696
+ this.safetyPlanDataSource.data = this.victimSafetyPlans;
2697
+ console.log('this.victimSafetyPlans');
2698
+ console.log(this.victimSafetyPlans);
2699
+ });
2700
+ // this.myVictimServiceId =1;
2701
+ // this._victimServicesComponent.getVictimServiceDetail(this.myVictimServiceId).subscribe(
2702
+ // victimServiceDetail => {
2703
+ // this.victimServiceDetail = victimServiceDetail;
2704
+ // console.log('service detail');
2705
+ // console.log(this.victimServiceDetail);
2706
+ // }
2707
+ // );
2708
+ this._victimServicesComponent.getServiceStatusHistories(1).subscribe(victimServiceStatusHistories => {
2709
+ // this.victimServiceStatusHistories = victimServiceStatusHistories;
2710
+ });
2711
+ }
2712
+ //---------------graphQL--------------------------------------
2713
+ // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
2714
+ // const queryString = `
2715
+ // {
2716
+ // findVictimServiceTypeProgramProviders {
2717
+ // data {
2718
+ // victimServiceTypeProgramProviderId
2719
+ // victimServiceType
2720
+ // victimProgramProvider
2721
+ // }
2722
+ // }
2723
+ // }`;
2724
+ // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
2725
+ // .map(result => {
2726
+ // return result.data.findVictimServiceTypeProgramProviders.data;
2727
+ // });
2728
+ // }
2729
+ goToSafetyPlanDetail(victimServiceId) {
2730
+ this.router.navigate(['saftyPlanDetail', victimServiceId, this.victimId]);
2731
+ }
2732
+ onAddNew() {
2733
+ this.hiddenDetailFlag = false;
2734
+ }
2735
+ onDeleteSafetyPlan(victimServiceId) {
2736
+ this.commonDialogService
2737
+ .confirm('', 'Do you want to delete this safety plan?', 'Yes', 'No')
2738
+ .subscribe(res => {
2739
+ this.result = res;
2740
+ if (this.result) {
2741
+ this._victimServicesComponent.deleteSafetyPlan(victimServiceId, this.staffId)
2742
+ .subscribe(result => {
2743
+ this.snackBar.open('delete safety plan Successfully !', '', { duration: 3000, });
2744
+ this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2745
+ this.victimSafetyPlans = victimSafetyPlans;
2746
+ this.safetyPlanDataSource.data = this.victimSafetyPlans;
2747
+ });
2748
+ });
2749
+ }
2750
+ });
2751
+ }
2752
+ back() {
2753
+ this.router.navigate(['victimHome']);
2754
+ }
2755
+ }
2756
+ /** @nocollapse */ VictimSafetyPlanComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
2757
+ /** @nocollapse */ VictimSafetyPlanComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: VictimSafetyPlanComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\n <mat-card>\n <mat-card-header>\n </mat-card-header>\n <mat-card-content>\n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\n </mat-toolbar>\n <br>\n <button mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n <br>\n <br>\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"startDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"goal\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"victimServiceStatus\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"victimServiceId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\n <mat-icon>edit</mat-icon> \n </button> \n \n \n\n\n\n\n\n &nbsp;&nbsp;\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\"> \n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\n </button> \n </mat-cell> -->\n\n <mat-cell *matCellDef=\"let element\">\n \n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n\n &nbsp;&nbsp;\n \n <button\n class=\"delete-btn\"\n matTooltip=\"Delete Safety Plan\"\n mat-icon-button\n color=\"primary\"\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\n <i class=\"material-icons\">delete</i>\n </button>\n\n\n\n\n \n </mat-cell>\n\n \n \n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n \n \n</mat-card-content>\n</mat-card>", dependencies: [{ kind: "component", type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { 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: ["sticky", "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" }] });
2758
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimSafetyPlanComponent, decorators: [{
2759
+ type: Component,
2760
+ args: [{ providers: [CommonDialogService], template: "\n <mat-card>\n <mat-card-header>\n </mat-card-header>\n <mat-card-content>\n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\n </mat-toolbar>\n <br>\n <button mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n <br>\n <br>\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"startDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"goal\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"victimServiceStatus\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\n </ng-container>\n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\n </ng-container>\n\n <ng-container matColumnDef=\"victimServiceId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\"> \n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\n <mat-icon>edit</mat-icon> \n </button> \n \n \n\n\n\n\n\n &nbsp;&nbsp;\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\"> \n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\n </button> \n </mat-cell> -->\n\n <mat-cell *matCellDef=\"let element\">\n \n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\n <i class=\"material-icons\">mode_edit</i>\n </button>\n\n &nbsp;&nbsp;\n \n <button\n class=\"delete-btn\"\n matTooltip=\"Delete Safety Plan\"\n mat-icon-button\n color=\"primary\"\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\n <i class=\"material-icons\">delete</i>\n </button>\n\n\n\n\n \n </mat-cell>\n\n \n \n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\n </mat-table>\n \n \n</mat-card-content>\n</mat-card>" }]
2761
+ }], ctorParameters: function () { return [{ type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i1.HttpClient }, { type: i1$1.MatDialog }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.MatSnackBar }, { type: i6.SmartAuthService }]; } });
2762
+
2763
+ class SeriveProviderComponent {
2764
+ constructor(formBuilder, dialogRef, _victimServicesComponent, data) {
2765
+ this.formBuilder = formBuilder;
2766
+ this.dialogRef = dialogRef;
2767
+ this._victimServicesComponent = _victimServicesComponent;
2768
+ this.data = data;
2769
+ this.spForm = this.formBuilder.group({
2770
+ voteeProviderId: [''],
2771
+ });
2772
+ }
2773
+ cancel() {
2774
+ this.dialogRef.close();
2775
+ }
2776
+ ngOnInit() {
2777
+ console.log('data.providerCollections');
2778
+ console.log(this.data);
2779
+ console.log(this.data.serviceTypeId);
2780
+ this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((items) => {
2781
+ this.programProviders = items.filter((y) => (y.victimServiceTypeId === this.data.serviceTypeId));
2782
+ console.log('this.programProviders');
2783
+ console.log(this.programProviders);
2784
+ });
2785
+ this.spForm.get('voteeProviderId').valueChanges.subscribe(voteeProviderId => {
2786
+ console.log('voteeProviderId in service provider component.');
2787
+ console.log(voteeProviderId);
2788
+ });
2789
+ }
2790
+ }
2791
+ /** @nocollapse */ SeriveProviderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SeriveProviderComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: i1$1.MatDialogRef }, { token: NgcSmartVictimService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2792
+ /** @nocollapse */ SeriveProviderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SeriveProviderComponent, selector: "app-service-provider", ngImport: i0, template: `
2793
+ <h1 mat-dialog-title> {{data.serviceType}}</h1>
2794
+ <div mat-dialog-content class="main" [formGroup]="spForm">
2795
+ <mat-form-field>
2796
+ <mat-label>service provider</mat-label>
2797
+
2798
+ <mat-select formControlName="voteeProviderId">
2799
+ <mat-option
2800
+ *ngFor="let providerOption of programProviders"
2801
+ [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
2802
+ </mat-option>
2803
+ </mat-select>
2804
+
2805
+ </mat-form-field>
2806
+
2807
+ </div>
2808
+ <div mat-dialog-actions class="actions">
2809
+ <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>
2810
+ Cancel Change
2811
+ </button>
2812
+ <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >
2813
+ Save Change
2814
+ </button>
2815
+ </div>
2816
+ `, 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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i14.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.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
2817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SeriveProviderComponent, decorators: [{
2818
+ type: Component,
2819
+ args: [{ selector: 'app-service-provider', template: `
2820
+ <h1 mat-dialog-title> {{data.serviceType}}</h1>
2821
+ <div mat-dialog-content class="main" [formGroup]="spForm">
2822
+ <mat-form-field>
2823
+ <mat-label>service provider</mat-label>
2824
+
2825
+ <mat-select formControlName="voteeProviderId">
2826
+ <mat-option
2827
+ *ngFor="let providerOption of programProviders"
2828
+ [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
2829
+ </mat-option>
2830
+ </mat-select>
2831
+
2832
+ </mat-form-field>
2833
+
2834
+ </div>
2835
+ <div mat-dialog-actions class="actions">
2836
+ <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>
2837
+ Cancel Change
2838
+ </button>
2839
+ <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >
2840
+ Save Change
2841
+ </button>
2842
+ </div>
2843
+ `, styles: [".main{width:100%;display:flex;flex-direction:column}.actions{display:flex}\n"] }]
2844
+ }], ctorParameters: function () {
2845
+ return [{ type: i1$2.UntypedFormBuilder }, { type: i1$1.MatDialogRef }, { type: NgcSmartVictimService }, { type: undefined, decorators: [{
2846
+ type: Inject,
2847
+ args: [MAT_DIALOG_DATA]
2848
+ }] }];
2849
+ } });
2850
+
2851
+ class VictimSafetyPlanDetailComponent {
2852
+ constructor(dialog, _victimServicesComponent, http, snackBar, route, router, commonDialogService, formBuilder) {
2853
+ this.dialog = dialog;
2854
+ this._victimServicesComponent = _victimServicesComponent;
2855
+ this.http = http;
2856
+ this.snackBar = snackBar;
2857
+ this.route = route;
2858
+ this.router = router;
2859
+ this.commonDialogService = commonDialogService;
2860
+ this.formBuilder = formBuilder;
2861
+ this.editSafetyPlan = {};
2862
+ this.providerListCollection = [];
2863
+ this.serviceCheck = [];
2864
+ this.victimServiceStatusHistoriesDataSource = new MatTableDataSource();
2865
+ this.initForm();
2866
+ }
2867
+ initForm() {
2868
+ this.spForm = this.formBuilder.group({
2869
+ serviceGoal: new UntypedFormControl('', Validators.compose([
2870
+ Validators.required
2871
+ ])),
2872
+ goalStatus: new UntypedFormControl('', Validators.compose([
2873
+ Validators.required
2874
+ ])),
2875
+ goalStatusDate: new UntypedFormControl('', Validators.compose([
2876
+ Validators.required, dateValidator()
2877
+ ])),
2878
+ comment: new UntypedFormControl('', Validators.required)
2879
+ });
2880
+ this.spForm.markAsPristine();
2881
+ this.spForm.markAsUntouched();
2882
+ }
2883
+ ngOnInit() {
2884
+ var data = this.route.snapshot.data;
2885
+ this.loginStaff = data.loginStaff;
2886
+ this.staffId = this.loginStaff.staffId;
2887
+ this.sub = this.route.params.subscribe(params => {
2888
+ this.victimServiceId = params['victimServiceId'];
2889
+ this.victimId = params['victimId'];
2890
+ });
2891
+ this.hiddenAddNewFlag = false;
2892
+ this.isDisplay = false;
2893
+ this._victimServicesComponent.getVictimServiceTypes().subscribe((items) => {
2894
+ this.victimServiceTypes = items;
2895
+ });
2896
+ this._victimServicesComponent.getVictimServiceStatus().subscribe((items) => {
2897
+ this.victimServiceStatus = items;
2898
+ });
2899
+ this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
2900
+ this.victimName = items.firstName + ', ' + items.lastName;
2901
+ });
2902
+ //---------------graphQL--------------------------------------
2903
+ // this.getVictimServiceTypeProgramProviders().subscribe(result => {
2904
+ // this.providerList = result;
2905
+ // });
2906
+ // console.log('this.victimServiceId');
2907
+ // console.log(this.victimServiceId);
2908
+ if (this.victimServiceId != 0) {
2909
+ this._victimServicesComponent.getVictimServices(this.victimServiceId).subscribe(victimSafetyPlans => {
2910
+ console.log('victimSafetyPlans');
2911
+ console.log(victimSafetyPlans);
2912
+ this.editSafetyPlan = victimSafetyPlans[0];
2913
+ this.victimId = victimSafetyPlans[0].victimId;
2914
+ console.log('this.editSafetyPlan');
2915
+ console.log(this.editSafetyPlan);
2916
+ // console.log('this.editSafetyPlan.goal');
2917
+ // console.log(this.editSafetyPlan.goal);
2918
+ // console.log('this.editSafetyPlan[0].goal');
2919
+ // console.log(this.editSafetyPlan[0].goal);
2920
+ });
2921
+ this._victimServicesComponent.getServiceStatusHistories(this.victimServiceId).subscribe(victimServiceStatusHistories => {
2922
+ // this.victimServiceStatusHistories = victimServiceStatusHistories;
2923
+ this.victimServiceStatusHistoriesDataSource.data = victimServiceStatusHistories;
2924
+ });
2925
+ }
2926
+ this.loadProvider();
2927
+ }
2928
+ //pass in id
2929
+ isInArray(providerListCollectionKey, serviceTypeName, event) {
2930
+ console.log('providerListCollectionKey');
2931
+ console.log(providerListCollectionKey);
2932
+ console.log('serviceTypeName');
2933
+ console.log(serviceTypeName);
2934
+ console.log('event.source.value');
2935
+ console.log(event.checked);
2936
+ if (event.checked == true) {
2937
+ for (let j = 0; j < this.providerListCollection.length; j++) {
2938
+ if (providerListCollectionKey == this.providerListCollection[j].groupId) {
2939
+ this.providerListCollection[j].isDisplay = !this.providerListCollection[j].isDisplay;
2940
+ const dialogRef = this.dialog.open(SeriveProviderComponent, {
2941
+ width: '500px',
2942
+ data: {
2943
+ serviceType: serviceTypeName,
2944
+ serviceTypeId: providerListCollectionKey,
2945
+ providerCollections: [...this.providerListCollection],
2946
+ },
2947
+ panelClass: 'formFieldWidth480',
2948
+ });
2949
+ dialogRef.afterClosed().subscribe((result) => {
2950
+ console.log('The dialog was closed');
2951
+ console.log(result);
2952
+ if (result) {
2953
+ console.log('The dialog was closed, inside result');
2954
+ this.savePlanProvider(providerListCollectionKey, result.voteeProviderId);
2955
+ }
2956
+ });
2957
+ // return;
2958
+ }
2959
+ }
2960
+ } //if event.checked == true
2961
+ //this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId ]);
2962
+ }
2963
+ loadProvider() {
2964
+ this.providerListCollection = [];
2965
+ this._victimServicesComponent.getvVictimServiceTypeProgramProviders()
2966
+ .subscribe((providerList) => {
2967
+ if (providerList) {
2968
+ let providers = Object.create(null);
2969
+ for (let i = 0; i < providerList.length; i++) {
2970
+ if (!providers[providerList[i].victimServiceTypeId]) {
2971
+ providers[providerList[i].victimServiceTypeId] = [];
2972
+ if (this.editSafetyPlan.vVictimServiceDetails != null) {
2973
+ for (let j = 0; j < this.editSafetyPlan.vVictimServiceDetails.length; j++) {
2974
+ if (providerList[i].victimServiceTypeId == this.editSafetyPlan.vVictimServiceDetails[j].victimServiceId.toString()) {
2975
+ this.isDisplay = true;
2976
+ }
2977
+ }
2978
+ }
2979
+ this.providerListCollection.push({ groupId: providerList[i].victimServiceTypeId, isDisplay: this.isDisplay, collection: providers[providerList[i].victimServiceTypeId] });
2980
+ }
2981
+ providers[providerList[i].victimServiceTypeId].push(providerList[i]);
2982
+ }
2983
+ }
2984
+ });
2985
+ }
2986
+ //---------------graphQL--------------------------------------
2987
+ // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
2988
+ // const queryString = `
2989
+ // {
2990
+ // findVictimServiceTypeProgramProviders {
2991
+ // data {
2992
+ // victimServiceTypeProgramProviderId
2993
+ // victimServiceType
2994
+ // victimProgramProvider
2995
+ // }
2996
+ // }
2997
+ // }`;
2998
+ // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
2999
+ // .map(result => {
3000
+ // return result.data.findVictimServiceTypeProgramProviders.data;
3001
+ // });
3002
+ // }
3003
+ evaluateSelection(victimServiceTypeId) {
3004
+ if (this.editSafetyPlan.vVictimServiceDetails) {
3005
+ return this.editSafetyPlan.vVictimServiceDetails.findIndex(r => r.victimServiceTypeId === victimServiceTypeId) >= 0;
3006
+ }
3007
+ }
3008
+ savePlanProvider(victimServiceTypeId, victimProgramProviderId) {
3009
+ console.log('savePlanProvider');
3010
+ console.log(victimServiceTypeId);
3011
+ console.log(victimProgramProviderId);
3012
+ if (victimProgramProviderId === "" || victimProgramProviderId === null || victimProgramProviderId === undefined) {
3013
+ this.snackBar.open('Please pick a program on the drop down list !', '', { duration: 120, });
3014
+ // alert('Please pick a program on the drop down list !');
3015
+ }
3016
+ else {
3017
+ if (this.victimServiceId == 0) {
3018
+ //insert
3019
+ console.log('insert new plan');
3020
+ const safetyPlan = {
3021
+ victimId: this.victimId,
3022
+ fullName: null,
3023
+ victimServiceId: 0,
3024
+ goal: this.editSafetyPlan.goal,
3025
+ comment: this.editSafetyPlan.comment,
3026
+ modifiedBy: this.staffId,
3027
+ victimServiceStatusId: null,
3028
+ status: null,
3029
+ startDate: null,
3030
+ vVictimServiceDetails: null,
3031
+ victimName: null
3032
+ };
3033
+ this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3034
+ const victimServiceStatus = {
3035
+ victimServiceStatusHistoryId: 0,
3036
+ victimServiceId: itms.victimServiceId,
3037
+ victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3038
+ startDate: this.editSafetyPlan.startDate,
3039
+ modifiedBy: this.staffId,
3040
+ comment: 'test add safety plan'
3041
+ };
3042
+ this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(() => {
3043
+ console.log('check itms.victimServiceId iniside add victim serive status');
3044
+ console.log(itms.victimServiceId);
3045
+ const victimServiceDetail = {
3046
+ victimServiceId: itms.victimServiceId,
3047
+ victimServiceDetailId: 0,
3048
+ victimServiceTypeId: victimServiceTypeId,
3049
+ victimProgramProviderId: victimProgramProviderId,
3050
+ modifiedBy: this.staffId,
3051
+ victimProgramProvider: null
3052
+ };
3053
+ console.log('add plan provider here at insert');
3054
+ this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3055
+ this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3056
+ });
3057
+ });
3058
+ });
3059
+ }
3060
+ else //update
3061
+ {
3062
+ const victimServiceDetail = {
3063
+ victimServiceId: this.victimServiceId,
3064
+ victimServiceDetailId: 0,
3065
+ victimServiceTypeId: victimServiceTypeId,
3066
+ victimProgramProviderId: victimProgramProviderId,
3067
+ modifiedBy: this.staffId,
3068
+ victimProgramProvider: null
3069
+ };
3070
+ console.log('add plan provider here at update');
3071
+ this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3072
+ this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId]);
3073
+ });
3074
+ }
3075
+ }
3076
+ }
3077
+ deleteProvider(victimProgramProviderId) {
3078
+ this.commonDialogService
3079
+ .confirm('', 'Do you want to delete this provider?', 'Yes', 'No')
3080
+ .subscribe(res => {
3081
+ this.result = res;
3082
+ if (this.result) {
3083
+ this._victimServicesComponent.deleteProvider(victimProgramProviderId, this.staffId)
3084
+ .subscribe(result => {
3085
+ this.snackBar.open('delete provider Successfully !', '', {
3086
+ duration: 3000,
3087
+ });
3088
+ location.reload();
3089
+ });
3090
+ }
3091
+ });
3092
+ // location.reload();
3093
+ }
3094
+ saveSafetyPlan() {
3095
+ if (this.editSafetyPlan.victimServiceId === undefined) {
3096
+ const safetyPlan = {
3097
+ victimId: this.victimId,
3098
+ fullName: null,
3099
+ victimServiceId: 0,
3100
+ goal: this.editSafetyPlan.goal,
3101
+ comment: this.editSafetyPlan.comment,
3102
+ modifiedBy: this.staffId,
3103
+ victimServiceStatusId: null,
3104
+ status: null,
3105
+ startDate: null,
3106
+ vVictimServiceDetails: null,
3107
+ victimName: null
3108
+ };
3109
+ this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3110
+ const victimServiceStatus = {
3111
+ victimServiceStatusHistoryId: 0,
3112
+ victimServiceId: itms.victimServiceId,
3113
+ victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3114
+ startDate: this.editSafetyPlan.startDate,
3115
+ modifiedBy: this.staffId,
3116
+ comment: 'test add safety Plan'
3117
+ };
3118
+ this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(resp => {
3119
+ this.snackBar.open('Insert status successfully!', '', {
3120
+ duration: 3000,
3121
+ });
3122
+ });
3123
+ this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3124
+ });
3125
+ }
3126
+ else {
3127
+ // this.editSafetyPlan.modifiedBy=this.loginStaff.staffId;
3128
+ this.editSafetyPlan.modifiedBy = this.staffId;
3129
+ this._victimServicesComponent.updateSafetyPlan(this.editSafetyPlan).subscribe(resp => {
3130
+ // this.snackBar.open('update Successfully!', '', {
3131
+ // duration: 3000,
3132
+ // });
3133
+ const victimServiceStatus = {
3134
+ victimServiceStatusHistoryId: 0,
3135
+ victimServiceId: this.editSafetyPlan.victimServiceId.toString(),
3136
+ victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3137
+ startDate: this.editSafetyPlan.startDate,
3138
+ modifiedBy: this.staffId,
3139
+ comment: 'test update safety Plan'
3140
+ };
3141
+ this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe();
3142
+ this.router.navigate(['saftyPlanDetail', this.editSafetyPlan.victimServiceId, this.victimId]);
3143
+ });
3144
+ }
3145
+ }
3146
+ back() {
3147
+ console.log('this.victimId');
3148
+ console.log(this.victimId);
3149
+ this.router.navigate(['saftyPlan', this.victimId]);
3150
+ }
3151
+ }
3152
+ /** @nocollapse */ VictimSafetyPlanDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.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 });
3153
+ /** @nocollapse */ VictimSafetyPlanDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: VictimSafetyPlanDetailComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "<mat-card>\n <mat-card-header>\n \n </mat-card-header>\n <mat-card-content>\n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\n </mat-toolbar>\n \n \n <div class='container'>\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\n \n \n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\n \n\n <div class=\"row\" > \n <mat-form-field >\n <mat-label>Goal:</mat-label>\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\n </mat-form-field>\n \n </div>\n \n <div class=\"row\"> \n <mat-form-field>\n <mat-label>Goal Status:</mat-label>\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\n </mat-select> \n </mat-form-field>\n </div>\n \n \n <div class=\"row\"> \n \n <mat-form-field>\n <mat-label>Goal Status Date:</mat-label>\n <input matInput \n formControlName=\"goalStatusDate\" \n [matDatepicker]=\"goalStatusDate\" \n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" \n (click)=\"goalStatusDate.open()\" \n >\n \n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\n <mat-datepicker #goalStatusDate></mat-datepicker> \n </mat-form-field> \n\n\n <div class=\"help-block\" \n *ngIf=\"spForm.get('goalStatusDate').hasError('date') \n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\n </div>\n </div>\n\n \n <div class=\"row\" > \n <!-- <mat-form-field style=\"width: 200px;\"> -->\n <!-- <mat-label>Comment:</mat-label> \n <textarea mdInput \n class=\"textarea-content\"\n [(ngModel)]=\"editSafetyPlan.comment\"\n formControlName=\"comment\" \n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\"\n >\n </textarea> -->\n <!-- </mat-form-field> -->\n\n\n\n <mat-form-field style=\"width: 400px;\">\n <mat-label>Comment:</mat-label>\n <textarea \n class=\"textarea-content\"\n matInput \n placeholder=\"\" \n formControlName=\"comment\" \n [(ngModel)]=\"editSafetyPlan.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\">\n </textarea> \n\n \n </mat-form-field>\n\n </div>\n\n </form>\n </div><!--end form-->\n \n \n <br>\n\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\n \n <mat-list>\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\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>\n <div> &nbsp;&nbsp;</div>\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\n \n <div class=\"serviceSelect\"> -->\n <!-- <mat-form-field> -->\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" > \n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\n </mat-select> -->\n <!-- </mat-form-field> -->\n \n <!-- </div>\n\n <div class=\"serviceButton\">\n <button mat-raised-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\n </div>\n </div> -->\n </div>\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\n \n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\n <div class=\"serviceSelect\" >\n . {{ serviceprovider.victimProgramProvider}}\n </div>\n <div class=\"serviceButton\">\n <button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> \n </div>\n \n </div>\n \n </div>\n \n </mat-list-item> \n \n </mat-list>\n </div>\n \n \n \n \n\n\n\n\n\n\n \n \n <!-- <div class='row' >\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\n <div class='col-md-7'> \n \n </div> \n </div> -->\n <!-- <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <mat-form-field >\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\n </mat-form-field>\n </div> \n </div>\n\n <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\n </mat-select>\n </div> \n </div>\n \n <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\n <mat-datepicker #goalStatusDate></mat-datepicker> \n </div> \n </div>\n \n <div class='row' >\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\n <div class='col-md-7'> \n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea> \n </div> \n </div> -->\n\n \n <div class='row' >\n <div class='col-md-12 text-center'>\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\n <button mat-raised-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\n <!-- &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n </div> \n </div> \n\n <!--status hisotry-->\n \n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"startDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"victimServiceStatusId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\n </ng-container>\n \n \n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n \n \n\n</mat-card-content>\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-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "component", type: i12$1.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i12$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i12.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i14.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i14.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i14.MatLabel, selector: "mat-label" }, { kind: "directive", type: i14.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i15.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: 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: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", 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: ["sticky", "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" }] });
3154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimSafetyPlanDetailComponent, decorators: [{
3155
+ type: Component,
3156
+ args: [{ providers: [CommonDialogService], template: "<mat-card>\n <mat-card-header>\n \n </mat-card-header>\n <mat-card-content>\n <mat-toolbar color=\"primary\">\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\n </mat-toolbar>\n \n \n <div class='container'>\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\n \n \n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\n \n\n <div class=\"row\" > \n <mat-form-field >\n <mat-label>Goal:</mat-label>\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\n </mat-form-field>\n \n </div>\n \n <div class=\"row\"> \n <mat-form-field>\n <mat-label>Goal Status:</mat-label>\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\n </mat-select> \n </mat-form-field>\n </div>\n \n \n <div class=\"row\"> \n \n <mat-form-field>\n <mat-label>Goal Status Date:</mat-label>\n <input matInput \n formControlName=\"goalStatusDate\" \n [matDatepicker]=\"goalStatusDate\" \n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" \n (click)=\"goalStatusDate.open()\" \n >\n \n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\n <mat-datepicker #goalStatusDate></mat-datepicker> \n </mat-form-field> \n\n\n <div class=\"help-block\" \n *ngIf=\"spForm.get('goalStatusDate').hasError('date') \n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\n </div>\n </div>\n\n \n <div class=\"row\" > \n <!-- <mat-form-field style=\"width: 200px;\"> -->\n <!-- <mat-label>Comment:</mat-label> \n <textarea mdInput \n class=\"textarea-content\"\n [(ngModel)]=\"editSafetyPlan.comment\"\n formControlName=\"comment\" \n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\"\n >\n </textarea> -->\n <!-- </mat-form-field> -->\n\n\n\n <mat-form-field style=\"width: 400px;\">\n <mat-label>Comment:</mat-label>\n <textarea \n class=\"textarea-content\"\n matInput \n placeholder=\"\" \n formControlName=\"comment\" \n [(ngModel)]=\"editSafetyPlan.comment\"\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"8\"\n cdkAutosizeMaxRows=\"12\">\n </textarea> \n\n \n </mat-form-field>\n\n </div>\n\n </form>\n </div><!--end form-->\n \n \n <br>\n\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\n \n <mat-list>\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\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>\n <div> &nbsp;&nbsp;</div>\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\n \n <div class=\"serviceSelect\"> -->\n <!-- <mat-form-field> -->\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" > \n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\n </mat-select> -->\n <!-- </mat-form-field> -->\n \n <!-- </div>\n\n <div class=\"serviceButton\">\n <button mat-raised-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\n </div>\n </div> -->\n </div>\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\n \n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\n <div class=\"serviceSelect\" >\n . {{ serviceprovider.victimProgramProvider}}\n </div>\n <div class=\"serviceButton\">\n <button mat-raised-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> \n </div>\n \n </div>\n \n </div>\n \n </mat-list-item> \n \n </mat-list>\n </div>\n \n \n \n \n\n\n\n\n\n\n \n \n <!-- <div class='row' >\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\n <div class='col-md-7'> \n \n </div> \n </div> -->\n <!-- <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <mat-form-field >\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\n </mat-form-field>\n </div> \n </div>\n\n <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\n </mat-select>\n </div> \n </div>\n \n <div class='row' >\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\n <div class='col-md-7'> \n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\n <mat-datepicker #goalStatusDate></mat-datepicker> \n </div> \n </div>\n \n <div class='row' >\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\n <div class='col-md-7'> \n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea> \n </div> \n </div> -->\n\n \n <div class='row' >\n <div class='col-md-12 text-center'>\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\n <button mat-raised-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\n <!-- &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\n &nbsp;&nbsp;<button mat-raised-button color=\"primary\" (click)=\"back()\">Back</button>\n </div> \n </div> \n\n <!--status hisotry-->\n \n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\n <ng-container matColumnDef=\"startDate\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\n </ng-container>\n\n\n <ng-container matColumnDef=\"victimServiceStatusId\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\n </ng-container>\n \n \n <ng-container matColumnDef=\"comment\">\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\n </ng-container>\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\n </mat-table>\n\n \n \n\n</mat-card-content>\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"] }]
3157
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i1.HttpClient }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: CommonDialogService }, { type: i1$2.UntypedFormBuilder }]; } });
3158
+
3159
+ const routes = [
3160
+ //{path: 'casenote/:victimId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
3161
+ { path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent, pathMatch: 'full', canActivate: [MsalGuard], resolve: { loginStaff: LoginStaffResolverService } },
3162
+ { path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3163
+ { path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3164
+ { path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3165
+ { path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3166
+ { path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3167
+ { path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3168
+ { path: 'smart-error', component: SmartErrorComponent }
3169
+ ];
3170
+ class VictimRoutingModule {
3171
+ }
3172
+ /** @nocollapse */ VictimRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3173
+ /** @nocollapse */ VictimRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: VictimRoutingModule, imports: [i5.RouterModule], exports: [RouterModule] });
3174
+ /** @nocollapse */ VictimRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
3175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: VictimRoutingModule, decorators: [{
3176
+ type: NgModule,
3177
+ args: [{
3178
+ imports: [
3179
+ RouterModule.forChild(routes)
3180
+ ],
3181
+ exports: [
3182
+ RouterModule
3183
+ ]
3184
+ }]
3185
+ }] });
3186
+
3187
+ const COMPONENTS = [
3188
+ NgcSmartVictimComponent,
3189
+ SmartVictimDetailComponent,
3190
+ SmartVictimDeleteConfirmComponent,
3191
+ ];
3192
+ const ENTRY_COMPONENTS = [
3193
+ SmartVictimDeleteConfirmComponent,
3194
+ ];
3195
+ const BASE_MODULES = [
3196
+ CommonModule,
3197
+ ReactiveFormsModule
3198
+ ];
3199
+ const CORE_MODULES = [NgcSmartCoreModule, SmartAddressModule, SmartUiModule,];
3200
+ const MATERIAL_MODULES = [
3201
+ MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3202
+ MatCardModule, MatSlideToggleModule,
3203
+ MatListModule, MatIconModule, MatButtonToggleModule,
3204
+ MatToolbarModule, MatTabsModule, MatExpansionModule,
3205
+ MatMenuModule, MatInputModule, MatProgressBarModule,
3206
+ MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3207
+ MatDialogModule, MatSidenavModule, MatSelectModule,
3208
+ MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule,
3209
+ ];
3210
+ class NgcSmartVictimModule {
3211
+ }
3212
+ /** @nocollapse */ NgcSmartVictimModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3213
+ /** @nocollapse */ NgcSmartVictimModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimModule, declarations: [NgcSmartVictimComponent,
3214
+ SmartVictimDetailComponent,
3215
+ SmartVictimDeleteConfirmComponent, CaseNoteComponent,
3216
+ ContactComponent,
3217
+ VictimSafetyPlanComponent,
3218
+ VictimSafetyPlanDetailComponent,
3219
+ VictimSearchFormComponent,
3220
+ SeriveProviderComponent], imports: [CommonModule,
3221
+ ReactiveFormsModule, MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3222
+ MatCardModule, MatSlideToggleModule,
3223
+ MatListModule, MatIconModule, MatButtonToggleModule,
3224
+ MatToolbarModule, MatTabsModule, MatExpansionModule,
3225
+ MatMenuModule, MatInputModule, MatProgressBarModule,
3226
+ MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3227
+ MatDialogModule, MatSidenavModule, MatSelectModule,
3228
+ MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule, NgcSmartCoreModule, SmartAddressModule, SmartUiModule, CommonDialogModule,
3229
+ FormsModule,
3230
+ VictimRoutingModule,
3231
+ ApolloModule], exports: [NgcSmartVictimComponent,
3232
+ SmartVictimDetailComponent,
3233
+ SmartVictimDeleteConfirmComponent, ApolloModule] });
3234
+ /** @nocollapse */ NgcSmartVictimModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimModule, providers: [NgcSmartVictimService], imports: [BASE_MODULES, MATERIAL_MODULES, CORE_MODULES, CommonDialogModule,
3235
+ FormsModule,
3236
+ VictimRoutingModule,
3237
+ ApolloModule, ApolloModule] });
3238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgcSmartVictimModule, decorators: [{
3239
+ type: NgModule,
3240
+ args: [{
3241
+ declarations: [...COMPONENTS,
3242
+ CaseNoteComponent,
3243
+ ContactComponent,
3244
+ VictimSafetyPlanComponent,
3245
+ VictimSafetyPlanDetailComponent,
3246
+ VictimSearchFormComponent,
3247
+ SeriveProviderComponent
3248
+ ],
3249
+ imports: [
3250
+ ...BASE_MODULES,
3251
+ ...MATERIAL_MODULES,
3252
+ ...CORE_MODULES,
3253
+ CommonDialogModule,
3254
+ FormsModule,
3255
+ VictimRoutingModule,
3256
+ ApolloModule,
3257
+ //SharedModule
3258
+ ],
3259
+ exports: [...COMPONENTS, ApolloModule],
3260
+ providers: [NgcSmartVictimService]
3261
+ }]
3262
+ }] });
3263
+
3264
+ /*
3265
+ * Public API Surface of ngc-smart-victim
3266
+ */
3267
+
3268
+ /**
3269
+ * Generated bundle index. Do not edit.
3270
+ */
3271
+
3272
+ 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 };
3273
+ //# sourceMappingURL=csmart-ngc-smart-victim.mjs.map