DBA Data[Home] [Help]

PACKAGE: APPS.HR_PERSON

Source


1 PACKAGE hr_person AS
2 /* $Header: peperson.pkh 120.0.12010000.1 2008/07/28 05:14:51 appldev ship $ */
3 /*
4  ******************************************************************
5  *                                                                *
6  *  Copyright (C) 1992 Oracle Corporation UK Ltd.,                *
7  *                   Chertsey, England.                           *
8  *                                                                *
9  *  All rights reserved.                                          *
10  *                                                                *
11  *  This material has been provided pursuant to an agreement      *
12  *  containing restrictions on its use.  The material is also     *
13  *  protected by copyright law.  No part of this material may     *
14  *  be copied or distributed, transmitted or transcribed, in      *
15  *  any form or by any means, electronic, mechanical, magnetic,   *
16  *  manual, or otherwise, or disclosed to third parties without   *
17  *  the express written permission of Oracle Corporation UK Ltd,  *
18  *  Oracle Park, Bittams Lane, Guildford Road, Chertsey, Surrey,  *
19  *  England.                                                      *
20  *                                                                *
21  ****************************************************************** */
22 /*
23  Name        : hr_person  (HEADER)
24 
25  Description : This package declares procedures required to INSERT,
26    UPDATE or DELETE people on Oracle Human Resources. Note, this
27    does not include extra validation provided by calling programs (such
28    as screen QuickPicks and HRLink validation) OR that provided by use
29    of constraints and triggers held against individual tables.
30  Change List
31  -----------
32 
33  Version Date      Author     ER/CR No. Description of Change
34  -------+---------+----------+---------+--------------------------
35  70.0    21-DEC-92 SZWILLIA             Date Created
36                                         Requires new messages
37  70.1    04-JAN-93 PBARRY               Following procedures added:
38 					product_installed
39                                         person_existance_check
40                                         pay_predel_validation
41                                         ssp_predel_validation
42                                         weak_predel_validation
43                                         strong_predel_validation
44                                         delete_a_person
45                                         people_default_deletes
46                                         applicant_default_deletes
47  70.2    04-JAN-93 PBARRY		Ignore_all_relationships parameter
48 					removed from strong_predel_validation.
49  70.3    11-FEB-93 PBARRY		P_SESSION_DATE parameter added to :
50 					weak_predel_validation
51 					strong_predel_validation
52 					delete_a_person
53 					check_contact
54  70.4    04-MAR-93 SZWILLIA             Changed parameters to dates.
55  70.5    11-MAR-93 NKHAn		Added 'exit' to the end
56  70.6    19-APR-93 TMathers             Added chk_future_person_type,
57                                               chk_prev_person_type,
58                                               Validate_address.
59                                         Changed derive_full_name
60                                         to be a procedure rather than
61                                         a function.Changed
62                                         strong_pre_delete validation
63                                         removed a line.
64  70.7    09-JUN-93   TMATHERS           Fixed validate_dob to work for any
65                                         person_type.
66  70.11   13-JUN-93   TMATHERS           Fixed generate_number added p_person_id
67                                         parameter. Fixed version comments also.
68  70.14   07-Dec-93   TMATHERS           Split Validate National Identifier
69  80.1                                   so that duplicate check is in another
70                                         procedure, check_ni_unique. B280
71  70.16   26-jul-94   TMathers           Overloaded chk_future wrt G1121.
72  70.17   06-May-96   TMathers           Overloaded derive_full_name to cope
73  70.18   07-May-96   TMathers           missing ????
74  70.19   27-Jan-97   VTreiger           Added PRE_NAME_ADJUNCT,SUFFIX as
75                                         parameters to derive_full_name
76 			        	 with suffix field.(352340).
77  115.1   20-Apr-00   czdickin           Added PER_INFORMATIONXX as parameters
78                                         to derive_full_name.
79  115.2   23-JAN092   stlocke		Added dbdrv commands
80  115.3   20-FEB-02   adhunter           Added npw parameters to generate_number and
81                                         validate_unique_number
82  115.4   03-NOV-02   eumenyio           added nocopy
83 
84  115.7   27-JAN-04   irgonzal           Enh 3299580: Overloaded generate_number.
85 
86  ================================================================= */
87 --
88 -- -----------------------  generate_number ------------------------
89 --
90 -- Procedure accepts the current emp and apl flags, national identifier
91 -- and business group and outputs the employee and applicant number
92 -- (Note if employee and applicant number are supplied and the method
93 --  is not automatic - the numbers will remain unchanged).
94 --
95 PROCEDURE generate_number
96  (p_current_employee    VARCHAR2 default null,
97   p_current_applicant   VARCHAR2 default null,
98   p_current_npw         VARCHAR2 default null,
99   p_national_identifier VARCHAR2 default null,
100   p_business_group_id   NUMBER,
101   p_person_id           NUMBER,
102   p_employee_number  IN OUT NOCOPY VARCHAR2 ,
103   p_applicant_number IN OUT NOCOPY VARCHAR2 ,
104   p_npw_number       IN OUT NOCOPY VARCHAR2);
105 --
106 -- 3299580: Overloaded
107 --
108 PROCEDURE generate_number
109  (p_current_employee    VARCHAR2 default null,
110   p_current_applicant   VARCHAR2 default null,
111   p_current_npw         VARCHAR2 default null,
112   p_national_identifier VARCHAR2 default null,
113   p_business_group_id   NUMBER,
114   p_person_id           NUMBER,
115   p_employee_number  IN OUT NOCOPY VARCHAR2 ,
116   p_applicant_number IN OUT NOCOPY VARCHAR2 ,
117   p_npw_number       IN OUT NOCOPY VARCHAR2
118  ,p_effective_date      IN     date
119  ,p_party_id            IN     number
120  ,p_date_of_birth       IN     date
121  ,p_start_date          IN     date default null
122  );
123 --
124 --
125 -- -------------------------- derive_full_name  ---------------------------
126 -- Construct FULL_NAME based on all name fields and if this name and date of
127 -- birth combination already exists (upper or lower case) then write an error
128 -- but DO NOT FAIL the procedure. Full Name may still be required as forms
129 -- treats this as a warning not an error
130 --
131 PROCEDURE derive_full_name
132 (p_first_name    VARCHAR2,
133  p_middle_names  VARCHAR2,
134  p_last_name     VARCHAR2,
135  p_known_as      VARCHAR2,
136  p_title         VARCHAR2,
137  p_suffix        VARCHAR2,
138  p_pre_name_adjunct VARCHAR2,
139  p_date_of_birth DATE,
140  p_person_id         NUMBER,
141  p_business_group_id NUMBER,
142  p_full_name OUT NOCOPY VARCHAR2 ,
143  p_duplicate_flag OUT NOCOPY VARCHAR2,
144  p_per_information1 VARCHAR2 DEFAULT NULL,
145  p_per_information2 VARCHAR2 DEFAULT NULL,
146  p_per_information3 VARCHAR2 DEFAULT NULL,
147  p_per_information4 VARCHAR2 DEFAULT NULL,
148  p_per_information5 VARCHAR2 DEFAULT NULL,
149  p_per_information6 VARCHAR2 DEFAULT NULL,
150  p_per_information7 VARCHAR2 DEFAULT NULL,
151  p_per_information8 VARCHAR2 DEFAULT NULL,
152  p_per_information9 VARCHAR2 DEFAULT NULL,
153  p_per_information10 VARCHAR2 DEFAULT NULL,
154  p_per_information11 VARCHAR2 DEFAULT NULL,
155  p_per_information12 VARCHAR2 DEFAULT NULL,
156  p_per_information13 VARCHAR2 DEFAULT NULL,
157  p_per_information14 VARCHAR2 DEFAULT NULL,
158  p_per_information15 VARCHAR2 DEFAULT NULL,
159  p_per_information16 VARCHAR2 DEFAULT NULL,
160  p_per_information17 VARCHAR2 DEFAULT NULL,
161  p_per_information18 VARCHAR2 DEFAULT NULL,
162  p_per_information19 VARCHAR2 DEFAULT NULL,
163  p_per_information20 VARCHAR2 DEFAULT NULL,
164  p_per_information21 VARCHAR2 DEFAULT NULL,
165  p_per_information22 VARCHAR2 DEFAULT NULL,
166  p_per_information23 VARCHAR2 DEFAULT NULL,
167  p_per_information24 VARCHAR2 DEFAULT NULL,
168  p_per_information25 VARCHAR2 DEFAULT NULL,
169  p_per_information26 VARCHAR2 DEFAULT NULL,
170  p_per_information27 VARCHAR2 DEFAULT NULL,
171  p_per_information28 VARCHAR2 DEFAULT NULL,
172  p_per_information29 VARCHAR2 DEFAULT NULL,
173  p_per_information30 VARCHAR2 DEFAULT NULL);
174 --
175 PROCEDURE derive_full_name
176 (p_first_name    VARCHAR2,
177  p_middle_names  VARCHAR2,
178  p_last_name     VARCHAR2,
179  p_known_as      VARCHAR2,
180  p_title         VARCHAR2,
181  p_suffix        VARCHAR2,
182  p_date_of_birth DATE,
183  p_person_id         NUMBER,
184  p_business_group_id NUMBER,
185  p_full_name OUT NOCOPY VARCHAR2 ,
186  p_duplicate_flag OUT NOCOPY VARCHAR2,
187  p_per_information1 VARCHAR2 DEFAULT NULL,
188  p_per_information2 VARCHAR2 DEFAULT NULL,
189  p_per_information3 VARCHAR2 DEFAULT NULL,
190  p_per_information4 VARCHAR2 DEFAULT NULL,
191  p_per_information5 VARCHAR2 DEFAULT NULL,
192  p_per_information6 VARCHAR2 DEFAULT NULL,
193  p_per_information7 VARCHAR2 DEFAULT NULL,
194  p_per_information8 VARCHAR2 DEFAULT NULL,
195  p_per_information9 VARCHAR2 DEFAULT NULL,
196  p_per_information10 VARCHAR2 DEFAULT NULL,
197  p_per_information11 VARCHAR2 DEFAULT NULL,
198  p_per_information12 VARCHAR2 DEFAULT NULL,
199  p_per_information13 VARCHAR2 DEFAULT NULL,
200  p_per_information14 VARCHAR2 DEFAULT NULL,
201  p_per_information15 VARCHAR2 DEFAULT NULL,
202  p_per_information16 VARCHAR2 DEFAULT NULL,
203  p_per_information17 VARCHAR2 DEFAULT NULL,
204  p_per_information18 VARCHAR2 DEFAULT NULL,
205  p_per_information19 VARCHAR2 DEFAULT NULL,
206  p_per_information20 VARCHAR2 DEFAULT NULL,
207  p_per_information21 VARCHAR2 DEFAULT NULL,
208  p_per_information22 VARCHAR2 DEFAULT NULL,
209  p_per_information23 VARCHAR2 DEFAULT NULL,
210  p_per_information24 VARCHAR2 DEFAULT NULL,
211  p_per_information25 VARCHAR2 DEFAULT NULL,
212  p_per_information26 VARCHAR2 DEFAULT NULL,
213  p_per_information27 VARCHAR2 DEFAULT NULL,
214  p_per_information28 VARCHAR2 DEFAULT NULL,
215  p_per_information29 VARCHAR2 DEFAULT NULL,
216  p_per_information30 VARCHAR2 DEFAULT NULL );
217 --
218 PROCEDURE derive_full_name
219 (p_first_name    VARCHAR2,
220  p_middle_names  VARCHAR2,
221  p_last_name     VARCHAR2,
222  p_known_as      VARCHAR2,
223  p_title         VARCHAR2,
224  p_date_of_birth DATE,
225  p_person_id         NUMBER,
226  p_business_group_id NUMBER,
227  p_full_name OUT NOCOPY VARCHAR2 ,
228  p_duplicate_flag OUT NOCOPY VARCHAR2,
229  p_per_information1 VARCHAR2 DEFAULT NULL,
230  p_per_information2 VARCHAR2 DEFAULT NULL,
231  p_per_information3 VARCHAR2 DEFAULT NULL,
232  p_per_information4 VARCHAR2 DEFAULT NULL,
233  p_per_information5 VARCHAR2 DEFAULT NULL,
234  p_per_information6 VARCHAR2 DEFAULT NULL,
235  p_per_information7 VARCHAR2 DEFAULT NULL,
236  p_per_information8 VARCHAR2 DEFAULT NULL,
237  p_per_information9 VARCHAR2 DEFAULT NULL,
238  p_per_information10 VARCHAR2 DEFAULT NULL,
239  p_per_information11 VARCHAR2 DEFAULT NULL,
240  p_per_information12 VARCHAR2 DEFAULT NULL,
241  p_per_information13 VARCHAR2 DEFAULT NULL,
242  p_per_information14 VARCHAR2 DEFAULT NULL,
243  p_per_information15 VARCHAR2 DEFAULT NULL,
244  p_per_information16 VARCHAR2 DEFAULT NULL,
245  p_per_information17 VARCHAR2 DEFAULT NULL,
246  p_per_information18 VARCHAR2 DEFAULT NULL,
247  p_per_information19 VARCHAR2 DEFAULT NULL,
248  p_per_information20 VARCHAR2 DEFAULT NULL,
249  p_per_information21 VARCHAR2 DEFAULT NULL,
250  p_per_information22 VARCHAR2 DEFAULT NULL,
251  p_per_information23 VARCHAR2 DEFAULT NULL,
252  p_per_information24 VARCHAR2 DEFAULT NULL,
253  p_per_information25 VARCHAR2 DEFAULT NULL,
254  p_per_information26 VARCHAR2 DEFAULT NULL,
255  p_per_information27 VARCHAR2 DEFAULT NULL,
256  p_per_information28 VARCHAR2 DEFAULT NULL,
257  p_per_information29 VARCHAR2 DEFAULT NULL,
258  p_per_information30 VARCHAR2 DEFAULT NULL);
259 
260 --  ------------------- check_ni_unique --------------------
261 procedure check_ni_unique
262 ( p_national_identifier VARCHAR2,
263   p_person_id           NUMBER,
264   p_business_group_id   NUMBER);
265 --
266 --
267 -- ------------------- validate_national_identifier -----------------------
268 --
269 -- Pass in national identifier and validate both construct (dependent on
270 -- the legislation of the business group) and uniqueness within business
271 -- group
272 --
273 PROCEDURE validate_national_identifier
274 ( p_national_identifier VARCHAR2,
275   p_person_id           NUMBER,
276   p_business_group_id   NUMBER);
277 --
278 --
279 -- ----------------------- validate_dob ------------------------------------
280 --
281 -- Date of Birth must be greater than start date for employees and applicants
282 --
283 PROCEDURE validate_dob
284 (p_date_of_birth      DATE,
285  p_start_date         DATE);
286 --
287 --
288 -- ----------------------- validate_sex_and_title --------------------------
289 --
290 -- Validation which should be performed at commit time for any person
291 --
292 PROCEDURE validate_sex_and_title(p_current_employee VARCHAR2
293                         ,p_sex              VARCHAR2
294                         ,p_title            VARCHAR2);
295 --
296 -- ----------------------- validate_unique_number --------------------------
297 --
298 -- Validation which should be performed at commit time for any person
299 --
300 PROCEDURE validate_unique_number(p_person_id          NUMBER
301                         ,p_business_group_id  NUMBER
302                         ,p_employee_number    VARCHAR2
303                         ,p_applicant_number   VARCHAR2
304                         ,p_npw_number         VARCHAR2
305                         ,p_current_employee   VARCHAR2
306                         ,p_current_applicant  VARCHAR2
307                         ,p_current_npw        VARCHAR2);
308 --
309 --
310 -- ----------------------- product_installed --------------------------
311 --
312 -- Has this product been installed? Return status and oracleid also.
313 --
314   PROCEDURE product_installed (p_application_short_name IN varchar2,
315                               p_status          OUT NOCOPY varchar2,
316                               p_yes_no          OUT NOCOPY varchar2,
317                               p_oracle_username OUT NOCOPY varchar2);
318 --
319 -- ----------------------- weak_predel_validation --------------------------
320 --
321 -- Weak pre-delete validation called primarily from Delete Person form.
322 --
323   PROCEDURE weak_predel_validation (p_person_id 	IN number,
324 				    p_session_date	IN date);
325 --
326 -- ----------------------- strong_predel_validation --------------------------
327 --
328 -- Strong pre-delete validation called from the Enter Person and Applicant
329 -- Quick Entry forms.
330 --
331   PROCEDURE strong_predel_validation (p_person_id IN number,
332 				      p_session_date IN date);
333 --
334 -- ----------------------- check_contact --------------------------
335 --
336 -- Whilst deleteing a contact relationship, is this contact 'used' for
337 -- anything else? If not then delete this person.
338 --
339   PROCEDURE check_contact (p_person_id                  IN number,
340                            p_contact_person_id          IN number,
341                            p_contact_relationship_id    IN number,
342 			   p_session_date		IN date);
343 --
344 -- ----------------------- delete_a_person --------------------------
345 --
346 -- Delete a person completely from the HR database. Deletes from all tables
347 -- referencing this person. Used primarily by Delete Person form.
348 --
349   PROCEDURE delete_a_person (p_person_id        IN number,
350                              p_form_call        IN boolean,
351 			     p_session_date	IN date);
352 --
356 -- Used primarily by the Enter Person form.
353 -- ----------------------- people_default_deletes --------------------------
354 --
355 -- Delete people who only have default information entered for them.
357 --
358   PROCEDURE people_default_deletes (p_person_id IN number,
359                                     p_form_call IN boolean);
360 --
361 -- ----------------------- applicant_default_deletes --------------------------
362 --
363 -- Delete applicants who only have default information entered for them.
364 -- Used primarily by the Applicant Quick Entry form.
365 --
366   PROCEDURE applicant_default_deletes (p_person_id      IN number,
367                                        p_form_call      IN boolean);
368 --
369 ------------------------- BEGIN: chk_future_person_type --------------------
370 FUNCTION chk_future_person_type
371         (p_system_person_type IN VARCHAR2
372         ,p_person_id IN INTEGER
373         ,p_business_group_id IN INTEGER
374         ,p_effective_start_date IN DATE) return BOOLEAN;
375 --
376 ------------------------- BEGIN: chk_future_person_type --------------------
377 FUNCTION chk_future_person_type
378         (p_system_person_type IN VARCHAR2
379         ,p_person_id IN INTEGER
380         ,p_business_group_id IN INTEGER
381         ,p_check_all IN VARCHAR2 DEFAULT 'Y'
382         ,p_effective_start_date IN DATE) return BOOLEAN;
383 --
384 ------------------------- BEGIN: chk_prev_person_type --------------------
385 FUNCTION chk_prev_person_type
386          (p_system_person_type IN VARCHAR2
387          ,p_person_id IN INTEGER
388          ,p_business_group_id IN INTEGER
389          ,p_effective_start_date IN DATE) RETURN BOOLEAN;
390 --
391 ------------------------- BEGIN: validate_address -------------------------
392 PROCEDURE validate_address(p_person_id INTEGER
393                           ,p_business_group_id INTEGER
394                           ,p_address_id INTEGER
395                           ,p_date_from DATE
396                           ,p_date_to DATE
397                           ,p_end_of_time DATE
398                           ,p_primary_flag VARCHAR2);
399 --
400 end hr_person;