@csmart/ngc-smart-victim 1.18.12 → 1.18.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/esm2022/csmart-ngc-smart-victim.mjs +5 -0
  2. package/esm2022/lib/caseNote/caseNote.component.mjs +194 -0
  3. package/esm2022/lib/common-dialog/common-dialog.component.mjs +23 -0
  4. package/esm2022/lib/common-dialog/common-dialog.module.mjs +34 -0
  5. package/esm2022/lib/common-dialog/common-dialog.service.mjs +33 -0
  6. package/esm2022/lib/contact/contact.component.mjs +140 -0
  7. package/esm2022/lib/email.services.mjs +42 -0
  8. package/esm2022/lib/intake.service.mjs +57 -0
  9. package/esm2022/lib/safetyPlan/serviceProvider.component.mjs +99 -0
  10. package/esm2022/lib/safetyPlan/victimSafetyPlan.component.mjs +116 -0
  11. package/esm2022/lib/safetyPlan/victimSafetyPlanDetail.component.mjs +340 -0
  12. package/esm2022/lib/shared/app.shared.module.mjs +215 -0
  13. package/esm2022/lib/shared/validators/date.validator.mjs +59 -0
  14. package/esm2022/lib/shared/validators/index.mjs +2 -0
  15. package/esm2022/lib/smart-victim-delete-confirm.component.mjs +44 -0
  16. package/esm2022/lib/smart-victim-detail/smart-victim-detail.component.mjs +1155 -0
  17. package/esm2022/lib/smart-victim.component.mjs +317 -0
  18. package/esm2022/lib/smart-victim.model.mjs +142 -0
  19. package/esm2022/lib/smart-victim.module.mjs +128 -0
  20. package/esm2022/lib/smart-victim.service.mjs +370 -0
  21. package/esm2022/lib/victim-routing.module.mjs +41 -0
  22. package/esm2022/lib/victimSearch/VictimSearchFilter.mjs +3 -0
  23. package/esm2022/lib/victimSearch/victimSearchForm.component.mjs +38 -0
  24. package/esm2022/public-api.mjs +11 -0
  25. package/fesm2022/csmart-ngc-smart-victim.mjs +3342 -0
  26. package/fesm2022/csmart-ngc-smart-victim.mjs.map +1 -0
  27. package/index.d.ts +5 -0
  28. package/lib/caseNote/caseNote.component.d.ts +51 -0
  29. package/lib/common-dialog/common-dialog.component.d.ts +14 -0
  30. package/lib/common-dialog/common-dialog.module.d.ts +8 -0
  31. package/lib/common-dialog/common-dialog.service.d.ts +11 -0
  32. package/lib/contact/contact.component.d.ts +40 -0
  33. package/lib/email.services.d.ts +11 -0
  34. package/lib/intake.service.d.ts +57 -0
  35. package/lib/safetyPlan/serviceProvider.component.d.ts +19 -0
  36. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +54 -0
  37. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +62 -0
  38. package/lib/shared/app.shared.module.d.ts +33 -0
  39. package/lib/shared/validators/date.validator.d.ts +9 -0
  40. package/lib/shared/validators/index.d.ts +1 -0
  41. package/lib/smart-victim-delete-confirm.component.d.ts +12 -0
  42. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +129 -0
  43. package/lib/smart-victim.component.d.ts +69 -0
  44. package/lib/smart-victim.model.d.ts +211 -0
  45. package/lib/smart-victim.module.d.ts +49 -0
  46. package/lib/smart-victim.service.d.ts +71 -0
  47. package/lib/victim-routing.module.d.ts +7 -0
  48. package/{src/lib/victimSearch/VictimSearchFilter.ts → lib/victimSearch/VictimSearchFilter.d.ts} +7 -9
  49. package/lib/victimSearch/victimSearchForm.component.d.ts +14 -0
  50. package/package.json +21 -6
  51. package/{src/public-api.ts → public-api.d.ts} +7 -12
  52. package/karma.conf.js +0 -32
  53. package/ng-package.json +0 -7
  54. package/src/lib/caseNote/caseNote.component.css +0 -22
  55. package/src/lib/caseNote/caseNote.component.html +0 -188
  56. package/src/lib/caseNote/caseNote.component.ts +0 -265
  57. package/src/lib/common-dialog/common-dialog.component.css +0 -10
  58. package/src/lib/common-dialog/common-dialog.component.html +0 -23
  59. package/src/lib/common-dialog/common-dialog.component.spec.ts +0 -25
  60. package/src/lib/common-dialog/common-dialog.component.ts +0 -21
  61. package/src/lib/common-dialog/common-dialog.module.ts +0 -22
  62. package/src/lib/common-dialog/common-dialog.service.ts +0 -35
  63. package/src/lib/contact/contact.component.css +0 -22
  64. package/src/lib/contact/contact.component.html +0 -124
  65. package/src/lib/contact/contact.component.ts +0 -176
  66. package/src/lib/email-notification.service.ts +0 -42
  67. package/src/lib/email.services.ts +0 -51
  68. package/src/lib/http.service.ts +0 -34
  69. package/src/lib/intake.service.ts +0 -82
  70. package/src/lib/loader.service.ts +0 -11
  71. package/src/lib/safetyPlan/serviceProvider.component.ts +0 -94
  72. package/src/lib/safetyPlan/victimSafetyPlan.component.css +0 -27
  73. package/src/lib/safetyPlan/victimSafetyPlan.component.html +0 -85
  74. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +0 -178
  75. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +0 -234
  76. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +0 -492
  77. package/src/lib/shared/app.shared.module.ts +0 -111
  78. package/src/lib/shared/validators/date.validator.ts +0 -73
  79. package/src/lib/shared/validators/index.ts +0 -1
  80. package/src/lib/smart-victim-delete-confirm.component.ts +0 -35
  81. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +0 -43
  82. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +0 -876
  83. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +0 -25
  84. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +0 -1469
  85. package/src/lib/smart-victim.component.css +0 -245
  86. package/src/lib/smart-victim.component.html +0 -132
  87. package/src/lib/smart-victim.component.spec.ts +0 -25
  88. package/src/lib/smart-victim.component.ts +0 -333
  89. package/src/lib/smart-victim.model.ts +0 -311
  90. package/src/lib/smart-victim.module.ts +0 -110
  91. package/src/lib/smart-victim.service.spec.ts +0 -12
  92. package/src/lib/smart-victim.service.ts +0 -576
  93. package/src/lib/victim-routing.module.ts +0 -36
  94. package/src/lib/victimSearch/victimSearchForm.component.html +0 -35
  95. package/src/lib/victimSearch/victimSearchForm.component.ts +0 -41
  96. package/src/test.ts +0 -16
  97. package/tsconfig.lib.json +0 -36
  98. package/tsconfig.spec.json +0 -17
  99. package/tslint.json +0 -17
