SQL: Asthma (Persistent) on Problem List

About

This report identifies active patients with a coded diagnosis of persistent asthma on their problem list (either active or inactive problem status).

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

Caveats

  • The problem list item must have either or both a SNOMED code or ICD-10 code consistent with persistent asthma in their problem list.  Simply having “asthma” listed without the code will not pull the patient into the list.
  • The code must be in the problem list.

Code

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

select chartnotes.patno, fname,lname,cast(note1 as char(30000)) as notes,problem_list, icd_1, snomed1, severity from chartnotes
inner join register on register.patno = chartnotes.patno
where section_subheading = 'PAST MEDICAL HISTORY' and
(icd_1 like ('J45.%')  or snomed1 in ('426656000','426979002','427295004'))
and chartnotes.patno > 99
and status_pat ='ACTIVE'