Skip to content

Commit

Permalink
Merge pull request #29 from gitcliff/category
Browse files Browse the repository at this point in the history
category:Adding the ability to dynamically select the risk category based on the total score of the level of care assessment form
  • Loading branch information
mozzy11 authored Apr 3, 2022
2 parents 4839578 + 9ba17bb commit 75d0573
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
Binary file modified config/forms/app/care.xlsx
Binary file not shown.
73 changes: 72 additions & 1 deletion config/forms/app/care.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@
<model>
<instance>
<care id="care" prefix="J1!care!" delimiter="#" version="1">
<inputs/>
<inputs>
<meta>
<location>
<lat/>
<long/>
<error/>
<message/>
</location>
</meta>
<source/>
<source_id/>
<contact>
<_id/>
<patient_id/>
<name/>
<date_of_birth/>
<sex/>
<parent>
<contact>
<phone/>
<name/>
</contact>
</parent>
</contact>
</inputs>
<care>
<medical/>
<knowledge/>
Expand All @@ -17,14 +41,26 @@
<employment/>
<living/>
<score/>
<category/>
<score_note/>
<category_note/>
</care>
<meta tag="hidden">
<instanceID/>
</meta>
</care>
</instance>
<instance id="contact-summary"/>
<bind nodeset="/care/inputs" relevant="./source = 'user'"/>
<bind nodeset="/care/inputs/source" type="string"/>
<bind nodeset="/care/inputs/source_id" type="string"/>
<bind nodeset="/care/inputs/contact/_id" type="db:person"/>
<bind nodeset="/care/inputs/contact/patient_id" type="string"/>
<bind nodeset="/care/inputs/contact/name" type="string"/>
<bind nodeset="/care/inputs/contact/date_of_birth" type="string"/>
<bind nodeset="/care/inputs/contact/sex" type="string"/>
<bind nodeset="/care/inputs/contact/parent/contact/phone" type="string"/>
<bind nodeset="/care/inputs/contact/parent/contact/name" type="string"/>
<bind nodeset="/care/care/medical" type="select1"/>
<bind nodeset="/care/care/knowledge" type="select1"/>
<bind nodeset="/care/care/adherence" type="select1"/>
Expand All @@ -43,13 +79,45 @@
if(selected( /care/care/communication , 'co'), 1, 0) + if(selected( /care/care/communication , 'temporary'), 2, 0) + if(selected( /care/care/communication , 'limitted'), 3, 0) + if(selected( /care/care/communication , 'xx'), 4, 0) +
if(selected( /care/care/employment , 'employed'), 1, 0) + if(selected( /care/care/employment , 'ltd_probs'), 2, 0) + if(selected( /care/care/employment , 'unemployed'), 3, 0) + if(selected( /care/care/employment , 'unable'), 4, 0) +
if(selected( /care/care/living , 'self_managed'), 1, 0) + if(selected( /care/care/living , 'adequate'), 2, 0) + if(selected( /care/care/living , 'unsafe'), 3, 0) + if(selected( /care/care/living , 'homless'), 4, 0)"/>
<bind nodeset="/care/care/category" type="string" calculate="if(( /care/care/score &gt;= 1 and /care/care/score &lt;= 15), 'Limitted', if(( /care/care/score &gt;= 16 and /care/care/score &lt; 40 ), 'Supportive', if(( /care/care/score &gt;= 40), 'Comprehensive','')))"/>
<bind nodeset="/care/care/score_note" readonly="true()" type="string"/>
<bind nodeset="/care/care/category_note" readonly="true()" type="string"/>
<bind nodeset="/care/meta/instanceID" type="string" readonly="true()" calculate="concat('uuid:', uuid())"/>
</model>
</h:head>
<h:body class="pages">
<group appearance="field-list" ref="/care/inputs">
<label>Level of Care Assessment</label>
<group ref="/care/inputs/contact">
<label></label>
<input appearance="db-object" ref="/care/inputs/contact/_id">
<label>What is the patient's name?</label>
</input>
<input appearance="hidden" ref="/care/inputs/contact/patient_id">
<label></label>
</input>
<input appearance="hidden" ref="/care/inputs/contact/name">
<label></label>
</input>
<input appearance="hidden" ref="/care/inputs/contact/date_of_birth">
<label></label>
</input>
<input appearance="hidden" ref="/care/inputs/contact/sex">
<label></label>
</input>
<group ref="/care/inputs/contact/parent">
<label></label>
<group ref="/care/inputs/contact/parent/contact">
<label></label>
<input appearance="hidden" ref="/care/inputs/contact/parent/contact/phone">
<label></label>
</input>
<input appearance="hidden" ref="/care/inputs/contact/parent/contact/name">
<label></label>
</input>
</group>
</group>
</group>
</group>
<group appearance="field-list" ref="/care/care">
<label>Questionaire</label>
Expand Down Expand Up @@ -223,6 +291,9 @@
<input ref="/care/care/score_note">
<label>Score is: <output value=" /care/care/score "/></label>
</input>
<input ref="/care/care/category_note">
<label>Risk Category is:<output value=" /care/care/category "/></label>
</input>
</group>
</h:body>
</h:html>

0 comments on commit 75d0573

Please sign in to comment.