{"_id":"5621497cc412c31900ee2796","category":"5621497bc412c31900ee2794","link_external":false,"version":"5621497bc412c31900ee2793","api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]}},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Authentication & Configuration\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"How to get an API Token\",\n  \"body\": \"If you have API access, you can find your API token by navigating to [DaisyBill](http://go.daisybill.com), clicking on your username found on the right side of the top nav-bar, and clicking ```Edit User```.\\n\\nYou can request a new token by clicking the ```Generate Token``` button.\"\n}\n[/block]\nYour API token can be set as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DaisybillApi.configuration.api_token = \\\"123456789abcdef\\\"\\n# => \\\"123456789abcdef\\\"\",\n      \"language\": \"ruby\",\n      \"name\": \"Token configuration\"\n    }\n  ]\n}\n[/block]\n\n```host``` and ```port``` are set by default:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DaisybillApi.configuration.host\\n# => \\\"go.daisybill.com\\\"\\n\\nDaisybillApi.configuration.port\\n# => 443\",\n      \"language\": \"ruby\",\n      \"name\": \"Default configuration\"\n    }\n  ]\n}\n[/block]\nSee the [daisybill_api gem docs](http://www.rubydoc.info/github/daisybill/daisybill_api) for more information\n\n## Examples\n- [Five steps to submit a bill](page:examples)","excerpt":"This page will help you get started with the DaisyBill API. You'll be up and running in a jiffy!","project":"5621497ac412c31900ee2790","sync_unique":"","updates":["5c13ecb2ad38f508f9700b66"],"user":"562148f56e20d40d007310fc","__v":47,"createdAt":"2015-10-16T19:01:16.613Z","isReference":false,"parentDoc":null,"slug":"getting-started","type":"basic","githubsync":"","hidden":false,"link_url":"","next":{"description":"","pages":[]},"order":0,"title":"Getting Started with DaisyBill API","childrenPages":[]}

Getting Started with DaisyBill API

This page will help you get started with the DaisyBill API. You'll be up and running in a jiffy!

