@csmart/ngc-smart-victim 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +13 -26
  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 +248 -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 +25 -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/intake.service.ts +82 -0
  17. package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
  18. package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
  19. package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
  20. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
  21. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
  22. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
  23. package/src/lib/shared/app.shared.module.ts +118 -0
  24. package/src/lib/shared/directives/phone-mask.directive.ts +41 -0
  25. package/src/lib/shared/validators/date.validator.ts +73 -0
  26. package/src/lib/shared/validators/index.ts +1 -0
  27. package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
  28. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
  29. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +860 -0
  30. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
  31. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1241 -0
  32. package/src/lib/smart-victim.component.css +192 -0
  33. package/src/lib/smart-victim.component.html +133 -0
  34. package/src/lib/smart-victim.component.spec.ts +25 -0
  35. package/src/lib/smart-victim.component.ts +323 -0
  36. package/src/lib/smart-victim.model.ts +301 -0
  37. package/src/lib/smart-victim.module.ts +116 -0
  38. package/src/lib/smart-victim.service.spec.ts +12 -0
  39. package/src/lib/smart-victim.service.ts +563 -0
  40. package/src/lib/victim-routing.module.ts +34 -0
  41. package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +4 -2
  42. package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
  43. package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
  44. package/src/public-api.ts +12 -0
  45. package/src/test.ts +22 -0
  46. package/tsconfig.lib.json +37 -0
  47. package/tsconfig.spec.json +17 -0
  48. package/tslint.json +17 -0
  49. package/bundles/csmart-ngc-smart-victim.umd.js +0 -6434
  50. package/bundles/csmart-ngc-smart-victim.umd.js.map +0 -1
  51. package/bundles/csmart-ngc-smart-victim.umd.min.js +0 -16
  52. package/bundles/csmart-ngc-smart-victim.umd.min.js.map +0 -1
  53. package/csmart-ngc-smart-victim.d.ts +0 -19
  54. package/csmart-ngc-smart-victim.metadata.json +0 -1
  55. package/esm2015/csmart-ngc-smart-victim.js +0 -25
  56. package/esm2015/lib/caseNote/caseNote.component.js +0 -349
  57. package/esm2015/lib/common-dialog/common-dialog.component.js +0 -46
  58. package/esm2015/lib/common-dialog/common-dialog.module.js +0 -32
  59. package/esm2015/lib/common-dialog/common-dialog.service.js +0 -63
  60. package/esm2015/lib/contact/contact.component.js +0 -232
  61. package/esm2015/lib/intake.service.js +0 -183
  62. package/esm2015/lib/safetyPlan/serviceProvider.component.js +0 -130
  63. package/esm2015/lib/safetyPlan/victimSafetyPlan.component.js +0 -257
  64. package/esm2015/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -556
  65. package/esm2015/lib/shared/app.shared.module.js +0 -81
  66. package/esm2015/lib/shared/directives/phone-mask.directive.js +0 -168
  67. package/esm2015/lib/shared/validators/date.validator.js +0 -108
  68. package/esm2015/lib/shared/validators/index.js +0 -7
  69. package/esm2015/lib/smart-victim-delete-confirm.component.js +0 -61
  70. package/esm2015/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1410
  71. package/esm2015/lib/smart-victim.component.js +0 -476
  72. package/esm2015/lib/smart-victim.model.js +0 -631
  73. package/esm2015/lib/smart-victim.module.js +0 -84
  74. package/esm2015/lib/smart-victim.service.js +0 -792
  75. package/esm2015/lib/victim-routing.module.js +0 -40
  76. package/esm2015/lib/victimSearch/VictimSearchFilter.js +0 -20
  77. package/esm2015/lib/victimSearch/victimSearchForm.component.js +0 -59
  78. package/esm2015/public-api.js +0 -13
  79. package/esm5/csmart-ngc-smart-victim.js +0 -25
  80. package/esm5/lib/caseNote/caseNote.component.js +0 -372
  81. package/esm5/lib/common-dialog/common-dialog.component.js +0 -48
  82. package/esm5/lib/common-dialog/common-dialog.module.js +0 -36
  83. package/esm5/lib/common-dialog/common-dialog.service.js +0 -75
  84. package/esm5/lib/contact/contact.component.js +0 -285
  85. package/esm5/lib/intake.service.js +0 -194
  86. package/esm5/lib/safetyPlan/serviceProvider.component.js +0 -99
  87. package/esm5/lib/safetyPlan/victimSafetyPlan.component.js +0 -306
  88. package/esm5/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -628
  89. package/esm5/lib/shared/app.shared.module.js +0 -85
  90. package/esm5/lib/shared/directives/phone-mask.directive.js +0 -184
  91. package/esm5/lib/shared/validators/date.validator.js +0 -108
  92. package/esm5/lib/shared/validators/index.js +0 -7
  93. package/esm5/lib/smart-victim-delete-confirm.component.js +0 -51
  94. package/esm5/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1502
  95. package/esm5/lib/smart-victim.component.js +0 -528
  96. package/esm5/lib/smart-victim.model.js +0 -541
  97. package/esm5/lib/smart-victim.module.js +0 -84
  98. package/esm5/lib/smart-victim.service.js +0 -1063
  99. package/esm5/lib/victim-routing.module.js +0 -44
  100. package/esm5/lib/victimSearch/VictimSearchFilter.js +0 -24
  101. package/esm5/lib/victimSearch/victimSearchForm.component.js +0 -70
  102. package/esm5/public-api.js +0 -13
  103. package/fesm2015/csmart-ngc-smart-victim.js +0 -5690
  104. package/fesm2015/csmart-ngc-smart-victim.js.map +0 -1
  105. package/fesm5/csmart-ngc-smart-victim.js +0 -6211
  106. package/fesm5/csmart-ngc-smart-victim.js.map +0 -1
  107. package/lib/caseNote/caseNote.component.d.ts +0 -45
  108. package/lib/common-dialog/common-dialog.component.d.ts +0 -11
  109. package/lib/common-dialog/common-dialog.module.d.ts +0 -2
  110. package/lib/common-dialog/common-dialog.service.d.ts +0 -8
  111. package/lib/contact/contact.component.d.ts +0 -37
  112. package/lib/intake.service.d.ts +0 -54
  113. package/lib/safetyPlan/serviceProvider.component.d.ts +0 -16
  114. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -49
  115. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -57
  116. package/lib/shared/app.shared.module.d.ts +0 -2
  117. package/lib/shared/directives/phone-mask.directive.d.ts +0 -14
  118. package/lib/shared/validators/date.validator.d.ts +0 -9
  119. package/lib/shared/validators/index.d.ts +0 -1
  120. package/lib/smart-victim-delete-confirm.component.d.ts +0 -9
  121. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -109
  122. package/lib/smart-victim.component.d.ts +0 -63
  123. package/lib/smart-victim.model.d.ts +0 -204
  124. package/lib/smart-victim.module.d.ts +0 -2
  125. package/lib/smart-victim.service.d.ts +0 -67
  126. package/lib/victim-routing.module.d.ts +0 -2
  127. package/lib/victimSearch/victimSearchForm.component.d.ts +0 -11
  128. package/public-api.d.ts +0 -4