@@ -1,110 +0,0 @@
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 { }
@@ -1,12 +0,0 @@
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
- });
@@ -1,576 +0,0 @@
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
- /*
370
- putVictimRelationship(id: any, val: any) {
371
- const tempVal = JSON.stringify(val);
372
- return this.http.put(this.smartVictimServiceUrl + 'VictimRelationships/' + id, tempVal, options).pipe
373
- (
374
- map(res => { return res;})
375
- );
376
- }
377
-
378
- postVictimRelationship(id: any, val: any) {
379
- const tempVal = JSON.stringify(val);
380
- return this.http.post(this.smartVictimServiceUrl + 'VictimRelationships/' + id, tempVal, options).pipe
381
- (
382
- map(res => { return res;})
383
- );
384
- }
385
-
386
- */
387
-
388
- deleteVictims(val: any, staffId: number) {
389
- return this.http.delete(this.smartVictimServiceUrl+ 'Victims/' + val + '?staffId='+ staffId, options).pipe
390
- (
391
- map(res => { return res;})
392
- );
393
- }
394
-
395
-
396
- // //==============Victim Serive===================================
397
-
398
- getVictims(offenderId: number): Observable <Victim[]> {
399
-
400
- return this.http.get(this.smartVictimServiceUrl + 'Victims/offender/' + offenderId)
401
- .pipe(map((res: Victim[]) => {
402
-
403
- return res;
404
- })
405
- ,catchError(this.handleError));
406
- }
407
-
408
- getVictimsByFilter(filter: VictimListFilter): Observable<Victim[]>{
409
- return this.http
410
- .post(this.smartVictimServiceUrl + '/Victims', JSON.stringify(filter), { headers: headers })
411
- .pipe(map((res: Victim[]) => {
412
- return res;
413
- })
414
- ,catchError(this.handleError));
415
- }
416
-
417
- getVictimListByFilter(filter: VictimListFilter)
418
- {
419
- console.log('filer in service');
420
- console.log(filter);
421
-
422
- return this.http
423
- .post(this.smartVictimServiceUrl + 'vVictims/Filter', JSON.stringify(filter), options)
424
- .pipe();
425
-
426
- }
427
-
428
-
429
- getCasetNotes(victimId: number): Observable <CaseNote[]> {
430
-
431
- return this.http.get(this.smartVictimServiceUrl + 'VictimCaseNotes/victim/' + victimId)
432
- .pipe(map((res: CaseNote[]) => {
433
- return res;
434
- })
435
- ,catchError(this.handleError));
436
-
437
-
438
- }
439
- addCaseNote(caseNote: CaseNote) {
440
- let body: string;
441
- body = JSON.stringify(caseNote);
442
- return this.http
443
- .post(this.smartVictimServiceUrl + 'VictimCaseNotes/', body, options);
444
-
445
- }
446
-
447
-
448
- updateCaseNote(caseNote: CaseNote){
449
-
450
- let body: string;
451
- body = JSON.stringify(caseNote);
452
- return this.http
453
- .put(this.smartVictimServiceUrl + 'VictimCaseNotes/' + caseNote.victimCaseNoteId, body, options)
454
-
455
- ;
456
- }
457
-
458
- deleteCaseNote(id: number, staffId: number) {
459
- return this.http.delete(`${this.smartVictimServiceUrl}VictimCaseNotes/${id}?staffId=${staffId}`);
460
- }
461
-
462
- getContacts(victimId: number): Observable <Contact[]> {
463
-
464
- return this.http.get(this.smartVictimServiceUrl + 'VictimContacts/victim/' + victimId)
465
- .pipe(map((res: Contact[]) => {
466
- return res;
467
- })
468
- ,catchError(this.handleError));
469
-
470
- }
471
- addContact(contact: Contact) {
472
- let body: string;
473
- body = JSON.stringify(contact);
474
- return this.http
475
- .post(this.smartVictimServiceUrl + 'VictimContacts/', body, options);
476
-
477
- }
478
-
479
-
480
- updateContact(contact: Contact){
481
-
482
- let body: string;
483
- body = JSON.stringify(contact);
484
- return this.http
485
- .put(this.smartVictimServiceUrl + 'VictimContacts/' + contact.victimContactId, body, options)
486
-
487
- ;
488
- }
489
-
490
- getSafetyPlans(victimId: number): Observable <VictimSafetyPlan[]> {
491
-
492
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
493
- .pipe(map((res: VictimSafetyPlan[]) => {
494
- return res;
495
- })
496
- ,catchError(this.handleError));
497
- }
498
-
499
- getVictimServices(victimServiceId: number): Observable <VictimSafetyPlan[]> {
500
-
501
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
502
- .pipe(map((res: VictimSafetyPlan[]) => {
503
- return res;
504
- })
505
- ,catchError(this.handleError));
506
-
507
- }
508
-
509
- getVictimServiceDetail(victimServiceId: number): Observable <VictimServiceDetail[]> {
510
-
511
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
512
- .pipe(map((res: VictimServiceDetail[]) => {
513
-
514
- return res;
515
- })
516
- ,catchError(this.handleError));
517
-
518
- }
519
- addSafetyPlan(victimSafetyPlan: VictimSafetyPlan) {
520
-
521
- let body: string;
522
- body = JSON.stringify(victimSafetyPlan);
523
- return this.http
524
- .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
525
- .pipe();
526
-
527
- }
528
- updateSafetyPlan(victimSafetyPlan: VictimSafetyPlan){
529
-
530
- let body: string;
531
- body = JSON.stringify(victimSafetyPlan);
532
- return this.http
533
- .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options)
534
-
535
- ;
536
- }
537
- addVictimServiceStatus(victimServiceStatusHistory: VictimServiceStatusHistory){
538
- let body: string;
539
- body = JSON.stringify(victimServiceStatusHistory);
540
- return this.http
541
- .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
542
-
543
- }
544
-
545
- getServiceStatusHistories(victimServiceId: number){
546
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
547
- .pipe(
548
- map((res: VictimServiceStatusHistory[]) => {
549
-
550
- return res;
551
- })
552
- ,catchError(this.handleError)
553
- );
554
- }
555
-
556
- deleteSafetyPlan(victimServiceId: number, staffId: number) {
557
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
558
-
559
- }
560
- addPlanProvider(victimServiceDetail:VictimServiceDetail){
561
- let body: string;
562
- body = JSON.stringify(victimServiceDetail);
563
- return this.http
564
- .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
565
- .pipe();
566
-
567
- }
568
-
569
- deleteProvider(victimProgramProviderId: string, staffId: number){
570
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
571
-
572
- }
573
-
574
-
575
-
576
- }