nvm

Since we use nvm and our different projects/branches use a different version of node. In order to always use the correct version of the node we have two tools. These set the node version and the default node version. The default node version must be set if one uses the avni client to do react-native run-android, which internally launches the packager or metro bundler. Each project has a .nvmrc file checked in specifying the node version.

  • A customized cd command that sets the node version and default node version. You can put this in our bashrc or bash profile files. See the function below.
  • When we are in a particular directory and switch the git branch the node version may need to change. To support this we have git checkout hooks.
function cd () {
  builtin cd "[email protected]"  
  if \[[ -f .nvmrc ]]  
  then  
    nvm use > /dev/null  
    nvm alias default current > /dev/null  
  fi  
}

Check whether a model method is used in any of the rules

As the avni model classes are used by the rule, it is possible that a method that you may want to refactor is getting used in the rule. In order to check you can run the following query by replacing your keyword. Note the rule columns are as of 19-Jan-2023 (some new rule columns may get added in the future when you are using this).

use openchs;

select program_eligibility_check_rule, subject_summary_rule from subject_type  
    where ((program_eligibility_check_rule like '%eligiblePrograms%')  
               or (subject_summary_rule like '%eligiblePrograms%'));

select encounter_eligibility_check_rule  
    from encounter_type where encounter_eligibility_check_rule like '%eligiblePrograms%';

select enrolment_summary_rule, enrolment_eligibility_check_rule, manual_enrolment_eligibility_check_rule from program  
where (  
          (enrolment_summary_rule like '%eligiblePrograms%') or  
          (enrolment_eligibility_check_rule like '%eligiblePrograms%') or  
          (manual_enrolment_eligibility_check_rule like '%eligiblePrograms%')  
          );

select decision_rule, validation_rule,  
       visit_schedule_rule, checklists_rule, task_schedule_rule  
from form  
where (  
        (decision_rule like '%eligiblePrograms%') or  
        (validation_rule like '%eligiblePrograms%') or  
        (visit_schedule_rule like '%eligiblePrograms%') or  
        (checklists_rule like '%eligiblePrograms%') or  
        (task_schedule_rule like '%eligiblePrograms%')  
          );

select query from report_card  
    where query like ('%eligiblePrograms%');