Open omahane opened 7 months ago
@omahane This is one that we weren't able to get to in refinement this week but is on the list of potential tickets for next sprint. Can you take a look and see if async refinement if feasible?
The size of this issue depends on the following:
This doesn't TRULY block #18003. The Allow Only One functionality works correctly for Vet Center Editors when they try to add a duplicate service via Add Content.
However, in order to replicate the existing functionality of the IEF, this has been included in scope, so makes sense to do before the final step.
Removed this as a blocker to #18003 as this is a nice to have and not critical to achieving the functionality
@omahane estimate on LOE here?
I would like to refine this before estimating. I put that we should consider all facility services when doing this, but we can also just do Vet Center. The effort required would differ.
@jilladams will split out VAMC health services into a separate ticket
I will change epics.
Glossary for new people
Problem Statement
On the Create Service content form, Editors first select their facility, then select a Service name from a dropdown, for the type of Service they would like to create for their facility. (Services map to VA Service taxonomy terms for the Facility type.)
Currently, the "Service name" dropdown displays all Services for the facility type, regardless of whether a Facility Service for that Service+Facility combination has already been created. This means an editor may select a Facility, Service, populate the entire Create Service form (which is time consuming), and then receive a validation error on save saying that the given Facility Service already exists & cannot be saved.
**Example screenshot**
![Screenshot 2024-08-16 at 1 33 16 PM](https://github.com/user-attachments/assets/e694776e-2f47-465b-bcaa-701c0450c76a)We should only show options in the "Service name" dropdown for Services that do not exist as a Facility Service for the given Facility.
Question
Do we need to handle this for VAMC System Health Service as well? That one acts differently, and you don't select a Facillity, you select a VAMC System section. Should it have its own ticket, or does it make sense to roll up into this ticket?
User story
As an editor, when creating a new Facility Service, I want to choose from Services that are not already in use on a Facility Service for my Facility.
Implementation steps
Example
Using a hook in the IEF (This is for reference only. Remove before closing ticket.)
As of 2024-03-28 (commit 4e254ffd1492344e12d422e8577609772bdbef95), the inline entity form (IEF) on Vet Centers reduces the options on services by the following code in
va_gov_vet_center/va_gov_vet_center.module
:We need to be able to do the same when the list of possible services is being shown on the form regardless of IEF. Ideally, this would happen for VAMC, Vet Center and VBA.
Using a PHP service
As of 2024-07-24, there's a
hasService
function inva_gov_vet_center/src/Service/RequiredServices.php
. This is the sort of thing we would like to know for any facility type, again, ideally.If so, we'd need to create a new service that accounts for the differences in the facility services.
Acceptance Criteria