Ramifications for Changing the External ID?

airbornejr24 wrote on Sunday, November 06, 2011:

We already have several patients who have internal and external IDs that initially started from the number one.  We’d like to change the external IDs to a different format, particularly for reasons related to referring clients to other facilities.

I believe we can implement the change and have all future patients have IDs consistent with the new format.  However, if we change the external IDs for existing patients, will that have some adverse effect on other information in the database that is related to that patient?  Will any links to that patient’s information be lost?

airbornejr24 wrote on Sunday, November 13, 2011:

Does anyone have any help for me?

bradymiller wrote on Sunday, November 13, 2011:

Hi,

A good place to start is by searching through code for pubpid, for example:
grep -R “pubpid” outputs:

/var/www/openemr/contrib/forms/psychiatrySet/intakeverslag/new.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/forms/psychiatrySet/intakeverslag/view.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/forms/psychiatrySet/brief_aan_verwijzer/new.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,sex,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/forms/psychiatrySet/brief_aan_verwijzer/view.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,sex,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/forms/psychiatrySet/psychiatrisch_onderzoek/new.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/forms/psychiatrySet/psychiatrisch_onderzoek/view.php:$result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/contrib/util/emr_scan_load.plx:# to its category, and its name must begin with the patient's pubpid
/var/www/openemr/contrib/util/emr_scan_load.plx:  my $pubpid = '';
/var/www/openemr/contrib/util/emr_scan_load.plx:    $pubpid = $1;
/var/www/openemr/contrib/util/emr_scan_load.plx:    "WHERE pubpid = '$pubpid' LIMIT 1")
/var/www/openemr/contrib/util/emr_scan_load.plx:    &tolog("$path: there is no patient with chart id '$pubpid'", 1);
/var/www/openemr/contrib/util/emr_scan_load.plx:    &tolog("$path: there are multiple patients with chart id '$pubpid'", 1);
/var/www/openemr/contrib/util/import_mi2xml.php:  $pubpid = trim( $medics->pubpid );
/var/www/openemr/contrib/util/import_mi2xml.php:  if (empty($pubpid)) {
/var/www/openemr/contrib/util/import_mi2xml.php:    array_push( $errors, "Patient ID '$pubpid' missing, patient skipped! ");
/var/www/openemr/contrib/util/import_mi2xml.php:  if ( $pubpid != 'NEWPATIENT') {
/var/www/openemr/contrib/util/import_mi2xml.php:	$query = "SELECT pid FROM patient_data WHERE pubpid LIKE '$pubpid'";
/var/www/openemr/contrib/util/import_mi2xml.php:	    array_push( $errors, "Patient ID '$pubpid' is ambiguous, patient skipped! ");
/var/www/openemr/contrib/util/import_mi2xml.php:	    // array_push( $errors, "Patient ID '$pubpid' exists, updates/new encounters only. ");
/var/www/openemr/contrib/util/import_mi2xml.php:      $patient_pid,                 // pubpid - use PID when NEWPATIENT
/var/www/openemr/contrib/util/import_mi2xml.php:    if( ($medics->pubpid == 'NEWPATIENT') || (!empty($medics->policy_id) ) ) {
/var/www/openemr/contrib/util/import_mi2xml.php:    if ($medics->pubpid == 'NEWPATIENT') {
/var/www/openemr/contrib/util/import_mi2xml.php:  $msg .= "Created new encounter for " . $medics->pubpid . ".<br>\n";
/var/www/openemr/contrib/util/import_mi2xml.php:  $pubpid = trim( $medics->pubpid );
/var/www/openemr/contrib/util/import_mi2xml.php:  $query = "SELECT pid FROM patient_data WHERE pubpid LIKE '$pubpid'";
/var/www/openemr/contrib/util/import_mi2xml.php:patient/pubpid
/var/www/openemr/library/options.inc.php:    if ($field_id == 'pubpid' && strlen($tmp) > 0) {
/var/www/openemr/library/appointments.inc.php:	'pubpid' => 'compareAppointmentsByPatientId',
/var/www/openemr/library/appointments.inc.php:  	'pubpid' => array( 'pubpid', 'date', 'time' ),
/var/www/openemr/library/appointments.inc.php:  	"p.fname, p.mname, p.lname, p.pid, p.pubpid, " .
/var/www/openemr/library/appointments.inc.php:	$id1 = $appointment1['pubpid'];
/var/www/openemr/library/appointments.inc.php:	$id2 = $appointment2['pubpid'];
/var/www/openemr/library/edi.inc:		$elig[18] = $row['pubpid'];					// Patient Account Number pubpid  
/var/www/openemr/library/patient.inc:    $where = "pubpid LIKE ? ";
/var/www/openemr/library/patient.inc:                $pubpid = "",
/var/www/openemr/library/patient.inc:        pubpid='$pubpid',
/var/www/openemr/library/ajax/left_nav_encounter_ajax.php:  "'," . htmlspecialchars($pid,ENT_QUOTES) . ",'" . htmlspecialchars(($prow['pubpid']),ENT_QUOTES) .
/var/www/openemr/library/ajax/find_patients.php:$pubpid = myGetValue('pubpid');
/var/www/openemr/library/ajax/find_patients.php:if ($pubpid) {
/var/www/openemr/library/ajax/find_patients.php:  if (myQueryPatients("pubpid LIKE '$pubpid'")) {
/var/www/openemr/library/ajax/find_patients.php:    $fname = $mname = $lname = $pubpid = '';
/var/www/openemr/library/ajax/find_patients.php:    $pubpid = $ss = '';
/var/www/openemr/library/ajax/find_patients.php:  echo "show_matches('$fname', '$mname', '$lname', '$pubpid', '$ss', '$message')\n";
/var/www/openemr/library/classes/Patient.class.php:	var $pubpid;
/var/www/openemr/library/classes/Patient.class.php:		$this->pubpid = "";
/var/www/openemr/library/classes/Patient.class.php:                                        ", pubpid ".
/var/www/openemr/library/classes/Patient.class.php:				$this->pubpid = $res['pubpid'];
/var/www/openemr/library/classes/Patient.class.php:	function get_pubpid() { return $this->pubpid; }
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Ms.', 'english', '', 'Farrah', 'Rolle', 'A.', '1973-10-11', '111 Main Street', '92101', 'San Luis', 'CA', '', '456789123', '', '(619) 555-2222', '(619) 555-3333', '(619) 555-1111', '', 'married', 'Joe', '2003-11-17 12:06:00', 'Female', 'Phil Martin', '', NULL, 'frolle@pennfirm.com', 'Latina', '', '', '3', '3200', '', '0000-00-00 00:00:00', '10', 5,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`)VALUES ( 'Mr.', 'english', '', 'Ted', 'Shaw', '', '1947-03-11', '222 1st Avenue', '92101', 'San Diego', 'CA', '', '920-24-2256', 'Landscape Architect', '(619) 555-7568', '(619) 555-9867', '(619) 555-7567', '', 'married', 'Marion Shaw', '2003-11-17 13:47:42', 'Male', 'Phil Martin', '', NULL, 'info@pennfirm.com', '', '', '', '', '', '', '0000-00-00 00:00:00', '24555', 1,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mrs.', 'english', '', 'Eduardo', 'Perez', '', '1957-01-09', '789 Third Avenue', '', 'San Diego', 'CA', '', '234567891', 'Manager of Transportation', '(619) 555-4859', '(619) 555-7821', '(619) 555-7823 x251', '', '', '', '2004-01-20 15:43:30', 'Male', 'Ynez Jones', '', 4, 'info@pennfirm.com', '', '', '', '', '', '', '0000-00-00 00:00:00', '789456', 4,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mrs.', 'spanish', '', 'Nora', 'Cohen', '', '1967-06-04', '155 First Avenue', '92101', 'San Luis', 'CA', '', '891-23-4567', '', '(213) 555-5555', '(213) 555-4444', '(818) 555-5555', '', 'married', '', '2004-01-16 10:28:22', 'Female', 'Phil Martin', '', 5, '', 'Latina', '', '', '3', '1500', '', '0000-00-00 00:00:00', '8', 8,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Brent', 'Perez', '', '1960-01-01', '1234 1st Avenue', '92101', 'San Diego', 'CA', '', '123456789', 'Airline Mechanic', '(619) 696-5050', '(888) 480-5050', '(619) 696-5050', '', 'married', 'Maria Perez', '2004-01-14 17:30:09', 'Male', 'Phil Martin', '', 5, 'bperez@pennfirm.com', 'Latino', '', '', '3', '2200', '', '2004-04-02 00:00:00', '1001', 41,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', '', '', 'Jim', 'Moses', '', '1945-02-14', '', '', 'Los Angeles', 'CA', '', '545676767', '', '(323) 555-4444', '(909) 555-6767', '(310) 555-1212', '', '', '', '2004-01-15 13:45:08', 'Male', 'Administrator Administrator', '', 1, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '17', 17,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', '', '', 'Richard', 'Jones', '', '1940-12-16', '400 West Broadway', '92101', 'San Diego', 'CA', '', '555-11-1111', '', '(619) 555-5555', '(619) 333-3333', '(619) 444-4444', '', 'married', '', '2004-01-16 10:02:41', '', 'Ynez Jones', '', 4, 'richard@pennfirm.com', '', '', '', '', '', '', '0000-00-00 00:00:00', '18', 18,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Ilias', 'Jenane', '', '1933-03-22', '145 N. East Street', '92111', 'La Mesa', 'CA', '', '111-11-2222', 'retired - school teacher', '(619) 555-2222', '(619) 555-3333', '(619) 555-1111', '', 'single', '', '2004-01-16 10:23:47', 'Female', 'Ynez Jones', '', 4, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '22', 22,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Jason', 'Binder', '', '1961-12-11', '100 West Sepulveda', '92020', 'Los Angeles', 'CA', '', '222-11-8888', 'Real Estate Agent', '', '', '', '', 'single', '', '2004-01-16 10:13:50', 'Male', 'Ynez Jones', '', 4, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '30', 30,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'John', 'Dockerty', 'D', '1977-05-02', '800 West Way', '92101', 'San Diego', 'CA', '', '111-11-1111', 'Physical therapist', '(567) 789-7891', '(567) 789-1234', '(567) 567-5678', '', 'single', '', '2004-01-16 10:21:05', '', 'Phil Martin', '', 5, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '25', 25,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'James', 'Janssen', '', '1966-04-28', '111 North Street', '90205', 'Irvine', 'CA', '', '555-11-1111', 'Office Manager', '(818) 555-2222', '(818) 555-2323', '(5555) 555-1111', '', 'single', '', '2004-01-19 14:21:25', 'Male', '', '', 1, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '26', 26,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Wallace', 'Buckley', '', '1952-04-03', '123 West Street', '90400', 'Barstow', 'California', '', '999-99-1111', 'Accountant', '(555) 111-1111', '(555) 111-1234', '(555) 555-5555', '', 'domestic partner', 'Mike Hart', '2004-01-16 10:18:28', '', 'Ynez Jones', '', 4, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '40', 40,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Robert', 'Dickey', '', '1955-04-12', '111 North Kearny', '91040', 'Torrance', 'CA', '', '214-22-1111', 'Project Manager', '(808) 555-1234', '(808) 555-4444', '(808) 555-1111', '', 'married', '', '2004-01-16 10:31:45', '', 'Phil Martin', '', 5, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '34', 34,'','','','');
/var/www/openemr/sql/example_patient_data.sql:(`title`, `language`, `financial`, `fname`, `lname`, `mname`, `DOB`, `street`, `postal_code`, `city`, `state`,  `drivers_license`, `ss`, `occupation`, `phone_home`, `phone_biz`, `phone_contact`, `phone_cell`, `status`, `contact_relationship`, `date`, `sex`, `referrer`, `referrerID`, `providerID`, `email`, `ethnoracial`, `interpretter`, `migrantseasonal`, `family_size`, `monthly_income`, `homeless`, `financial_review`, `pubpid`, `pid`, `genericname1`, `genericval1`, `genericname2`, `genericval2`) VALUES ( 'Mr.', 'english', '', 'Jillian', 'Mahoney', '', '1968-08-11', '444 North State Street', '90204', 'Santa Ana', 'CA', '', '222-11-1111', '', '(808) 555-4444', '(808) 555-3333', '(808) 555-5555', '', 'married', '', '2004-01-19 12:14:06', 'Female', 'Ynez Jones', '', 4, '', '', '', '', '', '', '', '0000-00-00 00:00:00', '35', 35,'','','','');
/var/www/openemr/sql/database.sql:INSERT INTO `layout_options` VALUES ('DEM', 'pubpid', '1Who', 'External ID', 5, 2, 1, 10, 15, '', 1, 1, '', 'ND', 'External identifier');
/var/www/openemr/sql/database.sql:  `pubpid` varchar(255) NOT NULL default '',
/var/www/openemr/sql/3_2_0-to-4_0_0_upgrade.sql:UPDATE layout_options SET edit_options = 'ND' WHERE form_id = 'DEM' AND field_id = 'pubpid' AND edit_options = '';
/var/www/openemr/sql/2_8_3-to-2_9_0_upgrade.sql:INSERT INTO layout_options VALUES ('DEM','pubpid'         ,'1Who','External ID'   , 5, 2,1,10,15,''       ,1,1,'','' ,'External identifier');
/var/www/openemr/custom/export_labworks.php:  "p.pubpid, p.fname, p.mname, p.lname, p.DOB, p.providerID, " .
/var/www/openemr/custom/export_labworks.php: Add($row['pubpid']);              // chart number
/var/www/openemr/custom/import_xml.php:   $apatient['pubpid'],
/var/www/openemr/custom/export_xml.php:  "p.pubpid, p.fname, p.mname, p.lname, p.DOB, p.providerID, " .
/var/www/openemr/custom/export_xml.php: Add("pubpid"     , $row['pubpid']);
/var/www/openemr/custom/BillingExport.csv.php:    $query = "SELECT p.pubpid, p.ss, p.lname, p.fname, p.mname, p.DOB, " .
/var/www/openemr/custom/BillingExport.csv.php:      ',"' . $this->fixString($prow['pubpid'])      . '"' .
/var/www/openemr/custom/readme_search.txt:$GLOBALS['pt_restrict_by_id'] = false;       // Should lookup by ID (pubpid) be restricted 
/var/www/openemr/custom/chart_tracker.php:  $query = "SELECT pd.pid, pd.pubpid, pd.fname, pd.mname, pd.lname, " .
/var/www/openemr/custom/chart_tracker.php:    "WHERE pd.pubpid = '$form_newid' " .
/var/www/openemr/custom/chart_tracker.php:  echo "  <td class='text'>" . $row['pubpid'] .
/var/www/openemr/custom/chart_tracker.php:       "<input type='hidden' name='form_curid' value='" . $row['pubpid'] . "' /></td>\n";
/var/www/openemr/myportal/soap_service/server_existingpatient.php:            $query="select count(*) AS count from patient_data where pubpid = ? $string_query";
/var/www/openemr/myportal/soap_service/server_newpatient.php:            $query="select count(*) AS count from patient_data where pubpid = ?";
/var/www/openemr/interface/billing/sl_eob_search.php:      "p.fname, p.mname, p.lname, p.pubpid, p.genericname2, p.genericval2, " .
/var/www/openemr/interface/billing/billing_report.php:function toencounter(pid, pubpid, pname, enc, datestr, dobstr) {
/var/www/openemr/interface/billing/billing_report.php: parent.left_nav.setPatient(pname,pid,pubpid,'',dobstr);
/var/www/openemr/interface/billing/billing_report.php:function topatient(pid, pubpid, pname, enc, datestr, dobstr) {
/var/www/openemr/interface/billing/billing_report.php: parent.left_nav.setPatient(pname,pid,pubpid,'',dobstr);
/var/www/openemr/interface/billing/billing_report.php:      $name = getPatientData($iter['enc_pid'], "fname, mname, lname, pubpid, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
/var/www/openemr/interface/billing/billing_report.php:        ",'" . addslashes($name['pubpid']) .
/var/www/openemr/interface/billing/billing_report.php:        ",'" . addslashes($name['pubpid']) .
/var/www/openemr/interface/forms/CAMOS/notegen.php:                        print xl("Claim")."# ".$notecontents['pubpid'] . "<br/>";
/var/www/openemr/interface/forms/CAMOS/notegen.php:		        $pdf->ezText(xl("Claim")."# ".$notecontents['pubpid'],8);
/var/www/openemr/interface/forms/CAMOS/notegen.php:		"t3.lname, t3.fname, t3.pubpid, date_format(t3.DOB,'%m-%d-%Y') as dob, " .
/var/www/openemr/interface/forms/CAMOS/notegen.php:		        $dates[$results1['datekey']][$results1['pid'].'_'.$results1['enc']]['pubpid'] = $results1['pubpid'];
/var/www/openemr/interface/new/new.php:$form_pubpid    = $_POST['pubpid'   ] ? trim($_POST['pubpid'   ]) : '';
/var/www/openemr/interface/new/new.php:   <input type='entry' size='5' name='pubpid' value='<?php echo $form_pubpid; ?>'>
/var/www/openemr/interface/new/new.php:if ($form_pubpid) { 
/var/www/openemr/interface/new/new_patient_save.php:if (!empty($_POST["pubpid"])) {
/var/www/openemr/interface/new/new_patient_save.php:  $form_pubpid = trim($_POST["pubpid"]);
/var/www/openemr/interface/new/new_patient_save.php:    "pubpid = '$form_pubpid'");
/var/www/openemr/interface/new/new_patient_save.php:if (isset($_POST["pubpid"]) && ($_POST["pubpid"] != "")) {
/var/www/openemr/interface/new/new_patient_save.php:  $mypubpid = $_POST["pubpid"];
/var/www/openemr/interface/new/new_patient_save.php:  $mypubpid = $pid;
/var/www/openemr/interface/new/new_patient_save.php:    "$mypubpid",
/var/www/openemr/interface/new/new_comprehensive_save.php:if (!empty($_POST["form_pubpid"])) {
/var/www/openemr/interface/new/new_comprehensive_save.php:  $form_pubpid = trim($_POST["form_pubpid"]);
/var/www/openemr/interface/new/new_comprehensive_save.php:    "pubpid = '$form_pubpid'");
/var/www/openemr/interface/new/new_comprehensive_save.php:  if ($field_id == 'pubpid' && empty($value)) $value = $pid;
/var/www/openemr/interface/new/new_search_popup.php:  // pubpid requires special treatment.  Match on that is fatal.
/var/www/openemr/interface/new/new_search_popup.php:  if ($fldname == 'pubpid') {
/var/www/openemr/interface/new/new_search_popup.php:$pubpid_matched = false;
/var/www/openemr/interface/new/new_search_popup.php:      $pubpid_matched = true;
/var/www/openemr/interface/new/new_search_popup.php:<?php if ($pubpid_matched) { ?>
/var/www/openemr/interface/new/new_search_popup.php:<?php if ($pubpid_matched) { ?>
/var/www/openemr/interface/reports/prescriptions_report.php:  if ($form_patient_id) $where .= " AND p.pubpid = '$form_patient_id'";
/var/www/openemr/interface/reports/prescriptions_report.php:   "p.pubpid, ".
/var/www/openemr/interface/reports/prescriptions_report.php:   "ORDER BY p.lname, p.fname, p.pubpid, r.id, s.sale_id";
/var/www/openemr/interface/reports/prescriptions_report.php:   $patient_id      = $row['pubpid'];
/var/www/openemr/interface/reports/prescriptions_report.php:   if (strcmp($row['pubpid'], $last_patient_id) == 0) {
/var/www/openemr/interface/reports/prescriptions_report.php:   $last_patient_id = $row['pubpid'];
/var/www/openemr/interface/reports/referrals_report.php:    "ut.organization, uf.facility_id, p.pubpid, " .
/var/www/openemr/interface/reports/referrals_report.php:   <?php echo $row['pubpid'] ?>
/var/www/openemr/interface/reports/appointments_report.php:		<th><a href="nojs.php" onclick="return dosort('pubpid')"
/var/www/openemr/interface/reports/appointments_report.php:	<?php if ($form_orderby == "pubpid") echo " style=\"color:#00cc00\"" ?>><?php  xl('ID','e'); ?></a>
/var/www/openemr/interface/reports/appointments_report.php:		<td class="detail">&nbsp;<?php echo $appointment['pubpid'] ?></td>
/var/www/openemr/interface/reports/chart_location_activity.php:  $query = "SELECT pid, pubpid, fname, mname, lname FROM patient_data WHERE " .
/var/www/openemr/interface/reports/chart_location_activity.php:    "pubpid = '$form_patient_id' ORDER BY pid LIMIT 1";
/var/www/openemr/interface/reports/chart_location_activity.php:  $query = "SELECT pid, pubpid, fname, mname, lname FROM patient_data WHERE " .
/var/www/openemr/interface/reports/chart_location_activity.php:  $form_patient_id = $ptrow['pubpid'];
/var/www/openemr/interface/reports/chart_location_activity.php:  echo "(" . $ptrow['pubpid'] . ")";
/var/www/openemr/interface/reports/front_receipts_report.php:    "p.fname, p.mname, p.lname, p.pubpid " .
/var/www/openemr/interface/reports/front_receipts_report.php:   <?php echo $row['pubpid'] ?>
/var/www/openemr/interface/reports/encounters_report.php:  'pubpid'  => 'lower(p.pubpid), fe.date',
/var/www/openemr/interface/reports/encounters_report.php:  "p.fname, p.mname, p.lname, p.pid, p.pubpid, " .
/var/www/openemr/interface/reports/encounters_report.php:   <a href="nojs.php" onclick="return dosort('pubpid')"
/var/www/openemr/interface/reports/encounters_report.php:   <?php if ($form_orderby == "pubpid") echo " style=\"color:#00cc00\"" ?>><?php  xl('ID','e'); ?></a>
/var/www/openemr/interface/reports/encounters_report.php:   <?php echo $row['pubpid']; ?>&nbsp;
/var/www/openemr/interface/reports/edi_270.php:								   p.pubpid,
/var/www/openemr/interface/reports/charts_checked_out.php:  "p.pubpid, p.fname, p.mname, p.lname " .
/var/www/openemr/interface/reports/charts_checked_out.php:  "ORDER BY p.pubpid";
/var/www/openemr/interface/reports/charts_checked_out.php:  "p.pubpid, p.fname, p.mname, p.lname " .
/var/www/openemr/interface/reports/charts_checked_out.php:  "ORDER BY p.pubpid";
/var/www/openemr/interface/reports/charts_checked_out.php:   <?php echo $row['pubpid']; ?>
/var/www/openemr/interface/reports/appt_encounter_report.php:   "p.fname, p.lname, p.pid, p.pubpid, " .
/var/www/openemr/interface/reports/appt_encounter_report.php:   "p.fname, p.lname, p.pid, p.pubpid, " .
/var/www/openemr/interface/reports/appt_encounter_report.php:   &nbsp;<?php  echo $row['pubpid'] ?>
/var/www/openemr/interface/reports/collections_report.php:    $form_cb_pubpid   = false;
/var/www/openemr/interface/reports/collections_report.php:    $form_cb_pubpid   = $_POST['form_cb_pubpid']   ? true : false;
/var/www/openemr/interface/reports/collections_report.php:  $form_cb_pubpid   = false;
/var/www/openemr/interface/reports/collections_report.php:if ($form_cb_pubpid  ) ++$initial_colspan;
/var/www/openemr/interface/reports/collections_report.php:						   <input type='checkbox' name='form_cb_pubpid'<?php if ($form_cb_pubpid) echo ' checked'; ?>>
/var/www/openemr/interface/reports/collections_report.php:      "p.pubpid, p.DOB, CONCAT(u.lname, ', ', u.fname) AS referrer, " .
/var/www/openemr/interface/reports/collections_report.php:      $row['pubpid']    = $erow['pubpid'];
/var/www/openemr/interface/reports/collections_report.php:        "pd.genericname2, pd.genericval2, pd.pid, pd.pubpid, pd.DOB, " .
/var/www/openemr/interface/reports/collections_report.php:      $row['pubpid'] = $pdrow['pubpid'];
/var/www/openemr/interface/reports/collections_report.php:<?php if ($form_cb_pubpid) { ?>
/var/www/openemr/interface/reports/collections_report.php:        if ($form_cb_pubpid) {
/var/www/openemr/interface/reports/collections_report.php:          echo "  <td class='detail'>&nbsp;" . $row['pubpid'] . "</td>\n";
/var/www/openemr/interface/reports/players_report_dialog.php:  "fname, mname, lname, pubpid, squad " .
/var/www/openemr/interface/reports/patient_list.php:   "p.postal_code, p.phone_home, p.phone_biz, p.pid, p.pubpid, " .
/var/www/openemr/interface/reports/patient_list.php:   <?php echo $row['pubpid'] ?>
/var/www/openemr/interface/orders/pending_orders.php:    echo '"' . addslashes($row['pubpid'        ]) . '",';
/var/www/openemr/interface/orders/pending_orders.php:  <td class="detail"><?php echo $row['pubpid'        ]; ?></td>
/var/www/openemr/interface/orders/pending_orders.php:    "pd.pubpid, " .
/var/www/openemr/interface/orders/orders_results.php:    parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAge($result['DOB_YMD']) . "'"; ?>);
/var/www/openemr/interface/orders/orders_results.php:  "pd.fname, pd.mname, pd.lname, pd.pubpid, $selects " .
/var/www/openemr/interface/orders/orders_results.php:      echo "  <td>" . htmlentities($row['pubpid']) . "</td>\n";
/var/www/openemr/interface/orders/pending_followup.php:    echo '"' . addslashes($row['pubpid'        ]) . '",';
/var/www/openemr/interface/orders/pending_followup.php:  <td class="detail"><?php echo $row['pubpid'        ]; ?></td>
/var/www/openemr/interface/orders/pending_followup.php:    "pd.pubpid, " .
/var/www/openemr/interface/patient_file/transaction/transaction_title.php: $result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/interface/patient_file/transaction/transaction_title.php: $info = 'ID: ' . $result['pubpid'];
/var/www/openemr/interface/patient_file/letter.php:  "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
/var/www/openemr/interface/patient_file/letter.php:    $patdata['lname'] . " (" . $patdata['pubpid'] . ")" ?></b>
/var/www/openemr/interface/patient_file/pos_checkout.php:$patdata = getPatientData($patient_id, 'fname,mname,lname,pubpid,street,city,state,postal_code');
/var/www/openemr/interface/patient_file/pos_checkout.php:  $patdata = getPatientData($patient_id, 'fname,mname,lname,pubpid,street,city,state,postal_code,providerID');
/var/www/openemr/interface/patient_file/pos_checkout.php:    $patdata['lname'] . " (" . $patdata['pubpid'] . ")" ?></b>
/var/www/openemr/interface/patient_file/encounter/encounter_title.php: $result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/interface/patient_file/encounter/encounter_title.php: $info = 'ID: ' . $result['pubpid'];
/var/www/openemr/interface/patient_file/front_payment.php:// $patdata = getPatientData($pid, 'fname,lname,pubpid');
/var/www/openemr/interface/patient_file/front_payment.php:  "p.fname, p.mname, p.lname, p.pubpid, i.copay " .
/var/www/openemr/interface/patient_file/front_payment.php:  $patdata = getPatientData($form_pid, 'fname,mname,lname,pubpid');
/var/www/openemr/interface/patient_file/front_payment.php:       $patdata['lname'] . " (" . $patdata['pubpid'] . ")" ?></td>
/var/www/openemr/interface/patient_file/front_payment.php:    $patdata['lname'] . " (" . $patdata['pubpid'] . ")" ?></b>
/var/www/openemr/interface/patient_file/front_payment.php:      "p.fname, p.mname, p.lname, p.pubpid, p.genericname2, p.genericval2, " .
/var/www/openemr/interface/patient_file/printed_fee_sheet.php:      ID:<br /><?php if ($form_fill) echo $patdata['pubpid']; ?>
/var/www/openemr/interface/patient_file/history/history_title.php: $result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/interface/patient_file/history/history_title.php: $info = 'ID: ' . $result['pubpid'];
/var/www/openemr/interface/patient_file/summary/summary_title.php: $result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/interface/patient_file/summary/summary_title.php: $info = 'ID: ' . $result['pubpid'];
/var/www/openemr/interface/patient_file/summary/pnotes_full_add.php:  $ndata = getPatientData($pid, "fname, lname, pubpid");
/var/www/openemr/interface/patient_file/summary/pnotes_full_add.php: parent.left_nav.setPatient(<?php echo "'" . htmlspecialchars( $ndata['fname']." ".$ndata['lname'], ENT_QUOTES) . "',$pid,'" . htmlspecialchars( $ndata['pubpid'], ENT_QUOTES) . "',window.name"; ?>);
/var/www/openemr/interface/patient_file/summary/pnotes_full.php:  $ndata = getPatientData($pid, "fname, lname, pubpid");
/var/www/openemr/interface/patient_file/summary/pnotes_full.php:   htmlspecialchars( $pid, ENT_QUOTES) . ",'" . htmlspecialchars( $ndata['pubpid'], ENT_QUOTES) . "',window.name"; ?>);
/var/www/openemr/interface/patient_file/summary/demographics.php:   "'," . htmlspecialchars($pid,ENT_QUOTES) . ",'" . htmlspecialchars(($result['pubpid']),ENT_QUOTES) .
/var/www/openemr/interface/patient_file/summary/demographics_full.php: parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAge($result['DOB_YMD']) . "'"; ?>);
/var/www/openemr/interface/patient_file/summary/browse.php:	                htmlspecialchars( $iter{"pubpid"}, ENT_NOQUOTES) . "</a></td>";
/var/www/openemr/interface/patient_file/summary/browse.php:	                htmlspecialchars( $iter{"pubpid"}, ENT_NOQUOTES) . "</a></td>";
/var/www/openemr/interface/patient_file/summary/browse.php:                        htmlspecialchars( $iter{"pubpid"}, ENT_NOQUOTES) . "</a></td>";
/var/www/openemr/interface/patient_file/summary/browse.php:                        htmlspecialchars( $iter{"pubpid"}, ENT_NOQUOTES) . "</a></td>";
/var/www/openemr/interface/patient_file/report/report_title.php: $result = getPatientData($pid, "fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,'%Y%m%d') as DOB_YMD");
/var/www/openemr/interface/patient_file/report/report_title.php: $info = 'ID: ' . $result['pubpid'];
/var/www/openemr/interface/main/finder/patient_select.php:      else if ($field_id == 'pubpid') {
/var/www/openemr/interface/main/finder/patient_select.php:    "field_id NOT LIKE 'pubpid' " .
/var/www/openemr/interface/main/finder/patient_select.php:        echo "<td class='srID'>" . htmlspecialchars( $iter['pubpid'], ENT_NOQUOTES) . "</td>";
/var/www/openemr/interface/main/calendar/find_patient_popup.php:    echo "  <td class='srID'>" . htmlspecialchars( $iter['pubpid'], ENT_NOQUOTES) . "</td>\n";
/var/www/openemr/interface/main/calendar/find_patient.php:    echo "  <td class='srID'>" . htmlspecialchars( $iter['pubpid'], ENT_NOQUOTES) . "</td>\n";
/var/www/openemr/interface/main/calendar/new_patient_save.php:    if (isset($_POST["pubpid"]) && ($_POST["pubpid"] != "")) {
/var/www/openemr/interface/main/calendar/new_patient_save.php:        $mypubpid = $_POST["pubpid"];
/var/www/openemr/interface/main/calendar/new_patient_save.php:        $mypubpid = $pid;
/var/www/openemr/interface/main/calendar/new_patient_save.php:                    "$mypubpid",
/var/www/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php:    "DOB as patient_dob, a.pc_facility, pd.pubpid " .
/var/www/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php:         $tmp['facility'],     $tmp['pubpid']) = $result->fields;
/var/www/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php:    $events[$i]['pubpid']      = $tmp['pubpid'];
/var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/default/user/details.html:				with patient <strong>[-$A_EVENT.patient_name-]</strong> (pid [-$A_EVENT.pubpid-])
/var/www/openemr/interface/main/calendar/modules/PostCalendar/common.api.php:                    pd.pubpid
/var/www/openemr/interface/main/calendar/modules/PostCalendar/common.api.php:         $event['catcolor'],   $event['catname'],     $event['catdesc'], $event['pid'], $event['aid'],$event['pubpid']) = $result->fields;
/var/www/openemr/interface/main/left_nav.php: function setPatient(pname, pid, pubpid, frname, str_dob) {
/var/www/openemr/interface/main/left_nav.php:  var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
/var/www/openemr/templates/patient_finder/general_find.html:			<a href="javascript:{literal}{}{/literal}" onclick="window.opener.document.{$form_id}.value='{if $ispub == true }{$result.pubpid}{else}{$result.pid}{/if}'; window.opener.document.{$form_name}.value='{$result.name}'; window.close();">{$result.name}</a>
/var/www/openemr/templates/patient_finder/general_find.html:		<td>{$result.pubpid}</td>
/var/www/openemr/controllers/C_Document.class.php:			$sql = "SELECT pid from patient_data where pubpid = '" . $file['patient_id'] . "'";
/var/www/openemr/controllers/C_Document.class.php:			// $sql = "SELECT pid from patient_data where pubpid = '" . $new_patient_id . "'";
/var/www/openemr/controllers/C_PatientFinder.class.php:		$sql = "SELECT CONCAT(lname, ' ', fname, ' ', mname) as name, DOB, pubpid, pid FROM patient_data";
/var/www/openemr/controllers/C_Prescription.class.php:		$pdf->ezText(str_pad($p->patient->get_pubpid(), 10, "0", STR_PAD_LEFT),10);
/var/www/openemr/controllers/C_Prescription.class.php:                echo (str_pad($p->patient->get_pubpid(), 10, "0", STR_PAD_LEFT));

Then can look through and see if there’s any code where it could possibly be used that may screw things up by changing them. For example, the code in controllers/C_Document.class.php look a bit suspicious.

-brady

bradymiller wrote on Sunday, November 13, 2011:

Also,
To scan/read through above, is much easier if you copy/paste it to a text editor and then make the window as wide as possible.
-brady