St. Paul-Ramsey Peer Participants (PDF)

Report Overview
•••
This report provides a list of participants that have
an alert with the word “peer” and an appointment
scheduled after the specified date.
St. Paul-Ramsey
Peer Participants
Infoview Report Template Guidance –
AGENCY-SPECIFIC (St. Paul-Ramsey)
Notes
*This report provides private information. Please refer to the MN WIC Data Privacy Policy (Ref: MOM,
Section 1.7).
*Participants in this report have an alert with the word “peer”.
*This report can be used to create address labels using the Mail Merge functionality in Microsoft Word. A
document, Creating Labels, is available on the MDH WIC website and provides step-by-step instructions for
using the Mail Merge function to create labels.
Tab 1 – Peer Participants
Prompt(s)
TABLE
FIELD
OPERATOR
VALUE
PROMPT/DEFINITION
Enter 3-digit Agency ID.
APPOINTMENT
Agencyid
APPOINTMENT
Appointmentdate
Equal to
###
Greater than
mm/dd/yy
The agency where the appointment was
scheduled.
Enter Start Date.
The beginning date of the time period
during which the appointment is scheduled.
Static Criteria
Peer Query
ALERT.Messagetext Matches Pattern peer
Explanation: Include participants that have a text with the word “peer”
REFERENCEDICTIONARY.Category Equal to LANGUAGE
Explanation: The REFERENCEDICTIONARY.Category identifies the correct description for the
HOUSEHOLD.Language1 field since the Externalid is not unique in the REFERENCEDICTIONARY table
1|Page
MN Department of Health WIC Program
St. Paul-Ramsey Peer Participants
•••
REFERENCEDICTIONARY.Externalid Equal to HOUSEHOLD.Language1
Explanation: The language is stored as a code in the HOUSEHOLD table and its description is referenced in the
REFERENCEDICTIONARY.Description field. In order to display the reason, the Externalid must be linked to the
Language1 field in the HOUSEHOLD table
Tab 1 – Peer Participants
Columns
•
•
•
•
•
•
•
•
•
•
Household ID ( MEMBER.Householdid)
First Name (MEMBER.Firstname)
Last Name (MEMBER.Lastname)
DOB (MEMBER.Dateofbirth)
Address (HOUSEHOLD.Mailaddress)
City (HOUSEHOLD.Mailcity)
State (HOUSEHOLD.Mailstate)
Zip (HOUSEHOLD.Mailzip)  See FORMULAS
Telephone (HOUSEHOLD.Telephone1)  See FORMULAS
Language (REFERENCEDICTIONARY.Description)
Sorted by
Household ID (Ascending)
2|Page
St. Paul-Ramsey Peer Participants
•••
Technical Notes
Notes
The joins to the REFERENCEDICTIONARY table are to the HEALTHNOTE table. These joins were removed and the
REFERENCEDICTIONARY was left un-joined in the FROM statement. The link was then made in the WHERE statement
using the Externalid and Description.
The link between the ALERT and MEMBER table was changed from Statewicid to Householdid in order for both mom
and infant to appear on the output since only the Household ID and not the State WIC ID is a report object.
Formulas
Agency ID (report header) =[Name] + " (" + [Agencyid] + ")"
Report Date (report header) ="Report Date: " + FormatDate(ToDate(UserResponse("Enter Start Date:");"M/d/yyyy
hh:mm:ss A");"MM/dd/yyyy")
Zip (column) =Left([Mailzip];5)
Telephone # (column) ="("+ Left([Telephone1];3)+") "+Substr([Telephone1];4;3)+"-"+Right([Telephone1];4)
SQL (changes are highlighted)
Peer Query
SELECT
dbo.MEMBER.HOUSEHOLDID,
dbo.MEMBER.FIRSTNAME,
dbo.MEMBER.LASTNAME,
dbo.MEMBER.DATEOFBIRTH,
dbo.HOUSEHOLD.MAILADDRESS,
dbo.HOUSEHOLD.MAILCITY,
dbo.HOUSEHOLD.MAILSTATE,
dbo.HOUSEHOLD.MAILZIP,
dbo.HOUSEHOLD.TELEPHONE1,
dbo.HOUSEHOLD.LANGUAGE1,
dbo.AGENCY.NAME,
dbo.APPOINTMENT.AGENCYID,
dbo.REFERENCEDICTIONARY.DESCRIPTION
FROM
dbo.REFERENCEDICTIONARY, (NOTE: Completely removed links to REFERENCEDICTIONARY)
dbo.HOUSEHOLD INNER JOIN dbo.MEMBER ON
(dbo.MEMBER.HOUSEHOLDID=dbo.HOUSEHOLD.HOUSEHOLDID)
INNER JOIN dbo.APPOINTMENT ON (dbo.APPOINTMENT.STATEWICID=dbo.MEMBER.STATEWICID)
3|Page
St. Paul-Ramsey Peer Participants
•••
INNER JOIN dbo.ALERT ON (dbo.ALERT.HOUSEHOLDID=dbo.MEMBER.HOUSEHOLDID)
INNER JOIN dbo.AGENCY ON (dbo.AGENCY.AGENCYID=dbo.APPOINTMENT.AGENCYID)
WHERE
(
dbo.APPOINTMENT.AGENCYID = @prompt('Enter 3-digit Agency ID:','A','Dbo
Appointment\Agencyid',Mono,Free,Persistent,,User:1)
AND
dbo.APPOINTMENT.APPOINTMENTDATE > @prompt('Enter Start Date:','D','Dbo
Appointment\Appointmentdate',Mono,Free,Persistent,,User:0)
AND
dbo.ALERT.MESSAGETEXT LIKE 'peer'
AND
dbo.REFERENCEDICTIONARY.CATEGORY = 'LANGUAGE'
AND
dbo.REFERENCEDICTIONARY.EXTERNALID = dbo.HOUSEHOLD.LANGUAGE1
)
4|Page