Hello All,
I'm taking a look at HTML development again. I have a couple of questions for the group.
1. How do you save a value to the flowsheet?
I took a look at the example form and the other html forms and found the following in the emrapiaccess-service.js file:
Since GE/Virence hasn't provided any documentation other than the example form (that I'm aware of), it seemed logical to toss something at this function and see if I could save to the flowsheet. I pasted the the dependencies from one of the Virence forms into my new form and created a text area:
It renders in the EMR fine. I get a script error after I enter some text and click again away from the text area. I haven't touched Javascript/HTML in a while so there could be a syntax error in front of me here that I'm not seeing. Does anyone have any thoughts?
2. In addition to the example HTML form and looking at CCC forms, has Virence provided any other documentation regarding HTML development or at least the API files?
3. For those of you who are doing HTML development any suggestions regarding development workflows? Debugging?
Thanks in advance,
Brad
You probably need quotes around HPI, and hpiInput is an html element, not a javascript variable. I would just pass the current element value, you could do it like this -
<textarea id=“hpiInput” type=“text” onchange=“setObsValue('HPI',this.value)”></textarea>
Otherwise to get the element value in javascript you need
document.getElementById("hpiInput").value;
or in jQuery (which the GE forms use, and I woudl recommend)
$('#hpiInput').val();
With HTML forms, google is your friend. You could search something like 'Javascript pass element value to onchange event' and get thousands of examples and explanations. Its one of the big benefits of using a universal language for form building instead of a proprietary one like MEL.
Another question. I have played around a little bit and have gotten things working better by testing in a browser outside of CPS. However, I am now having trouble updating the html file within CPS. This is the process that I have used.
1. Copy the updated html file into the subfolder I created in the encounter forms folder on jboss.
2. Modify one of the stock clinical kits to point to the html file and a place in the file structure of the EMR for my form. This is what that kit looks like:
[HTMLEFS][1][HPI][Enterprise, Testing][HPI General; Brad Hoover, Preferred Primary Care Physicians 12/13/2018 1:44 PM EST][HTML Form] [//localserver/EncounterForms/HPI/index.html]
This worked great the first time I tested the form. I thought all I really needed to do was copy my updated html file over and it should be there since all the pointers in the clinical kit are the same. However, I am not seeing any changes within CPS. I have reimported the clinical kit. Logged out of CPS and the terminal server I was on, but it does not refresh. Any thoughts?
Thanks,
Brad
The issue is the browser cache. In index.html, add this inside the head tags
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
<meta http-equiv="PRAGMA" content="NO-CACHE">
That should take care of the main page, I also use version control on the supplementary files.
<script language="javascript" src="js/foo.min.js?version=1"></script>
Then anytime you make a change to the file increase the version and the changes will be imported. Otherwise it should also work to clear the browser cache in IE and that should also update the form for testing purposes.
You will not need to reimport in the CKT for any reason.