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

DG1010P6.m

Go to the documentation of this file.
DG1010P6 ;ALB/REW - PRINT 1010 CONT'D PART VI ; 15 MAR 92
 ;;5.3;Registration;;Aug 13, 1993
 ;;1
PARTVI D FOOTER^DG1010P2
 G:$G(DGSTOP) CLEANUP^DG1010P7
 D HEADER^DG1010P2
 K DGE,DGINS,DGOT,DGOTHER,DGSC,DGSP,DGVT,DGXX,E
 S DGX=9999999-DFN1
 S DGISDT=$$LYR^DGMTSCU1(DGX) ;LAST YEAR
 D ALL^DGMTU21(DFN,"VSD",DGX,"IPR") ;RETURNS DGDEP,DGREL#,DGINR# & DGINC#
 S DGSP=$D(DGREL("S")) ;1=YES SPOUSE LAST YEAR
 D TOT^DGRP9(.DGINC)
 W !!,?41,"PART VI - INCOME SCREENING DATA OR ANNUAL INCOME",!,$C(13),DGLUND
 S DGP(0)=$G(^DPT(DFN,0))
 I DGSP=0 D
 .S DGRNAM="NOT APPLICABLE",(DGRSEX,DGRSSN,DGRDOB)=""
 E  D
 .S DGDEF=$P($G(DGREL("S")),"^",2)
 .S DGPR=+$G(DGREL("S"))
 .D SETVAR
SPOUSE W !,"1A.  CURRENT MARITAL STATUS: ",$$POINT^DG1010P0(DGP(0),5,11)
 W ?56,"| ","1B.  DATE OF MARRIAGE: ",$G(DGEFFDT),!,?56,"|",?131,$C(13),DGLUND
 S X=$P($G(^DGMT(408.22,+$G(DGINR("V")),0)),U,5)
 W !,"2A. WAS PATIENT MARRIED OR SEPARATED AT THE END OF LAST CALENDAR YEAR?: ",$S((X=1):"YES",(X=0):"NO",1:"UNANSWERED"),!,DGLUND
 W !,"2B. NAME OF SPOUSE",?36,"| ","2C. SEX OF SPOUSE",?56,"| ","2D. SPOUSE'S SOCIAL SECURITY NO",?97,"| ","2E. SPOUSE'S DATE OF BIRTH"
 W !?4,DGRNAM,?36,"| ",?42,DGRSEX,?56,"| ",?62,DGRSSN,?97,"| ",?103,DGRDOB
 W ?131,$C(13),DGLUND
