Appointuit support centre

Have a question? We have the answers to help you.

Examples of BP searches

Follow
EXAMPLE

Patients who have past history of diabetes but not Gestational diabetes and their Systolic BP in the past year has been over 170

SELECT *

FROM BPS_Patients

WHERE StatusText = 'Active'

AND InternalID IN (SELECT InternalID FROM PastHistory

WHERE ItemCode IN (3, 775, 776, 778, 774) AND RecordStatus = 1)

AND NOT InternalID IN (SELECT InternalID FROM PastHistory WHERE ItemCode = 780 AND RecordStatus = 1)

AND InternalID IN (SELECT InternalID FROM Observations WHERE DataName = 'Systolic' AND ObsDate > '01/01/2007' AND DataValue >= 170 AND RecordStatus = 1)

ORDER BY surname, firstname

 

EXAMPLE

Patients who have had 45 to 49 year old health assessments performed in the last year who was seen by a specific doctor

SELECT *

FROM BPS_Patients

WHERE StatusText = 'Active'

AND DOB < DateAdd(Year, -45, GetDate())

AND DOB > DateAdd(Year, -50, GetDate())

AND InternalID IN (SELECT InternalID FROM Visits WHERE VisitDate >= DateAdd(Year, -1, GetDate()) AND VisitDate <= GetDate()AND RecordStatus = 1 AND

UserID in (SELECT UserID FROM Users WHERE Surname ='Findacure'))

ORDER BY surname, firstname

 

EXAMPLE

Patients who smoke more than 10 cigarettes per day and have not received a Fluvax immunisation

SELECT *

FROM BPS_Patients

WHERE StatusText = 'Active'

AND InternalID IN (SELECT InternalID FROM Tobacco WHERE SmokingCode = 3 AND SmokesPerDay > 10)

AND InternalID NOT IN (SELECT InternalID FROM Immunisations

WHERE GivenDate >= '01/01/2005' AND VaccineName = 'Fluvax')

ORDER BY surname, firstname

 

http://kb.bpsoftware.net/au/bppremier/lava/Content/General/DatabaseSearches/SearchingtheDatabase.htm

Have more questions? Submit a request

Comments

Powered by Zendesk