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