Rest API excpects JSON data as payload.
Packages array should contain name and code of test packages/special packages, if any.
Tests array should contain name and code of each prescribed test.
BillItems array can include billable items other than lab tests and packages, if any. For example, home collection charge, doctor consultation charges etc.
-
URL
-
Method:
POST
-
Data Params
Example Json payload.
{"bill_no":"", "bill_date":"2021-11-11T10:23:53.027Z", "created_at":"2021-11-11T10:23:53.027Z","mrn":"", "patient_name":"Ervik C", "gender":"male", "date_of_birth":"1982-05-10T00:00:00Z", "age":"39", "address":"JP NAGAR", "mobile_no":"8880016018", "email":"xyz@gmail.com", "doctor_name":"", "patient_type":"OP", "ip_no":"", "ward_no":"", "room_no":"", "is_active":true, "created_by":"", "Tests":[{"Name":"ESR", "Code":"995" }], "Packages": [{"Name":"Package 1", "Code":"1000" }], "BillItems":[{"Name":"COLLECTION CHARGES", "Code":"2001" }], "payment_type": "card", "amount_paid": "740.0", "card_no": "12345"}
Required:
patient_name=[string]
bill_date=[string]
patient_name=[string]
gender=[string]
date_of_birth=[string]
mobile_no=[string]
Tests=[array]
Optional:
bill_no=[alphanumeric]
email=[string]
address=[string]
doctor_name=[string]
Packages=[array]
BillItems=[array]
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
Content:{ prescription_id : 3320402028096598 }
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "Email Invalid" }
- Code: 401 UNAUTHORIZED
Returns the report dispatch Ids related to a prescription
-
URL
https://ayuslab.com/integration/reports/report_dispatches.json
-
Method:
GET
-
Data Params
Example query parameter.
prescription_id=3320402028096598
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
Content:{ "report_dispatch_ids": [4572463440280654] }
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
- Code: 401 UNAUTHORIZED
Downloads the report
-
URL
-
Method:
GET
-
Data Params
Example query parameters.
prescription_id=3320402028096598 report_dispatch_id=4572463440280654
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
PDF file is downloaded
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
- Code: 401 UNAUTHORIZED
Soft deletes prescription and bill
-
URL
-
Method:
DELETE
-
Data Params
Example id.
id=3320402028096598
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
- Code: 401 UNAUTHORIZED
updates prescription and bill
-
URL
-
Method:
PUT
-
Data Params
Example Json payload.
{ "bill_no":"", "bill_date":"2021-11-11T10:23:53.027Z", "created_at":"2021-11-11T10:23:53.027Z","mrn":"", "patient_name":"Ervik C", "gender":"male", "date_of_birth":"1982-05-10T00:00:00Z", "age":"39", "address":"JP NAGAR", "mobile_no":"8880016018", "email":"xyz@gmail.com", "doctor_name":"", "patient_type":"OP", "ip_no":"", "ward_no":"", "room_no":"", "is_active":true, "created_by":"", "Tests":[{"Name":"ESR", "Code":"995" }], "Packages": [{"Name":"Package 1", "Code":"1000" }], "BillItems":[{"Name":"COLLECTION CHARGES", "Code":"2001" }], "payment_type": "card", "amount_paid": "740.0", "card_no": "12345"}
Required:
patient_name=[string]
bill_date=[string]
patient_name=[string]
gender=[string]
date_of_birth=[string]
mobile_no=[string]
Tests=[array]
Optional:
bill_no=[alphanumeric]
email=[string]
address=[string]
doctor_name=[string]
Packages=[array]
BillItems=[array]
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "Email Invalid" }
- Code: 401 UNAUTHORIZED
Returns the report dispatch Ids created in a date and relevant reference center
-
URL
https://ayuslab.com/integration/reports/report_dispatches.json
-
Method:
GET
-
Data Params
Example query parameter.
date = 30/03/2022 reference_center_id = 801
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
Content: {"status":true,"report_dispatch_ids":[8482464797237005,7684246479723456]}
- Code: 200
-
Error Response:
- Code: 400
Content: {"error":"Bad security token","status":400}
- Code: 400
Returns the report parameters
-
URL
-
Method:
GET
-
Data Params
Example query parameters.
report_id=2447742987942641
-
Header
X-Token=[token provided]
Content-Type=[application/json]
-
Success Response:
- Code: 200
{"report_dispatch_id":61917,"reports":[{"report_values":[],"test_name":" PROTEIN / CREATININE RATIO - URINE (RANDOM) ","report_format_type":"table_format","test_id":"144898"}]}
- Code: 200
-
Error Response:
- Code: 400
Content:{"error":"Bad security token","status":400}
- Code: 400