Tross
Demo dataBook a demo
ECLINICALWORKS

Write patient medications

Add medications to the current medication list.

POSThttps://preview.ontross.com/api/integrations/ecw/write-patient-medications
Request Fields
input.patientId
string
required
Patient chart being read or written, from fetch-patients.
Example
"100001"
input.encounterId
string
required
Encounter being read or written, from fetch-appointments.
Example
"200001"
input.medications
array
required
Medications to reconcile, each resolved against the catalog first.
input.medications[].name
string
required
Drug label supplied for matching against the medication catalog.
Example
"Folic Acid"
input.medications[].strength
string
required
Medication strength as the catalog spells it, paired with name.
Example
"1 MG"
input.medications[].sourceText
string
required
Original medication text, echoed back in the write result.
Example
"folic acid (folic acid 1 mg oral tablet)"
input.medications[].formulation
string
Optional ECW formulation. When omitted, the write proceeds only if name and strength resolve to exactly one ECW dose.
Example
"Tablet"
Default
""
auth_id
string
required
Saved connection to run this operation through, from the Authentication page. It decides which practice and login the call uses.
Example
"00000000-0000-4000-8000-000000000000"
Output Fields
medicationResults
array
Per-medication outcome, one row per medication you sent.
medicationResults[].sourceText
string
Original medication text, echoed back in the write result.
Example
"folic acid (folic acid 1 mg oral tablet)"
medicationResults[].matchStatus
string
Catalog match outcome, not_attempted only for free_text surgery writes.
Example
"matched"
medicationResults[].status
string
Addition outcome distinguishing saved, skipped, and already current medications.
Example
"added"
medicationResults[].reason
string
Why the call or hospitalization happened, saved as row text.
Example
"No unique catalog dose matched."
medicationResults[].matchedName
string
Catalog medication name that matched your source text.
Example
"Folic Acid"
medicationResults[].itemId
string
eCW catalog item behind this order or ICD-10 row.
Example
"900701"
medicationResults[].drugNameId
string
Catalog key for the drug name eCW matched.
Example
"900702"
medicationResults[].ndcCode
string
NDC code for this drug or dose.
Example
"00591-0322-01"
medicationResults[].strength
string
Medication strength as the catalog spells it, paired with name.
Example
"1 MG"
medicationResults[].formulation
string
Dose form, needed unless name and strength match one dose.
Example
"Tablet"
medicationsSaved
boolean
Whether eCW accepted the medication list write.
Example
true
Code
curl --request POST \
  --url https://preview.ontross.com/api/integrations/ecw/write-patient-medications \
  --header 'X-API-Key: REPLACE_KEY_VALUE' \
  --header 'content-type: application/json' \
  --data '{"input":{"encounterId":"200001","medications":[{"formulation":"Tablet","name":"Folic Acid","sourceText":"folic acid (folic acid 1 mg oral tablet)","strength":"1 MG"},{"formulation":"Tablet Delayed Release","name":"Pantoprazole","sourceText":"pantoprazole (pantoprazole 40 mg oral delayed release tablet)","strength":"40 MG"}],"patientId":"100001"},"auth_id":"auth_uuid_here"}'
Request BODY
{
  "input": {
    "encounterId": "200001",
    "medications": [
      {
        "formulation": "Tablet",
        "name": "Folic Acid",
        "sourceText": "folic acid (folic acid 1 mg oral tablet)",
        "strength": "1 MG"
      },
      {
        "formulation": "Tablet Delayed Release",
        "name": "Pantoprazole",
        "sourceText": "pantoprazole (pantoprazole 40 mg oral delayed release tablet)",
        "strength": "40 MG"
      }
    ],
    "patientId": "100001"
  },
  "auth_id": "auth_uuid_here"
}
Response BODY
{
  "id": "string",
  "workflow_id": "string",
  "auth_id": "string",
  "status": "string",
  "input": {},
  "output": {
    "medicationResults": [
      {
        "sourceText": "folic acid (folic acid 1 mg oral tablet)",
        "matchStatus": "matched",
        "status": "added",
        "reason": "No unique catalog dose matched.",
        "matchedName": "Folic Acid",
        "itemId": "900701",
        "drugNameId": "900702",
        "ndcCode": "00591-0322-01",
        "strength": "1 MG",
        "formulation": "Tablet"
      }
    ],
    "medicationsSaved": true
  },
  "files": null,
  "created_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z"
}