I have a namespace that checks an internal 6-digit provider number against an npi number lookup table. The lookup table is valued nightly by a sql query. The namespace is contained in multiple tclprocs in multiple sites.
Is there a way to set this namespace up globally so that it can be called/referenced from a central location?
We just set up a master site on our test server.
Also not really that familiar with the concept of packages and/or how to set those up correctly.
We’re on Cloverleaf 6.1.2 , Unix AIX 7.1.0.0
### NAMESPACE CODE BELOW ###
namespace eval NPIDoctorNumberLogic {
#NPIdoctor_number_logic – pull the doctor data out of passed in doctor field
#
# Called:
# NPIdoctor_number_logic {DoctorCheckList doctor StripMDflag}# DoctorCheckList = keyed list of user fields
# doctor = data from HL7 doctor field – format “id^ln, fn” or “id^ln^fn”
#
# Notes:
# Can be used for any doctor number on the HL7 transaction
# Queries doctor against sms_npi.tbl , pulls back npi if found, defaults ‘9999999999’ if not found
# sms_npi.tbl updated nightly from values in Tufts Provider Directory
#
# Returns:
# doctor info (modified or original, depending on logic checks)
#
###############################################
# For checking doctor id against sms_npi.tbl and returning corresponding npi value
proc NPIdoctor_number_logic {doctor} {
# break apart the doctor field that Softlab sends
catch [set doctorList [split $doctor ~]]
# Run through doctorList to parse info for multiple iterations
foreach doctorItem $doctorList {
catch [set doctorList [split $doctorItem ^]]
catch [set doctor_ID [lindex $doctorList 0]]
catch [set doctor_IDlen [string length $doctor_ID]]
if {$doctor_IDlen > 5} {
catch [set npi [tbllookup sms_npi.tbl $doctor_ID]]
catch [set doctorList [lreplace $doctorList 0 0 $npi]]
catch [set doctorList [lreplace $doctorList 5 5 $doctor_ID]]
catch [set doctorList [join $doctorList ^]]
catch [set doctor $doctorList]
lappend DoctorCheckList $doctor
catch [set DoctorCheckList [join $DoctorCheckList ~]]
}
}
# Return data list
return $DoctorCheckList
}
}