ncats/CTSA-Metrics

Datetime Issue in Query for Demo Age/DOB Measure

Closed this issue · 1 comments

Since birth_datetime is an optional field in the current OMOP version, I would suggest modifying the this line to have an 'OR' statement that includes the commented lines of code.

So the query would look like this:

		SELECT 'Demo Age/DOB' AS Domain,
		CAST(COUNT(DISTINCT D.person_id) as Float) AS 'Patients with Standards'
		FROM Person D
		-- We may want to alter this to be only Year of birth present at this time Year, Month and Day are required in order to count
		Where D.birth_datetime  is NOT NULL OR (D.Year_of_Birth  is NOT NULL
			and  D.month_of_Birth is NOT NULL
			and  D.Day_of_Birth  is NOT NULL)

The script was modified to only check for the year of birth.