Create Patient API

177 views
Skip to first unread message

shrikant telangi

unread,
Apr 14, 2021, 10:16:47 AM4/14/21
to DrChrono API Developers
I am trying to push data into drChrono But getting this error

 {"gender":["This field is required."],"doctor":["This field is required."]}

this is my code 

                
         string Body3='{"address": "string","auto_accident_insurance": {"auto_accident_case_number": "string","auto_accident_claim_rep_address": "string","auto_accident_claim_rep_city": "string","auto_accident_claim_rep_is_insurer": true,'+
             '"auto_accident_claim_rep_name": "string","auto_accident_claim_rep_state": "AL","auto_accident_claim_rep_zip": "string","auto_accident_company": "string",'+
             '"auto_accident_date_of_accident": "string","auto_accident_disabled_from_date": "string","auto_accident_disabled_to_date": "string","auto_accident_had_similar_condition": true,"auto_accident_is_subscriber_the_patient": true,'+
             '"auto_accident_notes": "string","auto_accident_patient_relationship_to_subscriber": "","auto_accident_payer_address": "string","auto_accident_payer_city": "string","auto_accident_payer_id": "string",'+
             '"auto_accident_payer_state": "AL","auto_accident_payer_zip": "string","auto_accident_policy_number": "string","auto_accident_return_to_work_date": "string","auto_accident_significant_injury": "YES","auto_accident_significant_injury_notes": "string","auto_accident_similar_condition_date": "string","auto_accident_similar_condition_notes": "string",'+
             '"auto_accident_state_of_occurrence": "AL","auto_accident_still_under_care": true,"auto_accident_subscriber_address": "string","auto_accident_subscriber_city": "string","auto_accident_subscriber_date_of_birth": "string","auto_accident_subscriber_first_name": "string","auto_accident_subscriber_last_name": "string","auto_accident_subscriber_middle_name": "string","auto_accident_subscriber_phone_number": "string",'+
             '"auto_accident_subscriber_social_security": "string","auto_accident_subscriber_state": "AL","auto_accident_subscriber_suffix": "string","auto_accident_subscriber_zip_code": "string","auto_accident_treatment_duration": "string","auto_accident_will_require_therapy": true,"auto_accident_will_require_therapy_rec": "string"},'+
             '"cell_phone": "string","chart_id": "string","city": "string","copay": "string","custom_demographics": [{"field_type": 0,"updated_at": "string","value": "string"}],"date_of_birth": "string","date_of_first_appointment": "string","date_of_last_appointment": "string","default_pharmacy": "string","disable_sms_messages": true,"doctor": 1,"email": "deanInfo@.com","emergency_contact_name": "string","emergency_contact_phone": "string","emergency_contact_relation": "string","employer": "string","employer_address": "string",'+
             '"employer_city": "string","employer_state": "string","employer_zip_code": "string","ethnicity": "blank","first_name": "string","gender": "male","home_phone": "string","id": 0,"last_name": "string","middle_name": "string","nick_name": "string","office_phone": "string",'+
            '"offices": [0],"patient_flags": [{"archived": true,"color": "string","created_at": "string","doctor": 1,"id": 4565,"name": "ram","priority": 0,"updated_at": "string"}],"patient_flags_attached": [{"archived": true,"created_at": "string","flag_text": "string","flag_type": 0,"id": 0,"updated_at": "string"}],"patient_payment_profile": "",'+
             '"patient_photo": "string","patient_photo_date": "string","patient_status": "A","preferred_language": "blank","primary_care_physician": "string","primary_insurance": {"insurance_claim_office_number": "string","insurance_company": "string","insurance_group_name": "string","insurance_group_number": "string","insurance_id_number": "string",'+
             '"insurance_payer_id": "string","insurance_plan_name": "string","insurance_plan_type": "","is_subscriber_the_patient": true,"patient_relationship_to_subscriber": "","photo_back": "string","photo_front": "string","subscriber_address": "string","subscriber_city": "string","subscriber_country": "","subscriber_date_of_birth": "string","subscriber_first_name": "string","subscriber_gender": "male","subscriber_last_name": "string","subscriber_middle_name": "string",'+
             '"subscriber_social_security": "string","subscriber_state": "AL","subscriber_suffix": "string","subscriber_zip_code": "string"},"race": "blank","referring_doctor": {"address": "string","email": "string","fax": "string","first_name": "string","last_name": "string","middle_name": "string","npi": "string","phone": "string","provider_number": "string","provider_qualifier": "","specialty": "","suffix": "string"},"referring_source": "string",'+
            '"responsible_party_email": "string","responsible_party_name": "string","responsible_party_phone": "string","responsible_party_relation": "string","secondary_insurance": {"insurance_claim_office_number": "string","insurance_company": "string","insurance_group_name": "string","insurance_group_number": "string","insurance_id_number": "string","insurance_payer_id": "string","insurance_plan_name": "string","insurance_plan_type": "","is_subscriber_the_patient": true,"patient_relationship_to_subscriber": "","photo_back": "string","photo_front": "string",'+
            '"subscriber_address": "string","subscriber_city": "string","subscriber_country": "","subscriber_date_of_birth": "string","subscriber_first_name": "string","subscriber_gender": "male","subscriber_last_name": "string","subscriber_middle_name": "string","subscriber_social_security": "string","subscriber_state": "AL","subscriber_suffix": "string","subscriber_zip_code": "string"},"social_security_number": "string","state": "string",'+
            '"tertiary_insurance": {"insurance_claim_office_number": "string","insurance_company": "string","insurance_group_name": "string","insurance_group_number": "string","insurance_id_number": "string","insurance_payer_id": "string","insurance_plan_name": "string","insurance_plan_type": "","is_subscriber_the_patient": true,"patient_relationship_to_subscriber": "","photo_back": "string","photo_front": "string","subscriber_address": "string","subscriber_city": "string","subscriber_country": "","subscriber_date_of_birth": "string","subscriber_first_name": "string","subscriber_gender": "male","subscriber_last_name": "string","subscriber_middle_name": "string","subscriber_social_security": "string","subscriber_state": "AL","subscriber_suffix": "string","subscriber_zip_code": "string"},'+
     '"updated_at": "string","workers_comp_insurance": {"property_and_casualty_agency_claim_number": "string","workers_comp_carrier_code": "string","workers_comp_case_number": "string","workers_comp_company": "string","workers_comp_date_of_accident": "string","workers_comp_group_name": "string","workers_comp_group_number": "string","workers_comp_notes": "string","workers_comp_payer_address": "string","workers_comp_payer_city": "string","workers_comp_payer_id": "string",'+
         '"workers_comp_payer_state": "AL","workers_comp_payer_zip": "string","workers_comp_state_of_occurrence": "AL","workers_comp_wcb": "string","workers_comp_wcb_rating_code": "string"},"zip_code": "string"}';
         //string Body3='{"Gender": "Male","date_of_birth": "01/01/1993","doctor": "1","email": "s...@yahho.com","first_name": "shri","last_name": "telangi","preferred_language": "marathi",}'+
         '"race": "erx"}';
 
         
        Http p3=new Http();
        HttpRequest request3=new HttpRequest();
        request3.setEndPoint(endpoint3);
        request3.setBody(Body3);
        request3.setMethod('POST');
        request3.setHeader('Authorization','Bearer '+AccessToken);
        HttpResponse response3=p3.send(request3);
        result3=response3.getBody();



