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

APCHS11B.m

Go to the documentation of this file.
APCHS11B ; IHS/CMI/LAB - CONTINUATION OF ROUTINES ;
 ;;2.0;IHS PCC SUITE;**4**;MAY 14, 2009
 ;
 ; ******************** SURVEILLANCE - HARD CODE ********************
HEIGHT ;
 Q:APCHSAGE>18
 S APCHSMSC="01" D MEASDFN
 Q:'APCHSMSD
 S APCHSDIS="HEIGHT"
 ;S APCHSIVD=$O(^AUPNVMSR("AA",APCHSPAT,APCHSMSD,""))
 S APCHSIVD=$$LASTMSR(APCHSPAT,APCHSMSD)
 I 'APCHSIVD S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 I APCHSAGE'>.5 S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSAGE'>1 S APCHSINT=60 D PRINT Q
 I APCHSAGE'>6 S APCHSINT=90 D PRINT Q
 I APCHSAGE'>16 S APCHSINT=180 S APCHSDD=1 D PRINT K APCHSDD Q
 Q
 ;
WEIGHT ;
 S APCHSMSC="02" D MEASDFN
 Q:'APCHSMSD
 S APCHSDIS="WEIGHT"
 ;S APCHSIVD=$O(^AUPNVMSR("AA",APCHSPAT,APCHSMSD,""))
 S APCHSIVD=$$LASTMSR(APCHSPAT,APCHSMSD)
 I 'APCHSIVD S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 I APCHSAGE'>.5 S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSAGE'>1 S APCHSINT=60 D PRINT Q
 I APCHSAGE'>6 S APCHSINT=90 D PRINT Q
 I APCHSAGE'>16 S APCHSINT=180 S APCHSDD=1 D PRINT K APCHSDD Q
 I APCHSAGE>16 S APCHSINT=365 S APCHSDD=1 D PRINT K APCHSDD Q
 Q
 ;
LASTMSR(P,T) ;return date of the last measurement T
 NEW X,Y,Z,D
 S Z=""
 S D=0 F  S D=$O(^AUPNVMSR("AA",P,T,D)) Q:D'=+D!(Z]"")  D
 .S Y=0 F  S Y=$O(^AUPNVMSR("AA",P,T,D,Y)) Q:Y'=+Y!(Z]"")  D
 ..Q:$P($G(^AUPNVMSR(Y,2)),U,1)  ;entered in error
 ..S Z=D
 Q Z
 Q:APCHSAGE'<(14/12)
 S APCHSMSC="06" D MEASDFN
 Q:'APCHSMSD
 S APCHSDIS="HEAD CIRCUMFERENCE"
 ;S APCHSIVD=$O(^AUPNVMSR("AA",APCHSPAT,APCHSMSD,""))
 S APCHSIVD=$$LASTMSR(APCHSPAT,APCHSMSD)  ;entere in error check
 I 'APCHSIVD S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 I APCHSAGE'>.5 S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSAGE'>1 S APCHSINT=60 D PRINT Q
 I APCHSAGE<(14/12) S APCHSINT=90 D PRINT Q
 Q
 ;
MEASDFN ;ENTRY POINT
 S APCHSMSD=$O(^AUTTMSR("C",APCHSMSC,""))
 Q
 ;
BP ;
 Q:APCHSAGE'>5
 I $D(^ATXAX("B","SURVEILLANCE DIABETES")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE DIABETES","")) S:$D(^ATXPAT(APCHSURD,11,APCHSPAT)) APCHSYRY=""
 I '$D(APCHSYRY),$D(^ATXAX("B","SURVEILLANCE HYPERTENSION")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE HYPERTENSION","")) S:$D(^ATXPAT(APCHSURD,11,APCHSPAT)) APCHSYRY=""
 I '$D(APCHSYRY),$D(^ATXAX("B","SURVEILLANCE OBESITY")) S APCHSURD=$O(^ATXAX("B","SURVEILLANCE OBESITY","")) S:$D(^ATXPAT(APCHSURD,11,APCHSPAT)) APCHSYRY=""
 S APCHSBP="BP"
 S APCHSDIS="BLOOD PRESSURE"
 S APCHSINT=365
 S APCHSBP=$O(^AUTTMSR("B",APCHSBP,""))
 Q:'APCHSBP&('$D(APCHSYRY))
 I 'APCHSBP S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 ;S APCHSIVD=$O(^AUPNVMSR("AA",APCHSPAT,APCHSBP,""))
 S APCHSIVD=$$LASTMSR(APCHSPAT,APCHSBP)
 I 'APCHSIVD,APCHSAGE'>10 S X1=APCHSDOB,X2=365*10 D C^%DTC S Y=X X APCHSCVD S APCHSDUE=Y,APCHSDAT="" D DISPLAY^APCHS11 Q
 I 'APCHSIVD S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11 Q
 I $D(APCHSYRY) S APCHSDUE="MAY BE DUE NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 D PASTAGE^APCHS11
 I APCHSOLD'>5,APCHSAGE'>10 S X1=APCHSDOB,X2=365*10 D C^%DTC S Y=X X APCHSCVD S APCHSDUE=Y D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSOLD'>5 S APCHSDUE="CHECK NOW" D GETDATE^APCHS11,DISPLAY^APCHS11 Q
 I APCHSAGE'<20 D PRINT
 Q
 ;
RECTAL ;
 Q:APCHSAGE<45
 S APCHSEXN="14"
 S APCHSDIS="RECTAL"
 S APCHSINT=365
 D REGEXAM^APCHS11
 Q
 ;
TONOM ;
 Q:APCHSAGE<40
 S APCHSEXN=26
 S APCHSDIS="TONOMETRY"
 S APCHSINT=$S(APCHSAGE<61:365*3,1:365)
 D REGEXAM^APCHS11
 Q
 ;
PRINT ;CALL TO GETDATE, COMPARE, AND DISPLAY IN APCHS11
 D GETDATE^APCHS11,COMPARE^APCHS11,DISPLAY^APCHS11
 Q
 ;