API not updating appointment status to "CONFIRMED"
API not updating appointment status to "CONFIRMED"
Hi,
I am trying to change the appointment status to "CONFIRMED" but instead it is changing to "EMAIL CONFIRMATION".
Here is the code...
<?php
$getCode = file_get_contents("php://input");
$json = json_decode($getCode, true);
$appointment_id = $json['appointment_id'];
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://api.opendental.com/fhir/appoint ... intment_id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: FHIRAPIKey=",
"Accept: application/json"
),
)
);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
$getPatientID = 'ERROR';
$array_temp = array('code'=>202);
} else {
$postdata = str_replace("needsaction","accepted",$response);
$curlData = curl_init();
curl_setopt_array($curlData, array(
CURLOPT_URL => "https://api.opendental.com/fhir/appoint ... intment_id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => $postdata,
CURLOPT_HTTPHEADER => array(
"Accept: application/json",
"Authorization: FHIRAPIKey=",
"Content-Type: application/json"
),
));
$getResp = curl_exec($curlData);
$errData = curl_error($curlData);
curl_close($curlData);
if ($errData) {
$array_temp = array('code'=>202);
} else {
$array_temp = array('code'=>200);
}
}
echo json_encode($array_temp);
?>
I am trying to change the appointment status to "CONFIRMED" but instead it is changing to "EMAIL CONFIRMATION".
Here is the code...
<?php
$getCode = file_get_contents("php://input");
$json = json_decode($getCode, true);
$appointment_id = $json['appointment_id'];
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://api.opendental.com/fhir/appoint ... intment_id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: FHIRAPIKey=",
"Accept: application/json"
),
)
);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
$getPatientID = 'ERROR';
$array_temp = array('code'=>202);
} else {
$postdata = str_replace("needsaction","accepted",$response);
$curlData = curl_init();
curl_setopt_array($curlData, array(
CURLOPT_URL => "https://api.opendental.com/fhir/appoint ... intment_id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => $postdata,
CURLOPT_HTTPHEADER => array(
"Accept: application/json",
"Authorization: FHIRAPIKey=",
"Content-Type: application/json"
),
));
$getResp = curl_exec($curlData);
$errData = curl_error($curlData);
curl_close($curlData);
if ($errData) {
$array_temp = array('code'=>202);
} else {
$array_temp = array('code'=>200);
}
}
echo json_encode($array_temp);
?>
Re: API not updating appointment status to "CONFIRMED"
If you go to Setup then Definitions in Opendental, you will be able to customize Appointment Confirmations by selecting Appt Confirmed in the column on the left. Here you will be able to add, or edit, an appointment confirmation. Here you can add a new Confirmation definition, or edit an existing by double clicking on it.
https://opendental.com/manual/confirmationstatus.html
In the "Edit Definition" window, after you have clicked add, or started editing an existing confirmation by double clicking, you will want to make sure the "Exclude when confirming" box is unchecked.
After editing/creating the definition for the confirmation, go to eServices in the main menu and select eConfirmation from the dropdown. On the left side, under the "eConfirmation Settings - Affects all Clinics" heading, click the dropdown next to "Accepted" and select the confirmation you just created/edited. Click ok and try running your fhir request again.
https://opendental.com/manual/confirmationstatus.html
In the "Edit Definition" window, after you have clicked add, or started editing an existing confirmation by double clicking, you will want to make sure the "Exclude when confirming" box is unchecked.
After editing/creating the definition for the confirmation, go to eServices in the main menu and select eConfirmation from the dropdown. On the left side, under the "eConfirmation Settings - Affects all Clinics" heading, click the dropdown next to "Accepted" and select the confirmation you just created/edited. Click ok and try running your fhir request again.
Re: API not updating appointment status to "CONFIRMED"
Hello Patrick,
I followed the steps you outlined, but I don't have eConfirmations activated. Do I need to activated eConfirmation in order to use the FHIR API to confirm appointments?
Also how do I upload screen shots on this forum?
Thank you,
Dr. Chokshi
I followed the steps you outlined, but I don't have eConfirmations activated. Do I need to activated eConfirmation in order to use the FHIR API to confirm appointments?
Also how do I upload screen shots on this forum?
Thank you,
Dr. Chokshi
Re: API not updating appointment status to "CONFIRMED"
eConfirmations will not need to be active for fhir to access the data it needs. It will pull values it needs from the db which are set by the dropdowns in the econfirmations settings.
To post a screenshot in the developers forum you'll need to host the screenshot somewhere that's accessible to the web. You can utilize image sharing sites like imgur, but be sure that it doesn't contain sensitive data. Place the link to the image inside img tags.
To post a screenshot in the developers forum you'll need to host the screenshot somewhere that's accessible to the web. You can utilize image sharing sites like imgur, but be sure that it doesn't contain sensitive data. Place the link to the image inside img tags.
Code: Select all
[img]LinkToImageHere[/img]
Re: API not updating appointment status to "CONFIRMED"
The eConfirmation setting are greyed out. I don't have a way to click on the dropdown.
[img]C:\Users\choks\Pictures\Capture2[/img]
[img]C:\Users\choks\Pictures\Capture2[/img]
Re: API not updating appointment status to "CONFIRMED"
Would you be able to upload that image to an image sharing site, like imgur.com, then use the link they provide for your image between the img tags? We would like to see screenshot of your Definitions window with "Appt Confirmed" selected on the left hand side as well.
Re: API not updating appointment status to "CONFIRMED"
Hello,
The image is posted on imgur. Here is the link: https://imgur.com/5wk6mKt
Thank you,
Dr. Chokshi
The image is posted on imgur. Here is the link: https://imgur.com/5wk6mKt
Thank you,
Dr. Chokshi
Re: API not updating appointment status to "CONFIRMED"
Dr. Chokshi,
You will need to log in to Open Dental with a user that has the 'eServices Setup' permission and open this window. Then you'll be able to change the Accepted setting from 'Emailed Confirmation' to something else.
You will need to log in to Open Dental with a user that has the 'eServices Setup' permission and open this window. Then you'll be able to change the Accepted setting from 'Emailed Confirmation' to something else.
Re: API not updating appointment status to "CONFIRMED"
Okay, I will call Open Dental. I am logging into Open Dental as Admin.
Re: API not updating appointment status to "CONFIRMED"
Thank you for your help. I was able to resolve the issue. Be safe and healthy!!!