@csmart/ngc-smart-victim 1.18.7 → 1.18.9

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 +22 -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 +22 -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 +1387 -0
  35. package/src/lib/smart-victim.component.css +245 -0
  36. package/src/lib/smart-victim.component.html +132 -0
  37. package/src/lib/smart-victim.component.spec.ts +25 -0
  38. package/src/lib/smart-victim.component.ts +333 -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 +16 -0
  49. package/tsconfig.lib.json +36 -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,110 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { ReactiveFormsModule,FormsModule} from '@angular/forms';
4
+ // import {
5
+
6
+
7
+ // MatMenuModule, MatProgressBarModule,
8
+
9
+ // MatSidenavModule,
10
+ // MatPaginatorModule,
11
+ // } from '@angular/material';
12
+
13
+ import { MatButtonModule } from '@angular/material/button';
14
+ import { MatCheckboxModule } from '@angular/material/checkbox';
15
+ import { MatCardModule } from '@angular/material/card';
16
+ import { MatSliderModule } from '@angular/material/slider';
17
+ import { MatListModule } from '@angular/material/list';
18
+ import { MatIconModule } from '@angular/material/icon';
19
+ import { MatButtonToggleModule } from '@angular/material/button-toggle';
20
+ import { MatToolbarModule } from '@angular/material/toolbar';
21
+ import { MatRadioModule } from '@angular/material/radio';
22
+ import { MatInputModule } from '@angular/material/input';
23
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
24
+ import { MatDatepickerModule } from '@angular/material/datepicker';
25
+ import { DateAdapter, MatNativeDateModule, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
26
+ import { MatDialogModule } from '@angular/material/dialog';
27
+ import { MatExpansionModule } from '@angular/material/expansion';
28
+ import { MatSelectModule } from '@angular/material/select';
29
+ import { MatTableModule } from '@angular/material/table';
30
+ import { MatSortModule } from '@angular/material/sort';
31
+ import { MatGridListModule } from '@angular/material/grid-list';
32
+ import { MatTabsModule } from '@angular/material/tabs';
33
+ import { CdkTableModule } from '@angular/cdk/table';
34
+ import { LayoutModule } from '@angular/cdk/layout';
35
+ import { SmartAddressModule } from '@csmart/ngc-smart-address';
36
+ import { NgcSmartVictimComponent } from './smart-victim.component';
37
+ import { NgcSmartVictimService } from './smart-victim.service';
38
+ import { SmartVictimDetailComponent } from './smart-victim-detail/smart-victim-detail.component';
39
+ import { SmartVictimDeleteConfirmComponent } from './smart-victim-delete-confirm.component';
40
+ import { CommonDialogModule } from './common-dialog/common-dialog.module';
41
+ import { VictimRoutingModule } from './victim-routing.module';
42
+ import { CaseNoteComponent } from './caseNote/caseNote.component';
43
+ import { ContactComponent } from './contact/contact.component';
44
+ import { VictimSafetyPlanComponent } from './safetyPlan/victimSafetyPlan.component';
45
+ import { VictimSafetyPlanDetailComponent } from './safetyPlan/victimSafetyPlanDetail.component';
46
+ import { VictimSearchFormComponent } from './victimSearch/victimSearchForm.component';
47
+ import { ApolloModule, APOLLO_OPTIONS } from 'apollo-angular';
48
+ import { SeriveProviderComponent } from './safetyPlan/serviceProvider.component';
49
+ import { NgcSmartCoreModule } from '@csmart/ngc-smart-core';
50
+ import { MatMenuModule } from '@angular/material/menu';
51
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
52
+ import { MatPaginatorModule } from '@angular/material/paginator';
53
+ import { MatSidenavModule } from '@angular/material/sidenav';
54
+ import { SmartUiModule } from '@csmart/smart-ui';
55
+
56
+ const COMPONENTS = [
57
+ NgcSmartVictimComponent,
58
+ SmartVictimDetailComponent,
59
+ SmartVictimDeleteConfirmComponent,
60
+
61
+
62
+ ];
63
+
64
+ const ENTRY_COMPONENTS = [
65
+ SmartVictimDeleteConfirmComponent,
66
+
67
+ ];
68
+
69
+ const BASE_MODULES = [
70
+ CommonModule,
71
+ ReactiveFormsModule
72
+ ];
73
+
74
+ const CORE_MODULES = [NgcSmartCoreModule, SmartAddressModule, SmartUiModule,];
75
+
76
+ const MATERIAL_MODULES = [
77
+ MatButtonModule, MatCheckboxModule,MatRadioModule,MatSliderModule,
78
+ MatCardModule, MatSlideToggleModule,
79
+ MatListModule, MatIconModule, MatButtonToggleModule,
80
+ MatToolbarModule, MatTabsModule, MatExpansionModule,
81
+ MatMenuModule, MatInputModule, MatProgressBarModule,
82
+ MatDatepickerModule, MatNativeDateModule,MatPaginatorModule,
83
+ MatDialogModule, MatSidenavModule, MatSelectModule,
84
+ MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule,
85
+ ];
86
+
87
+ @NgModule({
88
+ declarations: [...COMPONENTS,
89
+ CaseNoteComponent,
90
+ ContactComponent,
91
+ VictimSafetyPlanComponent,
92
+ VictimSafetyPlanDetailComponent,
93
+ VictimSearchFormComponent,
94
+ SeriveProviderComponent
95
+ ],
96
+ imports: [
97
+ ...BASE_MODULES,
98
+ ...MATERIAL_MODULES,
99
+ ...CORE_MODULES,
100
+ CommonDialogModule,
101
+ FormsModule,
102
+ VictimRoutingModule,
103
+ ApolloModule,
104
+ //SharedModule
105
+
106
+ ],
107
+ exports: [...COMPONENTS, ApolloModule],
108
+ providers: [NgcSmartVictimService]
109
+ })
110
+ export class NgcSmartVictimModule { }
@@ -0,0 +1,12 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { NgcSmartVictimService } from './smart-victim.service';
4
+
5
+ describe('NgcSmartVictimService', () => {
6
+ beforeEach(() => TestBed.configureTestingModule({}));
7
+
8
+ it('should be created', () => {
9
+ const service: NgcSmartVictimService = TestBed.get(NgcSmartVictimService);
10
+ expect(service).toBeTruthy();
11
+ });
12
+ });
@@ -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
+ }