ECLINICALWORKS
Write Surgical History
Write surgical history in eClinicalWorks
POSThttps://api.ontross.com/api/integrations/ecw/write-surgical-history
Request Fields
input
object
requiredInput for safely adding standardized Surgical History rows.
input.patientId
string
requiredPatient id
input.encounterId
string
requiredEncounter id
input.surgeries
array
requiredList of surgeries.
input.surgeries[].surgery
string
Surgery title supplied by the caller. Required when writeMode is free_text; otherwise used for catalog matching when a CPT code is unavailable or cannot resolve.
Default
""input.surgeries[].cptCode
string
Cpt code
Default
""input.surgeries[].writeMode
string
catalog (default) resolves a CPT code or surgical-history catalog item before writing. free_text writes the supplied surgery title exactly as entered after whitespace normalization, without performing any catalog lookup.
Default
"catalog"Accepted values
catalogfree_textinput.surgeries[].date
string
Optional surgery date in MM/YYYY format.
Default
""auth_id
string
requiredAuth id
Output Fields
surgeryResults
array
List of surgery Results.
surgeryResults[].sourceText
string
Source text
surgeryResults[].sourceCptCode
string
Source cpt code
surgeryResults[].date
string
Date
surgeryResults[].catalogItemId
string
Catalog item id
surgeryResults[].writeMode
string
The mode used to write this surgical-history entry.
surgeryResults[].matchStatus
string
Catalog-match outcome. not_attempted is returned only when writeMode is free_text, which intentionally bypasses catalog matching.
surgeryResults[].status
string
Status
surgeryResults[].matchType
string
Match type
surgeryResults[].reason
string
Reason
surgeryResults[].resolvedSurgery
string
Resolved surgery
surgeryResults[].resolvedCptCode
string
Resolved cpt code
surgicalHistorySaved
boolean
Surgical history saved
Code
curl --request POST \
--url https://api.ontross.com/api/integrations/ecw/write-surgical-history \
--header 'X-API-Key: REPLACE_KEY_VALUE' \
--header 'content-type: application/json' \
--data '{"input":{"encounterId":"200001","patientId":"100001","surgeries":[{"date":"05/2022","surgery":"amputation, above the left knee"},{"cptCode":"0001F","date":"01/2024"}]},"auth_id":"auth_uuid_here"}'Request BODY
{
"input": {
"encounterId": "200001",
"patientId": "100001",
"surgeries": [
{
"date": "05/2022",
"surgery": "amputation, above the left knee"
},
{
"cptCode": "0001F",
"date": "01/2024"
}
]
},
"auth_id": "auth_uuid_here"
}