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

APCHS11D.m

Go to the documentation of this file.
APCHS11D ; IHS/CMI/LAB - AND VISION EXAM CHECK ;
 ;;2.0;IHS PCC SUITE;**4**;MAY 14, 2009
 ;
 ;Checks in both V MEASUREMENT and V EXAM file to see if vision/hearing measurement or exam occurred
 ;
 ; ******************** SURVEILLANCE - HARD CODE ********************
VISION ;
 I APCHSAGE>15!(APCHSAGE<7) G X1
 S APCHSDIS="VISION EXAM"
 S APCHS("NO DISPLAY")=0 ;This variable set to one if vision exam occurred based on check of V MEASUREMENT file or V EXAM file
 S APCHSEXC="S APCHSIVD=$$LASTMSR^APCHS11B(APCHSPAT,APCHSMSD)" F APCHSMSC="07","08" Q:APCHS("NO DISPLAY")  D MEASDFN^APCHS11B I APCHSMSD D PROCESS
 I APCHS("NO DISPLAY") G X1
 S APCHSEXC="S APCHSIVD=$O(^AUPNVXAM(""AA"",APCHSPAT,APCHSEXD,""""))" F APCHSEXN=19 Q:APCHS("NO DISPLAY")  D EXAMDFN^APCHS11 I APCHSEXD D PROCESS
 I 'APCHS("NO DISPLAY") S APCHSEXD=$O(^AUTTEXAM("C",19,0)),APCHSDF1=9999999.15 D REFDF^APCHS11,DISPLAY
X1 K APCHS("NO DISPLAY"),APCHSYNG
 Q
 ;
HEARING ;
 I APCHSAGE>15!(APCHSAGE<7) G X2
 S APCHSDIS="HEARING EXAM"
 S APCHS("NO DISPLAY")=0 ;This variable set to one if hearing exam occurred based on check of V MEASUREMENT file or V EXAM file
 S APCHSEXC="S APCHSIVD=$$LASTMSR^APCHS11B(APCHSPAT,APCHSMSD)" F APCHSMSC="10","09" Q:APCHS("NO DISPLAY")  D MEASDFN^APCHS11B I APCHSMSD D PROCESS
 I APCHS("NO DISPLAY") G X2
 S APCHSEXC="S APCHSIVD=$O(^AUPNVXAM(""AA"",APCHSPAT,APCHSEXD,""""))" F APCHSEXN=17,23,24 Q:APCHS("NO DISPLAY")  D EXAMDFN^APCHS11 I APCHSEXD D PROCESS
 I 'APCHS("NO DISPLAY") D
 .S APCHSEXD=$O(^AUTTEXAM("C",17,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",23,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",24,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .D DISPLAY
X2 K APCHS("NO DISPLAY"),APCHSYNG,APCHSEXC
 Q
 ;
HEARACCL ;
 I APCHSAGE>18!(APCHSAGE<1) G X5
 S APCHSDIS="HEARING EXAM"
 S APCHSEXC="S APCHSIVD=$$LASTMSR^APCHS11B(APCHSPAT,APCHSMSD)" F APCHSMSC="10","09" D MEASDFN^APCHS11B I APCHSMSD D ACCLYR
 S APCHSEXC="S APCHSIVD=$O(^AUPNVXAM(""AA"",APCHSPAT,APCHSEXD,""""))" F APCHSEXN=17,23,24 D EXAMDFN^APCHS11 I APCHSEXD D ACCLYR
 I '$D(APCHSACL) S APCHSDIS="HEARING EXAM",APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D  G X5
 .S APCHSEXD=$O(^AUTTEXAM("C",17,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",23,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",24,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 .D DISPLAY^APCHS11
 D PROCACCL
X5 K APCHSEXC,APCHSACL
 Q
 ;
PROCESS ;CHECKS V MEASUREMENT FILE OR V EXAM FILE FOR ENTRIES
 X APCHSEXC
 I 'APCHSIVD G X3
 D PASTAGE^APCHS11
 I APCHSOLD<4 S APCHSYNG=$S('$D(APCHSYNG):APCHSIVD,APCHSYNG<APCHSIVD:APCHSYNG,1:APCHSIVD) ;Displays date on health summary of when last hearing/vision meas. occurred
 E  S APCHS("NO DISPLAY")=1
X3 Q
 ;
ACCLYR ; PLACE DATES IN ARRAY
 X APCHSEXC
 I APCHSIVD S APCHSACL(APCHSIVD)=""
 K APCHSIVD
 Q
 ;
PROCACCL ;DETERMINE IF HEARING TEST DUE BASED ON ACCELERATED (YEARLY) SCHEDULE
 S APCHSIVD=$O(APCHSACL(""))
 S APCHSINT=365
 S APCHSDIS="HEARING EXAM"
 D GETDATE^APCHS11,COMPARE^APCHS11
 S APCHSEXD=$O(^AUTTEXAM("C",17,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",23,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 I '$D(APCHSTEX) S APCHSEXD=$O(^AUTTEXAM("C",24,0)),APCHSDF1=9999999.15 D REFDF^APCHS11
 D DISPLAY^APCHS11
 Q
 ;
DISPLAY ;DISPLAY "MAY BE DUE NOW" PROMPT IF APPROPRIATE
 I $D(APCHSYNG) S APCHSDUE="MAY BE DUE NOW",APCHSIVD=APCHSYNG D GETDATE^APCHS11,DISPLAY^APCHS11 G X6
 S APCHSDUE="MAY BE DUE NOW",APCHSDAT="" D DISPLAY^APCHS11
X6 Q
 ;