@csmart/ngc-smart-victim 1.18.18 → 1.18.20

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