:: pregriskeval
<<set $here = 'pregriskeval'>>
<<set $ARGS = $location_var[$here]>>
<!-- !! this function returns value, which represents risk factor of conception-->
<!-- !! -4 when PC is pregnant-->
<!-- !! -3 when PC has got her period-->
<!-- !! -2 when the used contraception is birth control shot-->
<!-- !! -1 when PC is on the pills or if PC has used hormonal contraception at least two weeks-->
<!-- !!  0 when they do not use protection or the condom fails-->
<!-- !!  1 when they do not use protection or the condom fails and PC do not want to use a contraception-->
<!-- !!  2 when the condom is sabotaged by the PC or when she pretends to be on pills-->
<<set $eff_contra = iif(arrsize('ARGS') > 0,ARGS[0],sexcontra)>>
<<if $pc.knowpreg == 1 or $pc.thinkpreg == 1>>
	<<set $result = -4>>
<<elseif getvar("$eff_contra") == 2 or getvar("$pilldays") > 14>>
	<<set $result = -1>>
<<elseif getvar("$tabletkishot") != 0>>
	<<set $result = -2>>
<<elseif getvar("$mesec") > 0>>
	<<set $result = -3>>
<<elseif getvar("$eff_contra") == 0 or getvar("$eff_contra") == 4 or getvar("$eff_contra") == 5>>
	<<if ((preziktype == 1 and ($preziksabo + $prezikcount) > 0) or getvar("$preziktype") == 2) and getvar("$tabletkicheck") == 0 and getvar("$tabletki") > 0>>
		<<set $result = 1>>
	<<else>>
		<<set $result = 0>>
	<</if>>
<<elseif getvar("$eff_contra") == 1 or getvar("$eff_contra") == 7>>
	<!-- !{Definitely delibarately trying to get pregnant.} -->
	<<set $result = 2>>
<</if>>
