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

APCLRPL1.m

Go to the documentation of this file.
APCLRPL1 ; IHS/CMI/LAB - PROCESS R-DMG-510 ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;
START ;
 S (APCLBT,APCLBTH)=$H,APCLJOB=$J,APCLRCNT=0,APCLPTCT=0
 D XTMP^APCLOSUT("APCLRPL","PCC - DMG PAT LISTING")
 D PP,END
 Q
 ;
 ;
PP ;
 S DFN=0 F  S DFN=$O(^DPT(DFN)) Q:DFN'=+DFN  I '$P(^DPT(DFN,0),U,19) D PROC
 Q
 ;
END ;
 S APCLET=$H
 Q
PROC ;
 Q:$$DEMO^APCLUTL(DFN,$G(APCLDEMO))
 K APCLSPEC
 D SCREENS
 Q:$D(APCLSKIP)
 K APCLSRT,APCLPRNT S APCLCRIT=APCLSORT,APCLX=0
 X:$D(^APCLVSTS(APCLSORT,4)) ^APCLVSTS(APCLSORT,4) I '$D(APCLPRNT) D
 . I APCLPTVS="V" S Y=$P($P(APCLVREC,U),".") S APCLPRNT=Y Q
 . S APCLPRNT=$P(^DPT(DFN,0),U)
 .Q
 S APCLSRT=APCLPRNT
 S ^XTMP("APCLRPL",APCLJOB,APCLBTH,"DATA HITS",APCLSRT,DFN)="",APCLRCNT=APCLRCNT+1
 Q:$D(^XTMP("APCLRPL",APCLJOB,APCLBTH,"PATIENTS",DFN))!($D(APCLSCNT))
 S ^XTMP("APCLRPL",APCLJOB,APCLBTH,"PATIENTS",DFN)="",APCLPTCT=APCLPTCT+1
 Q
SCREENS ;
 K APCLSKIP
 S APCLI=0 F  S APCLI=$O(^APCLVRPT(APCLRPT,11,APCLI)) Q:APCLI'=+APCLI!($D(APCLSKIP))  D
 .I '$P(^APCLVSTS(APCLI,0),U,8) D SINGLE Q
 .D MULT
 .Q
 Q
SINGLE ;
 K X,APCLSPEC S X="",APCLX=0
 X:$D(^APCLVSTS(APCLI,1)) ^(1)
 I X="" S APCLSKIP="" Q
 I '$D(APCLSPEC),'$D(^APCLVRPT(APCLRPT,11,APCLI,11,"B",X)) S APCLSKIP="" Q
 Q
MULT ;
 K APCLFOUN,APCLSKIP,APCLSPEC,X S APCLX=0,X=""
 X:$D(^APCLVSTS(APCLI,1)) ^(1)
 I $O(X(""))="" S APCLSKIP="" Q
 I '$D(APCLSPEC) S Y="" F  S Y=$O(X(Y)) Q:Y=""  I $D(^APCLVRPT(APCLRPT,11,APCLI,11,"B",Y)) S APCLFOUN="" Q
 I $D(APCLSPEC),$G(X) S APCLFOUN=1 Q
 S:'$D(APCLFOUN) APCLSKIP=""
 Q