Skip to content

Commit

Permalink
Added prepopulations for pop type and ever tested for hts initial fro…
Browse files Browse the repository at this point in the history
…m hts eligibility screening
  • Loading branch information
patryllus committed Apr 6, 2022
1 parent c08b848 commit 75b8033
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions omod/src/main/webapp/resources/htmlforms/hts/htsInitialTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,34 @@
jq("#hts-entry-point option[value='160522']").hide(); //ER
jq("#hts-entry-point option[value='5622']").hide(); //O

//Prepopulated fields from the HTS eligibility forms
var prev_populationType = "<lookup expression="fn.latestObs(164930).getValueCoded()"/>";
var prev_keyPopulationType = "<lookup expression="fn.latestObs(160581).getValueCoded()"/>";
var prev_EverTested = "<lookup expression="fn.latestObs(164401).getValueCoded()"/>";

var PREVIOUS_POPULATION_TYPE = prev_populationType.replace(/[^\d]/g, '');
var PREVIOUS_KEY_POPULATION_TYPE = prev_keyPopulationType.replace(/[^\d]/g, '');
var EVER_TESTED = prev_EverTested.replace(/[^\d]/g, '');

if (PREVIOUS_POPULATION_TYPE == 164929) {
jq("#population-type input[value=164929]").prop("checked", true);
jq('#key-population').show();
}
if (PREVIOUS_POPULATION_TYPE == 164928) {
jq("#population-type input[value=164928]").prop("checked", true);
jq('#key-population').hide();
}
if (PREVIOUS_POPULATION_TYPE == 138643) {
jq("#population-type input[value=164928]").prop("checked", true);
jq('#key-population').hide();
}
if (PREVIOUS_KEY_POPULATION_TYPE != "" || PREVIOUS_KEY_POPULATION_TYPE != null) {
jq("#key-population input[type=checkbox][value="+PREVIOUS_KEY_POPULATION_TYPE+"]").prop("checked",true);
}
if (EVER_TESTED == 1065) {
jq("#ever-tested input[value=1065]").prop("checked", true);
}

if(IS_KDoD_SITE==false)
{
jq('#dodOnly').hide();
Expand Down

0 comments on commit 75b8033

Please sign in to comment.