[Home] [Help]
PACKAGE BODY: APPS.PER_MEA_UPD
Source
1 Package Body per_mea_upd as
2 /* $Header: pemearhi.pkb 115.9 2002/12/06 12:20:50 pkakar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_mea_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml
55 (p_rec in out nocopy per_mea_shd.g_rec_type
56 ) is
57 --
58 l_proc varchar2(72) := g_package||'update_dml';
59 l_last_update_date per_medical_assessments.last_update_date%TYPE;
60 l_last_updated_by per_medical_assessments.last_updated_by%TYPE;
61 l_last_update_login per_medical_assessments.last_update_login%TYPE;
62 --
63 Begin
64 hr_utility.set_location('Entering:'||l_proc, 5);
65 --
66 -- Increment the object version
67 p_rec.object_version_number := p_rec.object_version_number + 1;
68 --
69 -- Set the who columns
70 --
71 l_last_update_date := sysdate;
72 l_last_updated_by := fnd_global.user_id;
73 l_last_update_login := fnd_global.login_id;
74 --
75 -- Update the per_medical_assessments Row
76 --
77 update per_medical_assessments
78 set
79 medical_assessment_id = p_rec.medical_assessment_id
80 ,person_id = p_rec.person_id
81 ,examiner_name = p_rec.examiner_name
82 ,organization_id = p_rec.organization_id
83 ,consultation_date = p_rec.consultation_date
84 ,consultation_type = p_rec.consultation_type
85 ,incident_id = p_rec.incident_id
86 ,consultation_result = p_rec.consultation_result
87 ,disability_id = p_rec.disability_id
88 ,next_consultation_date = p_rec.next_consultation_date
89 ,description = p_rec.description
90 ,attribute_category = p_rec.attribute_category
91 ,attribute1 = p_rec.attribute1
92 ,attribute2 = p_rec.attribute2
93 ,attribute3 = p_rec.attribute3
94 ,attribute4 = p_rec.attribute4
95 ,attribute5 = p_rec.attribute5
96 ,attribute6 = p_rec.attribute6
97 ,attribute7 = p_rec.attribute7
98 ,attribute8 = p_rec.attribute8
99 ,attribute9 = p_rec.attribute9
100 ,attribute10 = p_rec.attribute10
101 ,attribute11 = p_rec.attribute11
102 ,attribute12 = p_rec.attribute12
103 ,attribute13 = p_rec.attribute13
104 ,attribute14 = p_rec.attribute14
105 ,attribute15 = p_rec.attribute15
106 ,attribute16 = p_rec.attribute16
107 ,attribute17 = p_rec.attribute17
108 ,attribute18 = p_rec.attribute18
109 ,attribute19 = p_rec.attribute19
110 ,attribute20 = p_rec.attribute20
111 ,attribute21 = p_rec.attribute21
112 ,attribute22 = p_rec.attribute22
113 ,attribute23 = p_rec.attribute23
114 ,attribute24 = p_rec.attribute24
115 ,attribute25 = p_rec.attribute25
116 ,attribute26 = p_rec.attribute26
117 ,attribute27 = p_rec.attribute27
118 ,attribute28 = p_rec.attribute28
119 ,attribute29 = p_rec.attribute29
120 ,attribute30 = p_rec.attribute30
121 ,mea_information_category = p_rec.mea_information_category
122 ,mea_information1 = p_rec.mea_information1
123 ,mea_information2 = p_rec.mea_information2
124 ,mea_information3 = p_rec.mea_information3
125 ,mea_information4 = p_rec.mea_information4
126 ,mea_information5 = p_rec.mea_information5
127 ,mea_information6 = p_rec.mea_information6
128 ,mea_information7 = p_rec.mea_information7
129 ,mea_information8 = p_rec.mea_information8
130 ,mea_information9 = p_rec.mea_information9
131 ,mea_information10 = p_rec.mea_information10
132 ,mea_information11 = p_rec.mea_information11
133 ,mea_information12 = p_rec.mea_information12
134 ,mea_information13 = p_rec.mea_information13
135 ,mea_information14 = p_rec.mea_information14
136 ,mea_information15 = p_rec.mea_information15
137 ,mea_information16 = p_rec.mea_information16
138 ,mea_information17 = p_rec.mea_information17
139 ,mea_information18 = p_rec.mea_information18
140 ,mea_information19 = p_rec.mea_information19
141 ,mea_information20 = p_rec.mea_information20
142 ,mea_information21 = p_rec.mea_information21
143 ,mea_information22 = p_rec.mea_information22
144 ,mea_information23 = p_rec.mea_information23
145 ,mea_information24 = p_rec.mea_information24
146 ,mea_information25 = p_rec.mea_information25
147 ,mea_information26 = p_rec.mea_information26
148 ,mea_information27 = p_rec.mea_information27
149 ,mea_information28 = p_rec.mea_information28
150 ,mea_information29 = p_rec.mea_information29
151 ,mea_information30 = p_rec.mea_information30
152 ,object_version_number = p_rec.object_version_number
153 ,last_update_date = l_last_update_date
154 ,last_updated_by = l_last_updated_by
155 ,last_update_login = l_last_update_login
156 where medical_assessment_id = p_rec.medical_assessment_id;
157 --
158 --
159 --
160 hr_utility.set_location(' Leaving:'||l_proc, 10);
161 --
162 Exception
163 When hr_api.check_integrity_violated Then
164 -- A check constraint has been violated
165 --
166 per_mea_shd.constraint_error
167 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
168 When hr_api.parent_integrity_violated Then
169 -- Parent integrity has been violated
170 --
171 per_mea_shd.constraint_error
172 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
173 When hr_api.unique_integrity_violated Then
174 -- Unique integrity has been violated
175 --
176 per_mea_shd.constraint_error
177 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
178 When Others Then
179 --
180 Raise;
181 End update_dml;
182 --
183 -- ----------------------------------------------------------------------------
184 -- |------------------------------< pre_update >------------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This private procedure contains any processing which is required before
190 -- the update dml.
191 --
192 -- Prerequisites:
193 -- This is an internal procedure which is called from the upd procedure.
194 --
195 -- In Parameters:
196 -- A Pl/Sql record structure.
197 --
198 -- Post Success:
199 -- Processing continues.
200 --
201 -- Post Failure:
202 -- If an error has occurred, an error message and exception wil be raised
203 -- but not handled.
204 --
205 -- Developer Implementation Notes:
206 -- Any pre-processing required before the update dml is issued should be
207 -- coded within this procedure. It is important to note that any 3rd party
208 -- maintenance should be reviewed before placing in this procedure.
209 --
210 -- Access Status:
211 -- Internal Row Handler Use Only.
212 --
213 -- {End Of Comments}
214 -- ----------------------------------------------------------------------------
215 Procedure pre_update
216 (p_rec in per_mea_shd.g_rec_type
217 ) is
218 --
219 l_proc varchar2(72) := g_package||'pre_update';
220 --
221 Begin
222 hr_utility.set_location('Entering:'||l_proc, 5);
223 --
224 hr_utility.set_location(' Leaving:'||l_proc, 10);
225 End pre_update;
226 --
227 -- ----------------------------------------------------------------------------
228 -- |-----------------------------< post_update >------------------------------|
229 -- ----------------------------------------------------------------------------
230 -- {Start Of Comments}
231 --
232 -- Description:
233 -- This private procedure contains any processing which is required after the
234 -- update dml.
235 --
236 -- Prerequisites:
237 -- This is an internal procedure which is called from the upd procedure.
238 --
239 -- In Parameters:
240 -- A Pl/Sql record structure.
241 --
242 -- Post Success:
243 -- Processing continues.
244 --
245 -- Post Failure:
246 -- If an error has occurred, an error message and exception will be raised
247 -- but not handled.
248 --
249 -- Developer Implementation Notes:
250 -- Any post-processing required after the update dml is issued should be
251 -- coded within this procedure. It is important to note that any 3rd party
252 -- maintenance should be reviewed before placing in this procedure.
253 --
254 -- Access Status:
255 -- Internal Row Handler Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Procedure post_update
260 (p_effective_date in date
261 ,p_rec in per_mea_shd.g_rec_type
262 ) is
263 --
264 l_proc varchar2(72) := g_package||'post_update';
265 --
266 Begin
267 hr_utility.set_location('Entering:'||l_proc, 5);
268 BEGIN
269 --
270 per_mea_rku.after_update
271 (p_effective_date => p_effective_date
272 ,p_medical_assessment_id => p_rec.medical_assessment_id
273 ,p_person_id => p_rec.person_id
274 ,p_examiner_name => p_rec.examiner_name
275 ,p_organization_id => p_rec.organization_id
276 ,p_consultation_date => p_rec.consultation_date
277 ,p_consultation_type => p_rec.consultation_type
278 ,p_incident_id => p_rec.incident_id
279 ,p_consultation_result => p_rec.consultation_result
280 ,p_disability_id => p_rec.disability_id
281 ,p_next_consultation_date => p_rec.next_consultation_date
282 ,p_description => p_rec.description
283 ,p_attribute_category => p_rec.attribute_category
284 ,p_attribute1 => p_rec.attribute1
285 ,p_attribute2 => p_rec.attribute2
286 ,p_attribute3 => p_rec.attribute3
287 ,p_attribute4 => p_rec.attribute4
288 ,p_attribute5 => p_rec.attribute5
289 ,p_attribute6 => p_rec.attribute6
290 ,p_attribute7 => p_rec.attribute7
291 ,p_attribute8 => p_rec.attribute8
292 ,p_attribute9 => p_rec.attribute9
293 ,p_attribute10 => p_rec.attribute10
294 ,p_attribute11 => p_rec.attribute11
295 ,p_attribute12 => p_rec.attribute12
296 ,p_attribute13 => p_rec.attribute13
297 ,p_attribute14 => p_rec.attribute14
298 ,p_attribute15 => p_rec.attribute15
299 ,p_attribute16 => p_rec.attribute16
300 ,p_attribute17 => p_rec.attribute17
301 ,p_attribute18 => p_rec.attribute18
302 ,p_attribute19 => p_rec.attribute19
303 ,p_attribute20 => p_rec.attribute20
304 ,p_attribute21 => p_rec.attribute21
305 ,p_attribute22 => p_rec.attribute22
306 ,p_attribute23 => p_rec.attribute23
307 ,p_attribute24 => p_rec.attribute24
308 ,p_attribute25 => p_rec.attribute25
309 ,p_attribute26 => p_rec.attribute26
310 ,p_attribute27 => p_rec.attribute27
311 ,p_attribute28 => p_rec.attribute28
312 ,p_attribute29 => p_rec.attribute29
313 ,p_attribute30 => p_rec.attribute30
314 ,p_mea_information_category => p_rec.mea_information_category
315 ,p_mea_information1 => p_rec.mea_information1
316 ,p_mea_information2 => p_rec.mea_information2
317 ,p_mea_information3 => p_rec.mea_information3
318 ,p_mea_information4 => p_rec.mea_information4
319 ,p_mea_information5 => p_rec.mea_information5
320 ,p_mea_information6 => p_rec.mea_information6
321 ,p_mea_information7 => p_rec.mea_information7
322 ,p_mea_information8 => p_rec.mea_information8
323 ,p_mea_information9 => p_rec.mea_information9
324 ,p_mea_information10 => p_rec.mea_information10
325 ,p_mea_information11 => p_rec.mea_information11
326 ,p_mea_information12 => p_rec.mea_information12
327 ,p_mea_information13 => p_rec.mea_information13
328 ,p_mea_information14 => p_rec.mea_information14
329 ,p_mea_information15 => p_rec.mea_information15
330 ,p_mea_information16 => p_rec.mea_information16
331 ,p_mea_information17 => p_rec.mea_information17
332 ,p_mea_information18 => p_rec.mea_information18
333 ,p_mea_information19 => p_rec.mea_information19
334 ,p_mea_information20 => p_rec.mea_information20
335 ,p_mea_information21 => p_rec.mea_information21
336 ,p_mea_information22 => p_rec.mea_information22
337 ,p_mea_information23 => p_rec.mea_information23
338 ,p_mea_information24 => p_rec.mea_information24
339 ,p_mea_information25 => p_rec.mea_information25
340 ,p_mea_information26 => p_rec.mea_information26
341 ,p_mea_information27 => p_rec.mea_information27
342 ,p_mea_information28 => p_rec.mea_information28
343 ,p_mea_information29 => p_rec.mea_information29
344 ,p_mea_information30 => p_rec.mea_information30
345 ,p_object_version_number => p_rec.object_version_number
346 ,p_person_id_o => per_mea_shd.g_old_rec.person_id
347 ,p_examiner_name_o => per_mea_shd.g_old_rec.examiner_name
348 ,p_organization_id_o => per_mea_shd.g_old_rec.organization_id
349 ,p_consultation_date_o => per_mea_shd.g_old_rec.consultation_date
350 ,p_consultation_type_o => per_mea_shd.g_old_rec.consultation_type
351 ,p_incident_id_o => per_mea_shd.g_old_rec.incident_id
352 ,p_consultation_result_o => per_mea_shd.g_old_rec.consultation_result
353 ,p_disability_id_o => per_mea_shd.g_old_rec.disability_id
354 ,p_next_consultation_date_o => per_mea_shd.g_old_rec.next_consultation_date
355 ,p_description_o => per_mea_shd.g_old_rec.description
356 ,p_attribute_category_o => per_mea_shd.g_old_rec.attribute_category
357 ,p_attribute1_o => per_mea_shd.g_old_rec.attribute1
358 ,p_attribute2_o => per_mea_shd.g_old_rec.attribute2
359 ,p_attribute3_o => per_mea_shd.g_old_rec.attribute3
360 ,p_attribute4_o => per_mea_shd.g_old_rec.attribute4
361 ,p_attribute5_o => per_mea_shd.g_old_rec.attribute5
362 ,p_attribute6_o => per_mea_shd.g_old_rec.attribute6
363 ,p_attribute7_o => per_mea_shd.g_old_rec.attribute7
364 ,p_attribute8_o => per_mea_shd.g_old_rec.attribute8
365 ,p_attribute9_o => per_mea_shd.g_old_rec.attribute9
366 ,p_attribute10_o => per_mea_shd.g_old_rec.attribute10
367 ,p_attribute11_o => per_mea_shd.g_old_rec.attribute11
368 ,p_attribute12_o => per_mea_shd.g_old_rec.attribute12
369 ,p_attribute13_o => per_mea_shd.g_old_rec.attribute13
370 ,p_attribute14_o => per_mea_shd.g_old_rec.attribute14
371 ,p_attribute15_o => per_mea_shd.g_old_rec.attribute15
372 ,p_attribute16_o => per_mea_shd.g_old_rec.attribute16
373 ,p_attribute17_o => per_mea_shd.g_old_rec.attribute17
374 ,p_attribute18_o => per_mea_shd.g_old_rec.attribute18
375 ,p_attribute19_o => per_mea_shd.g_old_rec.attribute19
376 ,p_attribute20_o => per_mea_shd.g_old_rec.attribute20
377 ,p_attribute21_o => per_mea_shd.g_old_rec.attribute21
378 ,p_attribute22_o => per_mea_shd.g_old_rec.attribute22
379 ,p_attribute23_o => per_mea_shd.g_old_rec.attribute23
380 ,p_attribute24_o => per_mea_shd.g_old_rec.attribute24
381 ,p_attribute25_o => per_mea_shd.g_old_rec.attribute25
382 ,p_attribute26_o => per_mea_shd.g_old_rec.attribute26
383 ,p_attribute27_o => per_mea_shd.g_old_rec.attribute27
384 ,p_attribute28_o => per_mea_shd.g_old_rec.attribute28
385 ,p_attribute29_o => per_mea_shd.g_old_rec.attribute29
386 ,p_attribute30_o => per_mea_shd.g_old_rec.attribute30
387 ,p_mea_information_category_o => per_mea_shd.g_old_rec.mea_information_category
388 ,p_mea_information1_o => per_mea_shd.g_old_rec.mea_information1
389 ,p_mea_information2_o => per_mea_shd.g_old_rec.mea_information2
390 ,p_mea_information3_o => per_mea_shd.g_old_rec.mea_information3
391 ,p_mea_information4_o => per_mea_shd.g_old_rec.mea_information4
392 ,p_mea_information5_o => per_mea_shd.g_old_rec.mea_information5
393 ,p_mea_information6_o => per_mea_shd.g_old_rec.mea_information6
394 ,p_mea_information7_o => per_mea_shd.g_old_rec.mea_information7
395 ,p_mea_information8_o => per_mea_shd.g_old_rec.mea_information8
396 ,p_mea_information9_o => per_mea_shd.g_old_rec.mea_information9
397 ,p_mea_information10_o => per_mea_shd.g_old_rec.mea_information10
398 ,p_mea_information11_o => per_mea_shd.g_old_rec.mea_information11
399 ,p_mea_information12_o => per_mea_shd.g_old_rec.mea_information12
400 ,p_mea_information13_o => per_mea_shd.g_old_rec.mea_information13
401 ,p_mea_information14_o => per_mea_shd.g_old_rec.mea_information14
402 ,p_mea_information15_o => per_mea_shd.g_old_rec.mea_information15
403 ,p_mea_information16_o => per_mea_shd.g_old_rec.mea_information16
404 ,p_mea_information17_o => per_mea_shd.g_old_rec.mea_information17
405 ,p_mea_information18_o => per_mea_shd.g_old_rec.mea_information18
406 ,p_mea_information19_o => per_mea_shd.g_old_rec.mea_information19
407 ,p_mea_information20_o => per_mea_shd.g_old_rec.mea_information20
408 ,p_mea_information21_o => per_mea_shd.g_old_rec.mea_information21
409 ,p_mea_information22_o => per_mea_shd.g_old_rec.mea_information22
410 ,p_mea_information23_o => per_mea_shd.g_old_rec.mea_information23
411 ,p_mea_information24_o => per_mea_shd.g_old_rec.mea_information24
412 ,p_mea_information25_o => per_mea_shd.g_old_rec.mea_information25
413 ,p_mea_information26_o => per_mea_shd.g_old_rec.mea_information26
414 ,p_mea_information27_o => per_mea_shd.g_old_rec.mea_information27
415 ,p_mea_information28_o => per_mea_shd.g_old_rec.mea_information28
416 ,p_mea_information29_o => per_mea_shd.g_old_rec.mea_information29
417 ,p_mea_information30_o => per_mea_shd.g_old_rec.mea_information30
418 ,p_object_version_number_o => per_mea_shd.g_old_rec.object_version_number
419 );
420 --
421 exception
422 --
423 when hr_api.cannot_find_prog_unit then
424 --
425 hr_api.cannot_find_prog_unit_error
426 (p_module_name => 'PER_MEDICAL_ASSESSMENTS'
427 ,p_hook_type => 'AU');
428 --
429 end;
430 --
431 hr_utility.set_location(' Leaving:'||l_proc, 10);
432 End post_update;
433 --
434 -- ----------------------------------------------------------------------------
435 -- |-----------------------------< convert_defs >-----------------------------|
436 -- ----------------------------------------------------------------------------
437 -- {Start Of Comments}
438 --
439 -- Description:
440 -- The Convert_Defs procedure has one very important function:
441 -- It must return the record structure for the row with all system defaulted
442 -- values converted into its corresponding parameter value for update. When
443 -- we attempt to update a row through the Upd process , certain
444 -- parameters can be defaulted which enables flexibility in the calling of
445 -- the upd process (e.g. only attributes which need to be updated need to be
446 -- specified). For the upd process to determine which attributes
447 -- have NOT been specified we need to check if the parameter has a reserved
448 -- system default value. Therefore, for all parameters which have a
449 -- corresponding reserved system default mechanism specified we need to
450 -- check if a system default is being used. If a system default is being
451 -- used then we convert the defaulted value into its corresponding attribute
452 -- value held in the g_old_rec data structure.
453 --
454 -- Prerequisites:
455 -- This private function can only be called from the upd process.
456 --
457 -- In Parameters:
458 -- A Pl/Sql record structure.
459 --
460 -- Post Success:
461 -- The record structure will be returned with all system defaulted parameter
462 -- values converted into its current row attribute value.
463 --
464 -- Post Failure:
465 -- No direct error handling is required within this function. Any possible
466 -- errors within this procedure will be a PL/SQL value error due to
467 -- conversion of datatypes or data lengths.
468 --
469 -- Developer Implementation Notes:
470 -- None.
471 --
472 -- Access Status:
473 -- Internal Row Handler Use Only.
474 --
475 -- {End Of Comments}
476 -- ----------------------------------------------------------------------------
477 Procedure convert_defs
478 (p_rec in out nocopy per_mea_shd.g_rec_type
479 ) is
480 --
481 l_proc varchar2(72) := g_package||'convert_defs';
482 --
483 Begin
484 --
485 hr_utility.set_location(' Entering:'||l_proc, 10);
486 --
487 -- We must now examine each argument value in the
488 -- p_rec plsql record structure
489 -- to see if a system default is being used. If a system default
490 -- is being used then we must set to the 'current' argument value.
491 --
492 If (p_rec.person_id = hr_api.g_number) then
493 p_rec.person_id :=
494 per_mea_shd.g_old_rec.person_id;
495 End If;
496 --
497 hr_utility.set_location(l_proc, 20);
498 --
499 If (p_rec.examiner_name = hr_api.g_varchar2) then
500 p_rec.examiner_name :=
501 per_mea_shd.g_old_rec.examiner_name;
502 End If;
503 --
504 hr_utility.set_location(l_proc, 30);
505 --
506 If (p_rec.organization_id = hr_api.g_number) then
507 p_rec.organization_id :=
508 per_mea_shd.g_old_rec.organization_id;
509 End If;
510 --
511 hr_utility.set_location(l_proc, 40);
512 --
513 If (p_rec.consultation_date = hr_api.g_date) then
514 p_rec.consultation_date :=
515 per_mea_shd.g_old_rec.consultation_date;
516 End If;
517 --
518 hr_utility.set_location(l_proc, 50);
519 --
520 If (p_rec.consultation_type = hr_api.g_varchar2) then
521 p_rec.consultation_type :=
522 per_mea_shd.g_old_rec.consultation_type;
523 End If;
524 --
525 hr_utility.set_location(l_proc, 60);
526 --
527 If (p_rec.incident_id = hr_api.g_number) then
528 p_rec.incident_id :=
529 per_mea_shd.g_old_rec.incident_id;
530 End If;
531 --
532 hr_utility.set_location(l_proc, 70);
533 --
534 If (p_rec.consultation_result = hr_api.g_varchar2) then
535 p_rec.consultation_result :=
536 per_mea_shd.g_old_rec.consultation_result;
537 End If;
538 --
539 hr_utility.set_location(l_proc, 80);
540 --
541 If (p_rec.disability_id = hr_api.g_number) then
542 p_rec.disability_id :=
543 per_mea_shd.g_old_rec.disability_id;
544 End If;
545 --
546 hr_utility.set_location(l_proc, 90);
547 --
548 If (p_rec.next_consultation_date = hr_api.g_date) then
549 p_rec.next_consultation_date :=
550 per_mea_shd.g_old_rec.next_consultation_date;
551 End If; --
552 hr_utility.set_location(l_proc, 100);
553 --
554 If (p_rec.description = hr_api.g_varchar2) then
555 p_rec.description :=
556 per_mea_shd.g_old_rec.description;
557 End If; --
558 hr_utility.set_location(l_proc, 110);
559 --
560 If (p_rec.attribute_category = hr_api.g_varchar2) then
561 p_rec.attribute_category :=
562 per_mea_shd.g_old_rec.attribute_category;
563 End If;
564 If (p_rec.attribute1 = hr_api.g_varchar2) then
565 p_rec.attribute1 :=
566 per_mea_shd.g_old_rec.attribute1;
567 End If;
568 If (p_rec.attribute2 = hr_api.g_varchar2) then
569 p_rec.attribute2 :=
570 per_mea_shd.g_old_rec.attribute2;
571 End If;
572 If (p_rec.attribute3 = hr_api.g_varchar2) then
573 p_rec.attribute3 :=
574 per_mea_shd.g_old_rec.attribute3;
575 End If;
576 If (p_rec.attribute4 = hr_api.g_varchar2) then
577 p_rec.attribute4 :=
578 per_mea_shd.g_old_rec.attribute4;
579 End If;
580 If (p_rec.attribute5 = hr_api.g_varchar2) then
581 p_rec.attribute5 :=
582 per_mea_shd.g_old_rec.attribute5;
583 End If;
584 If (p_rec.attribute6 = hr_api.g_varchar2) then
585 p_rec.attribute6 :=
586 per_mea_shd.g_old_rec.attribute6;
587 End If;
588 If (p_rec.attribute7 = hr_api.g_varchar2) then
589 p_rec.attribute7 :=
590 per_mea_shd.g_old_rec.attribute7;
591 End If;
592 If (p_rec.attribute8 = hr_api.g_varchar2) then
593 p_rec.attribute8 :=
594 per_mea_shd.g_old_rec.attribute8;
595 End If;
596 If (p_rec.attribute9 = hr_api.g_varchar2) then
597 p_rec.attribute9 :=
598 per_mea_shd.g_old_rec.attribute9;
599 End If;
600 If (p_rec.attribute10 = hr_api.g_varchar2) then
601 p_rec.attribute10 :=
602 per_mea_shd.g_old_rec.attribute10;
603 End If;
604 If (p_rec.attribute11 = hr_api.g_varchar2) then
605 p_rec.attribute11 :=
606 per_mea_shd.g_old_rec.attribute11;
607 End If;
608 If (p_rec.attribute12 = hr_api.g_varchar2) then
609 p_rec.attribute12 :=
610 per_mea_shd.g_old_rec.attribute12;
611 End If;
612 If (p_rec.attribute13 = hr_api.g_varchar2) then
613 p_rec.attribute13 :=
614 per_mea_shd.g_old_rec.attribute13;
615 End If;
616 If (p_rec.attribute14 = hr_api.g_varchar2) then
617 p_rec.attribute14 :=
618 per_mea_shd.g_old_rec.attribute14;
619 End If;
620 If (p_rec.attribute15 = hr_api.g_varchar2) then
621 p_rec.attribute15 :=
622 per_mea_shd.g_old_rec.attribute15;
623 End If;
624 If (p_rec.attribute16 = hr_api.g_varchar2) then
625 p_rec.attribute16 :=
626 per_mea_shd.g_old_rec.attribute16;
627 End If;
628 If (p_rec.attribute17 = hr_api.g_varchar2) then
629 p_rec.attribute17 :=
630 per_mea_shd.g_old_rec.attribute17;
631 End If;
632 If (p_rec.attribute18 = hr_api.g_varchar2) then
633 p_rec.attribute18 :=
634 per_mea_shd.g_old_rec.attribute18;
635 End If;
636 If (p_rec.attribute19 = hr_api.g_varchar2) then
637 p_rec.attribute19 :=
638 per_mea_shd.g_old_rec.attribute19;
639 End If;
640 If (p_rec.attribute20 = hr_api.g_varchar2) then
641 p_rec.attribute20 :=
642 per_mea_shd.g_old_rec.attribute20;
643 End If;
644 If (p_rec.attribute21 = hr_api.g_varchar2) then
645 p_rec.attribute21 :=
646 per_mea_shd.g_old_rec.attribute21;
647 End If;
648 If (p_rec.attribute22 = hr_api.g_varchar2) then
649 p_rec.attribute22 :=
650 per_mea_shd.g_old_rec.attribute22;
651 End If;
652 If (p_rec.attribute23 = hr_api.g_varchar2) then
653 p_rec.attribute23 :=
654 per_mea_shd.g_old_rec.attribute23;
655 End If;
656 If (p_rec.attribute24 = hr_api.g_varchar2) then
657 p_rec.attribute24 :=
658 per_mea_shd.g_old_rec.attribute24;
659 End If;
660 If (p_rec.attribute25 = hr_api.g_varchar2) then
661 p_rec.attribute25 :=
662 per_mea_shd.g_old_rec.attribute25;
663 End If;
664 If (p_rec.attribute26 = hr_api.g_varchar2) then
665 p_rec.attribute26 :=
666 per_mea_shd.g_old_rec.attribute26;
667 End If;
668 If (p_rec.attribute27 = hr_api.g_varchar2) then
669 p_rec.attribute27 :=
670 per_mea_shd.g_old_rec.attribute27;
671 End If;
672 If (p_rec.attribute28 = hr_api.g_varchar2) then
673 p_rec.attribute28 :=
674 per_mea_shd.g_old_rec.attribute28;
675 End If;
676 If (p_rec.attribute29 = hr_api.g_varchar2) then
677 p_rec.attribute29 :=
678 per_mea_shd.g_old_rec.attribute29;
679 End If;
680 If (p_rec.attribute30 = hr_api.g_varchar2) then
681 p_rec.attribute30 :=
682 per_mea_shd.g_old_rec.attribute30;
683 End If;
684 If (p_rec.mea_information_category = hr_api.g_varchar2) then
685 p_rec.mea_information_category :=
686 per_mea_shd.g_old_rec.mea_information_category;
687 End If;
688 If (p_rec.mea_information1 = hr_api.g_varchar2) then
689 p_rec.mea_information1 :=
690 per_mea_shd.g_old_rec.mea_information1;
691 End If;
692 If (p_rec.mea_information2 = hr_api.g_varchar2) then
693 p_rec.mea_information2 :=
694 per_mea_shd.g_old_rec.mea_information2;
695 End If;
696 If (p_rec.mea_information3 = hr_api.g_varchar2) then
697 p_rec.mea_information3 :=
698 per_mea_shd.g_old_rec.mea_information3;
699 End If;
700 If (p_rec.mea_information4 = hr_api.g_varchar2) then
701 p_rec.mea_information4 :=
702 per_mea_shd.g_old_rec.mea_information4;
703 End If;
704 If (p_rec.mea_information5 = hr_api.g_varchar2) then
705 p_rec.mea_information5 :=
706 per_mea_shd.g_old_rec.mea_information5;
707 End If;
708 If (p_rec.mea_information6 = hr_api.g_varchar2) then
709 p_rec.mea_information6 :=
710 per_mea_shd.g_old_rec.mea_information6;
711 End If;
712 If (p_rec.mea_information7 = hr_api.g_varchar2) then
713 p_rec.mea_information7 :=
714 per_mea_shd.g_old_rec.mea_information7;
715 End If;
716 If (p_rec.mea_information8 = hr_api.g_varchar2) then
717 p_rec.mea_information8 :=
718 per_mea_shd.g_old_rec.mea_information8;
719 End If;
720 If (p_rec.mea_information9 = hr_api.g_varchar2) then
721 p_rec.mea_information9 :=
722 per_mea_shd.g_old_rec.mea_information9;
723 End If;
724 If (p_rec.mea_information10 = hr_api.g_varchar2) then
725 p_rec.mea_information10 :=
726 per_mea_shd.g_old_rec.mea_information10;
727 End If;
728 If (p_rec.mea_information11 = hr_api.g_varchar2) then
729 p_rec.mea_information11 :=
730 per_mea_shd.g_old_rec.mea_information11;
731 End If;
732 If (p_rec.mea_information12 = hr_api.g_varchar2) then
733 p_rec.mea_information12 :=
734 per_mea_shd.g_old_rec.mea_information12;
735 End If;
736 If (p_rec.mea_information13 = hr_api.g_varchar2) then
737 p_rec.mea_information13 :=
738 per_mea_shd.g_old_rec.mea_information13;
739 End If;
740 If (p_rec.mea_information14 = hr_api.g_varchar2) then
741 p_rec.mea_information14 :=
742 per_mea_shd.g_old_rec.mea_information14;
743 End If;
744 If (p_rec.mea_information15 = hr_api.g_varchar2) then
745 p_rec.mea_information15 :=
746 per_mea_shd.g_old_rec.mea_information15;
747 End If;
748 If (p_rec.mea_information16 = hr_api.g_varchar2) then
749 p_rec.mea_information16 :=
750 per_mea_shd.g_old_rec.mea_information16;
751 End If;
752 If (p_rec.mea_information17 = hr_api.g_varchar2) then
753 p_rec.mea_information17 :=
754 per_mea_shd.g_old_rec.mea_information17;
755 End If;
756 If (p_rec.mea_information18 = hr_api.g_varchar2) then
757 p_rec.mea_information18 :=
758 per_mea_shd.g_old_rec.mea_information18;
759 End If;
760 If (p_rec.mea_information19 = hr_api.g_varchar2) then
761 p_rec.mea_information19 :=
762 per_mea_shd.g_old_rec.mea_information19;
763 End If;
764 If (p_rec.mea_information20 = hr_api.g_varchar2) then
765 p_rec.mea_information20 :=
766 per_mea_shd.g_old_rec.mea_information20;
767 End If;
768 If (p_rec.mea_information21 = hr_api.g_varchar2) then
769 p_rec.mea_information21 :=
770 per_mea_shd.g_old_rec.mea_information21;
771 End If;
772 If (p_rec.mea_information22 = hr_api.g_varchar2) then
773 p_rec.mea_information22 :=
774 per_mea_shd.g_old_rec.mea_information22;
775 End If;
776 If (p_rec.mea_information23 = hr_api.g_varchar2) then
777 p_rec.mea_information23 :=
778 per_mea_shd.g_old_rec.mea_information23;
779 End If;
780 If (p_rec.mea_information24 = hr_api.g_varchar2) then
781 p_rec.mea_information24 :=
782 per_mea_shd.g_old_rec.mea_information24;
783 End If;
784 If (p_rec.mea_information25 = hr_api.g_varchar2) then
785 p_rec.mea_information25 :=
786 per_mea_shd.g_old_rec.mea_information25;
787 End If;
788 If (p_rec.mea_information26 = hr_api.g_varchar2) then
789 p_rec.mea_information26 :=
790 per_mea_shd.g_old_rec.mea_information26;
791 End If;
792 If (p_rec.mea_information27 = hr_api.g_varchar2) then
793 p_rec.mea_information27 :=
794 per_mea_shd.g_old_rec.mea_information27;
795 End If;
796 If (p_rec.mea_information28 = hr_api.g_varchar2) then
797 p_rec.mea_information28 :=
798 per_mea_shd.g_old_rec.mea_information28;
799 End If;
800 If (p_rec.mea_information29 = hr_api.g_varchar2) then
801 p_rec.mea_information29 :=
802 per_mea_shd.g_old_rec.mea_information29;
803 End If;
804 If (p_rec.mea_information30 = hr_api.g_varchar2) then
805 p_rec.mea_information30 :=
806 per_mea_shd.g_old_rec.mea_information30;
807 End If;
808 --
809 End convert_defs;
810 --
811 -- ----------------------------------------------------------------------------
812 -- |---------------------------------< upd >----------------------------------|
813 -- ----------------------------------------------------------------------------
814 Procedure upd
815 (p_effective_date in date
816 ,p_rec in out nocopy per_mea_shd.g_rec_type
817 ) is
818 --
819 l_proc varchar2(72) := g_package||'upd';
820 --
821 Begin
822 --
823 hr_utility.set_location('Entering:'||l_proc, 5);
824 --
825 -- We must lock the row which we need to update.
826 --
827 per_mea_shd.lck
828 (p_rec.medical_assessment_id
829 ,p_rec.object_version_number
830 );
831 --
832 hr_utility.set_location(l_proc, 10);
833 --
834 --
835 -- 1. During an update system defaults are used to determine if
836 -- arguments have been defaulted or not. We must therefore
837 -- derive the full record structure values to be updated.
838 --
839 -- 2. Call the supporting update validate operations.
840 --
841 convert_defs(p_rec);
842 --
843 hr_utility.set_location(l_proc, 20);
844 --
845 per_mea_bus.update_validate
846 (p_effective_date
847 ,p_rec
848 );
849 --
850 hr_utility.set_location(l_proc, 30);
851 --
852 -- Call the supporting pre-update operation
853 --
854 per_mea_upd.pre_update(p_rec);
855 --
856 hr_utility.set_location(l_proc, 40);
857 --
858 -- Update the row.
859 --
860 per_mea_upd.update_dml(p_rec);
861 --
862 hr_utility.set_location(l_proc, 50);
863 --
864 -- Call the supporting post-update operation
865 --
866 per_mea_upd.post_update
867 (p_effective_date
868 ,p_rec
869 );
870 --
871 hr_utility.set_location('Leaving:'||l_proc, 60);
872 --
873 End upd;
874 --
875 -- ----------------------------------------------------------------------------
876 -- |---------------------------------< upd >----------------------------------|
877 -- ----------------------------------------------------------------------------
878 Procedure upd
879 (p_effective_date in date
880 ,p_medical_assessment_id in number
881 ,p_object_version_number in out nocopy number
882 ,p_consultation_date in date default hr_api.g_date
883 ,p_consultation_type in varchar2 default hr_api.g_varchar2
884 ,p_examiner_name in varchar2 default hr_api.g_varchar2
885 ,p_organization_id in number default hr_api.g_number
886 ,p_incident_id in number default hr_api.g_number
887 ,p_consultation_result in varchar2 default hr_api.g_varchar2
888 ,p_disability_id in number default hr_api.g_number
889 ,p_next_consultation_date in date default hr_api.g_date
890 ,p_description in varchar2 default hr_api.g_varchar2
891 ,p_attribute_category in varchar2 default hr_api.g_varchar2
892 ,p_attribute1 in varchar2 default hr_api.g_varchar2
893 ,p_attribute2 in varchar2 default hr_api.g_varchar2
894 ,p_attribute3 in varchar2 default hr_api.g_varchar2
895 ,p_attribute4 in varchar2 default hr_api.g_varchar2
896 ,p_attribute5 in varchar2 default hr_api.g_varchar2
897 ,p_attribute6 in varchar2 default hr_api.g_varchar2
898 ,p_attribute7 in varchar2 default hr_api.g_varchar2
899 ,p_attribute8 in varchar2 default hr_api.g_varchar2
900 ,p_attribute9 in varchar2 default hr_api.g_varchar2
901 ,p_attribute10 in varchar2 default hr_api.g_varchar2
902 ,p_attribute11 in varchar2 default hr_api.g_varchar2
903 ,p_attribute12 in varchar2 default hr_api.g_varchar2
904 ,p_attribute13 in varchar2 default hr_api.g_varchar2
905 ,p_attribute14 in varchar2 default hr_api.g_varchar2
906 ,p_attribute15 in varchar2 default hr_api.g_varchar2
907 ,p_attribute16 in varchar2 default hr_api.g_varchar2
908 ,p_attribute17 in varchar2 default hr_api.g_varchar2
909 ,p_attribute18 in varchar2 default hr_api.g_varchar2
910 ,p_attribute19 in varchar2 default hr_api.g_varchar2
911 ,p_attribute20 in varchar2 default hr_api.g_varchar2
912 ,p_attribute21 in varchar2 default hr_api.g_varchar2
913 ,p_attribute22 in varchar2 default hr_api.g_varchar2
914 ,p_attribute23 in varchar2 default hr_api.g_varchar2
915 ,p_attribute24 in varchar2 default hr_api.g_varchar2
916 ,p_attribute25 in varchar2 default hr_api.g_varchar2
917 ,p_attribute26 in varchar2 default hr_api.g_varchar2
918 ,p_attribute27 in varchar2 default hr_api.g_varchar2
919 ,p_attribute28 in varchar2 default hr_api.g_varchar2
920 ,p_attribute29 in varchar2 default hr_api.g_varchar2
921 ,p_attribute30 in varchar2 default hr_api.g_varchar2
922 ,p_mea_information_category in varchar2 default hr_api.g_varchar2
923 ,p_mea_information1 in varchar2 default hr_api.g_varchar2
924 ,p_mea_information2 in varchar2 default hr_api.g_varchar2
925 ,p_mea_information3 in varchar2 default hr_api.g_varchar2
926 ,p_mea_information4 in varchar2 default hr_api.g_varchar2
927 ,p_mea_information5 in varchar2 default hr_api.g_varchar2
928 ,p_mea_information6 in varchar2 default hr_api.g_varchar2
929 ,p_mea_information7 in varchar2 default hr_api.g_varchar2
930 ,p_mea_information8 in varchar2 default hr_api.g_varchar2
931 ,p_mea_information9 in varchar2 default hr_api.g_varchar2
932 ,p_mea_information10 in varchar2 default hr_api.g_varchar2
933 ,p_mea_information11 in varchar2 default hr_api.g_varchar2
934 ,p_mea_information12 in varchar2 default hr_api.g_varchar2
935 ,p_mea_information13 in varchar2 default hr_api.g_varchar2
936 ,p_mea_information14 in varchar2 default hr_api.g_varchar2
937 ,p_mea_information15 in varchar2 default hr_api.g_varchar2
938 ,p_mea_information16 in varchar2 default hr_api.g_varchar2
939 ,p_mea_information17 in varchar2 default hr_api.g_varchar2
940 ,p_mea_information18 in varchar2 default hr_api.g_varchar2
941 ,p_mea_information19 in varchar2 default hr_api.g_varchar2
942 ,p_mea_information20 in varchar2 default hr_api.g_varchar2
943 ,p_mea_information21 in varchar2 default hr_api.g_varchar2
944 ,p_mea_information22 in varchar2 default hr_api.g_varchar2
945 ,p_mea_information23 in varchar2 default hr_api.g_varchar2
946 ,p_mea_information24 in varchar2 default hr_api.g_varchar2
947 ,p_mea_information25 in varchar2 default hr_api.g_varchar2
948 ,p_mea_information26 in varchar2 default hr_api.g_varchar2
949 ,p_mea_information27 in varchar2 default hr_api.g_varchar2
950 ,p_mea_information28 in varchar2 default hr_api.g_varchar2
951 ,p_mea_information29 in varchar2 default hr_api.g_varchar2
952 ,p_mea_information30 in varchar2 default hr_api.g_varchar2
953 ) is
954 --
955 l_rec per_mea_shd.g_rec_type;
956 l_proc varchar2(72) := g_package||'upd';
957 --
958 Begin
959 hr_utility.set_location('Entering:'||l_proc, 5);
960 --
961 -- Call conversion function to turn arguments into the
962 -- l_rec structure.
963 --
964 l_rec :=
965 per_mea_shd.convert_args
966 (p_medical_assessment_id
967 ,hr_api.g_number
968 ,p_examiner_name
969 ,p_organization_id
970 ,p_consultation_date
971 ,p_consultation_type
972 ,p_incident_id
973 ,p_consultation_result
974 ,p_disability_id
975 ,p_next_consultation_date
976 ,p_description
977 ,p_attribute_category
978 ,p_attribute1
979 ,p_attribute2
980 ,p_attribute3
981 ,p_attribute4
982 ,p_attribute5
983 ,p_attribute6
984 ,p_attribute7
985 ,p_attribute8
986 ,p_attribute9
987 ,p_attribute10
988 ,p_attribute11
989 ,p_attribute12
990 ,p_attribute13
991 ,p_attribute14
992 ,p_attribute15
993 ,p_attribute16
994 ,p_attribute17
995 ,p_attribute18
996 ,p_attribute19
997 ,p_attribute20
998 ,p_attribute21
999 ,p_attribute22
1000 ,p_attribute23
1001 ,p_attribute24
1002 ,p_attribute25
1003 ,p_attribute26
1004 ,p_attribute27
1005 ,p_attribute28
1006 ,p_attribute29
1007 ,p_attribute30
1008 ,p_mea_information_category
1009 ,p_mea_information1
1010 ,p_mea_information2
1011 ,p_mea_information3
1012 ,p_mea_information4
1013 ,p_mea_information5
1014 ,p_mea_information6
1015 ,p_mea_information7
1016 ,p_mea_information8
1017 ,p_mea_information9
1018 ,p_mea_information10
1019 ,p_mea_information11
1020 ,p_mea_information12
1021 ,p_mea_information13
1022 ,p_mea_information14
1023 ,p_mea_information15
1024 ,p_mea_information16
1025 ,p_mea_information17
1026 ,p_mea_information18
1027 ,p_mea_information19
1028 ,p_mea_information20
1029 ,p_mea_information21
1030 ,p_mea_information22
1031 ,p_mea_information23
1032 ,p_mea_information24
1033 ,p_mea_information25
1034 ,p_mea_information26
1035 ,p_mea_information27
1036 ,p_mea_information28
1037 ,p_mea_information29
1038 ,p_mea_information30
1039 ,p_object_version_number
1040 );
1041 --
1042 -- Having converted the arguments into the
1043 -- plsql record structure we call the corresponding record
1044 -- business process.
1045 --
1046 per_mea_upd.upd
1047 (p_effective_date
1048 ,l_rec
1049 );
1050 p_object_version_number := l_rec.object_version_number;
1051 --
1052 hr_utility.set_location(' Leaving:'||l_proc, 10);
1053 End upd;
1054 --
1055 end per_mea_upd;