Difference between revisions of "Problem Views"

From Galen Healthcare Solutions - Allscripts TouchWorks EHR Wiki
Jump to navigation Jump to search
(New page: They are stored in Problem.ProblemIncludeFlags. This field is a bitmask, so you'll have to do a bitwise OR (ampersand in T-SQL) to determine whether a problem is in a particular view. Th...)
 
m
Line 1: Line 1:
They are stored in Problem.ProblemIncludeFlags.  This field is a bitmask, so you'll have to do a bitwise OR (ampersand in T-SQL) to determine whether a problem is in a particular view.  The bit values and sample query are below.
+
They are stored in Problem.ProblemIncludeFlags.  This field is a bitmask, so you'll have to do a bitwise OR (ampersand in T-SQL) to determine whether a problem is in a particular view.  The bit values and sample query are below.<BR>
 
   
 
   
Currently, a problem may only be in one of the bottom four views (PMH, PSH, PH, FH) and in active.  In short, you can make querying more efficient (this is only guaranteed in v10) by comparing integer values.  For example, if you wanted to pull any problems in Family History, you could have your WHERE clause look like: WHERE ProblemIncludeFlags IN (16, 17).  16 Would be Family History only, 17 would be FH + Active.
+
Currently, a problem may only be in one of the bottom four views (PMH, PSH, PH, FH) and in active.  In short, you can make querying more efficient (this is only guaranteed in v10) by comparing integer values.  For example, if you wanted to pull any problems in Family History, you could have your WHERE clause look like: WHERE ProblemIncludeFlags IN (16, 17).  16 Would be Family History only, 17 would be FH + Active.<BR>
 
   
 
   
0x00000001 -- Active
+
0x00000001 -- Active<BR>
0x00000002 -- PMH (Past Medical History)
+
0x00000002 -- PMH (Past Medical History)<BR>
0x00000004 -- PSH (Past Surgical History)
+
0x00000004 -- PSH (Past Surgical History)<BR>
0x00000008 -- PH (Personal History)
+
0x00000008 -- PH (Personal History)<BR>
0x00000010 -- FH (Family History)  0x00000010 is the same as an integer of 16.
+
0x00000010 -- FH (Family History)  0x00000010 is the same as an integer of 16.<BR>
 
   
 
   
 +
<PRE>
 
-- Select all PMH problems for a particular patient
 
-- Select all PMH problems for a particular patient
 
SELECT * FROM Problem p (NOLOCK)
 
SELECT * FROM Problem p (NOLOCK)
Line 14: Line 15:
 
WHERE ph.PatientID = 182484
 
WHERE ph.PatientID = 182484
 
AND (p.ProblemIncludeFlags & 0x00000004) <> 0
 
AND (p.ProblemIncludeFlags & 0x00000004) <> 0
 +
</PRE>

Revision as of 18:39, 7 November 2007

They are stored in Problem.ProblemIncludeFlags. This field is a bitmask, so you'll have to do a bitwise OR (ampersand in T-SQL) to determine whether a problem is in a particular view. The bit values and sample query are below.

Currently, a problem may only be in one of the bottom four views (PMH, PSH, PH, FH) and in active. In short, you can make querying more efficient (this is only guaranteed in v10) by comparing integer values. For example, if you wanted to pull any problems in Family History, you could have your WHERE clause look like: WHERE ProblemIncludeFlags IN (16, 17). 16 Would be Family History only, 17 would be FH + Active.

0x00000001 -- Active
0x00000002 -- PMH (Past Medical History)
0x00000004 -- PSH (Past Surgical History)
0x00000008 -- PH (Personal History)
0x00000010 -- FH (Family History) 0x00000010 is the same as an integer of 16.

-- Select all PMH problems for a particular patient
SELECT * FROM Problem p (NOLOCK)
INNER JOIN Problem_Header ph (NOLOCK) ON ph.CurrentProblemID = p.ID
WHERE ph.PatientID = 182484
AND (p.ProblemIncludeFlags & 0x00000004) <> 0