DEP W !!,?60,"3. DEPENDENTS",?131,$C(13),DGLUND,!,?32,"| ",?56,"| ",?71,"| ",?90,"| ",?114,"|"
 W !?5,"A. NAME",?32,"| ","B. SOCIAL SECURITY NO",?56,"| ","C. SEX",?71,"| ","D. DATE OF BIRTH",?90,"| ","E. RELATIONSHIP",?114,"| ","F. DEPENDENT AS"
 W !?32,"| ",?56,"| ",?71,"| ",?90,"| ",?114,"| ","   OF (DATE)",?131,$C(13),DGLUND
 I DGDEP'=0 D
 .F DGCT=1:1 Q:('$D(DGREL("D",DGCT)))  D
 ..S DGDEF=$P(DGREL("D",DGCT),"^",2)
 ..S DGPR=+$G(DGREL("D",DGCT))
 ..D SETVAR
 ..S X=$P($G(^DGPR(408.12,+DGREL("D",DGCT),0)),U,2)
 ..S X=$P($G(^DG(408.11,+X,0)),U,1),DGREL=$S((X=""):"UNANSWERED",1:X)
 ..W !,DGCT,?3,"| ",?8,$E(DGRNAM,1,24),?32,"|    ",DGRSSN,?56,"|    ",DGRSEX,?71,"|    ",DGRDOB,?90,"|    ",DGREL,?114,"|    ",DGEFFDT
 E  D
 .W !?5,"NONE INDICATED",?32,"| ",?56,"| ",?71,"| ",?90,"| ",?114,"| "
 W ?131,$C(13),DGLUND
INC W !!,?40,"4.  PREVIOUS CALENDAR YEAR (",($E(DGISDT,1,3)+1700),") INCOME INFORMATION",!,$C(13),DGLUND
 S X="",$P(X," ",50)="" W !?49,"| ",?86,"AMOUNT",?131,"",$C(13),X," ",$E(DGLUND,51,132)
 W !?5,"CHECK ALL APPLICABLE BOXES",?49,"| ",?69,"| ",?89,"| ",?109,"| "
 W !,?49,"| ",?54,"VETERAN",?69,"| ",?75,"SPOUSE",?89,"| ",?94,"DEPENDENTS",?109,"| ",?118,"TOTAL",?131,$C(13),DGLUND
 S DGGTOT=0
LOOP F I=1:1:10 S DGPCE=$P("8^9^10^11^12^13^14^15^16^17^",U,I) D
 .D GETINC
 .W !,DGCHECK,?3,"| ",$P($T(INCTEXT+I),";;",2),?49,"| ",$J($$AMT^DGMTSCU1(DGVETINC),15),?69,"| ",$J($$AMT^DGMTSCU1(DGSPOINC),15),?89,"| ",$J($$AMT^DGMTSCU1(DGDEPINC),15),?109,"| ",$J($$AMT^DGMTSCU1(DGTOTINC),15),?131,$C(13),DGLUND
 W !?109,"| ",!,?11,"11.  TOTAL INCOME",?109,"| ",$J($$AMT^DGMTSCU1(DGGTOT),15),?131,$C(13),DGLUND
 K DGEFFDT,DGPR
 G PARTVII^DG1010P7
 Q
GETINC ;
 S DGCHECK=""
 S (DGVETINC,DGSPOINC,DGDEPINC,DGTOTINC)=""
 I $D(DGTOT("V")) S DGVETINC=$P(DGTOT("V"),U,DGPCE) S DGTOTINC=DGVETINC
 I $D(DGTOT("S")) S DGSPOINC=$P(DGTOT("S"),U,DGPCE) S:DGSPOINC]"" DGTOTINC=(+DGTOTINC+DGSPOINC)
 I $D(DGTOT("D")) S DGDEPINC=$P(DGTOT("D"),U,DGPCE) S:DGDEPINC]"" DGTOTINC=(+DGTOTINC+DGDEPINC)
 I DGTOTINC]"" S DGGTOT=DGGTOT+DGTOTINC,DGCHECK=" X "
 Q
SETVAR ;
 S (DGRSEX,DGRDOB,DGRSSN)="",DGRNAM="UNANSWERED"
 I DGDEF']"" Q
 S DGNODE=$G(@(U_$P(DGDEF,";",2)_$P(DGDEF,";",1)_",0)"))
 S X=$P(DGNODE,"^",1),DGRNAM=$S((X=""):"UNANSWERED",1:X)
 S X=$P(DGNODE,"^",2),DGRSEX=$S((X=""):"UNANSWERED",(X="F"):"FEMALE",(X="M"):"MALE",1:"INVALID")
 S Y=$P(DGNODE,"^",3) X ^DD("DD") S DGRDOB=$S((Y=""):"UNANSWERED",1:Y)
 S X=$P(DGNODE,"^",9),DGRSSN=$S((X=""):"UNANSWERED",1:$E(X,1,3)_"-"_$E(X,4,5)_"-"_$E(X,6,10))
 S DGEFFDT=$$DATENP^DG1010P0($G(^DGPR(408.12,+DGPR,"E",1,0)),1)
 Q
INCTEXT ;
 ;;1.  SOCIAL SECURITY (NOT SSI)
 ;;2.  U.S. CIVIL SERVICE
 ;;3.  U.S. RAILROAD RETIREMENT
 ;;4.  MILITARY RETIREMENT
 ;;5.  UNEMPLOYMENT COMPENSATION
 ;;6.  OTHER RETIREMENT
 ;;7.  TOTAL INCOME FROM EMPLOYMENT 
 ;;8.  INTEREST, DIVIDEND, OR ANNUITY INCOME
 ;;9.  WORKERS COMPENSATION/BLACK LUNG BENEFITS
 ;;10. ALL OTHER INCOME