Surgeries/Procedures
Create
Section titled “Create”To create a surgery or procedure for a patient, make a request to:
HTTP Request
Section titled “HTTP Request”POST {server_url}/api/v2/patients/{patient_id}/surgeries
This request must include a valid User JWT token, please see our documentation
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
The following parameters are required when creating a surgery. To search for surgery name, reference Surgeries/Procedures - Names List.
URL Parameter
Section titled “URL Parameter”| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
Request Body Parameters
Section titled “Request Body Parameters”| Attribute | Required | Description |
|---|---|---|
| surgery | true | Parent attribute for surgery/procedure |
| ↳ name | true | Description of surgery/procedure from surgery names list |
| ↳ surgery_year | true | Four digit year when the surgery/procedure took place OR blank value when unknown |
Example Request
Section titled “Example Request”curl -X POST {server_url}/api/v2/patients/{patient_id}/surgeries-H "Content-type: application/json"-H "Authorization: Bearer {jwt_token}"-d '{ "surgery": { "name": "Hip Replacement", "surgery_year": 2015 } }'RestClient::Request.new( :method => :post, :url => "{server_url}/api/v2/patients/{patient_id}/surgeries", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }, :payload => { "surgery": { "name": "Hip Replacement", "surgery_year": 2015 } }).executeExample Response
Section titled “Example Response”{ "surgery": { "id": 108, "name": "Hip Replacement", "surgery_year": 2015 }}Delete
Section titled “Delete”To remove a surgery or procedure from a patient’s list of surgeries, make a request to:
HTTP Request
Section titled “HTTP Request”DELETE {server_url}/api/v1/patients/{patient_id}/surgeries/{surgery_id}
This request must include a valid User JWT token, please see our documentation
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
The following parameters are required when removing surgery/procedure.
URL Parameter
Section titled “URL Parameter”| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
| surgery_id | true | ID of patient’s surgery/procedure |
Example Request
Section titled “Example Request”curl -X DELETE {server_url}/api/v1/patients/{patient_id}/surgeries/{surgery_id}-H "Content-type: application/json"-H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :delete, :url => "{server_url}/api/v1/patients/{patient_id}/surgeries/{surgery_id}", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executePatient’s List
Section titled “Patient’s List”To retrieve the list of a patient’s current list of surgeries and procedures, make a request to:
HTTP Request
Section titled “HTTP Request”GET {server_url}/api/v2/patients/{patient_id}/surgeries
This request must include a valid User JWT token, please see our documentation
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
The following parameters are required to retrieve the list of patient’s surgeries and procedures.
URL Parameter
Section titled “URL Parameter”| Parameter | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v2/patients/{patient_id}/surgeries-H "Content-type: application/json"-H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :get, :url => "{server_url}/api/v2/patients/{patient_id}/surgeries", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executeExample Response
Section titled “Example Response”{ "surgeries": [ { "id": 7, "name": "Ankle", "surgery_year": 1985 }, { "id": 11, "name": "Appendectomy", "surgery_year": 1990 } ]}Names List
Section titled “Names List”To retrieve the full list of names for surgeries of interest on patient history in the MD Live system, make a request to:
HTTP Request
Section titled “HTTP Request”GET {server_url}/api/v2/surgery_names
This request must include a valid JWT token, please see our documentation
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v2/surgery_names-H "Content-type: application/json"-H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :get, :url => "{server_url}/api/v2/surgery_names", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executeExample Response
Section titled “Example Response”{ "surgery_names": [ { "name": "Ankle" }, { "name": "Appendectomy" }, { "name": "CABG (Bypass surgery)" }, { "name": "Colon resection" }, { "name": "Craniotomy" }, { "name": "Ear Tubes" }, { "name": "Gall bladder" }, { "name": "Head or neck" }, { "name": "Hip replacement" }, { "name": "Knee" }, { "name": "Lung resection" }, { "name": "Pacemaker" }, { "name": "Plastic Surgery" }, { "name": "Wrist" } ]}