AGMSPFRM ; IHS/ASDS/EFG - PRINT MSP FORM ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
;THIS IS THE DRIVER FOR PRINTING THE MSP FORM.
;IF THE VARIABLE AG("MSPPRINT") IS PRESENT, THE OPTION
;TO PRINT THE PATIENT'S DATA MAPPED TO THE FORM WAS
;SELECTED.
;IF THE VARIABLE IS NOT PRESENT, THE OPTION TO PRINT
;A BLANK FORM WAS SELECTED.
;
I '$D(AG("MSPPRINT")) G BLANK
K DIC,Y,DD,DO
S DIC="^AUPNMSP("
S DIC(0)="AEMQZ"
D ^DIC Q:Y=-1 S AG("DA")=+Y
K DIC,Y,DD,DO
Q:'$D(AG("DA"))
D ^XBCLS
G BLANK2
BLANK D ^XBCLS
D PTLK^AG
Q:X[U
S:'$G(DFN) DFN=""
BLANK2 K DIC,Y,DD,DO
S XBNS="AG;DFN",XBRP="PROCESS^AGMSPFRM" D ^XBDBQUE
K AG("MSPPRINT")
Q
PROCESS ;
K MSPRES
K DIQ,DIQ(0),^UTILITY("DIQ1",$J)
S:$G(AG("DA"))'="" DIC=9000037,DA=AG("DA"),DR=".01:.71;100",DIQ="MSPRES(" D EN^DIQ1
S FORM=0
D HDR,EN^AGMSP1
S FORM=1
D HDR,EN^AGMSP2
D HDR,EN^AGMSP3
D HDR,EN^AGMSP4
D HDR,EN^AGMSP5
D HDR,EN^AGMSP6
D HDR,EN^AGMSP7
K MSPRES
Q
HDR ;PRINT HEADER LINES
W:FORM @IOF
S:$G(DFN)'="" AGPAT=$P(^DPT(DFN,0),U)
S:$G(DFN)'="" AGCHRT=$S($D(^AUPNPAT(DFN,41,DUZ(2),0)):$P(^AUPNPAT(DFN,41,DUZ(2),0),U,2),1:"xxxxx")
S Y=DT D DD^%DT S AG("TODAY")=Y
S AGLINE("-")=$TR($J(" ",79)," ","-")
S AGLINE("EQ")=$TR($J(" ",79)," ","=")
S AGLINE("_")=$TR($J(" ",79)," ","_")
W !,?10,"WARNING: Confidential Patient Information, Privacy Act Applies"
W !,AGLINE("EQ")
W !,?22,"MEDICARE SECONDARY PAYER QUESTIONNAIRE"
W !,AGLINE("-")
W:$G(DFN)'="" !,$G(AGPAT)," (",$G(AGCHRT),")"
W !,?52,"REPORT DATE: "
W:$G(DFN)'="" AG("TODAY")
W !,AGLINE("EQ"),!
Q
AGMSPFRM ; IHS/ASDS/EFG - PRINT MSP FORM ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
+3 ;THIS IS THE DRIVER FOR PRINTING THE MSP FORM.
+4 ;IF THE VARIABLE AG("MSPPRINT") IS PRESENT, THE OPTION
+5 ;TO PRINT THE PATIENT'S DATA MAPPED TO THE FORM WAS
+6 ;SELECTED.
+7 ;IF THE VARIABLE IS NOT PRESENT, THE OPTION TO PRINT
+8 ;A BLANK FORM WAS SELECTED.
+9 ;
+10 IF '$DATA(AG("MSPPRINT"))
GOTO BLANK
+11 KILL DIC,Y,DD,DO
+12 SET DIC="^AUPNMSP("
+13 SET DIC(0)="AEMQZ"
+14 DO ^DIC
IF Y=-1
QUIT
SET AG("DA")=+Y
+15 KILL DIC,Y,DD,DO
+16 IF '$DATA(AG("DA"))
QUIT
+17 DO ^XBCLS
+18 GOTO BLANK2
BLANK DO ^XBCLS
+1 DO PTLK^AG
+2 IF X[U
QUIT
+3 IF '$GET(DFN)
SET DFN=""
BLANK2 KILL DIC,Y,DD,DO
+1 SET XBNS="AG;DFN"
SET XBRP="PROCESS^AGMSPFRM"
DO ^XBDBQUE
+2 KILL AG("MSPPRINT")
+3 QUIT
PROCESS ;
+1 KILL MSPRES
+2 KILL DIQ,DIQ(0),^UTILITY("DIQ1",$JOB)
+3 IF $GET(AG("DA"))'=""
SET DIC=9000037
SET DA=AG("DA")
SET DR=".01:.71;100"
SET DIQ="MSPRES("
DO EN^DIQ1
+4 SET FORM=0
+5 DO HDR
DO EN^AGMSP1
+6 SET FORM=1
+7 DO HDR
DO EN^AGMSP2
+8 DO HDR
DO EN^AGMSP3
+9 DO HDR
DO EN^AGMSP4
+10 DO HDR
DO EN^AGMSP5
+11 DO HDR
DO EN^AGMSP6
+12 DO HDR
DO EN^AGMSP7
+13 KILL MSPRES
+14 QUIT
HDR ;PRINT HEADER LINES
+1 IF FORM
WRITE @IOF
+2 IF $GET(DFN)'=""
SET AGPAT=$PIECE(^DPT(DFN,0),U)
+3 IF $GET(DFN)'=""
SET AGCHRT=$SELECT($DATA(^AUPNPAT(DFN,41,DUZ(2),0)):$PIECE(^AUPNPAT(DFN,41,DUZ(2),0),U,2),1:"xxxxx")
+4 SET Y=DT
DO DD^%DT
SET AG("TODAY")=Y
+5 SET AGLINE("-")=$TRANSLATE($JUSTIFY(" ",79)," ","-")
+6 SET AGLINE("EQ")=$TRANSLATE($JUSTIFY(" ",79)," ","=")
+7 SET AGLINE("_")=$TRANSLATE($JUSTIFY(" ",79)," ","_")
+8 WRITE !,?10,"WARNING: Confidential Patient Information, Privacy Act Applies"
+9 WRITE !,AGLINE("EQ")
+10 WRITE !,?22,"MEDICARE SECONDARY PAYER QUESTIONNAIRE"
+11 WRITE !,AGLINE("-")
+12 IF $GET(DFN)'=""
WRITE !,$GET(AGPAT)," (",$GET(AGCHRT),")"
+13 WRITE !,?52,"REPORT DATE: "
+14 IF $GET(DFN)'=""
WRITE AG("TODAY")
+15 WRITE !,AGLINE("EQ"),!
+16 QUIT