DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_COMPLAINT_CLAIMS_API

Source


1 Package Body ghr_complaint_claims_api as
2 /* $Header: ghcclapi.pkb 115.1 2003/01/30 16:31:42 asubrahm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ghr_complaint_claims_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Create_compl_claim> >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_compl_claim
13   (p_validate                       in     boolean  default false
14   ,p_effective_date                 in     date
15   ,p_complaint_id                   in     number
16   ,p_claim                          in     varchar2 default null
17   ,p_incident_date                  in     date     default null
18   ,p_phase                          in     varchar2 default null
19   ,p_mixed_flag                     in     varchar2 default null
20   ,p_claim_source                   in     varchar2 default null
21   ,p_agency_acceptance              in     varchar2 default null
22   ,p_aj_acceptance                  in     varchar2 default null
23   ,p_agency_appeal                  in     varchar2 default null
24   ,p_compl_claim_id                   out nocopy number
25   ,p_object_version_number            out nocopy number
26   ) is
27 
28   --
29   -- Declare cursors and local variables
30   --
31 
32   l_proc                varchar2(72) := g_package||'create_compl_claim';
33   l_compl_claim_id      number;
34   l_object_version_number number;
35 begin
36   hr_utility.set_location('Entering:'|| l_proc, 10);
37   --
38   -- Issue a savepoint
39   --
40   savepoint create_compl_claim;
41   hr_utility.set_location(l_proc, 20);
42   --
43   -- Truncate the time portion from all IN date parameters
44   --
45   -- Call Before Process User Hook
46   --
47   begin
48     ghr_complaint_claims_bk_1.create_compl_claim_b
49       (p_effective_date                 => trunc(p_effective_date)
50       ,p_complaint_id                   => p_complaint_id
51       ,p_claim                          => p_claim
52       ,p_incident_date                  => p_incident_date
53       ,p_phase                          => p_phase
54       ,p_mixed_flag                     => p_mixed_flag
55       ,p_claim_source                   => p_claim_source
56       ,p_agency_acceptance              => p_agency_acceptance
57       ,p_aj_acceptance                  => p_aj_acceptance
58       ,p_agency_appeal                  => p_agency_appeal
59       );
60   exception
61     when hr_api.cannot_find_prog_unit then
62       hr_api.cannot_find_prog_unit_error
63         (p_module_name => 'create_compl_claim'
64         ,p_hook_type   => 'BP'
65         );
66   end;
67   --
68   --
69   --
70   -- Validation in addition to Row Handlers
71   --
72 
73   hr_utility.set_location(l_proc, 40);
74   --
75   -- Process Logic
76   --
77   ghr_ccl_ins.ins
78  (
79    p_effective_date                 => p_effective_date
80   ,p_complaint_id                   => p_complaint_id
81   ,p_claim                          => p_claim
82   ,p_incident_date                  => p_incident_date
83   ,p_phase                          => p_phase
84   ,p_mixed_flag                     => p_mixed_flag
85   ,p_claim_source                   => p_claim_source
86   ,p_agency_acceptance              => p_agency_acceptance
87   ,p_aj_acceptance                  => p_aj_acceptance
88   ,p_agency_appeal                  => p_agency_appeal
89   ,p_compl_claim_id                 => l_compl_claim_id
90   ,p_object_version_number          => l_object_version_number
91   );
92   hr_utility.set_location(l_proc, 50);
93   --
94   -- Call After Process User Hook
95   --
96   begin
97     ghr_complaint_claims_bk_1.create_compl_claim_a
98       (p_effective_date                 => trunc(p_effective_date)
99       ,p_complaint_id                   => p_complaint_id
100       ,p_claim                          => p_claim
101       ,p_incident_date                  => p_incident_date
102       ,p_phase                          => p_phase
103       ,p_mixed_flag                     => p_mixed_flag
104       ,p_claim_source                   => p_claim_source
105       ,p_agency_acceptance              => p_agency_acceptance
106       ,p_aj_acceptance                  => p_aj_acceptance
107       ,p_agency_appeal                  => p_agency_appeal
108       ,p_compl_claim_id                 => l_compl_claim_id
109       ,p_object_version_number          => l_object_version_number
110       );
111   exception
112     when hr_api.cannot_find_prog_unit then
113       hr_api.cannot_find_prog_unit_error
114         (p_module_name => 'create_compl_claim'
115         ,p_hook_type   => 'AP'
116         );
117   end;
118   --
119   -- When in validation only mode raise the Validate_Enabled exception
120   --
121   if p_validate then
122     raise hr_api.validate_enabled;
123   end if;
124   --
125   -- Set all output arguments
126   --
127   p_compl_claim_id         := l_compl_claim_id;
128   p_object_version_number  := l_object_version_number;
129   --
130   hr_utility.set_location(' Leaving:'||l_proc, 70);
131 exception
132   when hr_api.validate_enabled then
133     --
134     -- As the Validate_Enabled exception has been raised
135     -- we must rollback to the savepoint
136     --
137     rollback to create_compl_claim;
138     --
139     -- Only set output warning arguments
140     -- (Any key or derived arguments must be set to null
141     -- when validation only mode is being used.)
142     --
143     p_compl_claim_id         := null;
144     p_object_version_number  := null;
145     hr_utility.set_location(' Leaving:'||l_proc, 80);
146   when others then
147     --
148     -- A validation or unexpected error has occured
149     --
150     rollback to create_compl_claim;
151     --RESET In/Out Params and SET Out Params
152     p_compl_claim_id         := null;
153     p_object_version_number  := null;
154     hr_utility.set_location(' Leaving:'||l_proc, 90);
155     raise;
156 end create_compl_claim;
157 --
158 
159 procedure update_compl_claim
160   (p_validate                     in     boolean default false
161   ,p_effective_date               in     date
162   ,p_compl_claim_id               in     number
163   ,p_object_version_number        in out nocopy number
164   ,p_complaint_id                 in     number    default hr_api.g_number
165   ,p_claim                        in     varchar2  default hr_api.g_varchar2
166   ,p_incident_date                in     date      default hr_api.g_date
167   ,p_phase                        in     varchar2  default hr_api.g_varchar2
168   ,p_mixed_flag                   in     varchar2  default hr_api.g_varchar2
169   ,p_claim_source                 in     varchar2  default hr_api.g_varchar2
170   ,p_agency_acceptance            in     varchar2  default hr_api.g_varchar2
171   ,p_aj_acceptance                in     varchar2  default hr_api.g_varchar2
172   ,p_agency_appeal                in     varchar2  default hr_api.g_varchar2
173   )
174 
175 is
176   l_proc                varchar2(72) := g_package||'update_compl_claim';
177   l_object_version_number number;
178 begin
179 hr_utility.set_location('Entering:'|| l_proc, 5);
180   --
181    savepoint update_compl_claim;
182 
183     --
184     -- Remember IN OUT parameter IN values
185     l_object_version_number := p_object_version_number;
186   --
187   -- Truncate the time portion from all IN date parameters
188   --
189 
190   --
191   -- Call Before Process User Hook
192   --
193   begin
194     ghr_complaint_claims_bk_2.update_compl_claim_b
195       (p_effective_date                 => trunc(p_effective_date)
196       ,p_complaint_id                   => p_complaint_id
197       ,p_claim                          => p_claim
198       ,p_incident_date                  => p_incident_date
199       ,p_phase                          => p_phase
200       ,p_mixed_flag                     => p_mixed_flag
201       ,p_claim_source                   => p_claim_source
202       ,p_agency_acceptance              => p_agency_acceptance
203       ,p_aj_acceptance                  => p_aj_acceptance
204       ,p_agency_appeal                  => p_agency_appeal
205       ,p_compl_claim_id                 => p_compl_claim_id
206       ,p_object_version_number          => p_object_version_number
207       );
208   exception
209     when hr_api.cannot_find_prog_unit then
210       hr_api.cannot_find_prog_unit_error
211         (p_module_name => 'update_compl_claim'
212         ,p_hook_type   => 'BP'
213         );
214   end;
215   --
216   -- Validation in addition to Row Handlers
217   --
218  -- Store the original ovn in case we rollback when p_validate is true
219  --
220   l_object_version_number  := p_object_version_number;
221 
222   hr_utility.set_location(l_proc, 6);
223 
224     ghr_ccl_upd.upd
225   (p_effective_date                 => p_effective_date
226   ,p_compl_claim_id                 => p_compl_claim_id
227   ,p_complaint_id                   => p_complaint_id
228   ,p_claim                          => p_claim
229   ,p_incident_date                  => p_incident_date
230   ,p_phase                          => p_phase
231   ,p_mixed_flag                     => p_mixed_flag
232   ,p_claim_source                   => p_claim_source
233   ,p_agency_acceptance              => p_agency_acceptance
234   ,p_aj_acceptance                  => p_aj_acceptance
235   ,p_agency_appeal                  => p_agency_appeal
236   ,p_object_version_number          => l_object_version_number
237   );
238   --
239   -- Call After Process User Hook
240   --
241   begin
242     ghr_complaint_claims_bk_2.update_compl_claim_a
243       (p_effective_date                 => trunc(p_effective_date)
244       ,p_complaint_id                   => p_complaint_id
245       ,p_claim                          => p_claim
246       ,p_incident_date                  => p_incident_date
247       ,p_phase                          => p_phase
248       ,p_mixed_flag                     => p_mixed_flag
249       ,p_claim_source                   => p_claim_source
250       ,p_agency_acceptance              => p_agency_acceptance
251       ,p_aj_acceptance                  => p_aj_acceptance
252       ,p_agency_appeal                  => p_agency_appeal
253       ,p_compl_claim_id                 => p_compl_claim_id
254       ,p_object_version_number          => l_object_version_number
255       );
256   exception
257     when hr_api.cannot_find_prog_unit then
258       hr_api.cannot_find_prog_unit_error
259         (p_module_name => 'update_compl_claim'
260         ,p_hook_type   => 'AP'
261         );
262   end;
263   --
264 -- When in validation only mode raise the Validate_Enabled exception
265   --
266   if p_validate then
267     raise hr_api.validate_enabled;
268   end if;
269   --
270   -- Set all output arguments
271   --
272   p_object_version_number  := l_object_version_number;
273   --
274   hr_utility.set_location(' Leaving:'||l_proc, 70);
275 exception
276   when hr_api.validate_enabled then
277     --
278     -- As the Validate_Enabled exception has been raised
279     -- we must rollback to the savepoint
280     --
281     rollback to update_compl_claim;
282     --
283     -- Only set output warning arguments
284     -- (Any key or derived arguments must be set to null
285     -- when validation only mode is being used.)
286     --
287     p_object_version_number  := l_object_version_number;
288     hr_utility.set_location(' Leaving:'||l_proc, 80);
289   when others then
290     --
291     -- A validation or unexpected error has occured
292     --
293     rollback to update_compl_claim;
294     --RESET In/Out Params and SET Out Params
295     p_object_version_number  := l_object_version_number;
296     hr_utility.set_location(' Leaving:'||l_proc, 90);
297     raise;
298 
299 end update_compl_claim;
300 
301 -- ----------------------------------------------------------------------------
302 -- |-----------------------< delete_compl_claim >-----------------------|
303 -- ----------------------------------------------------------------------------
304 --
305 procedure delete_compl_claim
306   (p_validate                      in     boolean  default false
307   ,p_compl_claim_id                in     number
308   ,p_object_version_number         in     number
309   ) is
310   --
311   -- Declare cursors and local variables
312   --
313   l_proc                  varchar2(72) := g_package||'delete_compl_claim';
314   l_exists                boolean      := false;
315 
316 begin
317   hr_utility.set_location('Entering:'|| l_proc, 5);
318   --
319   --
320   savepoint delete_compl_claim;
321   --
322   -- Truncate the time portion from all IN date parameters
323   --
324 
325   --
326   -- Call Before Process User Hook
327   --
328   begin
329     ghr_complaint_claims_bk_3.delete_compl_claim_b
330       (p_compl_claim_id                => p_compl_claim_id
331       ,p_object_version_number         => p_object_version_number
332       );
333   exception
334     when hr_api.cannot_find_prog_unit then
335       hr_api.cannot_find_prog_unit_error
336         (p_module_name => 'delete_compl_claim'
337         ,p_hook_type   => 'BP'
338         );
339   end;
340   --
341   -- Validation in addition to Row Handlers
342   --
343  -- Process Logic
344    ghr_ccl_del.del
345     (p_compl_claim_id                => p_compl_claim_id
346     ,p_object_version_number         => p_object_version_number
347      );
348  --
349   hr_utility.set_location(l_proc, 8);
350   --
351   -- Call After Process User Hook
352   --
353   begin
354     ghr_complaint_claims_bk_3.delete_compl_claim_a
355       (p_compl_claim_id                => p_compl_claim_id
356       ,p_object_version_number         => p_object_version_number
357       );
358   exception
359     when hr_api.cannot_find_prog_unit then
360       hr_api.cannot_find_prog_unit_error
361         (p_module_name => 'delete_compl_claim'
362         ,p_hook_type   => 'AP'
363         );
364   end;
365   --
366   -- When in validation only mode raise the Validate_Enabled exception
367   --
368   --
369   -- When in validation only mode raise the Validate_Enabled exception
370   --
371   if p_validate then
372     raise hr_api.validate_enabled;
373   end if;
374   --
375   hr_utility.set_location(' Leaving:'||l_proc, 11);
376 exception
377   when hr_api.validate_enabled then
378     -- we must rollback to the savepoint
379     --
380     ROLLBACK TO delete_compl_claim;
381     --
382   When Others then
383     ROLLBACK TO delete_compl_claim;
384     raise;
385 
386   hr_utility.set_location(' Leaving:'||l_proc, 12);
387 end delete_compl_claim;
388 end ghr_complaint_claims_api;
389