About
This SQL identifies patient charts that have a Default Appointment Type that does not match an Appointment Type in your system.
A sample image of this SQL report run in the Database Viewer is shown below:
Caveats
- If the SQL returns no results, then there is no action necessary.
- If results are returned, the patient record will need to be edited to either remove the default appointment type or select a valid appointment type.
Code
To highlight and copy the code below to your clipboard, simply click the Copy button.
select r.patno as patient_id, r.well_appt_type as default_well_appointment_type, '' as default_sick_appointment_type from register r where r.well_appt_type not in (select code1 from appt_type where code_type = 0) union select r.patno as patient_id, '' as default_well_appointment_type, r.sick_appt_type as default_sick_appointment_type from register r where r.sick_appt_type not in (select code1 from appt_type where code_type = 0)