episphere / quest

experimenting with the idea of a questionnaire markup
https://episphere.github.io/quest/
2 stars 11 forks source link

Variables in ValueIsOneOf function are not getting converted #422

Closed joshid-ims closed 1 year ago

joshid-ims commented 1 year ago

@danielruss

This question is not converting variables SEX and GEN correctly. This is working unconverted but not when converted. I had tried quotes around numbers as you had suggested first too. That did not work so tried removing quotes. They are converted in another question where only equals and or is used.

[SRVSCR_BRSTSCREEN_V1R0?,displayif="ValueIsOneOf("SEX",0,2) or ValueIsOneOf("GEN",2,3,4,5,55)"] Breast Cancer Screening Have you ever had any of these procedures to check for breast cancer or other conditions? Select all that apply. [0] Mammogram An x-ray of the breast. Involves standing in front of mammography machine that compresses your breasts between 2 plates. [1] Breast MRI An MRI (Magnetic Resonance Imaging) of the breast. Detailed pictures of the inside of your breast are taken while you were laying down in an MRI machine. Usually requires getting a dye through a needle in your arm. [2] Breast Ultrasound An ultrasound of the breast. A healthcare provider moved a wand-like device called a transducer over your skin to make the images of your breasts. [3] Breast Biopsy Small amounts of the breast are removed with a biopsy needle or during surgery. The breast tissue or cells are then looked at under a microscope to check for cancer or other problems. [88*] I have not had any of these screening tests -> SRVSCR_OVSCREEN_V1R0 <#NR -> SRVSCR_OVSCREEN_V1R0>

boyd-mj commented 1 year ago

@joshid-ims is the code not converting as expected? If so, this is probably a question for Kirk, who may not have access to this Github.

kirksnyder commented 1 year ago

We may (or may not) have a transformer issue, but the first problem to address is that the untransformed code is raising an error in Quest: [SRVSCR_BRSTSCREEN_V1R0?,displayif="ValueIsOneOf("SEX",0,2) or ValueIsOneOf("GEN",2,3,4,5,55)"]

Here's the screenshot @joshid-ims sent me: MicrosoftTeams-image

danielruss commented 1 year ago

Dont capitalize the "V". The function is "valueIsOneOf" not "ValueIsOneOf"

joshid-ims commented 1 year ago

We get this:

image

joshid-ims commented 1 year ago

[SRVSCR_BRSTSCREEN_V1R0?,displayif="valueIsOneOf("SEX","0","2") or valueIsOneOf("GEN","2","3","4","5","55")"] Breast Cancer Screening Have you ever had any of these procedures to check for breast cancer or other conditions? Select all that apply. [0] Mammogram An x-ray of the breast. Involves standing in front of mammography machine that compresses your breasts between 2 plates. [1] Breast MRI An MRI (Magnetic Resonance Imaging) of the breast. Detailed pictures of the inside of your breast are taken while you were laying down in an MRI machine. Usually requires getting a dye through a needle in your arm. [2] Breast Ultrasound An ultrasound of the breast. A healthcare provider moved a wand-like device called a transducer over your skin to make the images of your breasts. [3] Breast Biopsy Small amounts of the breast are removed with a biopsy needle or during surgery. The breast tissue or cells are then looked at under a microscope to check for cancer or other problems. [88*] I have not had any of these screening tests -> SRVSCR_OVSCREEN_V1R0 <#NR -> SRVSCR_OVSCREEN_V1R0>

danielruss commented 1 year ago

Try with single quotes before valueIsOneOf and after last closing parenthesis:

displayif='valueIsOneOf("SEX","0","2") or valueIsOneOf("GEN","2","3","4","5","55")'

joshid-ims commented 1 year ago

This code is still not working. Giving same error as Bad displayif function.

[SRVSCR_BRSTSCREEN_V1R0?,displayif='valueIsOneOf("SEX","0","2") or valueIsOneOf("GEN","2","3","4","5","55")'] Breast Cancer Screening Have you ever had any of these procedures to check for breast cancer or other conditions? Select all that apply. [0] Mammogram An x-ray of the breast. Involves standing in front of mammography machine that compresses your breasts between 2 plates. [1] Breast MRI An MRI (Magnetic Resonance Imaging) of the breast. Detailed pictures of the inside of your breast are taken while you were laying down in an MRI machine. Usually requires getting a dye through a needle in your arm. [2] Breast Ultrasound An ultrasound of the breast. A healthcare provider moved a wand-like device called a transducer over your skin to make the images of your breasts. [3] Breast Biopsy Small amounts of the breast are removed with a biopsy needle or during surgery. The breast tissue or cells are then looked at under a microscope to check for cancer or other problems. [88*] I have not had any of these screening tests -> SRVSCR_OVSCREEN_V1R0 <#NR -> SRVSCR_OVSCREEN_V1R0>

[SRVSCR_BRSTTISS_V1R0?,displayif='valueIsOneOf("GEN","2","3","4","5","55") or equals(SEX,2)'] Have you ever had breasts or breast tissue? (1) Yes (0) No (77) Don’t know

boyd-mj commented 1 year ago

@danielruss any ideas on the above?

danielruss commented 1 year ago

valueIsOneOf("GEN","2","3","4","5","55") or equals("SEX","2")

You cannot mix the old and new functions. I am going to create a function called "equals" so this does not keep happening.

should read

[SRVSCR_BRSTTISS_V1R0?,displayif='valueIsOneOf("GEN","2","3","4","5","55") or valueEquals("SEX","2")'] Have you ever had breasts or breast tissue?
(1) Yes
(0) No
(77) Don’t know