dropdown search in databasejoin

cap

Member
hello, in the attempt to have the db faster i have done some change and i have osme problem now, i have 10 record inserted now..so it still not a big problem but i need to solve this

So i have in the questionnaire form a radiobutton element which have as choice yes or not, and i have set it both for value and label
Before , using a calc element i would assign a value according to the choice..
E for YES and NE for NO
To make it faster i have changed the value of the radiobutton, so that the label YES would have the value E, and the label NO would have the label NE
But now, when i make a search in the radiobutton, with a database join...i see as choice the VALUE...but i want to see the LABL.SO i want to see YES/NOT and not E(NE as i am seeing now
How do i change this?
 
Hi there
It seems we are back on square one :) The database stores the value, if you want the label instead, value and label have to be the same in the radiobutton.

If you give me the three questions of your form in real (not just yes/no, D/E) I may be better able to advise you.

Kindly,
Lorenz
 
ok
i have a questionnare where all the questions have same or very similar pattern:
Question: does the patient have taken pills before?
Answer (radiobutton): Y/N
next..according to the answer we should know if the patient is eligible for pills. (this is a calc element called "calcE") there are 3 options overall but only 2 for each question. The options are E, NE,D (eligible,not eleigible, discuss)
So it may be
in a question can be that if answer is Y then calcE= E, or if answer is N then calcE=NE
Sometimes may be the reverse (N=E and Y=NE)
This is the basic operation

Some other times there could be another variable, calcE can assume the value D..for example if answer is= Y the calcE=D... (or the other way round, if answer=N then calcE=D)
When a D come out, a second calc element (calcD) is programmed to display a text..so:
answer=Y; if answer =Y then calcE=D; if calcE=D then calcD output"consider the possibility of pills"

This ia how i did it a the beginning, with all if the statement each other related

The frontend work was slow..when i click on Yor N it took a little while to print E or NE with only 2 elements, it tooks more when the 3rd element was involved also ( in both cases i could see the "things" spinning and the text LOADING...not really much, a couple of seconds..but too much for me, for this kind of operation

So someone suggest me to use direct link and no eachother relation, to make it faster
so i made for the radiobutton LABEL Y and N and the value E or NE or D according to the question need
Then in calcE i just use return radiobutton
and when i needed calcD i used..if radiobutton=D then return text

I have to say that it is not faster than before..it is the same...but i don't wan go and change again 3 element x 35 questions..and there are 10 record inserted already
As i see advanced search return the label value..so i though it could be possiibe to do it also in the database join elements i have used in the search form

That's all
Hope is clear enough

p.s.
now i remember..that someone that suggested me was you! :)
 
Last edited:
by the way..i just noticed now, that if i disbale the radiobutton option "button group" it is faster, how can it be possible??
 
Hi cap!

So let me repeat to see if I have understood. There are a number of questions about taking certain medicine (element 1). Depending on the medicine, element 2 indicates if the patient is eligible or nor or further discussions are needed. In some case the third element is triggered displaying some more information.

The key point for me is that the second element (calcE) is different for each type of medicine, right? What you could do is store all the medicines and their particular "calcE-outcomes" in a separate list. The second element (now calcE) could then simply display the information from that list depending on the value of element one, using a databasejoin or a cascadingdropdown (using one of the plugin's other display option then dropdown). Like this no calculations are needed. The databasjoin will still need some time to display, but maybe less then a calculation.

Hope this helps.

Kindly,
Lorenz
 
make it more general..the questions asks yes for medicine but also for general health conditions and similar
Going in details..it is a questionnaire that doctor uses to understand if a patient is selectable for a new teraphy.
So they collect a series of info, investigating, on history and present of patient..terapy, healt condition, other things that may interfere
All the questions, yes have a Yes, or Not answer, and depending on the question, the "verdict" can be Eligible, NonEligible or Discuss. When Discuss comes out a third element would state the indication for the discussion
The second element just state E, NE or D..that's all we need!
But a part of speed, now the problem is that for the way i ha setup the db..the databasejoin will display the value for the radiobutton, rather than the Yes or Not
And it is important, instead, to be able to search for ..let'say "all patients that have answered YEs to question number 5, or all patients that have answere NO to question 10 and YES to question 15
In advanced search..i can see the label value of the radiobutton..so ui can select YES or NOT for the search
In databasejoin no..i see the rawvalue i set..so E,NE,D..and this is not what i need
I will search for E, NE or D, on their appropriate element, that is the the calcE..that will be another search

In the end, i must be able to search for Y/N of radiobutton, and E/NE/D in calE..separately or combined..
All this search (with sometimes the aid of the second calc element ) will tell us what are the candidates for th enew terapy
hope this is clear

p.s.
I have found that with advanced seacrh i can be fine..can do all i need
I dont like to much the graphic aspect...with so many elements one could get confused watching at that long list
That's why i would like to have a search form where all the questions can be organized in groups of questions and watched in a more pleasant manner
 
Last edited:
Hi there!
That makes it clearer, thanks. I definitely would go for two lists: one for the patients and one for the medicines. This would also allow you to easily change the details without having to adjust the calculations inside the Fabrik element. In fact, the doctor could make them himself.

The elements would then be like this:
Element one: radio button yes/no for taking the medicine (for value and label)
Element two: calc with a simple database query in the medicines list to get the E/NotE/D outcome for the particular medicine.
Element three: is part of the medicines list and will be returned together with E/NotE/D.

The medicine list would then look like this:
Name, E/NotE/D, Details for D (this field remains empty if not applicable)

All this is under the assumption that there are no other conditions that define the E/NotE/D outcome, like age, gender, current illnesses etc. of the patient. And as there are possibly quite a number of medicines you would need to make one question set like this per medicine.

Kindly,
Lorenz
 
ok i see the point
i am a bit confused though..
i don't understand what is this suggestion for...to reduce that slowness?
Cause here i was asking on how to solve that issue of dropdown database join element showing values instead of label
So i think you are suggesting this to make faster those element calc

That means i should start from scratch, and also i have 30-40 records inserted already..and i don't want to get in trouble with these data and possible loss
Also i rather invest my time in having a more user friendly interface, as now the advanced search panel it is not satysfyng me...and the search form that could be better has that issue with database join element
The slowness is now the least of the issues..it is not unbearable, or stopping the user work..it is more somehing that disturb me as programmer..as i don't understand why it is slow for such easy db
So..i'd rather try to do not touch records, or modify heavily the structure again. i might chane aain the radiobutton value and the calc element related for the search form to be usable
 
anyway i might try to build it as test wlike you say..i haven't understood how to link the medicine list to the name list....
If it is really much faster then..would it be possibile to transfer data?
 
Hello
Guess I mixed up some of your threads :)
My suggestions help in solving the problem with a calc element depending on another. But it might also have an effect on the speed of the calc element; I suspect your calc is rather long with a lot of ifs. With a separate list the database is doing the ifs not the PHP code.
I think it could still be possible to add the medicine list, just don't delete any of the old elements in your questionnaire. Or you invest half a day to go through the 40 entries and adapt them for the "new system".

Kindly,
 
Actually there are no more if...only one in the second.calc, which is not always present. The first calc just return the radiobutton value, according to your first suggestion( hence the issue wirh databasejoin). The second calc only 1 if. If radiobutton=d return text
Nothing else
From this my surprise for the slowness (that i say it again is bearable for users)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top