@csmart/ngc-smart-victim 1.18.12 → 1.18.13

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