Help enabling write flows (MedicationRequest.create / DocumentReference.create) on OpenEMR 7.0.3

This is Sriyam from MedSync.

We need help. :pray:

We are stuck on enabling write flows and would love guidance.

Environment

  • OpenEMR 7.0.3
  • Base URL (subfolder): http://35.244.1.192/medsync-demo
  • FHIR base: http://35.244.1.192/medsync-demo/apis/default/fhir
  • Token endpoint: http://35.244.1.192/medsync-demo/oauth2/default/token
  • Flow: Client Credentials, JWT client (also tried client_secret_basic)

Goal
From an external app, store a prescription JSON file linked to an existing patient:

  • Preferred: FHIR MedicationRequest.create (structured)
  • Acceptable now: FHIR DocumentReference.create (attach our JSON to the patient)

What works

  • Using the OpenEMR Explorer, we can fetch a Bearer token and successfully GET FHIR resources in Postman (e.g., Patient, MedicationRequest search).
  • Patient search returns the FHIR Patient.id, e.g. 9f9a27dc-3485-4163-9065-c703b09b091b.

Roadblocks

  1. MedicationRequest.create returns 404. The CapabilityStatement shows only read + search for MedicationRequest (no create):
"type": "MedicationRequest",
"interaction": [{"code":"search-type"},{"code":"read"}]
  1. We tried to store the JSON via DocumentReference.create, but the token from the Explorer appears read-only.
  • POST /fhir/DocumentReference401 invalid_token

Questions

  1. On 7.0.3, is MedicationRequest.create intentionally disabled? If yes, is there a switch or patch to enable create on this resource?
  2. For storing the external prescription as a file, is DocumentReference.create the recommended path right now (since CapabilityStatement lists create for DocumentReference)?
1 Like