@csmart/ngc-smart-victim 1.14.42 → 1.18.0

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