SQL: Problem List Regardless of SNOMED Including Last Update Date

About

How can I see all my patients with a problem in the problem list, whether the problem has a SNOMED code, and view the last time the problem was updated? 

This report shows all the active problems for all your active patients. It indicates the ICD and SNOMED (if any) codes that are attached to the problems. Finally, it lists the creation date/last updated date for each of the problems on the list.

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

None.

Code

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

select register.patno, problem_list, cast(note1 as char(20000)) as notes, icd_1, snomed1, dx_description, updated_date from chartnotes
inner join register on register.patno = chartnotes.patno
left outer join dx on dx.dxcode = chartnotes.snomed1
where register.status_pat = 'ACTIVE'
and problem_list = 'Y' and register.patno >99