Skip to content

Commit

Permalink
Remove custom today XPath function (#7821)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuester authored and elvisdorkenoo committed Nov 3, 2022
1 parent e5457f4 commit d1494af
Show file tree
Hide file tree
Showing 39 changed files with 81 additions and 96 deletions.
Binary file modified config/default/forms/app/death_report.xlsx
Binary file not shown.
5 changes: 2 additions & 3 deletions config/default/forms/app/death_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Date of Death: <output value=" /death_report/death_details/date_of_death "/>&lt;
</translation>
</itext>
<instance>
<death_report id="death_report" prefix="J1!death_report!" delimiter="#" version="2022-08-19 15:07:41">
<death_report id="death_report" prefix="J1!death_report!" delimiter="#" version="2022-09-26 12:09:48">
<inputs>
<meta>
<location>
Expand Down Expand Up @@ -182,8 +182,7 @@ Date of Death: <output value=" /death_report/death_details/date_of_death "/>&lt;
<bind nodeset="/death_report/patient_name" type="string" calculate="../inputs/contact/name"/>
<bind nodeset="/death_report/patient_short_name" type="string" calculate="../inputs/contact/short_name"/>
<bind nodeset="/death_report/patient_display_name" type="string" calculate="if(../patient_short_name = '', ../patient_name, concat(../patient_name, ' (', ../patient_short_name, ')'))"/>
<bind nodeset="/death_report/death_details/date_of_death" type="date" jr:constraintMsg="jr:itext('/death_report/death_details/date_of_death:jr:constraintMsg')" required="true()" constraint="(decimal-date-time(.) &lt;= decimal-date-time(today()))
and floor(decimal-date-time(today()) - decimal-date-time(.)) &lt;= 365"/>
<bind nodeset="/death_report/death_details/date_of_death" type="date" required="true()" constraint="(. &lt;= now()) and floor(decimal-date-time(today()) - decimal-date-time(.)) &lt;= 365" jr:constraintMsg="jr:itext('/death_report/death_details/date_of_death:jr:constraintMsg')"/>
<bind nodeset="/death_report/death_details/place_of_death" type="select1" required="true()"/>
<bind nodeset="/death_report/death_details/place_of_death_other" type="string" required="true()" relevant="selected(../place_of_death, 'other')"/>
<bind nodeset="/death_report/death_details/death_information" type="string"/>
Expand Down
Binary file modified config/default/forms/app/delivery.xlsx
Binary file not shown.
14 changes: 7 additions & 7 deletions config/default/forms/app/delivery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
</translation>
</itext>
<instance>
<delivery id="delivery" prefix="J1!delivery!" delimiter="#" version="2022-08-23 13-48">
<delivery id="delivery" prefix="J1!delivery!" delimiter="#" version="2022-09-26 12-11">
<inputs>
<meta>
<location>
Expand Down Expand Up @@ -1361,7 +1361,7 @@
<bind nodeset="/delivery/patient_short_name" type="string" calculate="coalesce(../inputs/contact/short_name, ../summary/custom_translations/custom_woman_label)"/>
<bind nodeset="/delivery/patient_short_name_start" type="string" calculate="coalesce(../inputs/contact/short_name, ../summary/custom_translations/custom_woman_start_label)"/>
<bind nodeset="/delivery/t_danger_signs_referral_follow_up" type="string" calculate="../pnc_danger_sign_check/r_pnc_danger_sign_present"/>
<bind nodeset="/delivery/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(floor(decimal-date-time(today())) + 3)"/>
<bind nodeset="/delivery/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(decimal-date-time(today()) + 3)"/>
<bind nodeset="/delivery/condition/woman_outcome" type="select1" required="true()"/>
<bind nodeset="/delivery/pnc_danger_sign_check" relevant="selected(../condition/woman_outcome, 'alive_well') or
selected(../condition/woman_outcome, 'alive_unwell')"/>
Expand All @@ -1377,7 +1377,7 @@ selected(../vaginal_bleeding, 'yes') or
selected(../vaginal_discharge, 'yes') or
selected(../convulsion, 'yes'), 'yes', 'no')"/>
<bind nodeset="/delivery/death_info_woman" relevant="selected(../condition/woman_outcome, 'deceased')"/>
<bind nodeset="/delivery/death_info_woman/woman_death_date" type="date" constraint="decimal-date-time(.) &lt;= decimal-date-time(today()) and difference-in-months( ., today() ) &lt; 1" required="true()" jr:constraintMsg="jr:itext('/delivery/death_info_woman/woman_death_date:jr:constraintMsg')"/>
<bind nodeset="/delivery/death_info_woman/woman_death_date" type="date" jr:constraintMsg="jr:itext('/delivery/death_info_woman/woman_death_date:jr:constraintMsg')" required="true()" constraint=". &lt;= now() and difference-in-months( ., today() ) &lt; 1"/>
<bind nodeset="/delivery/death_info_woman/woman_death_place" type="select1" required="true()"/>
<bind nodeset="/delivery/death_info_woman/woman_death_birth" type="select1" required="true()"/>
<bind nodeset="/delivery/death_info_woman/woman_death_add_notes" type="string" constraint="string-length(.) &lt;= 300" required="false()" jr:constraintMsg="jr:itext('/delivery/death_info_woman/woman_death_add_notes:jr:constraintMsg')"/>
Expand All @@ -1403,15 +1403,15 @@ selected(../convulsion, 'yes'), 'yes', 'no')"/>
<bind nodeset="/delivery/delivery_outcome/babies_delivered_num" type="string" calculate="if(selected(../babies_delivered, '1'), 1, if(selected(../babies_delivered, '2'), 2, if(selected(../babies_delivered, '3'), 3, if(selected(../babies_delivered, 'other'), ../babies_delivered_other, 0))))"/>
<bind nodeset="/delivery/delivery_outcome/babies_alive_num" type="string" calculate="if(selected(../babies_alive, '1'), 1, if(selected(../babies_alive, '2'), 2, if(selected(../babies_alive, '3'), 3, if(selected(../babies_alive, 'other'), ../babies_alive_other, 0))))"/>
<bind nodeset="/delivery/delivery_outcome/babies_deceased_num" type="string" calculate="../babies_delivered_num - ../babies_alive_num"/>
<bind nodeset="/delivery/delivery_outcome/delivery_date" type="date" constraint="decimal-date-time(.) &lt;= decimal-date-time(today()) and difference-in-months( ., today() ) &lt; 1" required="true()" jr:constraintMsg="jr:itext('/delivery/delivery_outcome/delivery_date:jr:constraintMsg')"/>
<bind nodeset="/delivery/delivery_outcome/delivery_date" type="date" jr:constraintMsg="jr:itext('/delivery/delivery_outcome/delivery_date:jr:constraintMsg')" required="true()" constraint=". &lt;= now() and difference-in-months( ., today() ) &lt; 1"/>
<bind nodeset="/delivery/delivery_outcome/delivery_place" type="select1" required="true()"/>
<bind nodeset="/delivery/delivery_outcome/delivery_place_other" type="string" constraint="string-length(.) &lt;= 100" relevant="../delivery_place = 'other'" required="true()" jr:constraintMsg="jr:itext('/delivery/delivery_outcome/delivery_place_other:jr:constraintMsg')"/>
<bind nodeset="/delivery/delivery_outcome/delivery_mode" type="select1" relevant="../delivery_place = 'health_facility'" required="true()"/>
<bind nodeset="/delivery/delivery_outcome/delivery_conductor" type="select1" relevant="../delivery_place = 'home' or ../delivery_place = 'other'" required="true()"/>
<bind nodeset="/delivery/delivery_outcome/delivery_conductor_other" type="string" constraint="string-length(.) &lt;= 100" relevant="../delivery_conductor = 'other'" required="true()" jr:constraintMsg="jr:itext('/delivery/delivery_outcome/delivery_conductor_other:jr:constraintMsg')"/>
<bind nodeset="/delivery/baby_death" relevant="../delivery_outcome/babies_deceased_num &gt; 0"/>
<bind nodeset="/delivery/baby_death/baby_death_repeat_count" type="string" readonly="true()" calculate=" /delivery/delivery_outcome/babies_deceased_num "/>
<bind nodeset="/delivery/baby_death/baby_death_repeat/baby_death_date" type="date" constraint="decimal-date-time(.) &lt;= decimal-date-time(today()) and difference-in-months( ., today() ) &lt; 1" required="true()" jr:constraintMsg="jr:itext('/delivery/baby_death/baby_death_repeat/baby_death_date:jr:constraintMsg')"/>
<bind nodeset="/delivery/baby_death/baby_death_repeat/baby_death_date" type="date" jr:constraintMsg="jr:itext('/delivery/baby_death/baby_death_repeat/baby_death_date:jr:constraintMsg')" required="true()" constraint=". &lt;= now() and difference-in-months( ., today() ) &lt; 1"/>
<bind nodeset="/delivery/baby_death/baby_death_repeat/baby_death_place" type="select1" required="true()"/>
<bind nodeset="/delivery/baby_death/baby_death_repeat/stillbirth" type="select1" required="true()"/>
<bind nodeset="/delivery/baby_death/baby_death_repeat/baby_death_add_notes" type="string" constraint="string-length(.) &lt;= 300" required="false()" jr:constraintMsg="jr:itext('/delivery/baby_death/baby_death_repeat/baby_death_add_notes:jr:constraintMsg')"/>
Expand Down Expand Up @@ -1464,7 +1464,7 @@ selected(../blue_skin, 'yes'), 'yes', 'no')"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/date_of_birth" type="string" calculate="../../../../../delivery_outcome/delivery_date"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/vaccines_received" type="string" calculate="../../vaccines_received"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/t_danger_signs_referral_follow_up" type="string" calculate="../../r_baby_danger_sign_present"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(floor(decimal-date-time(today())) + 3)"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(decimal-date-time(today()) + 3)"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/measurements/weight" type="string" calculate="../../../birth_weight"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/measurements/length" type="string" calculate="../../../birth_length"/>
<bind nodeset="/delivery/babys_condition/baby_repeat/baby_details/baby_profile/danger_signs/infected_umbilical_cord" type="string" calculate="../../../infected_umbilical_cord"/>
Expand Down Expand Up @@ -1496,7 +1496,7 @@ selected(../condition/woman_outcome, 'alive_unwell') or
<bind nodeset="/delivery/pnc_visits/who_note" readonly="true()" type="string"/>
<bind nodeset="/delivery/pnc_visits/pnc_visits_attended" type="select" constraint="not(selected(.,'none')) or count-selected(.) &lt; 2" required="true()"/>
<bind nodeset="/delivery/pnc_visits/pnc_visits_additional" type="int" constraint=". &gt;=0 and . &lt;= 6" required="false()" jr:constraintMsg="jr:itext('/delivery/pnc_visits/pnc_visits_additional:jr:constraintMsg')"/>
<bind nodeset="/delivery/pnc_visits/days" type="string" calculate="floor(decimal-date-time(today())) - floor(decimal-date-time( /delivery/delivery_outcome/delivery_date ))"/>
<bind nodeset="/delivery/pnc_visits/days" type="string" calculate="floor(decimal-date-time(today()) - decimal-date-time( /delivery/delivery_outcome/delivery_date ))"/>
<bind nodeset="/delivery/summary/r_submit_note" readonly="true()" type="string"/>
<bind nodeset="/delivery/summary/r_summary_details" readonly="true()" type="string"/>
<bind nodeset="/delivery/summary/r_patient_details" readonly="true()" type="string"/>
Expand Down
Binary file modified config/default/forms/app/pnc_danger_sign_follow_up_baby.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions config/default/forms/app/pnc_danger_sign_follow_up_baby.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
</translation>
</itext>
<instance>
<pnc_danger_sign_follow_up_baby id="pnc_danger_sign_follow_up_baby" prefix="J1!pnc_danger_sign_follow_up_baby!" delimiter="#" version="2022-08-19 15:16:18">
<pnc_danger_sign_follow_up_baby id="pnc_danger_sign_follow_up_baby" prefix="J1!pnc_danger_sign_follow_up_baby!" delimiter="#" version="2022-09-26 09:13:25">
<inputs>
<meta>
<location>
Expand Down Expand Up @@ -258,7 +258,7 @@
<bind nodeset="/pnc_danger_sign_follow_up_baby/patient_uuid" type="string" calculate="../inputs/contact/_id"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/patient_id" type="string" calculate="../inputs/contact/patient_id"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/patient_name" type="string" calculate="../inputs/contact/name"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(floor(decimal-date-time(today())) + 3)"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(decimal-date-time(today()) + 3)"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/t_danger_signs_referral_follow_up" type="string" calculate="../danger_signs/r_danger_sign_present"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/danger_signs/visit_confirm" type="select1" required="true()"/>
<bind nodeset="/pnc_danger_sign_follow_up_baby/danger_signs/danger_sign_present" type="select1" required="true()"/>
Expand Down
Binary file modified config/default/forms/app/pnc_danger_sign_follow_up_mother.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions config/default/forms/app/pnc_danger_sign_follow_up_mother.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
</translation>
</itext>
<instance>
<pnc_danger_sign_follow_up_mother id="pnc_danger_sign_follow_up_mother" prefix="J1!pnc_danger_sign_follow_up_mother!" delimiter="#" version="2019-11-04 14:08:55">
<pnc_danger_sign_follow_up_mother id="pnc_danger_sign_follow_up_mother" prefix="J1!pnc_danger_sign_follow_up_mother!" delimiter="#" version="2022-09-26 09:14:27">
<inputs>
<meta>
<location>
Expand Down Expand Up @@ -230,7 +230,7 @@
<bind nodeset="/pnc_danger_sign_follow_up_mother/patient_name" type="string" calculate="../inputs/contact/name"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/patient_short_name" type="string" calculate="coalesce(../inputs/contact/short_name, ../danger_signs/custom_translations/custom_woman_label)"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/patient_short_name_start" type="string" calculate="coalesce(../inputs/contact/short_name, ../danger_signs/custom_translations/custom_woman_start_label)"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(floor(decimal-date-time(today())) + 3)"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/t_danger_signs_referral_follow_up_date" type="string" calculate="date-time(decimal-date-time(today()) + 3)"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/t_danger_signs_referral_follow_up" type="string" calculate="../danger_signs/r_danger_sign_present"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/danger_signs/visit_confirm" type="select1" required="true()"/>
<bind nodeset="/pnc_danger_sign_follow_up_mother/danger_signs/danger_sign_present" type="select1" required="true()"/>
Expand Down
Binary file modified config/default/forms/app/pregnancy.xlsx
Binary file not shown.
Loading

0 comments on commit d1494af

Please sign in to comment.