EASEZPF ;ALB/SCK/GAH - Print 1010EZ Enrollment form ; 10/19/2000
 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**44,51,84**;Sep 5, 2006;Build 2
 ;
 ; These routines print a version of the OMB approved VA10-10EZ form.
 ; No local modifications to these routines will be made.  Any changes
 ; will be provided through the National Patch Module  release process.
 ;
QUE(EASAPP,EASDFN) ; Queue the 1010EZ print
 ;  Input
 ;      EASAPP - Internal entry number in the 1010EZ HOLDING File, #712
 ;      EASDFN - [Optionla] Patient DFN
 ;
 ;  Output
 ;      ZTSK   - Task Number returned from call to Task Manager
 ;
 ;  
 N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK,ZUSR,POP,X,ERR
 ;
 ; Check for conditions to print form.  If conditions not met, quit
 G:$$CHECKS(EASAPP) EXIT
 ;
 W !!?5,*7,"Do not select a slave device for output."
 W !?5,"This output requires a 132 column output printer."
 W !?5,"Output to SCREEN will be unreadable.",!
 ;
 S EASAPP=$G(EASAPP),EASDFN=$G(EASDFN)
 ; Can't be a slave
 S %ZIS="Q",%ZIS("S")="I $P($G(^(1)),U)'[""SLAVE""&($P($G(^(0)),U)'[""SLAVE"")"
 D ^%ZIS
 ;
 G:POP EXIT
 ;EAS*1*51 -- if version # 6 or greater, use new print format
 S ZTRTN="EN^EASEZPF"
 I '$G(EASVRSN) S EASVRSN=$$VERSION^EASEZU4(EASAPP)
 I '(EASVRSN<6) S ZTRTN="EN^EASEZP6F"
 ; Either queue for print or print manually by user choice (EAS*1.0*84)
 I $D(IO("Q")) D  G EXIT ;Queued print chosen
 . S ZUSR=DUZ,ZTDESC="1010EZ PRINT"
 . F X="ZUSR","EASAPP","EASDFN" S ZTSAVE(X)=""
 . D ^%ZTLOAD
 . D HOME^%ZIS
 ;
 ;Manual print chosen
 D @ZTRTN
 D ^%ZISC
 G EXIT
 ;
EXIT Q +$G(ZTSK)
 ;
CHECKS(EASAPP) ; Check for quit conditions
 ;
 Q 0
 N RSLT
 ;
 S X=$$GET1^DIQ(712,EASAPP_",",3.4,"I") D
 . I +X'>0 S ERR(3.4)="The applicant has not been linked to the PATIENT File, #2"
 ;
 S X=$$GET1^DIQ(712,EASAPP_",",5.1,"I") D
 . I +X'>0 S ERR(5.1)="This application has not been reviewed"
 ;
 S X=$$GET1^DIQ(712,EASAPP_",",9.1,"I") D
 . I X>0 S ERR(9.1)="This application has already been closed, thE VA10-10EZ cannot be printed"
 ;
 I $D(ERR)>0 D
 . W !!?3,*7,"The VA10-10EZ for "
 . W $$GET1^DIQ(712,EASAPP_",",1),", ",$$GET1^DIQ(712,EASAPP_",",2),", "
 . W !?3,"WEB submission ID: ",$$GET1^DIQ(712,EASAPP_",",.1)
 . W !?3,"could not be printed for the following reason(s): "
 . S X=0
 . F  S X=$O(ERR(X)) Q:'X  D
 . . W !?5,">> ",ERR(X)
 . S RSLT=1
 ;
 Q $G(RSLT)
 ;
