Fix - a default value for pubpid is not written to the database when the External ID field in the New Patient form is set to Unused
In line 50-52 all field_ids that have an associated uor value greater than zero are pulled from layout_options, for each a value is set in $newdata (which will be written to database). When pubpid (External ID) has a uor equal to zero there is no field_id to cause a value to be set.
Adding pubpid when it's uor value is zero to the list of field_ids will result in get_layout_form_value returning the empty string (since isset($_POST['form_pubpid']) will be false) causing a default value to be set in line 66(67) and 67(68).