For anyone that has built custom HTML forms -
We are trying to build one with a large text area and can not get the enter key to create a new line. Has anyone been able to do this? Thanks
You should use a <textarea> control. See: http://www.w3schools.com/tags/tag_textarea.asp for more details and example.
aaltotsky:
That is the control we are using, the enter key just doesn't do anything, like its blocked. Is it working for you? Any advice on what to look for?
It's true. The enter is disabled. Try to use Ctrl+m as temporary solution.
I may build the JS function for textarea. This issue is with WebBrowser control and not with your page.
gibsonmi: I researched a bit more and discovered that Enter does not pass to HTML form. The Enter is captured on the top level window. There are few solutions I could suggest:
- Use Ctrl+m for carriage returns
- Create an ActiveX component that will capture the all keyboard event and pass it to form as Ctrl+m
- Create a pop-up with textarea control and use IE to enter text. (The latest version of $mdObject demo page has example how to open HTML form in pure IE. )
- Use modal dialog $mdObject.emr.window.openDialog. The enter is working in it just fine.
For textarea control, I was able to just put a listener for e.keycode == 13 and do nothing when it is pressed. This seems to fix it. The enter key is ignored at a higher level in the window that it spawns from, so you can't even catch the key event.
gibsonmi, aaltotsky:
For inputs that go to DOCUMENT variables or Obs terms, are you using onblur, onchange, onclick, etc. to handle the assignments? Or are you assigning them when the window is closed? I'm trying to find the best way to write up my text translations that doesn't cause the system to slow down too much.
Also, do any of you know what {RELEASE_CLINICAL_LOCK("LOCK_NAME")} and {ACQUIRE_CLINICAL_LOCK("LOCK_NAME")} do? I saw that GE uses these in their HTML forms.
mikeseale:
I'm not sure what you did, but your code does not work on CPS12 SP8.
May be you can share an example of your page. Did you do anything specific with clinical kit? Are you using EMR?
The onblur is the best place to associate DOCUMENT variable assignment in case if the form somehow will not fire the onunload event.
I'm not sure what the ACQUIRE_CLINICAL_LOCK/RELEASE_CLINICAL_LOCK will do, but the document could be edit by multiple users. If you set DOCUMENT variable(s) in the both places you may have a conflict.
Has anyone set up anything for doing SQL queries through javascript within their forms? I usually use AJAX and PHP to send out my SQL queries, but I didn't want to put these on my CPS web server unless I had to.
It is usually considered bad practice to run SQL queries through javascript, but it seems like we are using javascript and HTML in a fairly closed environment (in my case the javascript would be ran on a virtual server via Citrix and not the local computer).
mikeseale:
I would not recommend you to use SQL query right from the HTML forms. You will have to compromise security by embedding SQL user credentials. Bad Idea!
The better way is to put a WebApi Server that will a) authenticate user; b) implement all JSON calls and retrieves/updates data in the SQL/Oracle database. You can use AngularJS and single page application (SPA) to build very robust forms. (Take a look of using Bearer token for Authorization)
My company (mdObject) started this project, but lack of funding brought the project to a halt.
My biggest question is why you cannot use MEL? Take a look into Open Source project $mdObject at https://github.com/mdObject/GECentricity or NuGet package: http://www.nuget.org/packages/mdObject.Centricity/. It has very good coverage for majority Centricity functionality. It's free and you can use it for commercial application as well!!!
aaltotsky:
Thanks for your reply. I've used MEL to get almost everything I need (and sometimes have to go to the mldef files). There are some simple fields in Registration that you cannot pull into the forms that we use all the time: Employer Name, Employer Phone, Employer Fax - to name a few. Also, we do worker's comp cases, so if there is a case attached to the appointment, we pull in information like claim #, date of injury, etc. so that the providers and nurses don't have to key this in. Currently with VFE forms, I run a python or C# program to get this information and pull it back into the form. It looks bad, though, because it will open a command shell while running and close after it is finished.
I'm hoping to make this fairly streamlined when moving to HTML, and it sounds like the WebAPI server might be the way to do this.
Sorry this isn't exactly HTML form related, but I have a answer to something that came up in discussion:
mikeseale: If you are pulling in data with C# you can suppress the console window. Start with a console application and then go to project properties and change the output type to "Windows Application". We have done a bit of similar tinkering around and I have found this to work in hiding the window.
Bhoover:
Thanks for the info! I'll set my programs up with this.
How are you handling text translation from within the HTML Forms. I'm currently writing everything to 2-3 document variables (depending on size of my text) that are on text components or within other forms during the window unload event. This seems to work for the most part, but I was curious how others are doing it.
Hello,
I have built a sample HTML form and I am looking to link it to obs terms. what's the best way to do this. I am currently using cps 12.2.
Thanks in advance!