department-of-veterans-affairs / abd-vro

To get Veterans benefits in minutes, VRO software uses health evidence data to help fast track disability claims.
Other
18 stars 6 forks source link

Preliminary research into tracked item APIs #3207

Closed mackhowell-nava closed 1 month ago

mackhowell-nava commented 1 month ago

Things we know about:

Things we've seen:

See also:

Potential product task: Reach out to Nathan Jolly.

nanotone commented 1 month ago

Results from investigating the feasibility of using BGS for working with tracked items:

bgs-ext, the Ruby gem that vets-api uses for making BGS calls, has a tracked_items service which supports one method, find_tracked_items (by claim ID). In vets-api staging, this can be invoked like

fs = Form526Submission.find(1366)  # VFN 796378881 has results on claim 600442578
key = fs.form['form526']['form526']['veteran']['emailAddress'].first(39)
ti = BGS::Services.new(external_uid: fs.user_account.icn, external_key: key).tracked_items
ti.find_tracked_items(fs.submitted_claim_id)

which returns a data structure that looks like

{:benefit_claim=>
  {:name=>"BenefitClaim",
   :dvlpmt_items=>
    [{:jrn_dt=>Wed, 17 Jul 2024 12:37:27 -0500,
      :name=>"DevelopmentItem",
      :claim_id=>"600527334",
      :create_dt=>Wed, 17 Jul 2024 12:37:26 -0500,
      :create_ptcpnt_id=>"601227029",
      :create_stn_num=>"322",
      :docid=>"1130103",
      :dvlpmt_item_id=>"499228",
      :dvlpmt_tc=>"CLMNTRQST",
      :req_dt=>Wed, 17 Jul 2024 00:00:00 -0500,
      :short_nm=>"Claim for a Specific Evaluation",
      :std_devactn_id=>"38976",
      :suspns_dt=>Wed, 17 Jul 2024 00:00:00 -0500},
     {:jrn_dt=>Wed, 17 Jul 2024 12:36:28 -0500,
      :name=>"DevelopmentItem",
      :claim_id=>"600527334",
...

Other documented methods on the TrackedItemService can be invoked by directly calling the SOAP method:

response = ti.send(:request, :find_tracked_items_by_file_number, "fileNumber": fs.birls_id)
response.body[:find_tracked_items_by_file_number_response]

This should presumably apply to write methods as well, including ManageTrackedItems and deleteTrackedItems, although we don't have documentation on the business rule governing when these operations would be allowed.

nanotone commented 1 month ago

Working understanding of the data structure resulting from find_tracked_items:

dvlpmt_items contains a list of tracked item objects, with the following business-relevant fields:

The response also includes a list of letters, each with these fields:

nanotone commented 1 month ago

I should also mention that the Ruby gem also supports a separate BGS service DocumentService, which to my knowledge is currently used by Caseflow to generate letters and associated tracked items for HigherLevelReviews.

mackhowell-nava commented 1 month ago

From Nathan Jolly in Slack in response to if he knows of any more APIs or resources:

Do you know if the received date is set for all tracked items, of is that used conditionally?