Strange radio button behavior

aethelwulffe wrote on Monday, August 12, 2013:

http://starfrontiers.org/khvcode/openemr/pmm.zip
The above is a Psychiatric med management form. Looks pretty nice and all, but has an issue.
There is one section of check boxes that will not stinkin’ stay set.
The form does not suffer from a paucity of code, as being lazy I simply ran with the full-on New/View/Report/Save/Table/Info format. Bear with my indiscretion.

[CODE REMOVED DUE TO SHITTY FORUM TRYING TO RENDER IT, guess you have to look at the files! Tildes do not work!]

There are three sets of radio buttons, psycho1, psycho2, and psycho3.
I save the form, everything is fine. I edit it, sometimes it shows up ok, sometimes some of the values are not set in the DOM. Sometimes this happens in the report, sometimes in the view. It is inconsistent all over the place. I have set all the values (and the fields) to straight integers, I have tried alpha strings, used === comparators, changed the form field names, removed the UL and li tags, removed code on either side of the stuff…checked it against multiple IDE’s, you name it.
It is true that I may well have no idea what I am doing in general, but I had been convinced over the last couple of decades that I could code radio buttons. Maybe I am nuts. I have spent about 6 hours just trying to get these things to work consistently. It seems like they work, then “poof”.
One side note: I seem to remember back in my days of using LBF forms that radio buttons were screwing up, and I had to change them out for list boxes.
I am running the older xampp package (still).
Any ideas?

fsgl wrote on Monday, August 12, 2013:

Radio buttons, if chosen as Data Type in the layout, will be missing in the actual form. I noticed this when constructing the Eye form for non-typists.

The problem has been reproduced in the regular Demo just now.

Per Pimm, Rod Roark built the LBV form, therefore it would be good to have some insight from him.

blankev wrote on Monday, August 12, 2013:

I just tried Demo versions of Open-EMR, but did not find anything under Forms nor Layout Based form.

Where can I see and experiment with the Psyche1, 2 and 3 FORMS?

blankev wrote on Monday, August 12, 2013:

I just tried Demo versions of Open-EMR, but did not find anything under Forms nor Layout Based Visit form.

Where can I see and experiment with the Psyche1, 2 and 3 FORMS, if it is the Zip File I can’t help you since I can not include it in the Database for Demo Version latest or Developers version.

If the original form that you used as example for your Psyche1,2,3, works by including it in your Open-EMR version, there is a slight typo or an experimental field that is giving you the problems.

Better ask a Developer for advise.

fsgl wrote on Monday, August 12, 2013:

Hi Pimm,

I reproduced the problem with the Comprehensive Ophthalmic Exam NT form in the regular Demo, not the Psych. forms.

aethelwulffe wrote on Monday, August 12, 2013:

OK, the zip file is a custom form. I referenced the issue of the LBF forms, as it MAY be related. I am a developer, as much as many here are…though web scripts are not actually my bag, being a C++ and Delphi guy. That is irrelevant. I can code some php and html. This is not a complex deal. I am indeed asking a developer for advice in any case, as this is the developer form.
In the form I have posted, it is an issue with the FIELDS “NAME=psycho1”, “psycho2”, and “psycho3”. Netbeans sees no issue with my syntax. I have tried many variations in the code, even pure straw grasping like removing form tags and such. The issue does not go away. They save, you view the report and they are all there, you use view to edit, one might disappear, you save it, another might disappear…then again them might all work. Looking at the database values, they all seem to save properly each and every time. They simply do not get populated into the DOM data dependably, which makes me very very curious. I HAVE REPLICATED this with an LBF form today. I find that this also happens with the standard Review of Systems form, but I can only get it do it with the field for Arrhythmia.

blankev wrote on Monday, August 12, 2013:

I just checked at the Demo Version and it might have to do with the php file instructions. If you take a look at the Demo version for production there is the eye form under layout based forms.

AM and PM can not be clicked. Possible these have to be check boxes and these are only one character wide. Y or N, 1 or 0 etc for the Database. The radio button makes a choice of the two it is AM or PM it can’t be both. But has nothing to do with time or date.

Could it be the date is gathered and is related to the Encounter date? This is the only date that really makes a change. Or could have to do with EU-VS dates configurations.

3-8-2013 is third of August or eighth of March…

For me using European as favorite, it had been an issue in the past. But was solved as far as I remember. But with older forms it still could be a problem.

In case of more questions, pls ask a professional.

aethelwulffe wrote on Monday, August 12, 2013:

