On revisiting the Portal after a couple of years - on version5.0.2(5), I figured I’d see what has changed. I tried to self-register a patient but it failed.
DataAdapter (default) Error Selecting SQL: Unknown column 'patient_data.county' in 'field list' (retry attempts: 0)
Can anyone tell me when/where “county” is added to patient_data table? It doesn’t appear in the sql files and it is required to get the self registration aspect of the portal to work. Maybe it is not needed for other parts of the portal to work? Seems like it is needed…
I added it via phpmyadmin with:
ALTER TABLE patient_data
ADD county
VARCHAR(255) NULL AFTER country_code
;
Retry and I progress but receive another error:
DataAdapter (default) Error Selecting SQL: Unknown column 'users.portal_user' in 'field list' (retry attempts: 0)
I found the patch.sql which adds this field, but I receive the error:
Field 'subtype' doesn't have a default value
which refers to line 52, causing the rest of the patch to fail.
Next I issued the sql command:
ALTER TABLE list_options CHANGE subtype subtype VARCHAR(31) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
Had to rerun the patch.sql line by line in phpmyadmin after that.
Finally registration proceeded and final pop-up:
Unable to either create credentials or send email.
Here is what we do know.:
Query Error
ERROR: query failed: INSERT INTO patient_access_onsite SET portal_username=?,portal_onetime=?,portal_pwd=?,portal_pwd_status=0,portal_salt=? ,pid=?
Error: Unknown column ‘portal_salt’ in ‘field list’
/var/www/openemr/portal/account/account.lib.php at 201:sqlStatementNoLog
/var/www/openemr/portal/account/account.php at 81:doCredentials(4464)
Appears sql_upgrade 5.0.2 is not for 5.0.2(5) since it drops this field…
Readded it via:
ALTER TABLE patient_access_onsite
ADD COLUMN portal_salt
VARCHAR(100) NULL;
and it worked!
Hopefully this helps others who may have similar issues.