EN ; Entry point to print 1010EZ
 N EALNE,EAINFO,EAABRT,EAADL,ERR
 ;
 D SETUP(.EALNE,.EAINFO,EASAPP,EASDFN)
 ;
 D PAGE1^EASEZPU
 D EN^EASEZPF1(.EALNE,.EAINFO)
 ;
 D PAGE2^EASEZPU
 D EN^EASEZPF2(.EALNE,.EAINFO)
 ;
 D EN^EASEZPF3(.EALNE,.EAINFO)
 ;
 ; Print additional second pages if more than 1 dependent.
 F EAADL=1:1 D  Q:$G(EAABRT)
 . I '$D(^TMP("EZTEMP",$J,"IIB",EAADL)) S EAABRT=1 Q
 . D PAGEN^EASEZPU(EAADL)
 . D EN^EASEZPF2(.EALNE,.EAINFO)
 ;
ENQUIT ; Cleanup temp globals after printing is complete
 K ^TMP("EASEZ",$J)
 K ^TMP("EZDATA",$J)
 K ^TMP("EZINDEX",$J)
 K ^TMP("EZTEMP",$J)
 K ^TMP("EZDISP",$J)
 Q
 ;
SETUP(EALNE,EAINFO,EASAPP,EASDFN) ; Set-up print variables
 ; Input
 ;   EALNE   - Line format array
 ;   EAINFO  - Misc Data
 ;      ("CLRK") - Clerk's intials
 ;      ("ID")   - Web ID from #712
 ;      ("PGE")  - Page number
 ;      ("VET" ) - Veteran's name submitting the application
 ;      ("SSN")  - Veteran's SSN
 ;      ("DISC") - Financial Disclosure status
 ;   EASAPP  - IEN of applicant on the 1010EZ HOLDING File, #712
 ;   EASDFN  - DFN of applicant in the PATIENT File, #2
 ;
 N X
 ;
 ; Build Line array for printout
 S EALNE("ULC")=$S('($D(IOST)#2):"-",IOST["C-":"-",1:"_")
 S EALNE("D")="",EALNE("DD")="",EALNE("UL")=""
 S $P(EALNE("D"),"-",131)="",$P(EALNE("DD"),"=",131)="",$P(EALNE("UL"),EALNE("ULC"),131)=""
 ;
 ; Setup information array
 ; Get clerk's initals
 S ZUSR=$G(ZUSR)
 I +ZUSR>0 D
 . S EAINFO("CLRK")=$$GET1^DIQ(200,ZUSR,1)
 . I EAINFO("CLRK")']"" D
 . . S X=$$GET1^DIQ(200,ZUSR,.01)
 . . S EAINFO("CLRK")=$E($P(X,",",2),1)_$E($P(X,","),1)
 E  D
 . S EAINFO("CLRK")="unk"
 ;
 ; Set data elements
 S EAINFO("PGE")=0
 S EAINFO("ID")=$$GET1^DIQ(712,EASAPP_",",.1)
 S EAINFO("PD")=$$FMTE^XLFDT($$NOW^XLFDT)
 S EAINFO("DISC")=$$GET1^DIQ(712,EASAPP_",",3.8)
 S EAINFO("EASAPP")=EASAPP
 S EAINFO("VET")=$$GET1^DIQ(712,EASAPP_",",1)
 S EAINFO("SSN")=$$GET1^DIQ(712,EASAPP_",",2)
 ;
 ; Retrieve applciation data from holding file, #712
 D EN^EASEZC1(EASAPP)
 D SORT^EASEZC3(EASAPP)
SETQ Q
 ;
HDRMAIN(EALNE) ;
 W @IOF
 W ?75,"OMB APPROVED NO. 2900-0091 / Est. Burden Avg. 20 min.",!,EALNE("DD")
 W !,"D E P A R T M E N T   O F   V E T E R A N S   A F F A I R S",?96,"APPLICATION FOR HEALTH BENEFITS",!,EALNE("DD")
 W !?50,"SECTION I - GENERAL INFORMATION",!,EALNE("D")
 Q
 ;
HDR(EALNE,EAINFO) ;
 W @IOF
 W !,"APPLICATION FOR HEALTH BENEFITS, Continued",?65,"| ",EAINFO("VET"),?100,"| ",EAINFO("SSN")
 W !,EALNE("DD")
 Q
 ;
FT(EALNE,EAINFO) ;
 N %,Y
 ;
 W !,EALNE("DD")
 W !,"AUTOMATED VA FORM 10-10EZ APR 1998",?40,"PRINTED: ",EAINFO("PD")
 W ?80,"Clerk: ",EAINFO("CLRK"),"/",EAINFO("ID")
 W ?120,"Page " S EAINFO("PGE")=EAINFO("PGE")+1 W EAINFO("PGE")
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASEZPF   5200     printed  Sep 23, 2025@19:30:55                                                                                                                                                                                                     Page 2
EASEZPF   ;ALB/SCK/GAH - Print 1010EZ Enrollment form ; 10/19/2000
 +1       ;;1.0;ENROLLMENT APPLICATION SYSTEM;**44,51,84**;Sep 5, 2006;Build 2
 +2       ;
 +3       ; These routines print a version of the OMB approved VA10-10EZ form.
 +4       ; No local modifications to these routines will be made.  Any changes
 +5       ; will be provided through the National Patch Module  release process.
 +6       ;
QUE(EASAPP,EASDFN) ; Queue the 1010EZ print
 +1       ;  Input
 +2       ;      EASAPP - Internal entry number in the 1010EZ HOLDING File, #712
 +3       ;      EASDFN - [Optionla] Patient DFN
 +4       ;
 +5       ;  Output
 +6       ;      ZTSK   - Task Number returned from call to Task Manager
 +7       ;
 +8       ;  
 +9        NEW ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK,ZUSR,POP,X,ERR
 +10      ;
 +11      ; Check for conditions to print form.  If conditions not met, quit
 +12       if $$CHECKS(EASAPP)
               GOTO EXIT
 +13      ;
 +14       WRITE !!?5,*7,"Do not select a slave device for output."
 +15       WRITE !?5,"This output requires a 132 column output printer."
 +16       WRITE !?5,"Output to SCREEN will be unreadable.",!
 +17      ;
 +18       SET EASAPP=$GET(EASAPP)
           SET EASDFN=$GET(EASDFN)
 +19      ; Can't be a slave
 +20       SET %ZIS="Q"
           SET %ZIS("S")="I $P($G(^(1)),U)'[""SLAVE""&($P($G(^(0)),U)'[""SLAVE"")"
 +21       DO ^%ZIS
 +22      ;
 +23       if POP
               GOTO EXIT
 +24      ;EAS*1*51 -- if version # 6 or greater, use new print format
 +25       SET ZTRTN="EN^EASEZPF"
 +26       IF '$GET(EASVRSN)
               SET EASVRSN=$$VERSION^EASEZU4(EASAPP)
 +27       IF '(EASVRSN<6)
               SET ZTRTN="EN^EASEZP6F"
 +28      ; Either queue for print or print manually by user choice (EAS*1.0*84)
 +29      ;Queued print chosen
           IF $DATA(IO("Q"))
               Begin DoDot:1
 +30               SET ZUSR=DUZ
                   SET ZTDESC="1010EZ PRINT"
 +31               FOR X="ZUSR","EASAPP","EASDFN"
                       SET ZTSAVE(X)=""
 +32               DO ^%ZTLOAD
 +33               DO HOME^%ZIS
               End DoDot:1
               GOTO EXIT
 +34      ;
 +35      ;Manual print chosen
 +36       DO @ZTRTN
 +37       DO ^%ZISC
 +38       GOTO EXIT
 +39      ;
EXIT       QUIT +$GET(ZTSK)
 +1       ;
CHECKS(EASAPP) ; Check for quit conditions
 +1       ;
 +2        QUIT 0
 +3        NEW RSLT
 +4       ;
 +5        SET X=$$GET1^DIQ(712,EASAPP_",",3.4,"I")
           Begin DoDot:1
 +6            IF +X'>0
                   SET ERR(3.4)="The applicant has not been linked to the PATIENT File, #2"
           End DoDot:1
 +7       ;
 +8        SET X=$$GET1^DIQ(712,EASAPP_",",5.1,"I")
           Begin DoDot:1
 +9            IF +X'>0
                   SET ERR(5.1)="This application has not been reviewed"
           End DoDot:1
 +10      ;
 +11       SET X=$$GET1^DIQ(712,EASAPP_",",9.1,"I")
           Begin DoDot:1
 +12           IF X>0
                   SET ERR(9.1)="This application has already been closed, thE VA10-10EZ cannot be printed"
           End DoDot:1
 +13      ;
 +14       IF $DATA(ERR)>0
               Begin DoDot:1
 +15               WRITE !!?3,*7,"The VA10-10EZ for "
 +16               WRITE $$GET1^DIQ(712,EASAPP_",",1),", ",$$GET1^DIQ(712,EASAPP_",",2),", "
 +17               WRITE !?3,"WEB submission ID: ",$$GET1^DIQ(712,EASAPP_",",.1)
 +18               WRITE !?3,"could not be printed for the following reason(s): "
 +19               SET X=0
 +20               FOR 
                       SET X=$ORDER(ERR(X))
                       if 'X
                           QUIT 
                       Begin DoDot:2
 +21                       WRITE !?5,">> ",ERR(X)
                       End DoDot:2
 +22               SET RSLT=1
               End DoDot:1
 +23      ;
 +24       QUIT $GET(RSLT)
 +25      ;
EN        ; Entry point to print 1010EZ
 +1        NEW EALNE,EAINFO,EAABRT,EAADL,ERR
 +2       ;
 +3        DO SETUP(.EALNE,.EAINFO,EASAPP,EASDFN)
 +4       ;
 +5        DO PAGE1^EASEZPU
 +6        DO EN^EASEZPF1(.EALNE,.EAINFO)
 +7       ;
 +8        DO PAGE2^EASEZPU
 +9        DO EN^EASEZPF2(.EALNE,.EAINFO)
 +10      ;
 +11       DO EN^EASEZPF3(.EALNE,.EAINFO)
 +12      ;
 +13      ; Print additional second pages if more than 1 dependent.
 +14       FOR EAADL=1:1
               Begin DoDot:1
 +15               IF '$DATA(^TMP("EZTEMP",$JOB,"IIB",EAADL))
                       SET EAABRT=1
                       QUIT 
 +16               DO PAGEN^EASEZPU(EAADL)
 +17               DO EN^EASEZPF2(.EALNE,.EAINFO)
               End DoDot:1
               if $GET(EAABRT)
                   QUIT 
 +18      ;
ENQUIT    ; Cleanup temp globals after printing is complete
 +1        KILL ^TMP("EASEZ",$JOB)
 +2        KILL ^TMP("EZDATA",$JOB)
 +3        KILL ^TMP("EZINDEX",$JOB)
 +4        KILL ^TMP("EZTEMP",$JOB)
 +5        KILL ^TMP("EZDISP",$JOB)
 +6        QUIT 
 +7       ;
SETUP(EALNE,EAINFO,EASAPP,EASDFN) ; Set-up print variables
 +1       ; Input
 +2       ;   EALNE   - Line format array
 +3       ;   EAINFO  - Misc Data
 +4       ;      ("CLRK") - Clerk's intials
 +5       ;      ("ID")   - Web ID from #712
 +6       ;      ("PGE")  - Page number
 +7       ;      ("VET" ) - Veteran's name submitting the application
 +8       ;      ("SSN")  - Veteran's SSN
 +9       ;      ("DISC") - Financial Disclosure status
 +10      ;   EASAPP  - IEN of applicant on the 1010EZ HOLDING File, #712
 +11      ;   EASDFN  - DFN of applicant in the PATIENT File, #2
 +12      ;
 +13       NEW X
 +14      ;
 +15      ; Build Line array for printout
 +16       SET EALNE("ULC")=$SELECT('($DATA(IOST)#2):"-",IOST["C-":"-",1:"_")
 +17       SET EALNE("D")=""
           SET EALNE("DD")=""
           SET EALNE("UL")=""
 +18       SET $PIECE(EALNE("D"),"-",131)=""
           SET $PIECE(EALNE("DD"),"=",131)=""
           SET $PIECE(EALNE("UL"),EALNE("ULC"),131)=""
 +19      ;
 +20      ; Setup information array
 +21      ; Get clerk's initals
 +22       SET ZUSR=$GET(ZUSR)
 +23       IF +ZUSR>0
               Begin DoDot:1
 +24               SET EAINFO("CLRK")=$$GET1^DIQ(200,ZUSR,1)
 +25               IF EAINFO("CLRK")']""
                       Begin DoDot:2
 +26                       SET X=$$GET1^DIQ(200,ZUSR,.01)
 +27                       SET EAINFO("CLRK")=$EXTRACT($PIECE(X,",",2),1)_$EXTRACT($PIECE(X,","),1)
                       End DoDot:2
               End DoDot:1
 +28      IF '$TEST
               Begin DoDot:1
 +29               SET EAINFO("CLRK")="unk"
               End DoDot:1
 +30      ;
 +31      ; Set data elements
 +32       SET EAINFO("PGE")=0
 +33       SET EAINFO("ID")=$$GET1^DIQ(712,EASAPP_",",.1)
 +34       SET EAINFO("PD")=$$FMTE^XLFDT($$NOW^XLFDT)
 +35       SET EAINFO("DISC")=$$GET1^DIQ(712,EASAPP_",",3.8)
 +36       SET EAINFO("EASAPP")=EASAPP
 +37       SET EAINFO("VET")=$$GET1^DIQ(712,EASAPP_",",1)
 +38       SET EAINFO("SSN")=$$GET1^DIQ(712,EASAPP_",",2)
 +39      ;
 +40      ; Retrieve applciation data from holding file, #712
 +41       DO EN^EASEZC1(EASAPP)
 +42       DO SORT^EASEZC3(EASAPP)
SETQ       QUIT 
 +1       ;
HDRMAIN(EALNE) ;
 +1        WRITE @IOF
 +2        WRITE ?75,"OMB APPROVED NO. 2900-0091 / Est. Burden Avg. 20 min.",!,EALNE("DD")
 +3        WRITE !,"D E P A R T M E N T   O F   V E T E R A N S   A F F A I R S",?96,"APPLICATION FOR HEALTH BENEFITS",!,EALNE("DD")
 +4        WRITE !?50,"SECTION I - GENERAL INFORMATION",!,EALNE("D")
 +5        QUIT 
 +6       ;
HDR(EALNE,EAINFO) ;
 +1        WRITE @IOF
 +2        WRITE !,"APPLICATION FOR HEALTH BENEFITS, Continued",?65,"| ",EAINFO("VET"),?100,"| ",EAINFO("SSN")
 +3        WRITE !,EALNE("DD")
 +4        QUIT 
 +5       ;
FT(EALNE,EAINFO) ;
 +1        NEW %,Y
 +2       ;
 +3        WRITE !,EALNE("DD")
 +4        WRITE !,"AUTOMATED VA FORM 10-10EZ APR 1998",?40,"PRINTED: ",EAINFO("PD")
 +5        WRITE ?80,"Clerk: ",EAINFO("CLRK"),"/",EAINFO("ID")
 +6        WRITE ?120,"Page "
           SET EAINFO("PGE")=EAINFO("PGE")+1
           WRITE EAINFO("PGE")
 +7        QUIT