OpenDataCapture icon indicating copy to clipboard operation
OpenDataCapture copied to clipboard

Upload data session

Open david-roper opened this issue 1 year ago • 0 comments

Description

Create a type of session in which the user can log an ID and import data via csv. The step by step process should go something like this:

  • select upload data session
  • once form is submitted redirect of a upload data page
  • select which instrument format you want to upload the data into
  • provide file dropzone for csv file to upload
  • let instrument validation schema validate csv data
  • if valid import data into the subject table

Note: file upload can be similar to what is done with the file dropzone component seen in databank

Process rundown

  • Create upload data session page
    • Add to “protected routes” in Router.tsx
    • Add to useNavItems hook
    • Once this is done, you should be able to navigate to an empty page
  • Nice interface to select instrument
    • call useinstrumentInfoQuery to get the list of instruments (via data property)
      • param kind should be form
    • Show at minimum title, maybe also other info
  • useNavigate hook returns navigate function
  • Call instrumentInfoQuery.data.map() to iterate through each item
    • Have user select title of instrument (onclick function should call navigate(id))
  • Have upload interface
    • Create page and add to navItems as you did for the data session page
      • Have a :id param (look at other items to see how)
  • useParams hook returns params
    • Get id from params
  • Convert csv into json
    • make sure to infer data types within csv properly
  • Send to backend for validation

Estimated Difficulty

High

Priority

Medium

david-roper avatar Aug 14 '24 18:08 david-roper