I am a professional dude. I just try to adopt a self-depreciating tone to hide my enormous ego. These are the developer forums, not the idiot help desk, which is why I posted here. I have some passing familiarity with OpenEMR, as I have been working with it for about 5 years as a customizing developer and am on the OEMR board of directors. Please refrain from continuing to indicate I should cease posting on this subject and seek out a “professional”. I know all the professionals involved with OpenEMR. LBF is not the primary concern anyway, it is the behavior of radio buttons in the forms API that I am concerned with.
My demo install is at dev.arsponline.org. I’ll put the form up on there, along with other examples that display the same behavior.

blankev wrote on Monday, August 12, 2013:

Ohhhhh this is great news. Don’t worry about my comments. I do not worry about your comments.

aethelwulffe wrote on Monday, August 12, 2013:

Forgive me Pieter. In addition to being a jerk, I am a little grumpy today.

blankev wrote on Tuesday, August 13, 2013:

Must be your radio button. Don’t press the radio button, it could make you older or younger, or worse you might be the same age. Now I do worry about your comment. Please find a solution, it is terrible if you are grumpy even if it is a little.

YOU ARE FORGIVEN, but I really don’t know for what ;-))

blankev wrote on Tuesday, August 13, 2013:

Dear fsgl (fyio),

in the demo stable version I just changed your time and AM and PM into radio button behavior as I understand radio buttons should be used, I kept them optional as in the original, but that is not what it should be, it would make everybody confused.

For this I had to make a new list, the am-pm list with the options: am order 1 and pm order 2

Next include radio button and choose am-pm -list for the radio button

I wanted to get it just behind the time but that I can not accomplish. Should be easy if you know how.

bradymiller wrote on Tuesday, August 13, 2013:

Out of curiosity? what’s worse? psycho1 or psycho3?

bradymiller wrote on Tuesday, August 13, 2013:

On a quick look, appears psycho2 is probably the worst. First, some sanity testing could be to just see what happens after you grab the object with below debug statements that will go to your log:
error_log(“DEBUG_psycho1:”.$obj{“psycho1”},0);
error_log(“DEBUG_psycho2:”.$obj{“psycho2”},0);
error_log(“DEBUG_psycho2:”.$obj{“psycho3”},0);

(BTW, php error_log() and javascript alert() are my favorite debugging tools)

-brady
OpenEMR

fsgl wrote on Tuesday, August 13, 2013:

Thanks, Pimm.

I assumed that one can just choose Radio Button in the Data Type drop down without constructing a list.

The real form in the Wiki does not have radio buttons because of my lack of knowledge, therefore readers will not be flummoxed.

blankev wrote on Tuesday, August 13, 2013:

As long as you need a YES or NO you don’t need
to make a list or change something. for AM and PM that looks a lot nicer you might need it.

How did you manage to include the Ophthalmic-Form in the Demo version? Do you have more powers than a normal visitor?

Also: Do you know how to tweak the latest Developers Demo V4.3 from within Database?

Tnx, Pimm

fsgl wrote on Tuesday, August 13, 2013:

The Eye form was imported (Configure Export/Import from Globals->Features, then Backup->Import Configuration). Tony McCormick asked me to export the lbv.sql file so that the collection of the Eye forms can be made “share-able”. If one can export, surely one can import.

I am beginning to get my toes wet in Database. No disasters thus far. And thanks to you, Cverk & Kevin, if catastrophe strikes, the backup pulls the bacon out of the fire.

blankev wrote on Tuesday, August 13, 2013:

OK, seems I have to work with import and export in Demo Version ok for production implementation.

In Dev Demo Database etc does not accept import of SQL files.

So if one can: export in Demo Version Dev. one can NOT always import. Needs some fine tuning. Tony McCormick could make the changes in PHPAdmin for Dev Demo?

PHPAdminI understand the CSV file, but what can I do to learn the SQL import? Or how to go fromCSV to SQL? Can you explain?

fsgl wrote on Tuesday, August 13, 2013:

Just imported the Eye NT form into the Dev. Demo.

Database->layout_options, pages 5-7, seems to have the tables for the form.

Tony said that this can only be done via mysql command or PhpMyAdmin.

The form originally had sets of Components in NationNotes, which were lost in the export/import process.

What are your thoughts?

blankev wrote on Tuesday, August 13, 2013:

I just a moment ago of this writing I did have a look in PHPMyadmin, but for me it is still impossible to import a file.

The results for me are as follows

This is the message I get from Dev Demo Open-EMR.org trying to do an IMPORT:

Error in Processing Request
Error code: 500
Error text: Internal Server Error

and when I try to use SQL:

The mysqli extension is missing. Please check your PHP configuration. Documentation ?

So what can be wrong with my settings I get these error messages? This is my conclusion since you again could import the Eye file.