[block:api-header] { "type": "basic", "title": "API Authentication & Configuration" } [/block] [block:callout] { "type": "info", "title": "How to get an API Token", "body": "If you have API access, you can find your API token by navigating to [DaisyBill](http://go.daisybill.com), clicking on your username found on the right side of the top nav-bar, and clicking ```Edit User```.\n\nYou can request a new token by clicking the ```Generate Token``` button." } [/block] Your API token can be set as follows: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.api_token = \"123456789abcdef\"\n# => \"123456789abcdef\"", "language": "ruby", "name": "Token configuration" } ] } [/block] ```host``` and ```port``` are set by default: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.host\n# => \"go.daisybill.com\"\n\nDaisybillApi.configuration.port\n# => 443", "language": "ruby", "name": "Default configuration" } ] } [/block] See the [daisybill_api gem docs](http://www.rubydoc.info/github/daisybill/daisybill_api) for more information ## Examples - [Five steps to submit a bill](page:examples)
View all 84 endpoints
[block:api-header] { "type": "basic", "title": "API Authentication & Configuration" } [/block] [block:callout] { "type": "info", "title": "How to get an API Token", "body": "If you have API access, you can find your API token by navigating to [DaisyBill](http://go.daisybill.com), clicking on your username found on the right side of the top nav-bar, and clicking ```Edit User```.\n\nYou can request a new token by clicking the ```Generate Token``` button." } [/block] Your API token can be set as follows: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.api_token = \"123456789abcdef\"\n# => \"123456789abcdef\"", "language": "ruby", "name": "Token configuration" } ] } [/block] ```host``` and ```port``` are set by default: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.host\n# => \"go.daisybill.com\"\n\nDaisybillApi.configuration.port\n# => 443", "language": "ruby", "name": "Default configuration" } ] } [/block] See the [daisybill_api gem docs](http://www.rubydoc.info/github/daisybill/daisybill_api) for more information ## Examples - [Five steps to submit a bill](page:examples)
{"_id":"596cd4fa8ce87f003d39cc54","project":"5621497ac412c31900ee2790","version":"5621497bc412c31900ee2793","category":"596cd4aa7485f2001a09cd0d","user":"5928300b3ddea50f00aec401","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-07-17T15:17:14.650Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Index endpoints return records in a paginated fashion to make sure responses are easier to handle. The number of records returned per page can be set using the `per_page` query parameter. By default the maximum number of records to be returned `per_page` is 25, however the maximum is 100 for the Claims Administrator and Payer index endpoints. See the query params listed under each index endpoint for more options.\",\n  \"title\": \"Pagination\"\n}\n[/block]\nEach paginated response from DaisyBill includes corresponding headers, including the next page, offset, current page, number of records per page, total number of records, and total number of pages. See below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"X-Next-Page: 2\\nX-Offset: 0\\nX-Page: 1\\nX-Per-Page 25\\nX-Total: 2999\\nX-Total-Pages: 120\",\n      \"language\": \"text\",\n      \"name\": \"Pagination Headers\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"pagination","type":"basic","title":"Paginated Responses","__v":0,"parentDoc":null,"childrenPages":[]}

Paginated Responses


[block:callout] { "type": "info", "body": "Index endpoints return records in a paginated fashion to make sure responses are easier to handle. The number of records returned per page can be set using the `per_page` query parameter. By default the maximum number of records to be returned `per_page` is 25, however the maximum is 100 for the Claims Administrator and Payer index endpoints. See the query params listed under each index endpoint for more options.", "title": "Pagination" } [/block] Each paginated response from DaisyBill includes corresponding headers, including the next page, offset, current page, number of records per page, total number of records, and total number of pages. See below: [block:code] { "codes": [ { "code": "X-Next-Page: 2\nX-Offset: 0\nX-Page: 1\nX-Per-Page 25\nX-Total: 2999\nX-Total-Pages: 120", "language": "text", "name": "Pagination Headers" } ] } [/block]
[block:callout] { "type": "info", "body": "Index endpoints return records in a paginated fashion to make sure responses are easier to handle. The number of records returned per page can be set using the `per_page` query parameter. By default the maximum number of records to be returned `per_page` is 25, however the maximum is 100 for the Claims Administrator and Payer index endpoints. See the query params listed under each index endpoint for more options.", "title": "Pagination" } [/block] Each paginated response from DaisyBill includes corresponding headers, including the next page, offset, current page, number of records per page, total number of records, and total number of pages. See below: [block:code] { "codes": [ { "code": "X-Next-Page: 2\nX-Offset: 0\nX-Page: 1\nX-Per-Page 25\nX-Total: 2999\nX-Total-Pages: 120", "language": "text", "name": "Pagination Headers" } ] } [/block]
{"_id":"562e3b2be01a430d00c2c956","link_external":false,"parentDoc":null,"sync_unique":"","user":"562148f56e20d40d007310fc","title":"400 Bad Request","type":"basic","version":"5621497bc412c31900ee2793","category":"562e3846d38b650d00444803","createdAt":"2015-10-26T14:39:39.632Z","link_url":"","slug":"bad-requests","order":0,"updates":[],"__v":5,"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"githubsync":"","hidden":false,"project":"5621497ac412c31900ee2790","body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create Rendering Provider\"\n}\n[/block]\nMany DaisyBill models use validators to ensure that valid data is persisted when a record is created or updated. Consider the following request and its response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"rendering_provider = DaisybillApi::Models::RenderingProvider.create(\\n  billing_provider_id: 25,\\n  first_name: \\\"Cecile\\\",\\n  last_name: \\\"Romaguera\\\",\\n  npi: \\\"3\\\",\\n  state_license_number: \\\"251229\\\",\\n  taxonomy_code: \\\"\\\",\\n  type_of_specialty: \\\"Basketball-player\\\"\\n)\",\n      \"language\": \"ruby\",\n      \"name\": \"Invalid Request\"\n    }\n  ]\n}\n[/block]\nValidation errors are included in the response, showing the attributes corresponding to invalid inputs and their respective errors:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"errors\\\":{  \\n    \\\"taxonomy\\\":[\\\"can't be blank\\\"],\\n    \\\"npi\\\":[\\\"is the wrong length (should be 10 characters)\\\"],\\n    \\\"type_of_specialty\\\":[\\\"is not included in the list\\\"]\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response to bad request (400)\"\n    }\n  ]\n}\n[/block]","excerpt":"","isReference":false,"childrenPages":[]}

400 Bad Request


[block:api-header] { "type": "post", "title": "Create Rendering Provider" } [/block] Many DaisyBill models use validators to ensure that valid data is persisted when a record is created or updated. Consider the following request and its response: [block:code] { "codes": [ { "code": "rendering_provider = DaisybillApi::Models::RenderingProvider.create(\n billing_provider_id: 25,\n first_name: \"Cecile\",\n last_name: \"Romaguera\",\n npi: \"3\",\n state_license_number: \"251229\",\n taxonomy_code: \"\",\n type_of_specialty: \"Basketball-player\"\n)", "language": "ruby", "name": "Invalid Request" } ] } [/block] Validation errors are included in the response, showing the attributes corresponding to invalid inputs and their respective errors: [block:code] { "codes": [ { "code": "{ \n \"errors\":{ \n \"taxonomy\":[\"can't be blank\"],\n \"npi\":[\"is the wrong length (should be 10 characters)\"],\n \"type_of_specialty\":[\"is not included in the list\"]\n }\n}", "language": "json", "name": "Response to bad request (400)" } ] } [/block]
[block:api-header] { "type": "post", "title": "Create Rendering Provider" } [/block] Many DaisyBill models use validators to ensure that valid data is persisted when a record is created or updated. Consider the following request and its response: [block:code] { "codes": [ { "code": "rendering_provider = DaisybillApi::Models::RenderingProvider.create(\n billing_provider_id: 25,\n first_name: \"Cecile\",\n last_name: \"Romaguera\",\n npi: \"3\",\n state_license_number: \"251229\",\n taxonomy_code: \"\",\n type_of_specialty: \"Basketball-player\"\n)", "language": "ruby", "name": "Invalid Request" } ] } [/block] Validation errors are included in the response, showing the attributes corresponding to invalid inputs and their respective errors: [block:code] { "codes": [ { "code": "{ \n \"errors\":{ \n \"taxonomy\":[\"can't be blank\"],\n \"npi\":[\"is the wrong length (should be 10 characters)\"],\n \"type_of_specialty\":[\"is not included in the list\"]\n }\n}", "language": "json", "name": "Response to bad request (400)" } ] } [/block]
{"_id":"562e3d014376430d006f179a","hidden":false,"isReference":false,"updates":[],"createdAt":"2015-10-26T14:47:29.546Z","githubsync":"","parentDoc":null,"type":"basic","version":"5621497bc412c31900ee2793","__v":5,"excerpt":"","link_url":"","slug":"404-not-found","project":"5621497ac412c31900ee2790","sync_unique":"","title":"404 Not Found","api":{"auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","url":""},"body":"Requesting a non-existent record will produce a `404 Not Found` error:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"billing_provider = DaisybillApi::Models::BillingProvider.find(0)\",\n      \"language\": \"ruby\",\n      \"name\": \"Request for non-existent Billing Provider\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"error\\\":\\\"404 not found\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"404 Not Found\"\n    }\n  ]\n}\n[/block]","category":"562e3846d38b650d00444803","link_external":false,"order":1,"user":"562148f56e20d40d007310fc","childrenPages":[]}

404 Not Found


Requesting a non-existent record will produce a `404 Not Found` error: [block:code] { "codes": [ { "code": "billing_provider = DaisybillApi::Models::BillingProvider.find(0)", "language": "ruby", "name": "Request for non-existent Billing Provider" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"error\":\"404 not found\"\n}", "language": "json", "name": "404 Not Found" } ] } [/block]
Requesting a non-existent record will produce a `404 Not Found` error: [block:code] { "codes": [ { "code": "billing_provider = DaisybillApi::Models::BillingProvider.find(0)", "language": "ruby", "name": "Request for non-existent Billing Provider" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"error\":\"404 not found\"\n}", "language": "json", "name": "404 Not Found" } ] } [/block]
{"_id":"562e4e174376430d006f17b3","excerpt":"","slug":"401-unauthorized","parentDoc":null,"updates":[],"version":"5621497bc412c31900ee2793","body":"You may receive a 401 Unauthorized response if you do not have API access or use an invalid `api_token`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DaisybillApi.configuration.api_token = \\\"123abc\\\"\\n\\nDaisybillApi::Models::BillingProvider.find(3)\",\n      \"language\": \"ruby\",\n      \"name\": \"Invalid Token\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"error\\\":\\\"Your user is not active.\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"401 Unauthorized\"\n    }\n  ]\n}\n[/block]","category":"562e3846d38b650d00444803","hidden":false,"isReference":false,"__v":0,"githubsync":"","link_external":false,"order":2,"project":"5621497ac412c31900ee2790","type":"basic","user":"562148f56e20d40d007310fc","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"createdAt":"2015-10-26T16:00:23.493Z","link_url":"","sync_unique":"","title":"401 Unauthorized","childrenPages":[]}

401 Unauthorized


You may receive a 401 Unauthorized response if you do not have API access or use an invalid `api_token`: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.api_token = \"123abc\"\n\nDaisybillApi::Models::BillingProvider.find(3)", "language": "ruby", "name": "Invalid Token" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"error\":\"Your user is not active.\"\n}", "language": "json", "name": "401 Unauthorized" } ] } [/block]
You may receive a 401 Unauthorized response if you do not have API access or use an invalid `api_token`: [block:code] { "codes": [ { "code": "DaisybillApi.configuration.api_token = \"123abc\"\n\nDaisybillApi::Models::BillingProvider.find(3)", "language": "ruby", "name": "Invalid Token" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"error\":\"Your user is not active.\"\n}", "language": "json", "name": "401 Unauthorized" } ] } [/block]
{"_id":"58ee5f0604a99a3700eb0191","slug":"429-too-many-requests-rate-limiting","title":"429 Too Many Requests (Rate Limiting)","user":"562148f56e20d40d007310fc","body":"If you make requests too quickly you will receive a 429 Too Many Requests error. Each response from DaisyBill includes headers pertaining to your rate limit, including the limit, the remaining number of requests, and the time at which the limit will reset. See below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"X-Rate-Limit-Limit:100\\nX-Rate-Limit-Remaining:99\\nX-Rate-Limit-Reset:2017-04-12 10:01:00 -0700\",\n      \"language\": \"text\",\n      \"name\": \"Rate Limit Headers\"\n    }\n  ]\n}\n[/block]","category":"562e3846d38b650d00444803","isReference":false,"order":3,"version":"5621497bc412c31900ee2793","type":"basic","updates":[],"__v":0,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"excerpt":"","githubsync":"","parentDoc":null,"project":"5621497ac412c31900ee2790","createdAt":"2017-04-12T17:08:22.154Z","hidden":false,"link_external":false,"link_url":"","next":{"pages":[],"description":""},"sync_unique":"","childrenPages":[]}

