Prescription scope

Hi could some help me i try to add user/prescription.read during app registration, but i cant find this in the list of scope either using confidential or public application type.

Based on the documentation found in this link openemr/API_README.md at master · openemr/openemr · GitHub this can be found under api:oemr (user api which are the /api/ endpoints)

Thanks
Casper

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:

  1. Go to your OpenEMR Server

Login to your OpenEMR admin account (or SSH into the server if needed).

  1. 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)

  1. 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.

  1. Restart OpenEMR (Optional)

Usually not necessary. But if scopes are cached, restart Apache/PHP service:

sudo systemctl restart apache2

or

sudo systemctl restart httpd

  1. 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.