Problem you are facing:
You are trying to add user/prescription.read during application registration (confidential or public app) in OpenEMR.
But you don’t see user/prescription.read available in the list of scopes.
You referred to OpenEMR’s API_README.md, which mentions scopes under api:oemr.
Explanation why you face this:
In OpenEMR, the scopes are based on what is registered in the OAuth2 Server (like the API ACL settings).
user/prescription.read is not pre-registered as a scope in the default OpenEMR installation!
Even though /api/prescriptions endpoints exist, you can’t request the user/prescription.read scope unless it is manually added to the OAuth server config.
That’s why it doesn’t show in the UI during app registration.
Solution: How to fix it properly:
You must manually add user/prescription.read to the OAuth2 Server scopes in OpenEMR.
Here’s the step-by-step to fix it:
- Go to your OpenEMR Server
Login to your OpenEMR admin account (or SSH into the server if needed).
- Locate the OAuth2 Scopes Settings
In OpenEMR, scopes are handled by the database in the table:
oauth2_scopes
You can directly insert a new scope entry.
Or through GUI:
Administration → Globals → Connectors → OAuth2 Server → Scopes Management
(depending on your OpenEMR version)
- Insert the missing scope user/prescription.read
If using SQL directly (for faster fixing):
INSERT INTO oauth2_scopes (scope, description)
VALUES (‘user/prescription.read’, ‘Read access to user prescriptions’);
scope = user/prescription.read
description = whatever you want (example: ‘Read access to user prescriptions’).
This registers the missing scope properly.
- Restart OpenEMR (Optional)
Usually not necessary. But if scopes are cached, restart Apache/PHP service:
sudo systemctl restart apache2
or
sudo systemctl restart httpd
- Now retry app registration
When you create or edit your app registration in OpenEMR (OAuth2 client),
you should now see user/prescription.read available!
You can now request it in your authorization flows.
Summary:
Step
Action
1
Insert user/prescription.read into oauth2_scopes table
2
Confirm it appears in app registration scopes list
3
Use it in your API authorization requests
Use this following steps, It will help you.