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
99 stars 69 forks source link

SPIKE: FE dive on how to achieve KISS / data searches #15054

Closed jilladams closed 1 year ago

jilladams commented 1 year ago

Description

Epic = https://github.com/department-of-veterans-affairs/va.gov-cms/issues/14993 and contains notes on the scope / potential approaches for how to allow plain language search of health services within the Facility Locator

All of the plain language associations are available within the health services taxonomy.

KISS has been proposed as a means to pull the Taxonomy content, make it available browser side for on the fly querying.

Engineering notes

Right now KISS's main implementation is using Drupal to manage Cerner data. This is documented in https://depo-platform-documentation.scrollhelp.site/developer-docs/how-to-opt-in-to-drupal-as-the-source-of-truth-for, and this is a model for how KISS could also be used for managing Taxonomy data, to some extent.

Swirt knows KISS and can be consulted for details. Ryan Koch built the Cerner implementation and could also be available, as needed. (Be judicious in use of his time.)

Acceptance criteria

xiongjaneg commented 1 year ago

Kiss it simply Static, here's a knowledge transfer ticket from Ryan Koch: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/13823

xiongjaneg commented 1 year ago

What is the plain language search supposed to be? The search is based on a typed in term, e.g., kidney plain language search turns up renal, nephrology, etc. What about typos?

Search logic is based on 526ez Form https://www.va.gov/find-forms/about-form-21-526ez/. If login is needed to view the form, there's a Github login or Laura can help identify the right person to ask.

xiongjaneg commented 1 year ago

est 5

eselkin commented 1 year ago

What is the plain language search supposed to be? The search is based on a typed in term, e.g., kidney plain language search turns up renal, nephrology, etc. What about typos?

Search logic is based on 526ez Form https://www.va.gov/find-forms/about-form-21-526ez/. If login is needed to view the form, there's a Github login or Laura can help identify the right person to ask.

Here's the file with the autosuggest logic src/applications/disability-benefits/all-claims/pages/addDisabilities.js in vets-website

And here's their schema src/applications/disability-benefits/all-claims/content/disabilityLabels.js

However, it does not suggest one thing if it's related to some other condition only if it's typing is closely related. So a nephro prefix does not bring up renal or kidney anything or vice-versa

Also, as a side reference: src/platform/forms-system/src/js/fields/AutosuggestField.jsx This is the field React Component Not a fuzzy match or special kind of search

aklausmeier commented 1 year ago

commenting for my own visibility to stay in the loop on this

eselkin commented 1 year ago

Background

526 form

My notes above document how the form 526 uses data in vets-website from a hard-coded taxonomy file. Data is fed directly from the file to the autocomplete text field. The autocomplete field is somewhat complex, but does not do any fuzzy matching or nearest matching, just substring search.

drupal download using GraphQL in metalsmith and how to use in vets-website

The Cerner->VistA method was instituted because lots of disparate parts were relying on flippers per-facility to determine if that facility needed a link to Cerner or VistA portal. Whether a facility was Cerner or VisA was placed behind a redux slice that got data from drupal en masse. It is a fairly reusable approach. We should use the action built for that process to load in our data-- method is reasonably understandable.

Plan

  1. We can use the existing methods for pulling data from drupal in content-build. Modeling on (src/site/stages/build/drupal/static-data-files/vamcFacilitySupplementalStatus/index.js in content-build)
  2. We can use the existing methods for pulling data from drupal generated json into vets-website. Modeling on src/platform/utilities/cerner/dsot.js and src/platform/site-wide/drupal-static-data/source-files/vamc-ehr/connect/index.js
  3. We can use selectors similar to vamc-ehr to use the drupal data.
    1. Just one selector for all data needed for the autocomplete
    2. Data has 4 booleans that are probably of importance. Some terms only apply to certain facilities (VBA,Vet Center,VAMC,TRICARE). It is unknown if we should make one file for each of these conditions or do some processing in app/on device. There are only 109 taxonomy entries so on-device is not too cumbersome.
  4. We take data from the selector and feed it into the autocomplete like they have for the 526 form.
  5. We would need to include the selector on each page where it is used, currently just find-locations.

GraphQL

Rudimentary query -- needs additional details:

{
  taxonomyTermQuery(
    offset: 0
    filter: {conditions: [{operator: EQUAL, field: "vid", value: ["health_care_service_taxonomy"]}]}
  ) {
    count
    entities {
      ... on TaxonomyTermHealthCareServiceTaxonomy {
        name
        fieldAlsoKnownAs
        fieldCommonlyTreatedCondition
        fieldHealthServiceApiId
        fieldServiceTypeOfCare
        fieldShowForVetCenters
        fieldShowForVbaFacilities
        fieldShowForVamcFacilities
        fieldTricareSpecificService
      }
    }
  }
}

fields that can be used in snake_case (convert to camel)

Alternatives to KISS

There really don't seem to be any alternative methods other than this to conveniently use an updated list that has drupal as the source of truth. As the editors are already using the taxonomy in drupal, we must use this method. The sugar on top of using redux is not significant and a simple ingestion of the data.

Other resources

KISS

Supplemental Status

xiongjaneg commented 1 year ago

@eselkin What's the process for refreshing data? How often should the process be refreshed, for example if a new taxon is added.

eselkin commented 1 year ago

I didn't see this. It would get refreshed at every build/deploy of content-build. I imagine content-build gets rebuilt far more often than taxonomies are added. But if an element is added between builds, I'd imagine it's possible to forcibly set off a build.

jilladams commented 1 year ago

Updated #14993 with pointers to these SPIKE results, and that ticket is queued for next refinement. SInce Jane is gone this week, and we won't get to the engineering meeting in th elast suggested AC before she's back, I'm closing this as done, and we can regroup in next FE prefinement about what happens next.

xiongjaneg commented 1 year ago

discussed at 10/19/23 engineering refinement