Patient - PRovider join

Patient - PRovider join

Postby rnisha » Fri Jul 27, 2012 2:45 pm

Hi,
How can i get the patient provider relationship in Works db.

Thanks,
rnisha.
rnisha
 
Posts: 5
Joined: Sun Apr 29, 2012 2:27 am

Re: Patient - PRovider join

Postby Fallon.Hartford » Wed May 22, 2013 10:24 am

Hi Rnisha - This query depends on what provider you are looking for. If you want the PCP of the Patient, you would use the query below.

The PCP is housed in the Patient_Member table as ProviderID. In the PCPTYPE field, if the value is R then this is a outside PCP, and if it is a P then it is an internal provider. You can link this back to find the provider's name by joining on the Person table again, as all internal providers and patients names are stored in the Person table. The Referring_Provider_DE table houses the names of the external/referring providers.

Select
pat.LastName+', '+pat.FirstName 'PatientName',
CASE WHEN PCPTYPE = 'R' THEN ISNULL(rpd.EntryName,'')
ELSE Per.LastName+', '+per.FirstName
END AS 'PCPName'

from
Patient_Member pm
INNER JOIN Person pat ON pat.ID = pm.ID
LEFT OUTER JOIN Person per ON pm.ProviderID = per.ID
LEFT OUTER JOIN dbo.Referring_Provider_DE rpd ON rpd.ID = pm.ProviderID
Fallon.Hartford
 
Posts: 1
Joined: Wed May 22, 2013 9:01 am


Return to Tools: Queries, Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron