Closed sxgormley closed 4 years ago
@MikeyManoguerra @sxgormley Is the Figma board still an accurate representation of the SEP Search form? Site ID, SEP ID, last name, dob, mother's first name, needles in, needles out, exchanged for, and visit date. For each of these fields I need the corresponding parameter name to pass to api/participants and api/sep. I'm also not sure why Site ID is above the form title.
Yes, the figma board is accurate. the only thing missing is a 'clear' button. I should have mentioned this when I was formulating the ticket, can you add a clear button?
the endpoint is api/sep/
visit, site, created_at, needles_in, needles_out
Are the fields.
Shoot and this was a good question because another thing you have to do before submitting to the api endpoint is to create a visit.
and to create a visit, you need a program and service. im not sure if we have the real program name in here. so just use queueStore.queues[0].id
for the program, and queueStore.queues[0].services[0].id
for the service, and leave a big //TODO TEMP FIX ASAP
comment.
FYI we also do not want to create a front desk event for these sep visits, but ill write a specific ticket to fix this visit/ fde stuff and for now just hardcode it and let it create the front desk event for now.
Finally, the site will remain constant over the course of a user being logged in, so you can actually save this as a piece of global state. there are no sites in the db at the moment. ill get you that by eod tomorrow
@LizKalter ^^ if this is confusing or this feature is now too crazy for one ticket let me know.
@MikeyManoguerra Sorry, but the information here doesn't completely align with what I am seeing on the Figma board. If I'm looking at the wrong thing please let me know.
I am seeing 9 fields:
Site ID (Why is this positioned above the form title? Does it have some special significance or behavior?)
SEP ID
Participant's Last Name
Date of Birth
Mother's First Name (Note that this is first name, not maiden name, so I'm not sure if this is correct.)
Needles In (These 3 needle count related fields are dropdown menus. What are the values in these menus supposed to be?)
Needles Out
Exchanged For
Visit Date
Can I get the names that these 9 fields correspond to on the backend? It might be helpful to have some sample data as well. For example, I have no idea what kind of input is expected for Site ID or SEP ID.
Where should the clear button be located and which fields does it affect?
Can you tell me which fields are required?
The original ticket description mentions "datetime defaults to now." What is this in reference to?
Thanks!
I obviously don't understand how github notifications work. sorry for the delay.
The site id will not change across the the session, bc someone will be at the same site all day and checking in multiple people. that is why it is separate and significant. This should exist as a global piece of state, and not be cleared when the form is cleared. site end point now has retrievable data at /api/site/
What the form is displaying to the user and what the sep
endpoint accepts are different. however, the user does not know anything about visit ids ( or may not even care that a database "visit" is created.) we have to create a visit, for data integrity and db relations.
so even though this sep form displays participant info, all we really care about is the participant id saved in a useState, as alluded to in the original ticket.
the full flow of this form is:
sep
endpoint, using the site id in global state, the visit id returned from the visit you just created, and the needle countssep
endpoint requires :
to submit
the " time defaults to now " refers to the submission time. so you not need to include a 'created_at' field at all. i thought we had discussed submitting at a later time, but i guess that did not make it into the design so ignore
sep_id is a new value on the participant object, along with maiden_name. these can be used as search parameters to filter participants.
The needle dropdowns are number values, lets say btwn 1 and 20. im not sure what the upper limit should be at the moment.
I missed the fact that there is an exchanged for dropdown. leave that out for now. there should only be two dropdowns, needles_in and needles_out
I have been focused on building out the back end infra structure for these endpoints (site, sep). I neglected the front end api infrastructure. if you want the seperate tickets for these things (site/ sep api calls, site state setting, etc let me know)
Hi @MikeyManoguerra ! What is the status of this ticket?
This form has two actions. one to search at
/api/participants
, and one to post at/api/sep
/validators/
. doesnt have to be exhaustive, but make sure things are present