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