This is Sriyam from MedSync.
We need help. ![]()
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,MedicationRequestsearch). - Patient search returns the FHIR
Patient.id, e.g.9f9a27dc-3485-4163-9065-c703b09b091b.
Roadblocks
- MedicationRequest.create returns 404. The CapabilityStatement shows only read + search for MedicationRequest (no
create):
"type": "MedicationRequest",
"interaction": [{"code":"search-type"},{"code":"read"}]
- We tried to store the JSON via DocumentReference.create, but the token from the Explorer appears read-only.
- POST
/fhir/DocumentReference→401 invalid_token
Questions
- On 7.0.3, is
MedicationRequest.createintentionally disabled? If yes, is there a switch or patch to enable create on this resource? - For storing the external prescription as a file, is DocumentReference.create the recommended path right now (since CapabilityStatement lists
createforDocumentReference)?