nus-cs2103-AY2223S2 / pe-dev-response

1 stars 0 forks source link

Vaccine "Infinite Loop" #2852

Open nus-pe-bot opened 1 year ago

nus-pe-bot commented 1 year ago

Able to add a vaccine as its own requirement

Screenshot 2023-04-14 at 2.58.05 PM.png


[original: nus-cs2103-AY2223S2/pe-interim#2242] [original labels: severity.Low type.FunctionalityBug]

francisyzy commented 1 year ago

Team's Response

This is not an infinite loop as the patient can still take the vaccination "VACX" IF they have not taken any vaccination that has a "VACX" group. So a patient that has not taken any vaccinations can still take that vaccination.

Note too that the names of the vaccination and the groups of the vaccination are different things. While checking if the patient can take the vacicnation based on its vaccination history, VMS checks the groups of the vaccinations that the patient has taken. This has been explained clearly here (pg 23):

image.png

The meanings of each types are also explained in detail here (pg 12):

image.png


However, if your intened version of "infinite loop" is something like this instead:

image.png

It would still not be an "infinite loop" as a patient that has not taken a vaccination that contains the "VACX" group can take the vaccination.

This can be demonstrated with the following command:

  1. Clear all data (this is so that you can copy and paste the following commands exactly): patient clear --force true and vaccination clear --force true
  2. Add vaccination "VACX": vaccination add VACX --g VACX --h NONE::VACX
  3. Add a patient that has not taken that vaccination (this command will add a patient that has not taken any vaccinations): patient add --n NONE--p 445 --d 0001-1-1 --b A+
  4. Schedule an appointment: appointment add --p 1 --v 1 --s 2024-1-1 --e 2024-1-2

The appointment will be scheduled.


If "infinite loop" concerns other requriement types as well, for example a case like this:

image.png

This would just mean that the patient will have to take a vaccination that has the group "VACX" before being able to take this vaccination. Vaccination groups are not unique as well as demonstrated in the start up sample data with multiple vaccination containing the "DOSE 1", "DOSE 2", etc groups.


If the issue then is about intersecting requirements concerning the NONE type, this has been state in the planned enhancement section:

image.png

Duplicate status (if any):

--