New sketchpad form


(Mouse55) #1

I’ve developed a sketchpad form that generally works well and is almost ready for posting on github (if I can figure out how to do that). I had attempted to post a previous version that didn’t have touchpad support (which was crucial) but didn’t get any feedback. It’s also possible that I didn’t upload it correctly. Briefly, it is a visit-linked graphic form wherein one can sketch any desired scrawl over a predetermined background of one’s choosing. Anticipated uses could range from drawing positions of lacerations over a facial background, for example, or perhaps relative sizes and shapes of various lesions over a human body background but it could also be utilized to save a signature over a consent or other administrative form. Essentially, it saves analog data (the sketch) in a digital format (in the database). I also use it as I’m seeing patients to keep quick notes (like a paper scratchpad) to aid my memory when I’m dictating later. There are still a few minor quirks however. The flow and end results work perfectly at a computer while working with a mouse. My desired workflow, however, would be with a stylus and touchpad (I use an Apple Pencil and iPad), as I don’t have easy access to a computer while working directly with patients. I presume that it would work with other touchpad devices but have no means by which to test them. But what works on the computer doesn’t quite work smoothly on the iPad. I can create and save the sketches appropriately but if I attempt to view the saved results on the encounter summary page (by clicking “expand all”, for example) the whole working non-“header” portion of the page rides upwards by 25 pixels or so (an amount equal to the vertical dimension of the little tab that reads “Summary” at the top of the lower portion of the page) and this then throws off the vertical component of the touch position for the page, which makes clicking on desired areas to collapse or edit the sketchpad a hit or miss option (mostly miss). I can always collapse everything by clicking the “View Past Encounters” button on the header and reselecting the desired visit but this doesn’t seem entirely professional.

Does anyone have any ideas where the code is that makes the little blue Summary tab disappear? Furthermore, why would it work differently on a touchscreen device than a computer screen with mouse? I can certainly put my existing code up on github, which might make following along with the above problem description a little easier. Thank you.


(Brady Miller) #2

hi @Mouse55 ,
When in doubt, post the code to github :slight_smile:
(I can then even have one of the Up For Grabs demo it for other users to test it).
-brady


(Mouse55) #3

I’ve uploaded (or at least tried to upload) a new folder called “sketchpad” to the interface/forms folder and then tried to create a pull request. First things first, let me know if the code made it through the system. We’ll see if that works then worry about the specifics of the code later. Thanks.


(Mouse55) #4

Sketchpad works in 5.0.1(7) but not in the up-for-grabs demo, which I note to be 5.0.2-dev. A first quick glance substantiates that jQuery-min-3-1-1 is no longer contained in public/assets, thereby making my use of that library invalid. Where is jQuery kept in the new scheme?


(Brady Miller) #5

hi @Mouse55 ,

Path for jquery 3.1.1 is here:
public/assets/jquery/dist/jquery.min.js

To get it to work in both versions, recommend bringing in the standard assets (includes jquery and bootstrap) via call to the Header::setupHeader (rec grepping codebase to see how used and will require use OpenEMR\Core\Header; in the script to be able to use the Header script)

-brady


(Mouse55) #6

Hmm. Maybe this isn’t ready for primetime. I changed the references to public/assets/jquery/dist/jquery.min.js but it still doesn’t work on the UFG Demo (maybe it takes some time for the changes to percolate through the system?). I’ll keep working on it but for whatever reason I can’t seem to install 5.0.2(dev) successfully on my Ubuntu 16.04 system so I have a hard time setting up a virtual test machine. Perhaps it’s because it’s using an older version of PHP (7.0). I’ll keep trying but this will take some time.


(Mouse55) #7

OK, I’ve installed 5.0.2(dev) on an Ubuntu 18.04 server and edited my sketchpad files so they work on my test server. I’ve uploaded them to my Mouse55/sketchpad repository but the Epsilon upforgrabs entity still doesn’t demonstrate the form. Maybe it will after the midnight update? I’ve done all I can for now and will tackle the other above-noted problems later.


(Mouse55) #8

Dang, it finally works! Now on to fixing the “little” things. Remember that the form has to be registered et al before it can be used.