@csmart/ngc-smart-victim 0.1.7 → 1.13.2

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