THE BIG QUESTION HERE IS WHERE DO I PLACE IT AND WHY. WHAT ARE THE BEST PRACTICES OR WHAT IS GOOD POLICY TO DO IT ONE WAY OVER ANOTHER? the following is a mockup of the query. declare @from_dob date = dateadd(year,-45,'20210101') declare @to_dob date = dateadd(year,-40,'20211231') declare @research_date date = '20150101' declare @region varchar(100) select @region = dbo.z_bi_get_region(db_name()) select @region as region , personnel_id , last_name , first_name , gender_code , birth_date ,datediff(year,birth_date,cast(getdate() as date)) as age_at_run_date , mobile_phone_number , home_phone_number , primary_email_address , primary_address_line1 , primary_address_line2 , primary_address_city , primary_address_state , primary_address_zipcode , death_flag ,isnull(s1.disease_found,'N') as disease_found ,@from_dob as from_DOB, @to_dob as to_DOB, @research_date as research_date from c_personnel pers outer apply ( select top 1 'Y' as disease_found from c_research s inner join c_research_item si on s.research_key=si.research_key and si.active_flag='Y' inner join l_procedure_code pc on si.procedure_code=pc.procedure_code inner join l_disease_type dt on pc.disease_type_code=mt.disease_type_code and dt.disease_type_code in ('Cancer','Heart','Kidney',’Lung’,'Accident',’Neurological’) inner join l_location st on s._location_code=st.location_code where pers.personnel_key=s.personnel_key and s._serviced_date >= @research_date AND st.location_code NOT IN ('HP','CLNK') AND st.practice_code <> 'DocNABox' ) as s1 where pers.birth_date >= @from_dob and pers.birth_date < dateadd(d,1,@to_dob) and pers.master_personnel_key is null AND pers.issuer_of_personnel_id = 'system' and pers.gender_code='M' and isnull(pers.death_flag,'N')='N' and isnull(s1.disease_found,'N')='N' order by datediff(year,birth_date,cast(getdate() as date))
THE BIG QUESTION HERE IS WHERE DO I PLACE IT AND WHY. WHAT ARE THE BEST PRACTICES OR WHAT IS GOOD POLICY TO DO IT ONE WAY OVER ANOTHER? the following is a mockup of the query.
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.