We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Invalid Appointment Types on Scheduled Appointments

About

This SQL identifies Appointment Types on scheduled appointments that do not match an Appointment Type in your system.

Caveats

  • If the SQL returns no results, then there is no action necessary. 
  • If results are returned, the appointment needs to be edited so that it includes a valid Appointment Type.

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select s.appt_date as appointment_date, s.create_datetime as appointment_scheduled_on, s.patno as patient_id, s.code1 as appt_reason from schedule s where s.appt_date > current_timestamp and s.patno > 0 and s.code1  not in (select code1 from appt_type where code_type = 0) order by s.appt_date