AMHFC1 ; IHS/CMI/LAB - FORMS COUNT (FILE) report process ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
P ; Run by posting date
D XTMP^AMHUTIL("AMHFC","BH FORMS COUNT REPORT")
S AMHODAT=AMHSD_".9999" F S AMHODAT=$O(^AMHREC("AD",AMHODAT)) Q:AMHODAT=""!((AMHODAT\1)>AMHED) D V1
Q
V1 ;
S AMHVSIT="" F S AMHVSIT=$O(^AMHREC("AD",AMHODAT,AMHVSIT)) Q:AMHVSIT'=+AMHVSIT I $D(^AMHREC(AMHVSIT,0)) D PROC
Q
PROC ;
I AMHDEC'="ALL",AMHDEC'=$P(^AMHREC(AMHVSIT,0),U,19) Q
Q:$P(^AMHREC(AMHVSIT,0),U,19)=""
Q:'$D(^VA(200,$P(^AMHREC(AMHVSIT,0),U,19),0))
S AMHAP=$P(^VA(200,$P(^AMHREC(AMHVSIT,0),U,19),0),U)
S AMHVREC=^AMHREC(AMHVSIT,0)
S D=$P(AMHVREC,U,8) I D,$$DEMO^AMHUTIL1(D,$G(AMHDEMO))
S AMHDATE=$P(AMHODAT,".")
SET S ^(AMHDATE)=$S($D(^XTMP("AMHFC",$J,AMHAP,AMHDATE)):^(AMHDATE)+1,1:1)
Q
EOJ ; clean up and exit
K AMHVREC,AMHCLIN,AMHSKIP,AMH1,AMH2,AMHAP,AMHX,AMHY,AMHVDES,AMHDATE,AMHPROV,AMHSEC,AMHZ
Q
;
;
AMHFC1 ; IHS/CMI/LAB - FORMS COUNT (FILE) report process ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
P ; Run by posting date
+1 DO XTMP^AMHUTIL("AMHFC","BH FORMS COUNT REPORT")
+2 SET AMHODAT=AMHSD_".9999"
FOR
SET AMHODAT=$ORDER(^AMHREC("AD",AMHODAT))
IF AMHODAT=""!((AMHODAT\1)>AMHED)
QUIT
DO V1
+3 QUIT
V1 ;
+1 SET AMHVSIT=""
FOR
SET AMHVSIT=$ORDER(^AMHREC("AD",AMHODAT,AMHVSIT))
IF AMHVSIT'=+AMHVSIT
QUIT
IF $DATA(^AMHREC(AMHVSIT,0))
DO PROC
+2 QUIT
PROC ;
+1 IF AMHDEC'="ALL"
IF AMHDEC'=$PIECE(^AMHREC(AMHVSIT,0),U,19)
QUIT
+2 IF $PIECE(^AMHREC(AMHVSIT,0),U,19)=""
QUIT
+3 IF '$DATA(^VA(200,$PIECE(^AMHREC(AMHVSIT,0),U,19),0))
QUIT
+4 SET AMHAP=$PIECE(^VA(200,$PIECE(^AMHREC(AMHVSIT,0),U,19),0),U)
+5 SET AMHVREC=^AMHREC(AMHVSIT,0)
+6 SET D=$PIECE(AMHVREC,U,8)
IF D
IF $$DEMO^AMHUTIL1(D,$GET(AMHDEMO))
+7 SET AMHDATE=$PIECE(AMHODAT,".")
SET SET ^(AMHDATE)=$SELECT($DATA(^XTMP("AMHFC",$JOB,AMHAP,AMHDATE)):^(AMHDATE)+1,1:1)
+1 QUIT
EOJ ; clean up and exit
+1 KILL AMHVREC,AMHCLIN,AMHSKIP,AMH1,AMH2,AMHAP,AMHX,AMHY,AMHVDES,AMHDATE,AMHPROV,AMHSEC,AMHZ
+2 QUIT
+3 ;
+4 ;