posting images into insurance

219 views
Skip to first unread message

bramar...@gmail.com

unread,
Mar 13, 2018, 3:20:22 AM3/13/18
to drchrono Medical Healthcare API SDK
Hi,
I'm trying to POST the insurance card image into the drchrono using /api/insurances but can't see the related field to upload the image in the documentation. Also I'm trying to visitbut giving error as shown below. Does the API support the image upload. AS we have the mechanism to scan the insurance card and get the details from the scanned image. Thank you 


Denis Malinovskiy

unread,
Mar 13, 2018, 7:26:19 PM3/13/18
to drchro...@googlegroups.com
Thanks for letting us know about this issue, I pushed a hotfix for the documentation popups, it'll be live in an hour.

Then we'll be able to see what field should be used to upload the image.

--
You received this message because you are subscribed to the Google Groups "drchrono Medical Healthcare API SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drchrono-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Denis Malinovskiy
Software Engineer, drchrono

bramar...@gmail.com

unread,
Mar 14, 2018, 12:51:02 AM3/14/18
to drchrono Medical Healthcare API SDK

@app.route('/files', methods=['POST', 'GET']) def upload_file(): # headers = {'Authorization': 'Bearer %s' %session['access_token']} headers = {'Authorization': 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type':'application/json'} file = request.files['file'] filename = file.filename filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename) with open(filepath, 'rb') as image_file: f = image_file.read() b = bytearray(f) photo = base64.b64encode(f) data = {'primary_insurance': {}} data['primary_insurance']['photo_front'] = photo api_url = "https://drchrono.com/api/patients/123456" chrono_response = requests.patch(url=api_url, json=data, headers=headers)

TypeError: Object of type 'bytes' is not JSON serializable 

How to upload the images here ? getting 400 error ?

Denis Malinovskiy

unread,
Mar 14, 2018, 1:00:16 PM3/14/18
to drchro...@googlegroups.com

Mark Adam

unread,
Jun 15, 2020, 5:20:57 PM6/15/20
to DrChrono API Developers
Is there an updated link because that one loads the Hunt Valley tutorial with no information on this topic. 

On Wednesday, March 14, 2018 at 10:00:16 AM UTC-7, Denis Malinovskiy wrote:
On Tue, Mar 13, 2018 at 9:51 PM <brama...@gmail.com> wrote:

@app.route('/files', methods=['POST', 'GET']) def upload_file(): # headers = {'Authorization': 'Bearer %s' %session['access_token']} headers = {'Authorization': 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type':'application/json'} file = request.files['file'] filename = file.filename filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename) with open(filepath, 'rb') as image_file: f = image_file.read() b = bytearray(f) photo = base64.b64encode(f) data = {'primary_insurance': {}} data['primary_insurance']['photo_front'] = photo api_url = "https://drchrono.com/api/patients/123456" chrono_response = requests.patch(url=api_url, json=data, headers=headers)

TypeError: Object of type 'bytes' is not JSON serializable 

How to upload the images here ? getting 400 error ?

On Tuesday, March 13, 2018 at 4:26:19 PM UTC-7, Denis Malinovskiy wrote:
Thanks for letting us know about this issue, I pushed a hotfix for the documentation popups, it'll be live in an hour.

Then we'll be able to see what field should be used to upload the image.

On Tue, Mar 13, 2018 at 12:20 AM <bramar...@gmail.com> wrote:
Hi,
I'm trying to POST the insurance card image into the drchrono using /api/insurances but can't see the related field to upload the image in the documentation. Also I'm trying to visitbut giving error as shown below. Does the API support the image upload. AS we have the mechanism to scan the insurance card and get the details from the scanned image. Thank you 


--
You received this message because you are subscribed to the Google Groups "drchrono Medical Healthcare API SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drchrono-api...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Denis Malinovskiy
Software Engineer, drchrono

--
You received this message because you are subscribed to the Google Groups "drchrono Medical Healthcare API SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drchro...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

bri...@drchrono.com

unread,
Jun 15, 2020, 5:56:29 PM6/15/20
to DrChrono API Developers

Elena Gasparini

unread,
Jun 25, 2021, 11:22:37 AM6/25/21
to DrChrono API Developers
Hi there,

The uploading document example is helpful for posting to patient documents and patching to patient profile_photo but the insurance card images are nested under patient -> primary_insurance or secondary_insurance and do not fit into this same example format.  Could you provide an example of how to patch patient insurance photo_front or photo_back?

Thank you!
Elena

bri...@drchrono.com

unread,
Jun 28, 2021, 11:51:24 AM6/28/21
to DrChrono API Developers
What language are you utilizing?

Elena Gasparini

unread,
Jul 8, 2021, 8:45:39 AM7/8/21
to DrChrono API Developers
python3

Elena Gasparini

unread,
Jul 8, 2021, 8:45:41 AM7/8/21
to DrChrono API Developers
python3

On Monday, June 28, 2021 at 8:51:24 AM UTC-7 bri...@drchrono.com wrote:

bri...@drchrono.com

unread,
Jul 13, 2021, 6:21:22 PM7/13/21
to DrChrono API Developers
Apologies for the delay. Try this code sample:

import requests


payload={}
files=[
('primary_insurance.photo_front',('my-photo-500x333.jpeg',open('/Users/bmcknight/Pictures/my-photo-500x333.jpeg','rb'),'image/jpeg'))
]
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}

response = requests.request("PATCH", url, headers=headers, data=payload, files=files)

print(response.text)

Reply all
Reply to author
Forward
0 new messages