department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
98 stars 69 forks source link

Spike: Review Police data available for use on VAMC police page #15446

Closed xiongjaneg closed 12 months ago

xiongjaneg commented 1 year ago

Description

The data available from Axon needs to be made available so that we can display it on a VAMC page. For the near term, this is likely a manual CSV. The vendor API is likely not available until next spring, March or April. Lighthouse likely would not be involved until that time.

Details received from vendor

Additional context

Income Limits example

Income Limits also uses a CSV and a vets-api API implementation to pull / display data.

Pending

how to identify data for the following (Michelle's note: I've already asked if this data is expected to be in the same database or separate data source)

Data elements

Required (based on understanding of legislature)

Nice to have elements (for context)

Tasks

Acceptance Criteria

Team

xiongjaneg commented 1 year ago

Data availability concerns captured in Slack thread

mmiddaugh commented 1 year ago

We received some additional information:






Pending answers from the software vendor

jilladams commented 1 year ago

Tagged as Sprint 96 since pushed out of Sprint 95 plan, and got new info that we may be able to pull this in.

mmiddaugh commented 1 year ago

Additional info from the data software vendor:

regarding an API: Our plan for facilitating access to this data leverages the Axon DataStore, which is not an API endpoint but rather a Microsoft Azure SQL Database to which your team can connect using ODBC-compliant tools. This Axon DataStore Introduction article provides some additional details on this architecture. That article and the DataStore Field Mapping article are the best resources for seeing examples of how the data is returned when queries are run against the database. Once your team has finalized what will be displayed on the dashboards and the specific data points needed to support that display, a custom database view could be created to make it more efficient to query those specific points using a tool such as PowerBI.

As a reminder, direct access to the Axon DataStore will not be available until the completion of Phase 2 of this project.

Regarding different sources for the data, there is a separate DataStore for the Axon Records and Axon Standards products. As the RMS system, Records houses the day-to-day forms, incident reports, and investigations completed by VA police. Axon Standards is usually the source for use of force and sometimes disciplinary information/internal investigations. I would have to defer to the VA team for specific details on the data points that they are capturing in each system.

jilladams commented 1 year ago

If we go the vets-api route, we know we will need to:

jilladams commented 1 year ago

From planning: so far, we believe the contact info will be a (maybe one of many) CSV, and CMS does not need to be involved.

eselkin commented 1 year ago

We would need to inject into the drupalPages.data keys with FacilitySidebarQuery a new element in data.xFacilitySideBarQuery.links[-1].links[-1].links[-1] like

{
   "expanded": false,
   "description": "Police data",
   "label": "VA Police", 
   "url": {
        "path": `${data.xFacilitySideBarQuery.links[0].url.path}/va-police`
   },
   "entity": {
      "linkedEntity": {
         "entityPublished": true,
         "moderationState": "published"
      }
    }
}

We should probably use a tested component like https://www.npmjs.com/package/csvtojson rather than manually transforming the CSV. I'm assuming the CSV will be exported as 1 row = 1 facility for 1 year, but it may be entirely different (e.g. 1 event / row). I looked at the Tucson data that Axon provides, but you can't actually see the data being used so it's not helpful.

jilladams commented 1 year ago

@eselkin in scrum today, we discussed that due to the tight timing on this project, we should meet to review SPIKE findings and figure out what we still need from the data vendor, so we can get them moving. @xiongjaneg volunteered to schedule that sync, so if we are ready for it sooner than end of sprint, please let her know? The main points to understand for that purpose are:

(I know you're still working through things, just FYI-ing the scrum convo.)

eselkin commented 1 year ago

A little clarification on the data would be nice, like:

  1. Is the CSV row cumulative data for a period or is it 1 row per event that needs to be summarized/bucketed for display?
  2. Do all facilities have some data?
  3. What key/identifier are they using for a VAMC location?
eselkin commented 1 year ago

We need a ticket for

  1. Determine how to create a content-build page when no graphql is being used to generate data. We need a VA Police Page built for each VAMC facility.
  2. Create a Vets-Website component for loading in JSON data for a facility Id and displaying sections and boxes within each section for the important data.
  3. Complete the code to add VA Police to the Facility Sidebar (see comment above)
  4. IS there possibly special code for Lovell? Does the sidebar get generated differently? Does the main page need two separate pages?
jilladams commented 1 year ago

Eli has reviewed:

So we will need: an example of raw data. We have some questions:

Next step: @eselkin to let @xiongjaneg know when he's ready to review (tomorrow?) so we can move the meeting currently scheduled for 10/23.

eselkin commented 1 year ago

One more question, does Lovell's TRICARE side also get the VA Police link?

reminder to add to VA Police link in sidenav for Lovell page

{
...
in entity: {
   ...
   "fieldMenuSection": "both"|"va"
   }
}
eselkin commented 1 year ago

Will stop working on determining how to place the sidenav links and build pages. Will work on:

  1. Creating skeleton structure for loading in a CSV and processing the unknown content into JSON
  2. Adding step 1 into metalsmith
  3. Skeleton structure for loading content from processed data in 1 & 2 and loading into redux (similar to KISS -- adding selectors for Facility ID to retrieve data).

Need tickets for

  1. Finalizing structure of CSV -> JSON
  2. Finalizing component reading data from redux
xiongjaneg commented 1 year ago

Ticket 1: #15722 CSV -> JSON Ticket 2: #15723 redux

xiongjaneg commented 1 year ago

@mmiddaugh Here's Eli and Max's ideal data/format for Police data from the vendor

Required (based on understanding of legislature)

Date Facility - should match the facility ID provided by facility api, otherwise would possibly need Drupal data matching

For each column below, there should be a row for all the data needed per the desired date range

Doesn't need to be in the table above, just need info per facility

Nice to have elements (for context), possibly additional columns formatted in the same way as required elements above

xiongjaneg commented 1 year ago

Per Eli: the example of Tuscon police data was not helpful because it was just a summary of the stats not access to the raw data

xiongjaneg commented 1 year ago

For everything, need facility ID and it should match what's in VAST, otherwise there would have to be some effort to map them

eselkin commented 1 year ago
If the rows are per event, in a worst-case-scenario, making sure we don't have PII in the data is best. It's likely that we just want true or false for columns. The Columns would still be the similar datetime_utc system_id facility_id arrest_made ticket_issued prosecution_ticket officer_used_force weapon_discharged complaint investigation_of_officer disciplinary_action_against_officer call_for_service officer_initiated category_of_incident
2023-01-01T10:00:00Z va_10101 vha_605 true true false false false false true NULL or empty

Similar to their query in https://my.axon.com/s/article/Axon-Records-DataStore-Field-Mappings?language=en_US on We don't want any of the PersonToOffence or Person information and don't care about the report numbers, unless they tell us we have to get report numbers if we're joining on them. But we don't know all the fields available, I think the mappings doesn't list everything and they know the fields better than we do. Not sure where to find whether it was initiated as a call or by the officer. Not sure where disciplinary action is held.

select c.Description, o.NibrsUcrCode, c.Code, o.Severity
    , o.NibrsUcrCode, c.Ucr
    , o.Completion, l.facilityId, 
from axon.Offenses o
    inner join dw.OffenseToCharge otc on o.ExternalId = otc.FromExternalId and otc.ReportNumber = o.ReportNumber
    inner join axon.Charges c on otc.ToExternalId = c.ExternalId and otc.ReportNumber = c.ReportNumber
    inner join dw.Offenses dwo on o.ExternalId = dwo.ExternalId and o.ReportNumber = dwo.ReportNumber
    inner join axon.RecordsLocations l on o.ExternalId = l.ExternalId and o.ReportNumber = l.ReportNumber
    inner join axon.ArrestsCharges ac on o.ExternalId = ac.ParentExternalId and  o.ReportNumber = ac.ReportNumber
mmiddaugh commented 12 months ago

Not sure where disciplinary action is held.

Hi @eselkin, it seems there are two separate DataStores:

Is there an assumption that the data is connected between the Record and the Standards database as in the table commented above or should we confirm?

eselkin commented 12 months ago

If they are different stores, that's fine. I was just being optimistic above. We can combine things from the outputted CSVs as long as there's some ID that connects them.

eselkin commented 12 months ago

Added some ACs on finalize CSV->JSON

davidmpickett commented 12 months ago
  • Q: Should we expect police data and contact information for every facility? Or at the system level only?
    • A: Believed to be at facility level but will confirm

Have we received any further detail on this? Do we have an example of the raw contact data is stored?

eselkin commented 12 months ago
  • Q: Should we expect police data and contact information for every facility? Or at the system level only?

    • A: Believed to be at facility level but will confirm

Have we received any further detail on this? Do we have an example of the raw contact data is stored?

Not as far as I know.

xiongjaneg commented 12 months ago

From Michelle and Jane conversation: We will want the police data at the facility level. The vendor said they can provided it down to even the department level, but for our purposes, we will want it displayed at the facility level.

davidmpickett commented 12 months ago

Should have clarified, I'm specifically asking about the Contact Information, which seems like it's stored in an entirely different system than the other data. Do we know if the Contact Information has a facility level of granularity? Looking at the Tuscon example, there are geographical subdivisions (Wards, Divisions, etc) for incident data, but there is no Contact Information per these subdivisions. It is only displayed at the home page level in the footer

eselkin commented 12 months ago

Will stop working on determining how to place the sidenav links and build pages. Will work on:

  1. Creating skeleton structure for loading in a CSV and processing the unknown content into JSON
  2. Adding step 1 into metalsmith
  3. Skeleton structure for loading content from processed data in 1 & 2 and loading into redux (similar to KISS -- adding selectors for Facility ID to retrieve data).

Need tickets for

  1. Finalizing structure of CSV -> JSON
  2. Finalizing component reading data from redux

1,2 are in PR and QA 3 is not really technically possible until 1,2 passes so that the files are accessible to vets-website. So it's probably best to put this with #15723

Also 3, generally requires that drupalStaticData and connect-drupal-static-data and selectors be a bit more generalized, like jsonStaticData and connect-json-static-data. I've done most of this, just making sure tests pass.

mmiddaugh commented 12 months ago

Thank you for this @eselkin I'll email our list of requested data and ask for a meeting to discuss and view raw data

jilladams commented 12 months ago

@eselkin @xiongjaneg should this ticket stay open? Not sure if we need it to track the next steps re: the data call with Axon or not.

xiongjaneg commented 12 months ago

@jilladams @eselkin Our ACs are covered. Whatever comes out of the Axon call can be added to a subsequent ticket or stub out a new one. I'll close this.