Anoka - Scanned CTC Release (PDF)

MN WIC PROGRAM
Anoka - Scanned CTC Release
AGENCY-SPECIFIC >> ANOKA (REVISED 2.28.17)
Report Overview
This report was developed for Anoka County but could potentially be used by other agencies.
The output provides a list of participants, based on specified WIC Types, who were issued
benefits during a specified time period at a specified agency and have had a CTC release
scanned in the past year.
Notes
▪
This report provides private information. Please refer to the MN WIC Data Privacy Policy
(Ref: MOM, Section 1.7).
▪
Participants are included in the report output if they have had a document scanned within
365 days of the current date with a comment that includes “ctc” in the text. Only the most
recently scanned record displays in the report output.
▪
The Agency ID is based on the agency where the benefits were issued.
▪
The WIC Type is based on the participant’s WIC Type at the time of issuance.
▪
The Staff ID is based on the staff person who issued the benefits.
▪
The report output is formatted to download to an 8 x 11.5 inch Portrait PDF. It can also be
exported to Excel (the margins will need to be adjusted and the headers/footers will not
display.)
Tab 1 – Scanned CTC Release
ANOKA - SCANNED CTC RELEASE
INFOVIEW GUIDANCE DOCUMENT
Prompts
TABLE
FIELD
FOODINSTRUMENTSET Agencyid
OPERATOR
Equal to
VALUE
###
P:N;B;C;I
FOODINSTRUMENTSET Wicstatus
FOODINSTRUMENTSET Issueddate
FOODINSTRUMENTSET Issueddate
In List
Between
And
PROMPT/DEFINITIONS
Enter 3-digit Agency ID.
The agency where the benefits
were issued.
Enter WIC Type(s).
(use semi-colon
The participant’s WIC Type at the
to separate; no
time of benefit issuance
spaces)
mm/dd/yy
Enter Start Date.
The first date in the time period
during which participants were
issued benefits.
mm/dd/yy
Enter End Date.
The last date in the time period
during which participants were
issued benefits.
Static Criteria
CTC Scan Query
MEMBERIMAGE.Comments Matches Pattern %ctc%
AND
[SQL (WHERE)] dbo.MEMBERIMAGE.Addeddttm < DATEADD(day, 365, CURRENT_TIMESTAMP)
Explanation: include participants who have a scanned document with “ctc” in the Comment field that has been
added within the last 365 days
MAX(dbo.MEMBERIMAGE.Addeddttm)
Explanation: include only the most recent scan that meets the other criteria
Tab 1 – Scanned CTC Release
Columns
▪
▪
▪
▪
First Name (MEMBER.Firstname)
Last Name (MEMBER.Lastname)
DOB (MEMBER.Dateofbirth)
WIC Type (FOODINSTRUMENTSET.Wicstatus)
Page |2
ANOKA - SCANNED CTC RELEASE
INFOVIEW GUIDANCE DOCUMENT
▪
▪
▪
▪
Issued Date (FOODINSTRUMENTSET.Createdttm)
Issued Time (FOODINSTRUMENTSET.Createdttm)  See FORMULAS
Staff ID – Issued (FOODINSTRUMENTSET.Createuserid)
Scan Date (MEMBERIMAGE.Addeddttm)
Sorted by
Issued Date
Page |3
ANOKA - SCANNED CTC RELEASE
INFOVIEW GUIDANCE DOCUMENT
Technical Notes
Notes
Sorted by the Issued Date column, which sorted the Issued Time column correctly. Sorting by the Issued Time
column itself did not sort correctly (2PM was before 8 AM). Also, changed the Issued Date from Issueddate to
Createdttm.
Duplicate records were displaying since it appears that multiple scans can occur within 365 days. Added
MAX(dbo.MEMBERIMAGE.Addeddttm) to include only the most recent record.
The join from the AGENCY table was changed from MEMBER.Agencyid to FOODINSTRUMENTSET.Agencyid since
this is the agency the report outputs are based on.
Formulas
Tab 1 – Scanned CTC Release
Title (page header) ="Participants Issue Benefits between " + FormatDate(ToDate(UserResponse("Enter Start
Date:");"M/d/yyyy hh:mm:ss A");"M/d/yy") + " - " + FormatDate(ToDate(UserResponse("Enter End
Date:");"M/d/yyyy hh:mm:ss A");"M/d/yy")
Agency (report header) =[Name] + " (" + [Agencyid] +")"
Report Date (report header) ="Report Date: " + CurrentDate()
Issued Time (column) =FormatDate([Createdttm]; "hh:mm A")
SQL (changes are highlighted)
CTC Scan Query
SELECT
dbo.AGENCY.NAME,
dbo.FOODINSTRUMENTSET.AGENCYID,
dbo.FOODINSTRUMENTSET.STATEWICID,
dbo.FOODINSTRUMENTSET.SERVICESITEID,
dbo.MEMBER.FIRSTNAME,
dbo.MEMBER.LASTNAME,
dbo.MEMBER.DATEOFBIRTH,
dbo.MEMBER.HOUSEHOLDID,
dbo.FOODINSTRUMENTSET.ISSUEDDATE,
dbo.FOODINSTRUMENTSET.CREATEDTTM,
MAX(dbo.MEMBERIMAGE.ADDEDDTTM),
dbo.FOODINSTRUMENTSET.WICSTATUS,
dbo.FOODINSTRUMENTSET.CREATEUSERID
Page |4
ANOKA - SCANNED CTC RELEASE
INFOVIEW GUIDANCE DOCUMENT
FROM
dbo.FOODINSTRUMENTSET INNER JOIN dbo.MEMBER ON
(dbo.FOODINSTRUMENTSET.STATEWICID=dbo.MEMBER.STATEWICID)
INNER JOIN dbo.AGENCY ON (dbo.AGENCY.AGENCYID=dbo.FOODINSTRUMENTSET.AGENCYID)
INNER JOIN dbo.MEMBERIMAGE ON (dbo.MEMBERIMAGE.STATEWICID=dbo.MEMBER.STATEWICID)
WHERE
(
dbo.FOODINSTRUMENTSET.AGENCYID = @prompt('Enter 3-digit Agency ID:','A','Dbo
Foodinstrumentset\Agencyid',Mono,Free,Persistent,,User:0)
AND
dbo.FOODINSTRUMENTSET.ISSUEDDATE BETWEEN @prompt('Enter Start Date:','D','Dbo
Foodinstrumentset\Issueddate',Mono,Free,Persistent,,User:2) AND @prompt('Enter End Date:','D','Dbo
Foodinstrumentset\Issueddate',Mono,Free,Persistent,,User:3)
AND
dbo.FOODINSTRUMENTSET.WICSTATUS IN @prompt('Enter WIC Type(s):','A','Dbo
Foodinstrumentset\Wicstatus',Multi,Free,Persistent,,User:1)
AND
(
dbo.MEMBERIMAGE.COMMENTS LIKE '%ctc%'
AND
dbo.MEMBERIMAGE.Addeddttm < dateadd (day, 365, CURRENT_TIMESTAMP)
)
)
GROUP BY
dbo.AGENCY.NAME,
dbo.FOODINSTRUMENTSET.AGENCYID,
dbo.FOODINSTRUMENTSET.STATEWICID,
dbo.FOODINSTRUMENTSET.SERVICESITEID,
dbo.MEMBER.FIRSTNAME,
dbo.MEMBER.LASTNAME,
dbo.MEMBER.DATEOFBIRTH,
dbo.MEMBER.HOUSEHOLDID,
dbo.FOODINSTRUMENTSET.ISSUEDDATE,
dbo.FOODINSTRUMENTSET.CREATEDTTM,
dbo.FOODINSTRUMENTSET.WICSTATUS,
dbo.FOODINSTRUMENTSET.CREATEUSERID
Revisions
2.28.17 – Added Staff ID – Issued column per request by Anoka; changed the criteria to provide
the most recent scan date instead of all those within the past year
2.9.16 – Added Issued Time column; changed Issued Date from Issueddate to Createdttm for
sort to work correctly
4.12.16 – Revised the report to include only those who have a scanned CTC release form within
the last year. Since this change was specific to an Anoka County request, created their own
version of the report and removed all extraneous columns except those specifically requested
by Anoka.
Page |5