{"id":35,"date":"2012-10-24T16:14:15","date_gmt":"2012-10-24T16:14:15","guid":{"rendered":"http:\/\/www.w3.org\/community\/xformsusers\/?p=35"},"modified":"2012-10-24T16:16:52","modified_gmt":"2012-10-24T16:16:52","slug":"35","status":"publish","type":"post","link":"https:\/\/www.w3.org\/community\/xformsusers\/2012\/10\/24\/35\/","title":{"rendered":"Health hacks and XForms"},"content":{"rendered":"<p>I thought you might be interested in an XForms based web application\u00a0<a href=\"http:\/\/www.forms4health.com\" target=\"_blank\" rel=\"nofollow\">www.forms4health.com<\/a> &#8211; the foundation for which was created at a 2-day health hack known as <a href=\"http:\/\/nhshackday.com\/\" target=\"_blank\" rel=\"nofollow\">NHS hack-day<\/a> (NHS is the National Health Service in the UK).<\/p>\n<p>At the hack I proposed an electronic forms based application specifically for pre-operative assessments (essentially a set of questions designed to ascertain the background health and associated anaesthetic risk for patient scheduled for surgery). As I had previous experience of XForms I wanted to use XForms to create the front end of the application. The main requirements I had were a good fit for XForms &#8211; see below:<\/p>\n<ul>\n<li>The form should be as intuitive as possible for the patients:<\/li>\n<ul>\n<li>This meant that the form should be based upon clearly laid out sections<span style=\"color: #999999\"> &#8211; in this case I used the &lt;xf:switch\/&gt; statement to present different sections.<\/span><\/li>\n<li>Questions posed to the patient depend on their previous answers<span style=\"color: #999999\"> &#8211; here I used a mixture of &lt;xf:group ref=&#8221;.[conditional statement]&#8221;&gt; and &lt;xf:bind id=&#8221;SomeId&#8221; relevant=&#8221;conditional statement&#8221;\/&gt; &lt;xf:select1 bind=&#8221;SomeId&#8221;\/&gt;<\/span><\/li>\n<li>Errors on the form needed to be clearly highlighted to the user with associated help\/hint text<span style=\"color: #999999\"> &#8211; a feature directly supported by XForms<\/span><\/li>\n<li>The form needed to be &#8220;pretty&#8221;<span style=\"color: #999999\"> &#8211; Not being a UI expert I used Twitter&#8217;s <a href=\"http:\/\/twitter.github.com\/bootstrap\/\" target=\"_blank\" rel=\"nofollow\">bootstrap<\/a> to help style the form. This is still work in progress and I did need to figure out a few things but the integration so far with XSLTForms has not too been too painful.<\/span><\/li>\n<\/ul>\n<li>Options for select controls need to be sourced externally.<\/li>\n<ul>\n<li>In the current version of forms4health I have used a simple XML data models.<\/li>\n<li>In a full blown application these may be more complex in be sourced from an standalone terminology server.<\/li>\n<li><span style=\"color: #999999\">Either way the use of &lt;xf:model\/&gt; and the &lt;xf:itemset\/&gt; allows this information to be losley coupled to the form.<\/span><\/li>\n<\/ul>\n<li>The results of the form need to be sent\/saved as XML<\/li>\n<ul>\n<li>The healthcare administrator &#8220;booking&#8221; the assessment has a choice of PDF or XML as the output of the form submission <span style=\"color: #999999\">&#8211; here I used XForms to send the XML to a background Java servlet that either forwarded the XML directly or created a PDF via XSL:FO \/ FOP.<\/span><\/li>\n<li>Where XML is requested this is typically for integration with the healthcare institution&#8217;s own systems, however the specific XML may vary depending on healthcare facility. <span style=\"color: #999999\">This implies the need for lose coupling between the UI and the data &#8211; The MVC architecture of XForms allows this coupling to be defined declaratively.<\/span><\/li>\n<\/ul>\n<li>The form needs to be available on a variety of platforms<\/li>\n<ul>\n<li><span style=\"color: #999999\">In theory this is well aligned with XForms however (and I may be wrong) for now I think the majority of XForms applications are still being developed as web-sites\/embeded in HTML.\u00a0<\/span><span style=\"color: #999999\"> I used XSTLForms as this supports a large number of web browsers, however I have pre-processed (transformed) the xml files to html to ensure as wide a compatibility as possible (you will be able to see the difference between <a href=\"http:\/\/www.forms4health.com\/registration.html\" target=\"_blank\" rel=\"nofollow\">http:\/\/www.forms4health.com\/registration.html<\/a> and\u00a0<a href=\"http:\/\/www.forms4health.com\/registration.xml\" target=\"_blank\" rel=\"nofollow\">http:\/\/www.forms4health.com\/registration.xml<\/a>\u00a0if you\u00a0do\u00a0&#8220;view source&#8221;)<\/span><\/li>\n<\/ul>\n<li>The form and associated functionality needed to be developed quickly<\/li>\n<ul>\n<li><span style=\"color: #999999\">The declarative nature of XForms allowed us to build upon the excellent foundation provided by XForms to rapidly generate working applications<\/span><\/li>\n<\/ul>\n<\/ul>\n<p>Overall XForms was great for being able to quickly create a very usable application with relatively simple\/lightweight backend logic to produce a workable application. I am hoping the demo site will provide enough inspiration for an NHS (or other healthcare provider) organisation to sponsor the development of a fully functioning service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought you might be interested in an XForms based web application\u00a0www.forms4health.com &#8211; the foundation for which was created at a 2-day health hack known as NHS hack-day (NHS is the National Health Service in the UK). At the hack &hellip; <a href=\"https:\/\/www.w3.org\/community\/xformsusers\/2012\/10\/24\/35\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[1],"tags":[],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/users\/1677"}],"replies":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":8,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":42,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/posts\/35\/revisions\/42"}],"wp:attachment":[{"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.w3.org\/community\/xformsusers\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}