This sql performs a search of all Contacts in your system for the first name and last name you specify. It then lists the patient chart(s) where that individual is associated.
A sample image of this SQL report run in the Database Viewer is shown below:
- The search conditions must be an exact match. For example, searching for Mary Ann Smith will not show MaryAnn Smith, or searching for Aria Martinez will not show Aria Martinez-Garcia. To see all Contacts so you can add adjustable filters for fuzzy searching, see Contacts and Associated Patient Charts.
- The Contact may have any relationship to the patient chart.
To highlight and copy the code below to your clipboard, simply click the Copy button.
select first_name as contact_first, last_name as contact_last, patno, fname as patient_first, lname as patient_last from register inner join register_contact on register.patno = register_contact.patno inner join contact on contact.id = register_contact.contact_id where patno is not null and patno >= 99 and first_name = upper(:contact_first_name_to_look_for) and last_name = upper(:contact_last_name_to_look_for) order by patno