@@ -0,0 +1,563 @@
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
+ const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
12
+ const options = { headers: headers };
13
+
14
+ @Injectable({
15
+ providedIn: 'root'
16
+ })
17
+ export class NgcSmartVictimService {
18
+ private serviceApiUrl = 'https://smart-service-test.azurewebsites.net/graphql';
19
+ constructor(private http: HttpClient,
20
+ @Inject(SMART_OFFENDER_SERVICE_URL) private smartOffenderServiceUrl: string,
21
+ @Inject(SMART_LOOKUP_SERVICE_URL) private smartLookupServiceUrl: string,
22
+ @Inject(SMART_VICTIM_SERVICE_URL) private smartVictimServiceUrl: string,
23
+ private apollo: Apollo
24
+
25
+ ) { }
26
+
27
+ // getVictimInsurances(offenderId: any) {
28
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?offenderId=' + offenderId).pipe();
29
+ // }
30
+
31
+ // getVictimInsurance(id: any) {
32
+ // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
33
+ // }
34
+
35
+ // postVictimInsurance(val: any) {
36
+ // return this.http.post(this.smartOffenderServiceUrl + '/VictimInsurances', val).pipe();
37
+ // }
38
+
39
+ // putVictimInsurance(id: any, val: any) {
40
+ // return this.http.put(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id, val).pipe();
41
+ // }
42
+
43
+ // deleteVictimInsurance(id: any) {
44
+ // return this.http.delete(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
45
+ // }
46
+
47
+ // getVictimInsuranceTypes() {
48
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceTypes').pipe();
49
+ // }
50
+
51
+ // getVictimInsurancePolicyHolders() {
52
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsurancePolicyHolders').pipe();
53
+ // }
54
+
55
+ // getVictimInsuranceSwitchReasons() {
56
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceSwitchReasons').pipe();
57
+ // }
58
+
59
+ // getVictimInsuranceProviders() {
60
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProvider').pipe();
61
+ // }
62
+
63
+ // getVictimInsuranceProvider(id) {
64
+ // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProviders/' + id).pipe();
65
+ // }
66
+
67
+ // postProviderInformation(val: any) {
68
+ // return this.http.post(this.smartLookupServiceUrl + '/VictimInsuranceProviders', val).pipe();
69
+ // }
70
+
71
+ getCurrentHousing(offenderId: number) {
72
+
73
+ return this.http
74
+ .get(this.smartOffenderServiceUrl + 'Housings/current/' + offenderId)
75
+ .pipe();
76
+ }
77
+
78
+ private handleError(error: any) {
79
+ console.error(error);
80
+ return observableThrowError(error.json().error || 'Server error');
81
+ }
82
+
83
+ getDrugsTypes() {
84
+ return this.http.get(this.smartLookupServiceUrl + 'DrugTypes', options).pipe
85
+ (
86
+ map(res => res)
87
+ );
88
+ }
89
+
90
+ getDocketList(offenderId: number) {
91
+ const queryString = `
92
+ {
93
+ findDockets(input: { where: { offenderId:${offenderId} } }) {
94
+ totalCount
95
+ message
96
+ data {
97
+ docketId
98
+ docketNumber
99
+
100
+ }
101
+ }
102
+ }`;
103
+
104
+ return this.http.post<any>(this.serviceApiUrl, { query: queryString }).pipe(
105
+ map(({ data }) => {
106
+ console.log('dockets for this offender:', data.findDockets.data);
107
+ return data.findDockets.data;
108
+ }));
109
+
110
+
111
+ }
112
+
113
+ getSupportTypes() {
114
+ return this.http.get(this.smartLookupServiceUrl + 'VictimSupportTypes', options).pipe
115
+ (
116
+ map(res => res)
117
+ );
118
+ }
119
+
120
+ getPrefixes() {
121
+ return this.http.get(this.smartLookupServiceUrl + 'Prefixes', options).pipe
122
+ (
123
+ map(res => res)
124
+ );
125
+ }
126
+
127
+ getSuffixes() {
128
+ return this.http.get(this.smartLookupServiceUrl + 'Suffixes', options).pipe
129
+ (
130
+ map(res => res)
131
+ );
132
+ }
133
+
134
+ getRelationshipTypes() {
135
+ return this.http.get(this.smartLookupServiceUrl + 'RelationshipTypes', options).pipe
136
+ (
137
+ map(res => res)
138
+ );
139
+ }
140
+
141
+ getGenders() {
142
+ return this.http.get(this.smartLookupServiceUrl + 'Genders', options).pipe
143
+ (
144
+ map(res => res)
145
+ );
146
+ }
147
+
148
+ getWeaponTypes() {
149
+ return this.http.get(this.smartLookupServiceUrl + 'WeaponTypes', options).pipe
150
+ (
151
+ map(res => res)
152
+ );
153
+ }
154
+
155
+ getFlagOptionYesNoUnknowns() {
156
+ return this.http.get(this.smartLookupServiceUrl + 'FlagOptionYesNoUnknowns', options).pipe
157
+ (
158
+ map(res => {
159
+ return res;
160
+ })
161
+ );
162
+ }
163
+
164
+ getContactTypes() {
165
+ return this.http.get(this.smartLookupServiceUrl + 'ContactTypes', options).pipe
166
+ (
167
+ map(res => {
168
+ return res;
169
+ })
170
+ );
171
+ }
172
+ getContactMethods() {
173
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactMethods', options).pipe
174
+ (
175
+ map(res => {
176
+ return res;
177
+ })
178
+ );
179
+ }
180
+ getContactBys(){
181
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe
182
+ (
183
+ map(res => {
184
+ return res;
185
+ })
186
+ );
187
+
188
+ }
189
+
190
+ getVictimContactPurposes() {
191
+ return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe
192
+ (
193
+ map(res => {
194
+ return res;
195
+ })
196
+ );
197
+ }
198
+
199
+ getVictimServiceTypes() {
200
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceTypes', options).pipe
201
+ (
202
+ map(res => {
203
+ return res;
204
+ })
205
+ );
206
+ }
207
+ getVictimServiceStatus() {
208
+ return this.http.get(this.smartLookupServiceUrl + 'VictimServiceStatus', options).pipe
209
+ (
210
+ map(res => {
211
+ return res;
212
+ })
213
+ );
214
+ }
215
+
216
+ getvVictimServiceTypeProgramProviders() {
217
+ return this.http.get(this.smartLookupServiceUrl + 'vVictimServiceTypeProgramProviders', options).pipe
218
+ (
219
+ map(res => {
220
+ return res;
221
+ })
222
+ );
223
+ }
224
+
225
+
226
+ getVictim(val: any) {
227
+ return this.http.get(this.smartVictimServiceUrl + 'Victims/' + val, options).pipe
228
+ (
229
+ map(res => {
230
+ console.log('victim return data');
231
+ console.log(res);
232
+ return res;
233
+
234
+ })
235
+ );
236
+ }
237
+
238
+ getVictimAdvocate(val: any) {
239
+ return this.http.get(this.smartVictimServiceUrl + 'VictimAdvocates/' + val, options).pipe
240
+ (
241
+
242
+ map(res => {
243
+ return res;})
244
+ );
245
+ }
246
+
247
+ getVictimGuardian(val: any) {
248
+ return this.http.get(this.smartVictimServiceUrl + 'VictimGuardians/' + val, options).pipe
249
+ (
250
+
251
+ map(res => {
252
+ return res;})
253
+ );
254
+ }
255
+
256
+ postVictims(val: any) {
257
+ const tempVal = JSON.stringify(val);
258
+ return this.http.post(this.smartVictimServiceUrl+ 'Victims', tempVal, options).pipe
259
+ (
260
+ map(res => { return res;})
261
+ );
262
+ }
263
+
264
+ putVictims(id: any, val: any) {
265
+ const tempVal = JSON.stringify(val);
266
+ return this.http.put(this.smartVictimServiceUrl + 'Victims/' + id, tempVal, options).pipe
267
+ (
268
+ map(res => { return res;})
269
+ );
270
+ }
271
+
272
+ putVictimAdvocate(id: any, val: VictimAdvocate) {
273
+ let body: string;
274
+ body = JSON.stringify(val);
275
+ return this.http.put(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, body, options).pipe
276
+ (
277
+ map(res => { return res;})
278
+ );
279
+
280
+
281
+
282
+
283
+ }
284
+
285
+ postVictimAdvocate(id: any, val: any) {
286
+ const tempVal = JSON.stringify(val);
287
+ return this.http.post(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, tempVal, options).pipe
288
+ (
289
+ map(res => { return res;})
290
+ );
291
+ }
292
+
293
+ putVictimGuardian(id: any, val: any) {
294
+ console.log('update victim guardian');
295
+ console.log(val);
296
+ const tempVal = JSON.stringify(val);
297
+ return this.http.put(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe
298
+ (
299
+ map(res => { return res;})
300
+ );
301
+ }
302
+
303
+ postVictimGuardian(id: any, val: any) {
304
+ const tempVal = JSON.stringify(val);
305
+ return this.http.post(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe
306
+ (
307
+ map(res => { return res;})
308
+ );
309
+ }
310
+
311
+ getVictimDrugUse(val: any): Observable<VictimDrugUse[]>{
312
+ return this.http.get(this.smartVictimServiceUrl + 'VictimDrugUses/' + val, options).pipe
313
+ (
314
+ map((res: VictimDrugUse[]) => {
315
+ return res;})
316
+ );
317
+ }
318
+
319
+ putVictimDrugUse(id: any, val: VictimDrugUse[]) {
320
+ const tempVal = JSON.stringify(val);
321
+
322
+ return this.http.put(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe
323
+ (
324
+ map(res => { return res;})
325
+ );
326
+ }
327
+
328
+ postVictimDrugUse(id: any, val: any) {
329
+ const tempVal = JSON.stringify(val);
330
+ return this.http.post(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe
331
+ (
332
+ map(res => { return res;})
333
+ );
334
+ }
335
+
336
+ putVictimWeaponUse(id: any, val: any) {
337
+ const tempVal = JSON.stringify(val);
338
+ return this.http.put(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe
339
+ (
340
+ map(res => { return res;})
341
+ );
342
+ }
343
+
344
+ postVictimWeaponUse(id: any, val: any) {
345
+ const tempVal = JSON.stringify(val);
346
+ return this.http.post(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe
347
+ (
348
+ map(res => { return res;})
349
+ );
350
+ }
351
+ putVictimSupport(id: any, val: any) {
352
+ const tempVal = JSON.stringify(val);
353
+ return this.http.put(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe
354
+ (
355
+ map(res => { return res;})
356
+ );
357
+ }
358
+
359
+ postVictimSupport(id: any, val: any) {
360
+ const tempVal = JSON.stringify(val);
361
+ return this.http.post(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe
362
+ (
363
+ map(res => { return res;})
364
+ );
365
+ }
366
+
367
+ deleteVictims(val: any) {
368
+ return this.http.delete(this.smartVictimServiceUrl+ 'Victims/' + val, options).pipe
369
+ (
370
+ map(res => { return res;})
371
+ );
372
+ }
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
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+ getSafetyPlans(victimId: number): Observable <VictimSafetyPlan[]> {
480
+
481
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
482
+ .pipe(map((res: VictimSafetyPlan[]) => {
483
+ return res;
484
+ })
485
+ ,catchError(this.handleError));
486
+ }
487
+
488
+ getVictimServices(victimServiceId: number): Observable <VictimSafetyPlan[]> {
489
+
490
+ return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
491
+ .pipe(map((res: VictimSafetyPlan[]) => {
492
+ return res;
493
+ })
494
+ ,catchError(this.handleError));
495
+
496
+ }
497
+
498
+ getVictimServiceDetail(victimServiceId: number): Observable <VictimServiceDetail[]> {
499
+
500
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
501
+ .pipe(map((res: VictimServiceDetail[]) => {
502
+
503
+ return res;
504
+ })
505
+ ,catchError(this.handleError));
506
+
507
+ }
508
+ addSafetyPlan(victimSafetyPlan: VictimSafetyPlan) {
509
+
510
+ let body: string;
511
+ body = JSON.stringify(victimSafetyPlan);
512
+ return this.http
513
+ .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
514
+ .pipe();
515
+
516
+ }
517
+ updateSafetyPlan(victimSafetyPlan: VictimSafetyPlan){
518
+
519
+ let body: string;
520
+ body = JSON.stringify(victimSafetyPlan);
521
+ return this.http
522
+ .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options)
523
+
524
+ ;
525
+ }
526
+ addVictimServiceStatus(victimServiceStatusHistory: VictimServiceStatusHistory){
527
+ let body: string;
528
+ body = JSON.stringify(victimServiceStatusHistory);
529
+ return this.http
530
+ .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
531
+
532
+ }
533
+
534
+ getServiceStatusHistories(victimServiceId: number){
535
+ return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
536
+ .pipe(
537
+ map((res: VictimServiceStatusHistory[]) => {
538
+
539
+ return res;
540
+ })
541
+ ,catchError(this.handleError)
542
+ );
543
+ }
544
+
545
+ deleteSafetyPlan(victimServiceId: number, staffId: number) {
546
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
547
+
548
+ }
549
+ addPlanProvider(victimServiceDetail:VictimServiceDetail){
550
+ let body: string;
551
+ body = JSON.stringify(victimServiceDetail);
552
+ return this.http
553
+ .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
554
+ .pipe();
555
+
556
+ }
557
+
558
+ deleteProvider(victimProgramProviderId: string, staffId: number){
559
+ return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
560
+
561
+ }
562
+
563
+ }
@@ -0,0 +1,34 @@
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: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
17
+ {path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
18
+ {path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
19
+ {path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
20
+ {path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
21
+ {path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
22
+ {path: 'smart-error', component: SmartErrorComponent }
23
+ ];
24
+
25
+ @NgModule({
26
+ imports: [
27
+ RouterModule.forChild(routes)
28
+ ],
29
+ exports: [
30
+ RouterModule
31
+ ]
32
+ })
33
+ export class VictimRoutingModule {
34
+ }
@@ -1,7 +1,9 @@
1
- export declare class VictimListFilter {
1
+ export class VictimListFilter {
2
+
2
3
  offenderId: number;
3
4
  lastName: string;
4
5
  firstName: string;
5
6
  pdid: string;
6
7
  birthDate: Date;
7
- }
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
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Public API Surface of ngc-smart-victim
3
+ */
4
+
5
+ export * from './lib/smart-victim.service';
6
+ export * from './lib/smart-victim.component';
7
+ export * from './lib/smart-victim.model';
8
+ export * from './lib/smart-victim.module';
9
+ export * from './lib/caseNote/caseNote.component';
10
+ export * from './lib/smart-victim-detail/smart-victim-detail.component';
11
+ export * from './lib/smart-victim-delete-confirm.component';
12
+ export * from './lib/shared/directives/phone-mask.directive';