Post Discharge Assessment View
Summary
(Summarize the feature concisely)
What is the expected behavior?
Post discharge assessment data
Justification for request
There is currently a view in the EDW for iCMP related PDAs ([Integration].[CommonProgram].[iCMPPatientPDA_Enterprise]). But the logic that builds this view is too limiting (even for iCMP). We would like a new view that would capture all PDAs without limiting to a matching inpatient or ED event or to iCMP. The resulting view could then be used for PDA reporting for all programs not just ICMP.
Relevant Code, Supporting Documentation, Etc.
(Please provide any additional documentation or reference material here) (If you have any related code written, please share in code blocks below)
-- My Demo query
select *
from some_table
where something = 'something else'
This code will likely need some work, but it is our current starting place:
/*pull PDA data*/
proc sql;
connect to odbc
(user=xxxx password=xxxxx dsn=EDWProduction);
create table pda_pre as
select *
from connection to odbc
(select d.patientid, f.RelationshipCategoryDSC, g.CommunicationTypeDSC, g.calltypedsc, h.elementid,
i.smartdataelementval, d.encountertypedsc, l.ReasonForVisitNM, cast(h.CurrentValueDTS as date) as PDAdate
from epic.encounter.patientencounter_enterprise d
left join epic.encounter.ReasonForVisit_enterprise e on d.PatientEncounterID = e.PatientEncounterID
left join epic.Patient.CommunicationReferencePatientEncounter_enterprise f on d.PatientencounterID = f.PatientencounterID
left join epic.clinical.Communication_enterprise g on f.communicationid = g.communicationid
left join Epic.Encounter.SmartDataElementData_Enterprise h on d.patientid = h.patientlinkid
left join Epic.Encounter.SmartDataElementValue_Enterprise i on h.conceptvalueid=i.conceptvalueid
left join Epic.Patient.Patient_Enterprise j on h.patientlinkid=j.patientid
left join Epic.Reference.ReasonForVisit l on e.ReasonID = l.ReasonForVisitID
where h.elementid= ('EPIC#99982') and j.testflg=0 and f.RelationshipCategoryDSC = ('Self') and g.calltypedsc = ('Outgoing')
and d.encountertypedsc in ('Patient Outreach', 'Telephone')
AND l.ReasonForVisitNM in ('POST DISCHARGE FOLLOW UP CALL')
);
disconnect from odbc;
quit;