Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BGP8EL3

BGP8EL3.m

Go to the documentation of this file.
BGP8EL3 ;IHS/CMI/LAB - ELDER MEASURES;
 ;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
 ;
I9 ;EP
 S (BGPD1,BGPD2,BGPD3,BGPD4,BGPD5)=0
 S (BGPN1,BGPN2,BGPN3,BGPN4,BGPN5,BGPN6,BGPN7,BGPN8,BGPN6,BGPN7,BGPN8)=0
 I BGPAGEB<55 S BGPSTOP=1 Q
 I 'BGPACTCL S BGPSTOP=1 Q
 S BGPD1=1
 I BGPAGEB>54,BGPAGEB<65 S BGPD2=1
 I BGPAGEB>64,BGPAGEB<75 S BGPD3=1
 I BGPAGEB>74,BGPAGEB<85 S BGPD4=1
 I BGPAGEB>84 S BGPD5=1
 S BGPVALUE=$$FLU^BGP8D3(DFN,,BGPEDATE) ;set to date of flu shot
 I BGPVALUE]"" S BGPN1=1  ;FLU SHOT
 I $P(BGPVALUE,U,3)=2 S BGPN2=1  ;REFUSAL
 I $P(BGPVALUE,U,3)=3 S BGPN3=1,BGPN1=1  ;CONTRAINDICATION
 I BGPN1,'BGPN2 S BGPN7=1
 S BGPVALUE="AC"_"|||"_$$DATE^BGP8UTL($P(BGPVALUE,U,1))_" "_$P(BGPVALUE,U,2)
 K X,Y,Z,%,A,B,C,D,E,H,BDATE,EDATE,P,V,S,F,J,K,G,I,L,T
 K BGPX,BGPY,BGPC,BGPG
 Q
I10 ;EP
 F X=1:1:17 S Y="BGPD"_X S @Y=""
 F X=1:1:55 S Y="BGPN"_X S @Y=""
 I BGPAGEB<55 S BGPSTOP=1 Q
 I 'BGPACTCL S BGPSTOP=1 Q
 S BGPD1=1
 I BGPAGEB>54,BGPAGEB<65 S BGPD2=1
 I BGPAGEB>64,BGPAGEB<75 S BGPD3=1
 I BGPAGEB>74,BGPAGEB<85 S BGPD4=1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