Skip to content

Instantly share code, notes, and snippets.

@MartijnR
Last active December 7, 2018 21:53
Show Gist options
  • Save MartijnR/e5da9ece345f76bc7d3a67fbf5bb9167 to your computer and use it in GitHub Desktop.
Save MartijnR/e5da9ece345f76bc7d3a67fbf5bb9167 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><h:html xmlns="http://www.w3.org/2002/xforms" xmlns:OpenClinica="http://openclinica.com/odm" xmlns:enk="http://enketo.org/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:oc="http://openclinica.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
<h:title>Vital Signs</h:title>
<model>
<instance>
<relevant_and_constraint_test id="00caad5c-0543-4dc0-aa0c-e26f1386b7bd-F_RELEVANTCONS" version="19z">
<page1>
<wh_y/>
<wh_units/>
<weight/>
<weight_unit_des/>
<height/>
<height_unit_des/>
<wh_y_comment oc:queryParent="wh_y"/><wh_units_comment oc:queryParent="wh_units"/><weight_comment oc:queryParent="weight"/><height_comment oc:queryParent="height"/></page1>
<meta>
<instanceID/>
<instanceID_comment oc:queryParent="instanceID"/></meta>
</relevant_and_constraint_test>
</instance>
<bind nodeset="/relevant_and_constraint_test/page1/wh_y" oc:itemgroup="Group1" type="select"/>
<bind nodeset="/relevant_and_constraint_test/page1/wh_units" oc:itemgroup="Group1" relevant=" /relevant_and_constraint_test/page1/wh_y = 1" required="true() and comment-status(/relevant_and_constraint_test/page1/wh_units_comment)!='new' and comment-status(/relevant_and_constraint_test/page1/wh_units_comment)!='updated' and comment-status(/relevant_and_constraint_test/page1/wh_units_comment)!='closed'" type="select1"/>
<bind constraint=". &gt;= 50 and . &lt;= 1000" jr:constraintMsg="Weight must be between 50 and 1000 lbs or between 22 and 454 kg (no more than 1 decimal digit)" nodeset="/relevant_and_constraint_test/page1/weight" oc:itemgroup="Group1" relevant=" /relevant_and_constraint_test/page1/wh_y = 1" required="true() and comment-status(/relevant_and_constraint_test/page1/weight_comment)!='new' and comment-status(/relevant_and_constraint_test/page1/weight_comment)!='updated' and comment-status(/relevant_and_constraint_test/page1/weight_comment)!='closed'" type="decimal"/>
<bind calculate="if( /relevant_and_constraint_test/page1/wh_units = 2 and /relevant_and_constraint_test/page1/weight != '', concat( /relevant_and_constraint_test/page1/weight , ' pounds'),if( /relevant_and_constraint_test/page1/wh_units = 1 and /relevant_and_constraint_test/page1/weight != '', concat( /relevant_and_constraint_test/page1/weight , ' kilograms'), 'weight not entered'))" nodeset="/relevant_and_constraint_test/page1/weight_unit_des" oc:itemgroup="Group1" type="string"/>
<bind constraint="((. &gt;= 30 and . &lt;= 96 and /relevant_and_constraint_test/page1/wh_units = 2) or (. &gt;= 76 and . &lt;= 244 and /relevant_and_constraint_test/page1/wh_units = 1)) and (. = round( /relevant_and_constraint_test/page1/height ,1)) or comment-status(/relevant_and_constraint_test/page1/height_comment)='new' or comment-status(/relevant_and_constraint_test/page1/height_comment)='updated' or comment-status(/relevant_and_constraint_test/page1/height_comment)='closed'" jr:constraintMsg="Height must be between 30 and 96 in or 76 and 244 cm (no more than 1 decimal digits)" nodeset="/relevant_and_constraint_test/page1/height" oc:itemgroup="Group1" relevant=" /relevant_and_constraint_test/page1/wh_y = 1" required="true() and comment-status(/relevant_and_constraint_test/page1/height_comment)!='new' and comment-status(/relevant_and_constraint_test/page1/height_comment)!='updated' and comment-status(/relevant_and_constraint_test/page1/height_comment)!='closed'" type="decimal"/>
<bind calculate="if( /relevant_and_constraint_test/page1/wh_units = 2 and /relevant_and_constraint_test/page1/height != '', concat( /relevant_and_constraint_test/page1/height , ' inches'),if( /relevant_and_constraint_test/page1/wh_units = 1 and /relevant_and_constraint_test/page1/height != '', concat( /relevant_and_constraint_test/page1/height , ' centimeters'), 'height not entered'))" nodeset="/relevant_and_constraint_test/page1/height_unit_des" oc:itemgroup="Group1" type="string"/>
<bind calculate="concat('uuid:', uuid())" nodeset="/relevant_and_constraint_test/meta/instanceID" readonly="true()" type="string"/>
<bind enk:for="/relevant_and_constraint_test/page1/wh_y" nodeset="/relevant_and_constraint_test/page1/wh_y_comment" type="string"/><bind enk:for="/relevant_and_constraint_test/page1/wh_units" nodeset="/relevant_and_constraint_test/page1/wh_units_comment" type="string"/><bind enk:for="/relevant_and_constraint_test/page1/weight" nodeset="/relevant_and_constraint_test/page1/weight_comment" type="string"/><bind enk:for="/relevant_and_constraint_test/page1/height" nodeset="/relevant_and_constraint_test/page1/height_comment" type="string"/>
<!--<instance id="_users" src="jr://file-csv/users.xml"/>-->
</model>
</h:head>
<h:body class="pages theme-grid no-text-transform">
<group appearance="w4 field-list no-collapse" ref="/relevant_and_constraint_test/page1">
<select appearance="w4" ref="/relevant_and_constraint_test/page1/wh_y">
<label>Were weight &amp; height measured?</label>
<hint>Check the box if Yes</hint>
<item>
<label>Yes</label>
<value>1</value>
</item>
</select>
<select1 appearance="w2 minimal" ref="/relevant_and_constraint_test/page1/wh_units">
<label>Weight &amp; Height Units:</label>
<hint>Please choose units for Weight and Height</hint>
<item>
<label>kilograms &amp; centimeters</label>
<value>1</value>
</item>
<item>
<label>pounds &amp; inches</label>
<value>2</value>
</item>
</select1>
<input appearance="w1" ref="/relevant_and_constraint_test/page1/weight">
<label>Weight:</label>
<hint>Please provide weight in pounds (lbs) or kilograms (kg)</hint>
</input>
<input appearance="w1" ref="/relevant_and_constraint_test/page1/height">
<label>Height:</label>
<hint>Please provide height in inches (in) or centimeters (cm)</hint>
</input>
<input appearance="dn w1" ref="/relevant_and_constraint_test/page1/wh_y_comment"><label>Comment:</label></input><input appearance="dn w1" ref="/relevant_and_constraint_test/page1/wh_units_comment"><label>Comment:</label></input><input appearance="dn w1" ref="/relevant_and_constraint_test/page1/weight_comment"><label>Comment:</label></input><input appearance="dn w1" ref="/relevant_and_constraint_test/page1/height_comment"><label>Comment:</label></input></group>
</h:body>
</h:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment