@csmart/ngc-smart-victim 1.18.6 → 1.18.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +6 -22
  4. package/src/lib/caseNote/caseNote.component.css +20 -0
  5. package/src/lib/caseNote/caseNote.component.html +188 -0
  6. package/src/lib/caseNote/caseNote.component.ts +265 -0
  7. package/src/lib/common-dialog/common-dialog.component.css +10 -0
  8. package/src/lib/common-dialog/common-dialog.component.html +23 -0
  9. package/src/lib/common-dialog/common-dialog.component.spec.ts +25 -0
  10. package/src/lib/common-dialog/common-dialog.component.ts +21 -0
  11. package/src/lib/common-dialog/common-dialog.module.ts +22 -0
  12. package/src/lib/common-dialog/common-dialog.service.ts +35 -0
  13. package/src/lib/contact/contact.component.css +20 -0
  14. package/src/lib/contact/contact.component.html +124 -0
  15. package/src/lib/contact/contact.component.ts +176 -0
  16. package/src/lib/email-notification.service.ts +42 -0
  17. package/src/lib/email.services.ts +51 -0
  18. package/src/lib/http.service.ts +34 -0
  19. package/src/lib/intake.service.ts +82 -0
  20. package/src/lib/loader.service.ts +11 -0
  21. package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
  22. package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
  23. package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
  24. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
  25. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
  26. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
  27. package/src/lib/shared/app.shared.module.ts +111 -0
  28. package/src/lib/shared/validators/date.validator.ts +73 -0
  29. package/src/lib/shared/validators/index.ts +1 -0
  30. package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
  31. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
  32. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +869 -0
  33. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
  34. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1384 -0
  35. package/src/lib/smart-victim.component.css +192 -0
  36. package/src/lib/smart-victim.component.html +138 -0
  37. package/src/lib/smart-victim.component.spec.ts +25 -0
  38. package/src/lib/smart-victim.component.ts +329 -0
  39. package/src/lib/smart-victim.model.ts +301 -0
  40. package/src/lib/smart-victim.module.ts +110 -0
  41. package/src/lib/smart-victim.service.spec.ts +12 -0
  42. package/src/lib/smart-victim.service.ts +557 -0
  43. package/src/lib/victim-routing.module.ts +35 -0
  44. package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +9 -7
  45. package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
  46. package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
  47. package/{public-api.d.ts → src/public-api.ts} +12 -7
  48. package/src/test.ts +22 -0
  49. package/tsconfig.lib.json +37 -0
  50. package/tsconfig.spec.json +17 -0
  51. package/tslint.json +17 -0
  52. package/esm2022/csmart-ngc-smart-victim.mjs +0 -5
  53. package/esm2022/lib/caseNote/caseNote.component.mjs +0 -194
  54. package/esm2022/lib/common-dialog/common-dialog.component.mjs +0 -23
  55. package/esm2022/lib/common-dialog/common-dialog.module.mjs +0 -34
  56. package/esm2022/lib/common-dialog/common-dialog.service.mjs +0 -33
  57. package/esm2022/lib/contact/contact.component.mjs +0 -140
  58. package/esm2022/lib/email.services.mjs +0 -42
  59. package/esm2022/lib/intake.service.mjs +0 -57
  60. package/esm2022/lib/safetyPlan/serviceProvider.component.mjs +0 -99
  61. package/esm2022/lib/safetyPlan/victimSafetyPlan.component.mjs +0 -116
  62. package/esm2022/lib/safetyPlan/victimSafetyPlanDetail.component.mjs +0 -340
  63. package/esm2022/lib/shared/app.shared.module.mjs +0 -215
  64. package/esm2022/lib/shared/validators/date.validator.mjs +0 -59
  65. package/esm2022/lib/shared/validators/index.mjs +0 -2
  66. package/esm2022/lib/smart-victim-delete-confirm.component.mjs +0 -44
  67. package/esm2022/lib/smart-victim-detail/smart-victim-detail.component.mjs +0 -1104
  68. package/esm2022/lib/smart-victim.component.mjs +0 -316
  69. package/esm2022/lib/smart-victim.model.mjs +0 -133
  70. package/esm2022/lib/smart-victim.module.mjs +0 -128
  71. package/esm2022/lib/smart-victim.service.mjs +0 -352
  72. package/esm2022/lib/victim-routing.module.mjs +0 -41
  73. package/esm2022/lib/victimSearch/VictimSearchFilter.mjs +0 -3
  74. package/esm2022/lib/victimSearch/victimSearchForm.component.mjs +0 -38
  75. package/esm2022/public-api.mjs +0 -11
  76. package/fesm2022/csmart-ngc-smart-victim.mjs +0 -3263
  77. package/fesm2022/csmart-ngc-smart-victim.mjs.map +0 -1
  78. package/index.d.ts +0 -5
  79. package/lib/caseNote/caseNote.component.d.ts +0 -51
  80. package/lib/common-dialog/common-dialog.component.d.ts +0 -14
  81. package/lib/common-dialog/common-dialog.module.d.ts +0 -8
  82. package/lib/common-dialog/common-dialog.service.d.ts +0 -11
  83. package/lib/contact/contact.component.d.ts +0 -40
  84. package/lib/email.services.d.ts +0 -11
  85. package/lib/intake.service.d.ts +0 -57
  86. package/lib/safetyPlan/serviceProvider.component.d.ts +0 -19
  87. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -54
  88. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -62
  89. package/lib/shared/app.shared.module.d.ts +0 -33
  90. package/lib/shared/validators/date.validator.d.ts +0 -9
  91. package/lib/shared/validators/index.d.ts +0 -1
  92. package/lib/smart-victim-delete-confirm.component.d.ts +0 -12
  93. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -129
  94. package/lib/smart-victim.component.d.ts +0 -69
  95. package/lib/smart-victim.model.d.ts +0 -205
  96. package/lib/smart-victim.module.d.ts +0 -49
  97. package/lib/smart-victim.service.d.ts +0 -71
  98. package/lib/victim-routing.module.d.ts +0 -7
  99. package/lib/victimSearch/victimSearchForm.component.d.ts +0 -14
