Tips and Tricks
These are the tips and tricks working with the IBM FHIR Server.
DB2 Error 42501
If you see the 42501 error in the fhir-server logs, this section walks you through how to confirm and verify the permissions:
42501 The authorization ID does not have the privilege to perform the specified operation on the identified object.
Check the Stored Procedure and object mapping
SELECT * FROM syscat.procedures WHERE procschema = 'FHIRDATA'
The response shows the SQL objects (third column):
SCHEMA TABLE OBJECTNAMEFHIRDATA ADD_CODE_SYSTEM SQL191105170018025 84725 BLUADMIN 2 0x38001800 Q 2019-11-05FHIRDATA ADD_PARAMETER_NAME SQL191105170018126 84726 BLUADMIN 2 0x38001800 Q 2019-11-05FHIRDATA ADD_ANY_RESOURCE SQL191105170018328 84728 BLUADMIN 9 0x380038007c006c003c003800380018001400 Q 2019-11-05
Check if the FHIRSERVER user has execute privelege on the objectname.
select substr(authid,1,20) as authid, authidtype, privilege, grantable, substr(objectschema,1,12) as objectschema, substr(objectname,1,30) as objectname, objecttypefrom sysibmadm.privilegeswhere objectschema not like 'SYS%' AND AUTHID='FHIRSERVER' AND PRIVILEGE = 'EXECUTE'
If missing, then you’ll want to run a grant
GRANT EXECUTE ON PROCEDURE FHIRDATA.ADD_ANY_RESOURCE TO FHIRSERVER
Confirm the procedure and re-execute.