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

APCDFC1.m

Go to the documentation of this file.
APCDFC1 ; IHS/CMI/LAB - FORMS COUNT (FILE) report process ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
P ; Run by posting date
 S APCDODAT=APCDSD_".9999" F  S APCDODAT=$O(^APCDFORM("B",APCDODAT)) Q:APCDODAT=""!((APCDODAT\1)>APCDED)  S APCDDFN=$O(^APCDFORM("B",APCDODAT,"")) D V1
 Q
V1 ;
 S APCDC=0 F  S APCDC=$O(^APCDFORM(APCDDFN,11,APCDC)) Q:APCDC'=+APCDC  S APCDVDFN=$P(^APCDFORM(APCDDFN,11,APCDC,0),U) I APCDVDFN]"",$D(^AUPNVSIT(APCDVDFN,0)) D PROC
 Q
PROC ;
 I APCDDEC'="ALL",APCDDEC'=$P(^APCDFORM(APCDDFN,11,APCDC,0),U,2) Q
 Q:$P(^APCDFORM(APCDDFN,11,APCDC,0),U,2)=""
 Q:'$D(^VA(200,$P(^APCDFORM(APCDDFN,11,APCDC,0),U,2),0))
 S APCDAP=$P(^VA(200,$P(^APCDFORM(APCDDFN,11,APCDC,0),U,2),0),U)
 S APCDVREC=^AUPNVSIT(APCDVDFN,0)
 S APCDVDAT=$P($P(APCDVREC,U),".")
 Q:'$P(APCDVREC,U,9)
 Q:$P(APCDVREC,U,11)
 Q:'$D(^AUPNVPOV("AD",APCDVDFN))
 Q:'$D(^AUPNVPRV("AD",APCDVDFN))
 D @APCDPROC
 D DATE
SET S ^(APCDDATE)=$S($D(^XTMP("APCDFC",$J,APCDAP,APCDSORT,APCDDATE)):^(APCDDATE)+1,1:1)
 S ^(APCDDATE)=$S($D(^XTMP("APCDFC",$J,APCDAP,APCDSORT,"DEP COUNT",APCDDATE)):^(APCDDATE)+APCDVDES,1:APCDVDES)
 Q:'APCDSUBV
 S ^(APCDVDAT)=$S($D(^XTMP("APCDFC",$J,APCDAP,APCDSORT,"VISIT DATE",APCDDATE,APCDVDAT)):^(APCDVDAT)+1,1:1)
 Q
EOJ ; clean up and exit
 K APCDVREC,APCDCLIN,APCDSKIP,APCD1,APCD2,APCDAP,APCDX,APCDY,APCDVDES,APCDDATE,APCDPROV,APCDSEC,APCDZ
 Q
 ;
1 ;
 S APCDCLIN=$P(APCDVREC,U,8) I APCDCLIN="" S APCDSORT="NO CLINIC ENTERED" Q
 S APCDSORT=$P(^DIC(40.7,APCDCLIN,0),U)
 Q
 ;
2 ;
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".07",DA=APCDVDFN,DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S APCDSORT=^UTILITY("DIQ1",$J,9000010,APCDVDFN,.07,"E")
 K ^UTILITY("DIQ1",$J)
 Q
 ;
4 ;
 S APCDSORT="NONE"
 Q
3 ;TYPE
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".03",DA=APCDVDFN,DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S APCDSORT=^UTILITY("DIQ1",$J,9000010,APCDVDFN,.03,"E")
 K ^UTILITY("DIQ1",$J)
 Q
 ;
DATE ;
 S APCDDATE=$P(APCDODAT,".")
CALDEC ;
 S APCDVDES=0
 S APCDVFLE=9000010 F APCDFL=0:0 S APCDVFLE=$O(^DIC(APCDVFLE)) Q:APCDVFLE>9000010.99!(APCDVFLE'=+APCDVFLE)  D
 .Q:APCDVFLE=9000010.09
 .Q:APCDVFLE=9000010.14
 .Q:APCDVFLE=9000010.22
 .Q:APCDVFLE=9000010.24
 .Q:APCDVFLE=9000010.25
 .Q:APCDVFLE=9000010.31
 .Q:APCDVFLE=9000010.99
 .S APCDVDG=^DIC(APCDVFLE,0,"GL"),APCDVIGR=APCDVDG_"""AD"",APCDVDFN,APCDEDFN)"
 .S APCDEDFN="" F APCDEL=1:1 S APCDEDFN=$O(@APCDVIGR) Q:APCDEDFN'=+APCDEDFN  S APCDVDES=APCDVDES+1
 .Q
 Q
 ;