@csmart/ngc-smart-victim 1.18.17 → 1.18.18

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