AMHRP11 ; IHS/CMI/LAB - DETAILED/BRIEF LISTING OF RECORDS, REPORT 1 ;
;;4.0;IHS BEHAVIORAL HEALTH;**4**;JUN 18, 2010;Build 28
;
;
I 'AMHPG G HEADER1
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S AMHQUIT="" Q
W:$D(IOF) @IOF S AMHPG=AMHPG+1
W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
W !?(AMHCW-$L($P(^DIC(4,DUZ(2),0),U))/2),$P(^DIC(4,DUZ(2),0),U),?($S(AMHCW=132:120,1:72)),"Page ",AMHPG,!
S AMHTEXT="BEHAVIORAL HEALTH RECORD LISTING"
W !?(AMHCW-$L(AMHTEXT)/2),AMHTEXT,!
S AMHTEXT="Visit Dates: "_AMHBDD_" and "_AMHEDD
W ?(AMHCW-$L(AMHTEXT)/2),AMHTEXT,!
I $G(AMHSPAG) S AMHLENG=$L(AMHSRTR)+$L(AMHSORV)+2 S:AMHCW<AMHLENG AMHLENG=AMHCW W !?((AMHCW-AMHLENG)/2),AMHSORV,": ",AMHRSRT,!
W $TR($J(" ",AMHCW)," ","=")
I AMHRTYPE="B" W !," DATE",?10,"PROV",?15,"LOC",?20,"PATIENT NAME",?33,"ACT",?37,"CONT",?42,"AT",?46,"HRN",?57,"PROB",?66,"NARRATIVE"
E W !,"DATE/TIME",?16,"PROVIDER",?34,"PD",?38,"PRG",?42,"LOC",?47,"PATIENT",?59,"ACT",?64,"AT",?68,"CONT",?75,"HRN",?84,"SEX",?89,"AGE",?93,"PROB",?102," NARRATIVE"
W !,$TR($J(" ",AMHCW)," ","-")
Q
AMHRP11 ; IHS/CMI/LAB - DETAILED/BRIEF LISTING OF RECORDS, REPORT 1 ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;**4**;JUN 18, 2010;Build 28
+2 ;
+3 ;
+1 IF 'AMHPG
GOTO HEADER1
+2 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET AMHQUIT=""
QUIT
+1 IF $DATA(IOF)
WRITE @IOF
SET AMHPG=AMHPG+1
+2 WRITE !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
+3 WRITE !?(AMHCW-$LENGTH($PIECE(^DIC(4,DUZ(2),0),U))/2),$PIECE(^DIC(4,DUZ(2),0),U),?($SELECT(AMHCW=132:120,1:72)),"Page ",AMHPG,!
+4 SET AMHTEXT="BEHAVIORAL HEALTH RECORD LISTING"
+5 WRITE !?(AMHCW-$LENGTH(AMHTEXT)/2),AMHTEXT,!
+6 SET AMHTEXT="Visit Dates: "_AMHBDD_" and "_AMHEDD
+7 WRITE ?(AMHCW-$LENGTH(AMHTEXT)/2),AMHTEXT,!
+8 IF $GET(AMHSPAG)
SET AMHLENG=$LENGTH(AMHSRTR)+$LENGTH(AMHSORV)+2
IF AMHCW<AMHLENG
SET AMHLENG=AMHCW
WRITE !?((AMHCW-AMHLENG)/2),AMHSORV,": ",AMHRSRT,!
+9 WRITE $TRANSLATE($JUSTIFY(" ",AMHCW)," ","=")
+10 IF AMHRTYPE="B"
WRITE !," DATE",?10,"PROV",?15,"LOC",?20,"PATIENT NAME",?33,"ACT",?37,"CONT",?42,"AT",?46,"HRN",?57,"PROB",?66,"NARRATIVE"
+11 IF '$TEST
WRITE !,"DATE/TIME",?16,"PROVIDER",?34,"PD",?38,"PRG",?42,"LOC",?47,"PATIENT",?59,"ACT",?64,"AT",?68,"CONT",?75,"HRN",?84,"SEX",?89,"AGE",?93,"PROB",?102," NARRATIVE"
+12 WRITE !,$TRANSLATE($JUSTIFY(" ",AMHCW)," ","-")
+13 QUIT