Cognos2 matcher query: Difference between revisions
Ttenbergen (talk | contribs) m →Log |
Ttenbergen (talk | contribs) m →Log |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
== readable version == | == readable version == | ||
{{Collapsable| always= | |||
See [[CCMDB.accdb]] for actual master, but here is a readable version since this query is too complex for the Access visual editor and Access strips all line breaks etc. Since MW also strips them, open this in edit mode for the clean version. | See [[CCMDB.accdb]] for actual master, but here is a readable version since this query is too complex for the Access visual editor and Access strips all line breaks etc. Since MW also strips them, open this in edit mode for the clean version. | ||
| full= | |||
SELECT DISTINCT Cognos2_OneTime.ClientGUID, Cognos2_OneTime.ClientVisitGUID, Cognos2_OneTime.FirstName, Cognos2_OneTime.LastName, Cognos2_OneTime.HospitalMRN, Cognos2_OneTime.Chart, Cognos2_OneTime.Visit_Admit_DtTm, L_Log.Pat_ID AS Match_ChartPat_ID, ISNULL([Cognos2_Services_w_o_matches].[HospitalMRN]) AS MatchServiceTime_Pat_ID, L_Log.RecordStatus, Cognos2_Services.Service, Cognos2_Services.Service_StartDtTm, Cognos2_Services.Service_EndDtTm, s_Cognos_Services.exclude, Cognos2_OneTime.Gender, Cognos2_OneTime.PHIN, Cognos2_OneTime.DateOfBirth, Cognos2_OneTime.Prov, Cognos2_OneTime.PostalCode, [s_PatientFollow_distribution].[StartDtTm] <=[Cognos2_Services].[Service_StartDtTm] AND [Cognos2_Services].[Service_StartDtTm]<[s_PatientFollow_distribution].[EndDtTm] AND [s_laptops].[laptop]=Laptop_identifier() AS followed, L_Log.Accept_DtTm, L_Log.Arrive_DtTm, L_Log.Dispo_DtTm, nz(L_Log.Accept_DtTm, L_Log.Arrive_DtTm) AS Profile_Start_DtTm | SELECT DISTINCT Cognos2_OneTime.ClientGUID, Cognos2_OneTime.ClientVisitGUID, Cognos2_OneTime.FirstName, Cognos2_OneTime.LastName, Cognos2_OneTime.HospitalMRN, Cognos2_OneTime.Chart, Cognos2_OneTime.Visit_Admit_DtTm, L_Log.Pat_ID AS Match_ChartPat_ID, ISNULL([Cognos2_Services_w_o_matches].[HospitalMRN]) AS MatchServiceTime_Pat_ID, L_Log.RecordStatus, Cognos2_Services.Service, Cognos2_Services.Service_StartDtTm, Cognos2_Services.Service_EndDtTm, s_Cognos_Services.exclude, Cognos2_OneTime.Gender, Cognos2_OneTime.PHIN, Cognos2_OneTime.DateOfBirth, Cognos2_OneTime.Prov, Cognos2_OneTime.PostalCode, [s_PatientFollow_distribution].[StartDtTm] <=[Cognos2_Services].[Service_StartDtTm] AND [Cognos2_Services].[Service_StartDtTm]<[s_PatientFollow_distribution].[EndDtTm] AND [s_laptops].[laptop]=Laptop_identifier() AS followed, L_Log.Accept_DtTm, L_Log.Arrive_DtTm, L_Log.Dispo_DtTm, nz(L_Log.Accept_DtTm, L_Log.Arrive_DtTm) AS Profile_Start_DtTm | ||
FROM ((((((Cognos2_OneTime | FROM ((((((Cognos2_OneTime | ||
| Line 49: | Line 50: | ||
AND ( (sL_Cognos2_Service_exclusions.HospitalMRN) IS NULL)) | AND ( (sL_Cognos2_Service_exclusions.HospitalMRN) IS NULL)) | ||
AND (NOT (Cognos2_Services_w_o_matches.HospitalMRN) IS NULL); | AND (NOT (Cognos2_Services_w_o_matches.HospitalMRN) IS NULL); | ||
}} | |||
== Log == | == Log == | ||
* 2023-12-31 - re-did the change since the previous change broke things. Also added readable version above to make future edits of this more efficient | |||
* 2023-12-27 - removed filter for program as part of [[Change to having each collector collect both programs on the same laptop]] | * 2023-12-27 - removed filter for program as part of [[Change to having each collector collect both programs on the same laptop]] | ||
* 2022-06-30 - confirmed that this uses [[S PatientFollow distribution table]] including start and end dates; made this more explicit in query by using query name explicitly in field name references | * 2022-06-30 - confirmed that this uses [[S PatientFollow distribution table]] including start and end dates; made this more explicit in query by using query name explicitly in field name references | ||