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

APCLADA1.m

Go to the documentation of this file.
APCLADA1 ; IHS/CMI/LAB - PRINT CLINIC VISITS (CALC) ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
CALC ;find visits by date then store by patient name
 ;
 S APCLJOB=$J,APCLBT=$H
 D XTMP^APCLOSUT("APCLADA","PCC VISITS WITH ADA CODES")
 S APCLVDT=APCLBD-.0001
VST S APCLVDT=$O(^AUPNVSIT("B",APCLVDT))
 G NEXT:APCLVDT="",NEXT:APCLVDT>(APCLED+.2359) S APCLVDFN=0
VST1 S APCLVDFN=$O(^AUPNVSIT("B",APCLVDT,APCLVDFN)) G VST:APCLVDFN=""
 ;
 G VST1:'$D(^AUPNVSIT(APCLVDFN,0)) S APCLSTR=^(0)
 G VST1:$P(APCLSTR,"^",11) ;screen out deleted visits
 G VST1:'$D(^AUPNVDEN("AD",APCLVDFN))
 G VST1:$$DEMO^APCLUTL($P(APCLSTR,U,5),$G(APCLDEMO))
 I APCLLOC]"",$P(APCLSTR,U,6)'=APCLLOC Q
 Q:$P(^DPT($P(^AUPNVSIT(APCLVDFN,0),U,5),0),U)["DEMO,PATIENT"
 G:$D(^APCLCNTL(4,11,"B",$P(APCLSTR,"^",3))) VST1
 I APCLCL'="A" G VST1:$P(APCLSTR,"^",8)'=APCLCL
 S APCLCLX=$S(APCLCL=+APCLCL:APCLCL,1:$P(APCLSTR,"^",8))
 S:APCLCLX="" APCLCLX="E"
 ;
 S APCLDFN=$P(APCLSTR,"^",5),APCLNAME=$P(^DPT(APCLDFN,0),"^")
 S ^XTMP("APCLADA",APCLJOB,APCLBT,APCLCLX,APCLNAME,APCLDFN,APCLVDT,APCLVDFN)="" G VST1
 ;
NEXT ;
 S APCLET=$H
 Q
 ;