en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en de en de en de en de en en en fr en en en en en en en en en en en en da en en en en en en en en en en en en en en en ru en en en en en en en en it fa en uk en en fr en en en en en en cs en en en en en en en en en en en en en en en uk fi en en en it en en it en en en en en en en en en en en id en en en
The ACCESS NYC Field Screener is a tablet optimized version of the ACCESS NYC benefits eligibility screener created for outreach caseworkers.
Last update: 2022-09-07 22:38:21 UTC
This code, similar to the original eligibility screener, relies on the program content and benefits screening API proxy inside the ACCESS NYC website in order to provide screening results to the client and caseworker.
More about the Field Screener case study can be read about here.
$1 This package uses Composer Installers to install the package in the Must Use plugins directory (/wp-content/mu-plugins):
Copy the autoloader sample from the plugin directory into the must use plugin directory.
Or, manually create a page template in the theme directory with the following snippet.
<?php /** * Plugin Name: NYCO ACCESS NYC Field Screener * Description: Autoloads the backend of the Field Screener application. * Author: NYC Opportunity */ $dir = WPMU_PLUGIN_DIR . '/anyc-field-screener'; if (file_exists($dir)) { include_once $dir . '/Auth.php'; include_once $dir . '/Util.php'; require_once $dir . '/Backend.php'; new FieldScreener\Backend(); }
Copy the template sample from the plugin directory into the theme directory.
Or, manually create a page template in the theme directory with the following snippet.
Optional. A single template will suffice but there are two view routes for the application. The first is a root view and the second is a nested result view. It is possible to use WordPress's page template slug system to create two templates
📄 page-field-screener.php 📄 page-results.php
Add a new page and title it "Field Screener". Then, select the "Field Screener" as a page template and add a shortcode to the post content.
This will render the application's root view at the route /field-screener. Publish the page, then create another page for the results route. It can be titled "Results - Field Screener" but the page slug needs to be results. Select the "Field Screener" as a page template and add a shortcode to the post content.
The page="results" attribute designates the view as the results page. This will render the application's results view at the route /field-screener/results.
Publish the results page. The application will be viewable at /field-screener.
In addition to page. There are other shortcode attributes that can be set to customize the location and environment of the application.
The human readable environment string used in the environment alert to inform users which environment they are viewing.
This is the application link the environment alert will link users to when the environment's WP_ENV is not set to the production value, accessnyc.
The path to the application's static assets.
The root slug of the application. This should match the WordPress page slug.
The root slug and results slug for the application. This determines the redirect path from the main screening application to the results page. If the root is changed, this will need to be changed as well. This should match the WordPress page slug.
The root slug and results slug for the results page that is shared with users when they text or email results to themselves. This path replaces the results path defined above.
The string translation template location ID. This is used to scope translations for the application.
Can be set to results to designate the results route.
The env string is determined by the WP_ENV constant value. This constant is set in the various environments of the ACCESS NYC site. If the constant isn't defined the string will default to "Unknown."
Add the ?debug=1 query parameter to the URL to see application logs. This will display data values set to the household model, form validation warnings, and the screening API request object and responses. Set "Preserve Log" to true to retain the response from the application to the results page.
The network panel will also reveal the API request and response information.
The Mayor's Office for Economic Opportunity (NYC Opportunity) is committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Interested in contributing? See our open positions on buildwithnyc.github.io. Follow our team on Github (if you are part of the @cityofnewyork organization) or browse our work on Github.