1 PACKAGE hr_lookups_util_pkg AUTHID CURRENT_USER AS
2 /* $Header: hrlkutil.pkh 115.0 2002/05/29 09:31:48 pkm ship $ */
3 /*
4 ******************************************************************
5 * *
6 * Copyright (C) 2002 Oracle Corporation UK Ltd., *
7 * Reading, England. *
8 * *
9 * All rights reserved. *
10 * *
11 * *
12 ****************************************************************** */
13 /*
14
15 Name : hr_lookups_util_pkg
16
17 Description : Contains packages that allows quick retreival of
18 data that is created in PAY_LEGISLATIVE_FIELD_INFO
19 to map local lookups to Global Lookups.
20
21 Format of the mapping in this table is as follows:
22
23 RULE_TYPE LEG_CODE VALIDATION_TYPE VALIDATION_NAME FIELD_NAME
24 ----------- -------- --------------- --------------- ----------
25 LOCAL_LOOKUP DE TITLE DR DR_DR
26 LOCAL_LOOKUP DE MAR_STATUS SP EX
27 LOCAL_LOOKUP UK TITLE DR DOCTOR
28
29 Change List
30 -----------
31
32 Version Date Author Bug No. Description of Change
33 -------+---------+----------+---------+--------------------------
34
35 115.0 22-apr-02 IHarding Created
36 ================================================================= */
37 --
38 -- ----------------------- get_legislative_lookup_code ------------
39 --
40 -- This routine returns a legislative lookup code based on the inputs
41 -- of legislation code, lookup type and the global lookup code for
42 -- which you wish to find the localized equivalent.
43 --
44 -- If there does not exists a localized equivalent, the global lookup
45 -- is returned.
46 --
47 -- In the above example, parameters of DE, TITLE and DR would result
48 -- in the value DR_DR returning.
49 --
50 -- Input parameters of UK, TITLE and MR would result in MR being
51 -- returned. And so on.
52 --
53 FUNCTION get_legislative_lookup_code (p_lookup_type VARCHAR2
54 ,p_lookup_code VARCHAR2
55 ,p_legislation_code VARCHAR2)
56 return varchar2;
57 --
58 -- ----------------------- get_global_lookup_code ------------------
59 --
60 -- This routine does the opposite of get_legislative_lookup_code.
61 --
62 -- Based on legislation_code, lookup_type and a localized
63 -- lookup_code, the corresponding global code is returned. If there
64 -- is no global code, then the assumption is made that the supplied
65 -- localized code is in fact a global value.
66 --
67 -- In the above example, parameters of DE, TITLE and DR_DR would
68 -- result in the value DR returning.
69 --
70 -- Input parameters of UK, TITLE and MR would result in MR being
71 -- returned.
72 --
73 FUNCTION get_global_lookup_code (p_lookup_type VARCHAR2
74 ,p_lookup_code VARCHAR2
75 ,p_legislation_code VARCHAR2)
76 return varchar2;
77 --
78 --
79 ------------------------ swap_legislative_lookup_code ---------------
80 --
81 -- This routine takes a legislative code and swaps it for the equivalent
82 -- code in a different legislation. This could be used when moving records
83 -- between business groups and the data contains one field that has a
84 -- localized lookup in the source business group as well as the target
85 -- business group.
86 --
87 -- In the above example, passing in a source legislation of DE, a target
88 -- legislation of UK, a lookup_type of TITLE and a lookup_code of DR_DR
89 -- would result in the value 'DOCTOR' being returned.
90 --
91 -- The function just basically calls the above two functions in order,
92 -- first transforming the DE lookup to global and then finding out the
93 -- UK equivalent of the global lookup.
94 --
95 FUNCTION swap_legislative_lookup_code(p_lookup_type VARCHAR2
96 ,p_lookup_code VARCHAR2
97 ,p_source_leg_code VARCHAR2
98 ,p_target_leg_code VARCHAR2)
99 return varchar2;
100 --
101 --
102 END hr_lookups_util_pkg;