COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kstine on 17 Apr 2023 09:05:01 AM

Title: First office visit
Post by: kstine on 17 Apr 2023 09:05:01 AM
Hey Everyone!  Is there a formula I can write to tell the report to show only the patient's first visit, or is there a flag that you can use that says first visit - Y or N? I'm trying to pull a report of how many newborns our practice sees each month, but the new patient flag is only accurate if the box in the appointment screen is checked. This isn't always consistent. I'm not able to use visit type as this is used multiple times for the same patient during their first several visits. I can use reason as long as it says NP (new patient,) but this is not consistent across our offices. Any other thoughts/feedback you might have is much appreciated!!!
Title: Re: First office visit
Post by: dougp on 17 Apr 2023 09:48:27 AM
For the VisitDate query subject, change the Detail Aggregation property to Minimum.
Title: Re: First office visit
Post by: kstine on 17 Apr 2023 12:35:49 PM
Is this where you would change it?

https://onyxmsoorg-my.sharepoint.com/:i:/g/personal/kstine_onyxsc_org/EXLC4c_AOmpMm8clQIhYmKEB_A-yEc7U6OMgWi7NA2JeXg?e=8pGxt4 (https://onyxmsoorg-my.sharepoint.com/:i:/g/personal/kstine_onyxsc_org/EXLC4c_AOmpMm8clQIhYmKEB_A-yEc7U6OMgWi7NA2JeXg?e=8pGxt4)

I tried this, but the report still pulled in all visits for the patient that fit my other parameters.
Title: Re: First office visit
Post by: dougp on 17 Apr 2023 04:02:41 PM
Maybe you need a filter that effectively says

[Appointment].[Appointment].[AppointmentDate] = minimum([Appointment].[Appointment].[AppointmentDate])

You may need to use multiple queries.

MainQuery - contains all of the stuff you want to see
FirstAppointment - patient info (name, id, etc.) and minimum appointment date (so set the Detail Aggregation property for [AppointmentDate] to Minimum)
join those into OutputQuery on AppointmentDate = AppointmentDate, and add all of the data items from MainQuery to the data items list for OutputQuery
Modify your viz to use OutputQuery