please somebody help me 
        

Aaron Bethea

unread,
Apr 14, 2021, 10:21:07 AM4/14/21
to drchro...@googlegroups.com
Hi Shikkrant.

“gender” should be “Male”, “Female”, or “Other” as per the documentation. 
“doctor” should be an integer that matches the ID of a doctor-object from api/doctors.

You’re almost there, just make those changes and it should work with no problem. 

--
You received this message because you are subscribed to the Google Groups "DrChrono API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drchrono-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drchrono-api/6c2e2819-b59c-41aa-a833-1849900cceb7n%40googlegroups.com.
--
-Sent from my iOS mobile device (please excuse my typos!)

Aaron Bethea | Professional Services Engineer

225 Schilling Circle, Suite 295
Hunt Valley, MD 21030
Office: 443.690.7430
Fax: 443-557-1759
www.drchrono.com
Voted #1 mobile electronic health record by doctors six years in a row

shrikant telangi

unread,
Apr 14, 2021, 12:27:42 PM4/14/21
to drchro...@googlegroups.com
i changes in code but still getting same error this {"gender":["This field is required."],"doctor":["This field is required."]}

this is my code

string endpoint3='https://appstring

 Body3='{"Gender":"Male","date_of_birth":"01/01/1993","doctor":"270388","email":"s...@yahho.com","first_name":"Michael","last_name":"Hafran","preferred_language":"marathi","race":"erx"}';.drchrono.com/api/patients';

 Http p3=new Http();
        HttpRequest request3=new HttpRequest();
        request3.setEndPoint(endpoint3);
        request3.setBody(Body3);
        request3.setMethod('POST');
        request3.setHeader('Authorization','Bearer '+AccessToken);
        HttpResponse response3=p3.send(request3);
        result3=response3.getBody();
       
        system.JSONParser jp3=jSON.createParser(result3);



Look in body3 i pass the required field gender and doctor still getting this error   {"gender":["This field is required."],"doctor":["This field is required."]}

please help me i am continuously working sines 2 day on this 

Reply all
Reply to author
Forward
0 new messages