@csmart/ngc-smart-victim 0.1.7 → 1.13.0

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