429 Too Many Requests (Rate Limiting)


If you make requests too quickly you will receive a 429 Too Many Requests error. Each response from DaisyBill includes headers pertaining to your rate limit, including the limit, the remaining number of requests, and the time at which the limit will reset. See below: [block:code] { "codes": [ { "code": "X-Rate-Limit-Limit:100\nX-Rate-Limit-Remaining:99\nX-Rate-Limit-Reset:2017-04-12 10:01:00 -0700", "language": "text", "name": "Rate Limit Headers" } ] } [/block]
If you make requests too quickly you will receive a 429 Too Many Requests error. Each response from DaisyBill includes headers pertaining to your rate limit, including the limit, the remaining number of requests, and the time at which the limit will reset. See below: [block:code] { "codes": [ { "code": "X-Rate-Limit-Limit:100\nX-Rate-Limit-Remaining:99\nX-Rate-Limit-Reset:2017-04-12 10:01:00 -0700", "language": "text", "name": "Rate Limit Headers" } ] } [/block]
{"_id":"562e3d77e01a430d00c2c960","excerpt":"","link_url":"","next":{"description":"","pages":[]},"order":4,"slug":"reviewable-models","sync_unique":"","title":"Reviewable Models","user":"562148f56e20d40d007310fc","link_external":false,"githubsync":"","parentDoc":null,"__v":10,"body":"Some DaisyBill models undergo a review process after being created or updated. Objects can fail review if certain attributes are empty or contain invalid input, but can still be successfully created and updated as long as the hard requirements are met. \n\nLet's take a look at this process by creating a patient:\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create Patient\"\n}\n[/block]\nAll fields required for creating a patient are met:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DaisybillApi::Models::Patient.create(\\n  billing_provider_id: 25,\\n  first_name: \\\"Beatrice\\\",\\n  last_name: \\\"Kiddo\\\"\\n)\",\n      \"language\": \"ruby\",\n      \"name\": \"Create Patient\"\n    }\n  ]\n}\n[/block]\nsubsequent response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"created_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"updated_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"review_status\\\":\\\"pending\\\",\\n  \\\"review_errors\\\":[],\\n  \\\"review_warnings\\\":[],\\n  \\\"id\\\":48,\\n  \\\"first_name\\\":\\\"Beatrice\\\",\\n  \\\"last_name\\\":\\\"Kiddo\\\",\\n  \\\"links\\\":[  \\n    {  \\n      \\\"rel\\\":\\\"billing_provider\\\",\\n      \\\"href\\\":\\\"/api/v1/billing_providers/25\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"201 Created\"\n    }\n  ]\n}\n[/block]\nNotice how in the response above, `review_status` is pending, and `review_errors` is empty. This patient is currently being reviewed. Now let's retrieve this patient to see if the review has completed.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"patient = DaisybillApi::Models::Patient.find(48)\",\n      \"language\": \"ruby\",\n      \"name\": \"Get Patient\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"created_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"updated_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"review_status\\\":\\\"failed\\\",\\n  \\\"review_errors\\\":[  \\n    \\\"Address can't be blank\\\",\\n    \\\"Gender can't be blank\\\",\\n    \\\"Date of birth can't be blank\\\",\\n    \\\"SSN can't be blank\\\"\\n  ],\\n  \\\"review_warnings\\\":[],\\n  \\\"id\\\":48,\\n  \\\"first_name\\\":\\\"Beatrice\\\",\\n  \\\"last_name\\\":\\\"Kiddo\\\",\\n  \\\"links\\\":[  \\n    {  \\n      \\\"rel\\\":\\\"billing_provider\\\",\\n      \\\"href\\\":\\\"/api/v1/billing_providers/25\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    }\n  ]\n}\n[/block]\nThe review process for this patient is complete. The `review_status` has changed from `pending` to `failed`, and `review_errors` shows why the patient failed review. `review_warnings` is empty here, but this is used to convey warnings that do not need to be addressed in order for the record to be valid.\n\nLet's update this patient so it will pass review: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"address = DaisybillApi::Models::Address.new(\\n  address_1: \\\"123 Moen Dale Rd\\\",\\n  city: \\\"Santa Monica\\\",\\n  state: \\\"CA\\\",\\n  zip_code: \\\"900019988\\\"\\n)\\n\\npatient.address = address\\npatient.gender = \\\"Female\\\"\\npatient.date_of_birth = \\\"1976-05-24\\\"\\npatient.ssn = \\\"123456789\\\"\\n\\npatient.save\",\n      \"language\": \"ruby\",\n      \"name\": \"Update Patient\"\n    }\n  ]\n}\n[/block]\nAfter waiting for the patient to get reviewed, we may request it again to view any errors:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DaisybillApi::Models::Patient.find(48)\",\n      \"language\": \"ruby\",\n      \"name\": \"Get Patient\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n  \\\"created_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"updated_at\\\":\\\"2015-10-21T14:40:06.637-07:00\\\",\\n  \\\"review_status\\\":\\\"passed\\\",\\n  \\\"review_errors\\\":[],\\n  \\\"review_warnings\\\":[],\\n  \\\"id\\\":48,\\n  \\\"first_name\\\":\\\"Beatrice\\\",\\n  \\\"last_name\\\":\\\"Kiddo\\\",\\n  \\\"ssn\\\":\\\"123456789\\\",\\n  \\\"gender\\\": \\\"Female\\\",\\n  \\\"date_of_birth\\\": \\\"1976-05-24\\\",\\n  \\\"links\\\":[  \\n    {  \\n      \\\"rel\\\":\\\"billing_provider\\\",\\n      \\\"href\\\":\\\"/api/v1/billing_providers/25\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    }\n  ]\n}\n[/block]\nThe patient has passed review, and `review_errors` is empty.","category":"562e3846d38b650d00444803","createdAt":"2015-10-26T14:49:27.254Z","hidden":false,"isReference":false,"project":"5621497ac412c31900ee2790","type":"basic","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"version":"5621497bc412c31900ee2793","updates":[],"childrenPages":[]}

Reviewable Models


Some DaisyBill models undergo a review process after being created or updated. Objects can fail review if certain attributes are empty or contain invalid input, but can still be successfully created and updated as long as the hard requirements are met. Let's take a look at this process by creating a patient: [block:api-header] { "type": "post", "title": "Create Patient" } [/block] All fields required for creating a patient are met: [block:code] { "codes": [ { "code": "DaisybillApi::Models::Patient.create(\n billing_provider_id: 25,\n first_name: \"Beatrice\",\n last_name: \"Kiddo\"\n)", "language": "ruby", "name": "Create Patient" } ] } [/block] subsequent response: [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"pending\",\n \"review_errors\":[],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "201 Created" } ] } [/block] Notice how in the response above, `review_status` is pending, and `review_errors` is empty. This patient is currently being reviewed. Now let's retrieve this patient to see if the review has completed. [block:code] { "codes": [ { "code": "patient = DaisybillApi::Models::Patient.find(48)", "language": "ruby", "name": "Get Patient" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"failed\",\n \"review_errors\":[ \n \"Address can't be blank\",\n \"Gender can't be blank\",\n \"Date of birth can't be blank\",\n \"SSN can't be blank\"\n ],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "200 OK" } ] } [/block] The review process for this patient is complete. The `review_status` has changed from `pending` to `failed`, and `review_errors` shows why the patient failed review. `review_warnings` is empty here, but this is used to convey warnings that do not need to be addressed in order for the record to be valid. Let's update this patient so it will pass review: [block:code] { "codes": [ { "code": "address = DaisybillApi::Models::Address.new(\n address_1: \"123 Moen Dale Rd\",\n city: \"Santa Monica\",\n state: \"CA\",\n zip_code: \"900019988\"\n)\n\npatient.address = address\npatient.gender = \"Female\"\npatient.date_of_birth = \"1976-05-24\"\npatient.ssn = \"123456789\"\n\npatient.save", "language": "ruby", "name": "Update Patient" } ] } [/block] After waiting for the patient to get reviewed, we may request it again to view any errors: [block:code] { "codes": [ { "code": "DaisybillApi::Models::Patient.find(48)", "language": "ruby", "name": "Get Patient" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"passed\",\n \"review_errors\":[],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"ssn\":\"123456789\",\n \"gender\": \"Female\",\n \"date_of_birth\": \"1976-05-24\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "200 OK" } ] } [/block] The patient has passed review, and `review_errors` is empty.
Some DaisyBill models undergo a review process after being created or updated. Objects can fail review if certain attributes are empty or contain invalid input, but can still be successfully created and updated as long as the hard requirements are met. Let's take a look at this process by creating a patient: [block:api-header] { "type": "post", "title": "Create Patient" } [/block] All fields required for creating a patient are met: [block:code] { "codes": [ { "code": "DaisybillApi::Models::Patient.create(\n billing_provider_id: 25,\n first_name: \"Beatrice\",\n last_name: \"Kiddo\"\n)", "language": "ruby", "name": "Create Patient" } ] } [/block] subsequent response: [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"pending\",\n \"review_errors\":[],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "201 Created" } ] } [/block] Notice how in the response above, `review_status` is pending, and `review_errors` is empty. This patient is currently being reviewed. Now let's retrieve this patient to see if the review has completed. [block:code] { "codes": [ { "code": "patient = DaisybillApi::Models::Patient.find(48)", "language": "ruby", "name": "Get Patient" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"failed\",\n \"review_errors\":[ \n \"Address can't be blank\",\n \"Gender can't be blank\",\n \"Date of birth can't be blank\",\n \"SSN can't be blank\"\n ],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "200 OK" } ] } [/block] The review process for this patient is complete. The `review_status` has changed from `pending` to `failed`, and `review_errors` shows why the patient failed review. `review_warnings` is empty here, but this is used to convey warnings that do not need to be addressed in order for the record to be valid. Let's update this patient so it will pass review: [block:code] { "codes": [ { "code": "address = DaisybillApi::Models::Address.new(\n address_1: \"123 Moen Dale Rd\",\n city: \"Santa Monica\",\n state: \"CA\",\n zip_code: \"900019988\"\n)\n\npatient.address = address\npatient.gender = \"Female\"\npatient.date_of_birth = \"1976-05-24\"\npatient.ssn = \"123456789\"\n\npatient.save", "language": "ruby", "name": "Update Patient" } ] } [/block] After waiting for the patient to get reviewed, we may request it again to view any errors: [block:code] { "codes": [ { "code": "DaisybillApi::Models::Patient.find(48)", "language": "ruby", "name": "Get Patient" } ] } [/block] [block:code] { "codes": [ { "code": "{ \n \"created_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"updated_at\":\"2015-10-21T14:40:06.637-07:00\",\n \"review_status\":\"passed\",\n \"review_errors\":[],\n \"review_warnings\":[],\n \"id\":48,\n \"first_name\":\"Beatrice\",\n \"last_name\":\"Kiddo\",\n \"ssn\":\"123456789\",\n \"gender\": \"Female\",\n \"date_of_birth\": \"1976-05-24\",\n \"links\":[ \n { \n \"rel\":\"billing_provider\",\n \"href\":\"/api/v1/billing_providers/25\"\n }\n ]\n}", "language": "json", "name": "200 OK" } ] } [/block] The patient has passed review, and `review_errors` is empty.
{"_id":"585c2dfeef3e943900cfe048","createdAt":"2016-12-22T19:48:14.791Z","next":{"description":"","pages":[]},"type":"basic","api":{"auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":""},"excerpt":"","isReference":false,"project":"5621497ac412c31900ee2790","title":"Filtering Records","__v":0,"category":"585c2dd4906b9a1900db426a","hidden":false,"link_url":"","order":0,"updates":[],"user":"562148f56e20d40d007310fc","version":"5621497bc412c31900ee2793","body":"Certain endpoints allow you to filter your records according to certain attributes. Let's take a look at this process.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Filtering injuries by created_at date\\n\\ncurl \\\\\\n  https://go.daisybill.com/api/v1/patients/288941/injuries\\\\?api_token=abcdefghijklmnopqrstuvwxyz123456 \\\\\\n  -s \\\\\\n  -G \\\\\\n -d created_at[gt]=12/15/2016 \\\\\\n -d created_at[lt]=12/23/2016\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThe above code will retrieve injuries that have a `created_at` date greater than (after) 12/15/2016 and less than (before) 12/23/2016. Other date filtering options are below:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Date Filtering Operators\",\n    \"0-0\": \"eq\",\n    \"h-1\": \"Meaning\",\n    \"0-1\": \"\\\"equal to\\\"\",\n    \"1-0\": \"gt\",\n    \"1-1\": \"\\\"greater than\\\"\",\n    \"2-0\": \"lt\",\n    \"2-1\": \"\\\"less than\\\"\",\n    \"3-0\": \"gteq\",\n    \"3-1\": \"\\\"greater than or equal to\\\"\",\n    \"4-0\": \"lteq\",\n    \"4-1\": \"\\\"less than or equal to\\\"\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\nThese date filtering operators can be combined like in the example above, to provide more flexible queries. Only several endpoints allow this type of filtering at the moment. However check back soon, as this list is expected to increase. Please refer to the table below for endpoints that currently allow filtering:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Filterable endpoint URI\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Filterable Attributes\",\n    \"0-0\": \"/billing_providers/:id/injuries\",\n    \"0-1\": \"List Injuries for Billing Provider\",\n    \"0-2\": \"claim_number, created_at, updated_at\",\n    \"2-0\": \"/patients/:id/injuries\",\n    \"2-1\": \"List Injuries for Patient\",\n    \"2-2\": \"claim_number, created_at, updated_at\",\n    \"1-0\": \"/billing_providers/:id/remittances\",\n    \"1-1\": \"List Remittances for Billing Provider\",\n    \"1-2\": \"created_at, effective_date, deposited_on\",\n    \"3-0\": \"/billing_providers/:id/bills\",\n    \"3-1\": \"List Bills for Billing Provider\",\n    \"3-2\": \"created_at, updated_at, date_of_service\",\n    \"4-0\": \"/billing_providers/:id/pharmacy_bills\",\n    \"4-1\": \"List Pharmacy Bills for Billing Provider\",\n    \"4-2\": \"created_at, updated_at, date_of_service\",\n    \"5-0\": \"/billing_providers/:id/tasks\",\n    \"5-1\": \"List Tasks for Billing Provider\",\n    \"5-2\": \"completed, created_at, updated_at, due_date\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]","githubsync":"","link_external":false,"parentDoc":null,"slug":"filterable-records","sync_unique":"","childrenPages":[]}

Filtering Records


Certain endpoints allow you to filter your records according to certain attributes. Let's take a look at this process. [block:code] { "codes": [ { "code": "# Filtering injuries by created_at date\n\ncurl \\\n https://go.daisybill.com/api/v1/patients/288941/injuries\\?api_token=abcdefghijklmnopqrstuvwxyz123456 \\\n -s \\\n -G \\\n -d created_at[gt]=12/15/2016 \\\n -d created_at[lt]=12/23/2016", "language": "curl" } ] } [/block] The above code will retrieve injuries that have a `created_at` date greater than (after) 12/15/2016 and less than (before) 12/23/2016. Other date filtering options are below: [block:parameters] { "data": { "h-0": "Date Filtering Operators", "0-0": "eq", "h-1": "Meaning", "0-1": "\"equal to\"", "1-0": "gt", "1-1": "\"greater than\"", "2-0": "lt", "2-1": "\"less than\"", "3-0": "gteq", "3-1": "\"greater than or equal to\"", "4-0": "lteq", "4-1": "\"less than or equal to\"" }, "cols": 2, "rows": 5 } [/block] These date filtering operators can be combined like in the example above, to provide more flexible queries. Only several endpoints allow this type of filtering at the moment. However check back soon, as this list is expected to increase. Please refer to the table below for endpoints that currently allow filtering: [block:parameters] { "data": { "h-0": "Filterable endpoint URI", "h-1": "Description", "h-2": "Filterable Attributes", "0-0": "/billing_providers/:id/injuries", "0-1": "List Injuries for Billing Provider", "0-2": "claim_number, created_at, updated_at", "2-0": "/patients/:id/injuries", "2-1": "List Injuries for Patient", "2-2": "claim_number, created_at, updated_at", "1-0": "/billing_providers/:id/remittances", "1-1": "List Remittances for Billing Provider", "1-2": "created_at, effective_date, deposited_on", "3-0": "/billing_providers/:id/bills", "3-1": "List Bills for Billing Provider", "3-2": "created_at, updated_at, date_of_service", "4-0": "/billing_providers/:id/pharmacy_bills", "4-1": "List Pharmacy Bills for Billing Provider", "4-2": "created_at, updated_at, date_of_service", "5-0": "/billing_providers/:id/tasks", "5-1": "List Tasks for Billing Provider", "5-2": "completed, created_at, updated_at, due_date" }, "cols": 3, "rows": 6 } [/block]
Certain endpoints allow you to filter your records according to certain attributes. Let's take a look at this process. [block:code] { "codes": [ { "code": "# Filtering injuries by created_at date\n\ncurl \\\n https://go.daisybill.com/api/v1/patients/288941/injuries\\?api_token=abcdefghijklmnopqrstuvwxyz123456 \\\n -s \\\n -G \\\n -d created_at[gt]=12/15/2016 \\\n -d created_at[lt]=12/23/2016", "language": "curl" } ] } [/block] The above code will retrieve injuries that have a `created_at` date greater than (after) 12/15/2016 and less than (before) 12/23/2016. Other date filtering options are below: [block:parameters] { "data": { "h-0": "Date Filtering Operators", "0-0": "eq", "h-1": "Meaning", "0-1": "\"equal to\"", "1-0": "gt", "1-1": "\"greater than\"", "2-0": "lt", "2-1": "\"less than\"", "3-0": "gteq", "3-1": "\"greater than or equal to\"", "4-0": "lteq", "4-1": "\"less than or equal to\"" }, "cols": 2, "rows": 5 } [/block] These date filtering operators can be combined like in the example above, to provide more flexible queries. Only several endpoints allow this type of filtering at the moment. However check back soon, as this list is expected to increase. Please refer to the table below for endpoints that currently allow filtering: [block:parameters] { "data": { "h-0": "Filterable endpoint URI", "h-1": "Description", "h-2": "Filterable Attributes", "0-0": "/billing_providers/:id/injuries", "0-1": "List Injuries for Billing Provider", "0-2": "claim_number, created_at, updated_at", "2-0": "/patients/:id/injuries", "2-1": "List Injuries for Patient", "2-2": "claim_number, created_at, updated_at", "1-0": "/billing_providers/:id/remittances", "1-1": "List Remittances for Billing Provider", "1-2": "created_at, effective_date, deposited_on", "3-0": "/billing_providers/:id/bills", "3-1": "List Bills for Billing Provider", "3-2": "created_at, updated_at, date_of_service", "4-0": "/billing_providers/:id/pharmacy_bills", "4-1": "List Pharmacy Bills for Billing Provider", "4-2": "created_at, updated_at, date_of_service", "5-0": "/billing_providers/:id/tasks", "5-1": "List Tasks for Billing Provider", "5-2": "completed, created_at, updated_at, due_date" }, "cols": 3, "rows": 6 } [/block]
{"_id":"562164f8f4e0352100cbf299","createdAt":"2015-10-16T20:58:32.557Z","parentDoc":null,"slug":"list-attachments","user":"562148f56e20d40d007310fc","__v":3,"editedParams2":true,"githubsync":"","hidden":false,"link_external":false,"title":"List Attachments","editedParams":true,"excerpt":"","isReference":true,"link_url":"","project":"5621497ac412c31900ee2790","type":"get","updates":[],"version":"5621497bc412c31900ee2793","api":{"method":"get","params":[{"in":"path","name":"bill_id","ref":"","required":true,"type":"int","_id":"562a5bf8007ab40d007cb43a","default":"","desc":"ID of Bill"},{"required":false,"type":"int","_id":"562a67b624205f0d00ef4e4d","default":"1","desc":"Page offset to fetch","in":"query","name":"page","ref":""},{"in":"query","name":"per_page","ref":"","required":false,"type":"string","_id":"562a67b624205f0d00ef4e4c","default":"25","desc":"Number of results to return per page"},{"default":"","desc":"Pad a number of results","in":"query","name":"offset","ref":"","required":false,"type":"string","_id":"562a67b624205f0d00ef4e4b"}],"results":{"codes":[{"name":"","code":"{  \n  \"attachments\":[  \n    {  \n      \"created_at\":\"2015-10-23T09:49:03.364-07:00\",\n      \"updated_at\":\"2015-10-23T09:49:03.364-07:00\",\n      \"review_status\":\"passed\",\n      \"review_errors\":[],\n      \"review_warnings\":[],\n      \"id\":1488,\n      \"document_file_name\":\"xray_images.pdf\",\n      \"document_content_type\":\"application/pdf\",\n      \"document_file_size\":386672,\n      \"inactive\":false,\n      \"document_url\":\"https://daisybill-staging.s3.amazonaws.com/supporting_documents/xray_images.pdf?AWSAccessKeyId=AKIAJ4LZU7YC4MUC5X5P&Expires=1445623250&Signature=LduWOn6YeJ8vLBwMwpQcNV2fd9k%3D\",\n      \"report_type\":\"OZ:J1\",\n      \"links\":[  \n        {  \n          \"rel\":\"bill\",\n          \"href\":\"/api/v1/bills/544\"\n        }\n      ]\n    }\n  ]\n}","language":"json","status":200}]},"settings":"","url":"/bills/:bill_id/attachments","auth":"required","examples":{"codes":[{"language":"curl","code":"curl \\\n  https://go.daisybill.com/api/v1/bills/544/attachments\\?api_token=abcdefghijklmnopqrstuvwxyz123456 \\\n  -s \\\n  -X GET \\\n  -H \"Content-Type: application/json\"","name":"cURL"},{"language":"ruby","code":"bill = DaisybillApi::Models::Bill.find(544)\nbill.attachments"}]}},"body":"","category":"562164dcf761a4170068ecfa","next":{"description":"","pages":[]},"order":0,"sync_unique":"","childrenPages":[]}

getList Attachments


Path Params

bill_id:
required
integer
ID of Bill

Query Params

page:
integer1
Page offset to fetch
per_page:
string25
Number of results to return per page
offset:
string
Pad a number of results

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"562165056e20d40d00731131","api":{"examples":{"codes":[{"name":"cURL","language":"curl","code":"curl \\\n  https://go.daisybill.com/api/v1/attachments/1488\\?api_token=abcdefghijklmnopqrstuvwxyz123456 \\\n  -s \\\n  -X GET \\\n  -H \"Content-Type: application/json\""},{"language":"ruby","code":"attachment = DaisybillApi::Models::Attachment.find(1488)"}]},"method":"get","params":[{"required":true,"type":"int","_id":"562a697a61ade50d0028333b","default":"","desc":"ID of Attachment","in":"path","name":"id","ref":""}],"results":{"codes":[{"language":"json","code":"{  \n  \"created_at\":\"2015-10-23T09:49:03.364-07:00\",\n  \"updated_at\":\"2015-10-23T09:49:03.364-07:00\",\n  \"review_status\":\"passed\",\n  \"review_errors\":[],\n  \"review_warnings\":[],\n  \"id\":1488,\n  \"document_file_name\":\"xray_images.pdf\",\n  \"document_content_type\":\"application/pdf\",\n  \"document_file_size\":386672,\n  \"inactive\":false,\n  \"document_url\":\"https://daisybill-staging.s3.amazonaws.com/supporting_documents/xray_images.pdf?AWSAccessKeyId=AKIAJ4LZU7YC4MUC5X5P&Expires=1445623250&Signature=LduWOn6YeJ8vLBwMwpQcNV2fd9k%3D\",\n  \"report_type\":\"OZ:J1\",\n  \"links\":[  \n    {  \n      \"rel\":\"bill\",\n      \"href\":\"/api/v1/bills/544\"\n    }\n  ]\n}","name":"","status":200}]},"settings":"","url":"/attachments/:id","auth":"required"},"editedParams":true,"isReference":true,"link_external":false,"link_url":"","type":"get","user":"562148f56e20d40d007310fc","createdAt":"2015-10-16T20:58:45.690Z","excerpt":"","githubsync":"","hidden":false,"editedParams2":true,"next":{"description":"","pages":[]},"slug":"get-attachment","updates":[],"order":1,"parentDoc":null,"project":"5621497ac412c31900ee2790","sync_unique":"","__v":2,"body":"","category":"562164dcf761a4170068ecfa","title":"Get Attachment","version":"5621497bc412c31900ee2793","childrenPages":[]}

getGet Attachment


Path Params

id:
required
integer
ID of Attachment

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5621655bb244890d001869b0","excerpt":"","githubsync":"","hidden":false,"order":2,"__v":7,"category":"562164dcf761a4170068ecfa","editedParams2":true,"isReference":true,"link_external":false,"link_url":"","next":{"pages":[],"description":""},"slug":"create-attachment","api":{"method":"post","params":[{"_id":"562a6aa98437010d00c43caa","