Matching Package

advertisement
Central Person Registry (CPR) Matching Package
match_qp package
The match_qp package provides procedures and functions for matching.
A. check_date_of_birth_match
The check_date_of_birth_match function checks to see if the two supplied
character dates of birth match. The expected format for these dates is
MMDDYYYY. It uses the date match logic from Admission’s Standard ranking
logic as of 11/09/2004:
 If the months, days and years all match, then the dates match (Y).
 If the months match and the days or years match OR the days and years
match, then the dates are a partial match (P).
 If one or both of the dates is missing, then there is incomplete data for a
match (I).
 If the dates are different, then there is no match (N).
 Note: If none of the previous rules apply, then an error has occurred (0).
Steps of the function:
1) Since the procedure expects the character dates to be in the format of
MMDDYYY, verify that the dates are both full length. Return 0 if the dates are
not full length.
2) If at least one date is null or empty, then there is incomplete data for a match.
Return I.
3) If the strings are equal, then the dates match. Return Y.
4) Break down the first date string into numeric month, day and year.
5) Break down the second date string into numeric month, day and year.
6) If the months match and the days or years match or the days and years
match, then the dates are a partial match. Return P.
7) Otherwise the dates do not match. Return 0.
Input parameters:
date1_in – first character date to compare
date2_in – second character date to compare
requested_by_in – user id making the request
Output parameters:
N/A
Function return:
 Y, if the dates match
 P, if the months match and the days or years match OR days and years match
 I, if one or both dates is null
 N, if the dates do not match
 0, if an error occurred
2/9/16 1:36 AM
1
Central Person Registry (CPR) Matching Package
B. check_postal_code_match
The check_postal_code_match function checks to see if the two supplied
international postal codes match. It uses the zip code matching logic from
Admission’s International match criteria ranking:
 If the postal codes are the same, then they match (Y).
 If one or both of the postal codes is missing, then there is incomplete data for
a match (I).
 If the postal codes are different, then there is no match.
 Note: If none of the previous rules apply, then an error has occurred (0).
Steps of the function:
1) If at least one postal code is null or empty, then there is incomplete data for a
match. Return I.
2) If the strings are equal, then the postal codes match. Return Y.
3) If the postal codes are different, then they do not match. Return N.
Input parameters:
postal_code1_in – first postal code to compare
postal_code2_in – second postal code to compare
requested_by_in – user id making the request
Output parameters:
N/A
Function return:
 Y, if the postal codes match
 I, if one or both postal codes is null
 N, if the postal codes do not match
 0, if an error occurred
2/9/16 1:36 AM
2
Central Person Registry (CPR) Matching Package
C. find_matches_us
The find_matches_us procedure selects data based on the supplied name match
code, address match code, city match code and postal code input parameters. It
then uses the Standard match rankings from Admissions as of 11/09/2004 to
determine ranking values. The valid ranking values are from 1 to 550. Ranking
values from 330 to 550 are a match. Ranking values from 1 to 320 are not a
match. This procedure only determines rank values that are a match (330-550).
These rankings and their associated person_id are inserted into the
match_results table.
Steps of the procedure:
1) Declare a cursor using the name, address, city and postal code input
parameters.
2) Open the cursor and fetch the first record.
3) Loop through the records in the cursor.
a) Determine the date of birth match type.
b) If the names, addresses and cities match, then determine the rank value.
c) Else if the names and addresses match, then determine the rank value.
d) Else if the names and cities match, then determine the rank value.
e) Else if the names match, then determine the rank value.
f) Else set the rank value to 0.
g) If the rank value is greater than 0, then:
i) Select the next key value for the match_results table if it has not
already been selected.
ii) Insert a record in the match_results table.
h) Fetch the next record from the cursor.
Input parameters:
name_match_code_in – name match code
address_match_code_in – address match code
city_match_code_in – city match code
state_in – two-character US state
postal_code _in – postal code
dob_char_in – date of birth in character format (MMDDYYYY)
requested_userid_in – user id requesting the find match
Output parameters:
match_set_key_out:
 success – returns the match_set_key value for the records in the
match_results table
 success – returns 0 if no data was found
 exception/error occurred – returns -1
2/9/16 1:36 AM
3
Central Person Registry (CPR) Matching Package
D. find_matches_non_us
The find_matches_non_us procedure selects data based on the supplied name
match code, address match code, city match code and three-character country
code input parameters. It then uses Admission’s International match logic to
determine rank values. The valid ranking values are from 1 to 550. Ranking
values from 330 to 550 are a match. Ranking values from 1 to 320 are not a
match. This procedure only determines rank values that are a match (330-550).
These rankings and their associated person_id are inserted into the
match_results table.
Steps of the procedure:
4) Declare a cursor using the name, address, city and country input parameters.
5) Open the cursor and fetch the first record.
6) Loop through the records in the cursor.
a) Determine the date of birth match type.
b) Determine the postal code match type.
c) If the names, addresses, countries and postal codes match, then
determine the rank value.
d) Else if the names, cities and countries match, then determine the rank
value.
e) Else if the names, countries and dates of birth match, then determine the
rank value.
f) Else set the rank value to 0.
g) If the rank value is greater than 0, then:
i) Select the next key value for the match_results table if it has not
already been selected.
ii) Insert a record in the match_results table.
h) Fetch the next record from the cursor.
Input parameters:
name_match_code_in – name match code
address_match_code_in – address match code
city_match_code_in – city match code
country_code_three_in – three-character country code
postal_code _in – postal code
dob_char_in – date of birth in character format (MMDDYYYY)
requested_userid_in – user id requesting the find match
Output parameters:
match_set_key_out:
 success – returns the match_set_key value for the records in the
match_results table
 exception/error occurred – returns -1
2/9/16 1:36 AM
4
Download