@@ -0,0 +1,557 @@
1
+ import { HttpClient,HttpResponse, HttpHeaders } from '@angular/common/http';
2
+ import { Injectable, Inject } from '@angular/core';
3
+ import { SMART_LOOKUP_SERVICE_URL, SMART_OFFENDER_SERVICE_URL,SMART_VICTIM_SERVICE_URL,
4
+ VictimListFilter,VictimDrugUse,Victim,VictimSafetyPlan,
5
+ CaseNote,Contact,VictimServiceDetail,VictimServiceStatusHistory,VictimAdvocate,VictimGuardian} from './smart-victim.model';
6
+ import { Observable, throwError as observableThrowError} from 'rxjs';
7
+ import { map,catchError, filter } from 'rxjs/operators';
8
+ import { Apollo } from 'apollo-angular';
9
+
10
+
11
+
12
+ const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
13
+ const options = { headers: headers };
14
+
15
+ @Injectable({
16
+ providedIn: 'root'
17
+ })
18
+ export class NgcSmartVictimService {
19
+ private serviceApiUrl = 'https://smart-service-test.azurewebsites.net/graphql';
20
+ constructor(private http: HttpClient,
21
+
22
+ @Inject(SMART_OFFENDER_SERVICE_URL) private smartOffenderServiceUrl: string,
23
+ @Inject(SMART_LOOKUP_SERVICE_URL) private smartLookupServiceUrl: string,
24
+ @Inject(SMART_VICTIM_SERVICE_URL) private smartVictimServiceUrl: string,
25
+ private apollo: Apollo
26
+
27
+ ) { }
28
+
29
+ // getVictimInsurances(offenderId: any) {
30
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?offenderId=' + offenderId).pipe();
31
+ // }
32
+
33
+ // getVictimInsurance(id: any) {
34
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
35
+ // }
36
+
37
+ // postVictimInsurance(val: any) {
38
+ // return this.http.post(this.smartOffenderServiceUrl + '/VictimInsurances', val).pipe();
39
+ // }
40
+
41
+ // putVictimInsurance(id: any, val: any) {
42
+ // return this.http.put(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id, val).pipe();
43
+ // }
44
+
45
+ // deleteVictimInsurance(id: any) {
46
+ // return this.http.delete(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
47
+ // }
48
+
49
+ // getVictimInsuranceTypes() {
50
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceTypes').pipe();
51
+ // }
52
+
53
+ // getVictimInsurancePolicyHolders() {
54
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsurancePolicyHolders').pipe();
55
+ // }
56
+
57
+ // getVictimInsuranceSwitchReasons() {
58
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceSwitchReasons').pipe();
59
+ // }
60
+
61
+ // getVictimInsuranceProviders() {
62
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProvider').pipe();
63
+ // }
64
+
65
+ // getVictimInsuranceProvider(id) {
66
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProviders/' + id).pipe();
67
+ // }
68
+
69
+ // postProviderInformation(val: any) {
70
+ // return this.http.post(this.smartLookupServiceUrl + '/VictimInsuranceProviders', val).pipe();
71
+ // }
72
+
73
+ getCurrentHousing(offenderId: number) {
74
+
75
+ return this.http
76
+ .get(this.smartOffenderServiceUrl + 'Housings/current/' + offenderId)
77
+ .pipe();
78
+ }
79
+
80
+ private handleError(error: any) {
81
+ console.error(error);
82
+ return observableThrowError(error.json().error || 'Server error');
83
+ }
84
+
85
+ getDrugsTypes() {
86
+ return this.http.get(this.smartLookupServiceUrl + 'DrugTypes', options).pipe
87
+ (
88
+ map(res => res)
89
+ );
90
+ }
91
+
92
+ getDocketList(offenderId: number) {
93
+ const queryString = `
94
+ {
95
+ findDockets(input: { where: { offenderId:${offenderId} } }) {
96
+ totalCount
97
+ message
98
+ data {
99
+ docketId
100
+ docketNumber
101
+
102
+ }
103
+ }
104
+ }`;
105
+
106
+ return this.http.post<any>(this.serviceApiUrl, { query: queryString }).pipe(
107
+ map(({ data }) => {
108
+ console.log('dockets for this offender:', data.findDockets.data);
109
+ return data.findDockets.data;
110
+ }));
111
+
112
+
113
+ }
114
+
115
+ getSupportTypes() {
116
+ return this.http.get(this.smartLookupServiceUrl + 'VictimSupportTypes', options).pipe
117
+ (
118
+ map(res => res)
119
+ );
120
+ }
121
+
122
+ getPrefixes() {
123
+ return this.http.get(this.smartLookupServiceUrl + 'Prefixes', options).pipe
124
+ (
125
+ map(res => res)
126
+ );
127
+ }
128
+
129
+ getSuffixes() {
130
+ return this.http.get(this.smartLookupServiceUrl + 'Suffixes', options).pipe
131
+ (
132
+ map(res => res)
133
+ );
134
+ }
135
+
136
+ getRelationshipTypes() {
137
+ return this.http.get(this.smartLookupServiceUrl + 'RelationshipTypes', options).pipe
138
+ (
139
+ map(res => res)
140
+ );
141
+ }
142
+
143
+ getGenders() {
144
+ return this.http.get(this.smartLookupServiceUrl + 'Genders', options).pipe
145
+ (
146
+ map(res => res)
147
+ );
148
+ }
149
+
150
+ getWeaponTypes() {
151
+ return this.http.get(this.smartLookupServiceUrl + 'WeaponTypes', options).pipe
152
+ (
153
+ map(res => res)
154
+ );
155
+ }
156
+
157
+ getFlagOptionYesNoUnknowns() {
158
+ return this.http.get(this.smartLookupServiceUrl + 'FlagOptionYesNoUnknowns', options).pipe
159
+ (
160
+ map(res => {
161
+ return res;
162
+ })
163
+ );
164
+ }
165
+
166
+ getContactTypes() {
167
+ return this.http.get(this.smartLookupServiceUrl + 'ContactTypes', options).pipe
168
+ (
169
+ map(res => {
170
+ return res;
171
+ })
172
+ );
173
+ }
174
+ getContactMethods() {
175
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactMethods', options).pipe
176
+ (
177
+ map(res => {
178
+ return res;
179
+ })
180
+ );
181
+ }
182
+ getContactBys(){
183
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe
184
+ (
185
+ map(res => {
186
+ return res;
187
+ })
188
+ );
189
+
190
+ }
191
+
192
+ getVictimContactPurposes() {
193
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe
194
+ (
195
+ map(res => {
196
+ return res;
197
+ })
198
+ );
199
+ }
200
+
201
+ getVictimServiceTypes() {
202
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceTypes', options).pipe
203
+ (
204
+ map(res => {
205
+ return res;
206
+ })
207
+ );
208
+ }
209
+ getVictimServiceStatus() {
210
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceStatus', options).pipe
211
+ (
212
+ map(res => {
213
+ return res;
214
+ })
215
+ );
216
+ }
217
+
218
+ getvVictimServiceTypeProgramProviders() {
219
+ return this.http.get(this.smartLookupServiceUrl + 'vVictimServiceTypeProgramProviders', options).pipe
220
+ (
221
+ map(res => {
222
+ return res;
223
+ })
224
+ );
225
+ }
226
+
227
+
228
+ getVictim(val: any) {
229
+ return this.http.get(this.smartVictimServiceUrl + 'Victims/' + val, options).pipe
230
+ (
231
+ map(res => {
232
+ console.log('victim return data');
233
+ console.log(res);
234
+ return res;
235
+
236
+ })
237
+ );
238
+ }
239
+
240
+ getVictimAdvocate(val: any) {
241
+ return this.http.get(this.smartVictimServiceUrl + 'VictimAdvocates/' + val, options).pipe
242
+ (
243
+
244
+ map(res => {
245
+ return res;})
246
+ );
247
+ }
248
+
249
+ getVictimGuardian(val: any) {
250
+ return this.http.get(this.smartVictimServiceUrl + 'VictimGuardians/' + val, options).pipe
251
+ (
252
+
253
+ map(res => {
254
+ return res;})
255
+ );
256
+ }
257
+
258
+ postVictims(val: any) {
259
+ const tempVal = JSON.stringify(val);
260
+ return this.http.post(this.smartVictimServiceUrl+ 'Victims', tempVal, options).pipe
261
+ (
262
+ map(res => { return res;})
263
+ );
264
+ }
265
+
266
+ putVictims(id: any, val: any) {
267
+ const tempVal = JSON.stringify(val);
268
+ return this.http.put(this.smartVictimServiceUrl + 'Victims/' + id, tempVal, options).pipe
269
+ (
270
+ map(res => { return res;})
271
+ );
272
+ }
273
+
274
+ putVictimAdvocate(id: any, val: VictimAdvocate) {
275
+ let body: string;
276
+ body = JSON.stringify(val);
277
+ return this.http.put(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, body, options).pipe
278
+ (
279
+ map(res => { return res;})
280
+ );
281
+
282
+
283
+
284
+
285
+ }
286
+
287
+ postVictimAdvocate(id: any, val: any) {
288
+ const tempVal = JSON.stringify(val);
289
+ return this.http.post(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, tempVal, options).pipe
290
+ (
291
+ map(res => { return res;})
292
+ );
293
+ }
294
+
295
+ putVictimGuardian(id: any, val: any) {
296
+ console.log('update victim guardian');
297
+ console.log(val);
298
+ const tempVal = JSON.stringify(val);
299
+ return this.http.put(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe
300
+ (
301
+ map(res => { return res;})
302
+ );
303
+ }
304
+
305
+ postVictimGuardian(id: any, val: any) {
306
+ const tempVal = JSON.stringify(val);
307
+ return this.http.post(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe
308
+ (
309
+ map(res => { return res;})
310
+ );
311
+ }
312
+
313
+ getVictimDrugUse(val: any): Observable<VictimDrugUse[]>{
314
+ return this.http.get(this.smartVictimServiceUrl + 'VictimDrugUses/' + val, options).pipe
315
+ (
316
+ map((res: VictimDrugUse[]) => {
317
+ return res;})
318
+ );
319
+ }
320
+
321
+ putVictimDrugUse(id: any, val: VictimDrugUse[]) {
322
+ const tempVal = JSON.stringify(val);
323
+
324
+ return this.http.put(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe
325
+ (
326
+ map(res => { return res;})
327
+ );
328
+ }
329
+
330
+ postVictimDrugUse(id: any, val: any) {
331
+ const tempVal = JSON.stringify(val);
332
+ return this.http.post(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe
333
+ (
334
+ map(res => { return res;})
335
+ );
336
+ }
337
+
338
+ putVictimWeaponUse(id: any, val: any) {
339
+ const tempVal = JSON.stringify(val);
340
+ return this.http.put(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe
341
+ (
342
+ map(res => { return res;})
343
+ );
344
+ }
345
+
346
+ postVictimWeaponUse(id: any, val: any) {
347
+ const tempVal = JSON.stringify(val);
348
+ return this.http.post(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe
349
+ (
350
+ map(res => { return res;})
351
+ );
352
+ }
353
+ putVictimSupport(id: any, val: any) {
354
+ const tempVal = JSON.stringify(val);
355
+ return this.http.put(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe
356
+ (
357
+ map(res => { return res;})
358
+ );
359
+ }
360
+
361
+ postVictimSupport(id: any, val: any) {
362
+ const tempVal = JSON.stringify(val);
363
+ return this.http.post(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe
364
+ (
365
+ map(res => { return res;})
366
+ );
367
+ }
368
+
369
+ deleteVictims(val: any, staffId: number) {
370
+ return this.http.delete(this.smartVictimServiceUrl+ 'Victims/' + val + '?staffId='+ staffId, options).pipe
371
+ (
372
+ map(res => { return res;})
373
+ );
374
+ }
375
+
376
+
377
+ // //==============Victim Serive===================================
378
+
379
+ getVictims(offenderId: number): Observable <Victim[]> {
380
+
381
+ return this.http.get(this.smartVictimServiceUrl + 'Victims/offender/' + offenderId)
382
+ .pipe(map((res: Victim[]) => {
383
+
384
+ return res;
385
+ })
386
+ ,catchError(this.handleError));
387
+ }
388
+
389
+ getVictimsByFilter(filter: VictimListFilter): Observable<Victim[]>{
390
+ return this.http
391
+ .post(this.smartVictimServiceUrl + '/Victims', JSON.stringify(filter), { headers: headers })
392
+ .pipe(map((res: Victim[]) => {
393
+ return res;
394
+ })
395
+ ,catchError(this.handleError));
396
+ }
397
+
398
+ getVictimListByFilter(filter: VictimListFilter)
399
+ {
400
+ console.log('filer in service');
401
+ console.log(filter);
402
+
403
+ return this.http
404
+ .post(this.smartVictimServiceUrl + 'vVictims/Filter', JSON.stringify(filter), options)
405
+ .pipe();
406
+
407
+ }
408
+
409
+
410
+ getCasetNotes(victimId: number): Observable <CaseNote[]> {
411
+
412
+ return this.http.get(this.smartVictimServiceUrl + 'VictimCaseNotes/victim/' + victimId)
413
+ .pipe(map((res: CaseNote[]) => {
414
+ return res;
415
+ })
416
+ ,catchError(this.handleError));
417
+
418
+
419
+ }
420
+ addCaseNote(caseNote: CaseNote) {
421
+ let body: string;
422
+ body = JSON.stringify(caseNote);
423
+ return this.http
424
+ .post(this.smartVictimServiceUrl + 'VictimCaseNotes/', body, options);
425
+
426
+ }
427
+
428
+
429
+ updateCaseNote(caseNote: CaseNote){
430
+
431
+ let body: string;
432
+ body = JSON.stringify(caseNote);
433
+ return this.http
434
+ .put(this.smartVictimServiceUrl + 'VictimCaseNotes/' + caseNote.victimCaseNoteId, body, options)
435
+
436
+ ;
437
+ }
438
+
439
+ deleteCaseNote(id: number, staffId: number) {
440
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimCaseNotes/${id}?staffId=${staffId}`);
441
+ }
442
+
443
+ getContacts(victimId: number): Observable <Contact[]> {
444
+
445
+ return this.http.get(this.smartVictimServiceUrl + 'VictimContacts/victim/' + victimId)
446
+ .pipe(map((res: Contact[]) => {
447
+ return res;
448
+ })
449
+ ,catchError(this.handleError));
450
+
451
+ }
452
+ addContact(contact: Contact) {
453
+ let body: string;
454
+ body = JSON.stringify(contact);
455
+ return this.http
456
+ .post(this.smartVictimServiceUrl + 'VictimContacts/', body, options);
457
+
458
+ }
459
+
460
+
461
+ updateContact(contact: Contact){
462
+
463
+ let body: string;
464
+ body = JSON.stringify(contact);
465
+ return this.http
466
+ .put(this.smartVictimServiceUrl + 'VictimContacts/' + contact.victimContactId, body, options)
467
+
468
+ ;
469
+ }
470
+
471
+ getSafetyPlans(victimId: number): Observable <VictimSafetyPlan[]> {
472
+
473
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
474
+ .pipe(map((res: VictimSafetyPlan[]) => {
475
+ return res;
476
+ })
477
+ ,catchError(this.handleError));
478
+ }
479
+
480
+ getVictimServices(victimServiceId: number): Observable <VictimSafetyPlan[]> {
481
+
482
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
483
+ .pipe(map((res: VictimSafetyPlan[]) => {
484
+ return res;
485
+ })
486
+ ,catchError(this.handleError));
487
+
488
+ }
489
+
490
+ getVictimServiceDetail(victimServiceId: number): Observable <VictimServiceDetail[]> {
491
+
492
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
493
+ .pipe(map((res: VictimServiceDetail[]) => {
494
+
495
+ return res;
496
+ })
497
+ ,catchError(this.handleError));
498
+
499
+ }
500
+ addSafetyPlan(victimSafetyPlan: VictimSafetyPlan) {
501
+
502
+ let body: string;
503
+ body = JSON.stringify(victimSafetyPlan);
504
+ return this.http
505
+ .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
506
+ .pipe();
507
+
508
+ }
509
+ updateSafetyPlan(victimSafetyPlan: VictimSafetyPlan){
510
+
511
+ let body: string;
512
+ body = JSON.stringify(victimSafetyPlan);
513
+ return this.http
514
+ .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options)
515
+
516
+ ;
517
+ }
518
+ addVictimServiceStatus(victimServiceStatusHistory: VictimServiceStatusHistory){
519
+ let body: string;
520
+ body = JSON.stringify(victimServiceStatusHistory);
521
+ return this.http
522
+ .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
523
+
524
+ }
525
+
526
+ getServiceStatusHistories(victimServiceId: number){
527
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
528
+ .pipe(
529
+ map((res: VictimServiceStatusHistory[]) => {
530
+
531
+ return res;
532
+ })
533
+ ,catchError(this.handleError)
534
+ );
535
+ }
536
+
537
+ deleteSafetyPlan(victimServiceId: number, staffId: number) {
538
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
539
+
540
+ }
541
+ addPlanProvider(victimServiceDetail:VictimServiceDetail){
542
+ let body: string;
543
+ body = JSON.stringify(victimServiceDetail);
544
+ return this.http
545
+ .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
546
+ .pipe();
547
+
548
+ }
549
+
550
+ deleteProvider(victimProgramProviderId: string, staffId: number){
551
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
552
+
553
+ }
554
+
555
+
556
+
557
+ }
@@ -0,0 +1,35 @@
1
+ import { MsalGuard } from '@azure/msal-angular';
2
+ import { SmartErrorComponent } from '@csmart/ngc-smart-core';
3
+ import { LoginStaffResolverService, SelectedOffenderResolverService} from '@csmart/ngc-smart-core';
4
+ import { Routes, RouterModule } from '@angular/router';
5
+ import { NgModule } from '@angular/core';
6
+ import { CaseNoteComponent } from './caseNote/caseNote.component';
7
+ import { ContactComponent } from './contact/contact.component';
8
+ import { VictimSafetyPlanComponent } from './safetyPlan/victimSafetyPlan.component';
9
+ import { VictimSafetyPlanDetailComponent } from './safetyPlan/victimSafetyPlanDetail.component';
10
+ import { SmartVictimDetailComponent } from './smart-victim-detail/smart-victim-detail.component';
11
+ import { NgcSmartVictimComponent} from './smart-victim.component'
12
+
13
+ const routes: Routes = [
14
+
15
+ //{path: 'casenote/:victimId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
16
+ {path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
17
+ {path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
18
+ {path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
19
+ {path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
20
+ {path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
21
+ {path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
22
+ {path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
23
+ {path: 'smart-error', component: SmartErrorComponent }
24
+ ];
25
+
26
+ @NgModule({
27
+ imports: [
28
+ RouterModule.forChild(routes)
29
+ ],
30
+ exports: [
31
+ RouterModule
32
+ ]
33
+ })
34
+ export class VictimRoutingModule {
35
+ }
@@ -1,7 +1,9 @@
1
- export declare class VictimListFilter {
2
- offenderId: number;
3
- lastName: string;
4
- firstName: string;
5
- pdid: string;
6
- birthDate: Date;
7
- }
1
+ export class VictimListFilter {
2
+
3
+ offenderId: number;
4
+ lastName: string;
5
+ firstName: string;
6
+ pdid: string;
7
+ birthDate: Date;
8
+
9
+ }
@@ -0,0 +1,35 @@
1
+ <form name="victimSearchFrom" #From="ngForm">
2
+ <mat-expansion-panel [expanded]="true">
3
+ <mat-expansion-panel-header>
4
+ <mat-panel-title>
5
+ Search for Victims
6
+ </mat-panel-title>
7
+ </mat-expansion-panel-header>
8
+ <div class="victimSearch">
9
+ <mat-form-field>
10
+ <input matInput placeholder="Victim Last Name" [(ngModel)]="filter.lastName" name="lastName" id="lastName">
11
+ </mat-form-field>
12
+ <mat-form-field>
13
+ <input matInput placeholder="Victim First Name" [(ngModel)]="filter.firstName" name="firstName" id="firstName">
14
+ </mat-form-field>
15
+ <mat-form-field>
16
+ <input matInput placeholder="Victim Date of Birth" type="date" [(ngModel)]="filter.birthDate" name="birthDate" id="birthDate">
17
+ </mat-form-field>
18
+ <mat-form-field>
19
+ <input matInput placeholder="Offender PDID" [(ngModel)]="filter.pdid" name="pdid" id="pdid">
20
+ </mat-form-field>
21
+ <mat-form-field>
22
+ <input matInput placeholder="Offender CSOSA #"[(ngModel)]="filter.offenderId" name="offenderId" id="offenderId">
23
+ </mat-form-field>
24
+
25
+
26
+ <section>
27
+ <button id="victimSearchButton" mat-raised-button color="primary" (click)="onChange()">Search</button>
28
+ <span style="padding-right: 5px;"></span>
29
+ <button mat-raised-button color="primary" type="reset" value="Reset">Clear Changes</button>
30
+ </section>
31
+ </div>
32
+ </mat-expansion-panel>
33
+ </form>
34
+
35
+
@@ -0,0 +1,41 @@
1
+ import { Component, OnInit, ViewEncapsulation,
2
+ Output, EventEmitter } from '@angular/core';
3
+
4
+ import { VictimListFilter } from './VictimSearchFilter';
5
+
6
+ @Component({
7
+ selector: 'app-victim-search-form',
8
+ templateUrl: './victimSearchForm.component.html',
9
+ styleUrls: ['../smart-victim.component.css'],
10
+ encapsulation: ViewEncapsulation.None
11
+ })
12
+ export class VictimSearchFormComponent implements OnInit {
13
+
14
+ @Output() onSearch:EventEmitter<Object>=new EventEmitter<Object>();
15
+ change: EventEmitter<VictimListFilter> = new EventEmitter<VictimListFilter>();
16
+
17
+ filter: VictimListFilter = new VictimListFilter();
18
+
19
+ constructor() { }
20
+
21
+ ngOnInit() {
22
+
23
+ }
24
+
25
+ ngAfterViewInit() {
26
+
27
+ // var element = <HTMLInputElement> document.getElementById("victimSearchButton");
28
+ // element.disabled = true;
29
+ // setTimeout(function() {
30
+ // element.disabled = false;
31
+ // }, 10000);
32
+
33
+ }
34
+ onChange() {
35
+ console.log('this.filter in serach form.');
36
+ console.log(this.filter);
37
+
38
+ this.onSearch.emit(this.filter);
39
+
40
+ }
41
+ }