@csmart/ngc-smart-victim 0.1.6 → 1.13.1

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