API AppointmentTypeNum and Appointment Type

For requests or help with our API
Post Reply
jarkkok
Posts: 32
Joined: Mon Jul 26, 2021 7:46 am

API AppointmentTypeNum and Appointment Type

Post by jarkkok » Mon Jun 05, 2023 11:10 am

When getting appointment details, how does the AppointmentTypeNum value work? I don’t see API appointments returning values mapped to Appointment Type.

For instance, I pick Appointment Type “Cosmetic Whitening”, which in my definitions is set up with number 328. Then I save the appointment.
I’d assume when I get the appointment with AppointmentTypeNum 328, instead I get 7, which looks like it is the corresponding color from Setup->Appointments->Appointment Types.

Sample from definitions:
{
"DefNum": 7,
"ItemName": "Default",
"ItemValue": "",
"Category": 0,
"category": "AccountColors",
"isHidden": "false"
},

{
"DefNum": 328,
"ItemName": "Cosmetic Whitening",
"ItemValue": "",
"Category": 51,
"category": "WebSchedExistingApptTypes",
"isHidden": "false"
}


Is there a way for me to get a matching value in definitions for Appointment Type?

Thank you

JTS
Posts: 38
Joined: Thu Aug 18, 2022 12:56 pm

Re: API AppointmentTypeNum and Appointment Type

Post by JTS » Mon Jun 05, 2023 12:38 pm

Good afternoon,

Appointment Types are not defined in the definitions table, but instead in the appointmenttype table. The AppointmentTypeNum value of an appointment functions as a foreign key to the appointmenttype database table, where AppointmentTypeNum acts as the primary key for Appointment Types.

The "WebSchedExistingApptTypes" definition category is used when patients are selecting reasons for their visits when scheduling online, and are found in Setup->Definitions->Web Sched Existing Appt Types. These are unrelated to the AppointmentTypeNum field.

jarkkok
Posts: 32
Joined: Mon Jul 26, 2021 7:46 am

Re: API AppointmentTypeNum and Appointment Type

Post by jarkkok » Wed Jun 07, 2023 6:25 am

Thanks. That solved the mystery, except one thing.

In the list I got from appointmenttype table there no AppointmentTypeNum 0. Some appoinments (actually most) I pull seems to have that value. What does "AppointmentTypeNum": 0 mean?

JTS
Posts: 38
Joined: Thu Aug 18, 2022 12:56 pm

Re: API AppointmentTypeNum and Appointment Type

Post by JTS » Wed Jun 07, 2023 8:20 am

Correct, there is no Appointment Type with an AppointmentTypeNum of 0. If an appointment has an AppointmentTypeNum of 0, that means the appointment does not have an Appointment Type set.

Post Reply