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

VAQDBIM3.m

Go to the documentation of this file.
VAQDBIM3 ;ALB/JRP - MEANS TEST EXTRACTION (SCREEN 3);4-MAR-93
 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
 ; **********
 ; * PARTS OF THIS ROUTINE HAVE BEEN COPIED AND ALTERED FROM THE
 ; * DGMTSC* ROUTINES.  FOR MODULES THIS WAS DONE FOR, A REFERENCE
 ; * TO THE DGMTSC* ROUTINE WILL BE INCLUDE.
 ; **********
 ;
XTRCT3(DFN,ARRAY,OFFSET) ;EXTRACT SCREEN 3
 ;DEDUCTABLE EXPENSES INFORMATION
 ;This module is based on DIS^DGMTSC3
 ;
 ;INPUT  : See EXTRACT^VAQDBIM for explanation of parameters.  Input
 ;         also includes all DG* variables required to build screen.
 ;OUTPUT : n - Number of lines in display
 ;         -1^Error_text - Error
 ;
 ;CHECK INPUT
 Q:('$D(DFN)) "-1^Pointer to patient file not passed"
 Q:('$D(ARRAY)) "-1^Reference to output array not passed"
 Q:('$D(OFFSET)) "-1^Starting offset not passed"
 ;DECLARE VARIABLES
 N DGDC,DGCNT,DGDCS,DGDEP,DGIN1,DGINC,DGINR,DGREL,DGVIR0,TMP,LINES
 N COUNT,CHILD
 ;EXTRACT HEADER
 S LINES=OFFSET
 S TMP=$$HEADER^VAQDBIM0(3,ARRAY,OFFSET)
 Q:(TMP<0) TMP
 S OFFSET=LINES+TMP
 ;INITIALIZE MEANS TEST VARIABLES
 S DGVIR0=$G(^DGMT(408.22,DGVIRI,0)),DGIN1("V")=$G(^DGMT(408.21,DGVINI,1))
 S DGDC=$P(DGVIR0,"^",8) I DGDC D SET^DGMTSC31 S:'$D(DGDCS) DGDC=0
 S TMP=$$INSERT^VAQUTL1("Medical Expenses: ","",19)_$$AMT^DGMTSCU1($P(DGIN1("V"),"^"))
 S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 S OFFSET=OFFSET+1
 S TMP=$$INSERT^VAQUTL1("Funeral and Burial Expenses: ","",8)_$S('$P(DGVIR0,"^",5)&('$P(DGVIR0,"^",8)):"N/A",1:$$AMT^DGMTSCU1($P(DGIN1("V"),"^",2)))
 S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 S OFFSET=OFFSET+1
 S TMP=$$INSERT^VAQUTL1("Veteran's Educational Expenses: ","",5)_$$AMT^DGMTSCU1($P(DGIN1("V"),"^",3))
 S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 S OFFSET=OFFSET+1
 S @ARRAY@("DISPLAY",OFFSET,0)=""
 S OFFSET=OFFSET+1
 S TMP=$$INSERT^VAQUTL1("Child's Education Expenses: ","",5)_$S('DGDC:"N/A",1:"")
 S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 S OFFSET=OFFSET+1
 ;EXTRACT DEPENDENT CHILDREN WITH EMPLOYMENT INCOME
 I DGDC D
 .;SET COLUMN HEADINGS
 .S @ARRAY@("DISPLAY",OFFSET,0)=""
 .S OFFSET=OFFSET+1
 .S TMP=$$INSERT^VAQUTL1("Child's","",9)
 .S TMP=$$INSERT^VAQUTL1("Employment",TMP,25)
 .S TMP=$$INSERT^VAQUTL1("Post-secondary",TMP,37)
 .S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 .S OFFSET=OFFSET+1
 .S TMP=$$INSERT^VAQUTL1("First Name","",9)
 .S TMP=$$INSERT^VAQUTL1("Income",TMP,25)
 .S TMP=$$INSERT^VAQUTL1("Education Expenses",TMP,36)
 .S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 .S OFFSET=OFFSET+1
 .S TMP=$$INSERT^VAQUTL1($$REPEAT^VAQUTL1("-",12),"",9)
 .S TMP=$$INSERT^VAQUTL1($$REPEAT^VAQUTL1("-",10),TMP,25)
 .S TMP=$$INSERT^VAQUTL1($$REPEAT^VAQUTL1("-",18),TMP,37)
 .S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 .S OFFSET=OFFSET+1
 .;EXTRACT INFO FOR EACH DEPENDENT CHILD
 .S COUNT=0 F  S COUNT=$O(DGDCS(COUNT)) Q:'COUNT  S CHILD=DGDCS(COUNT) D CHILD
 Q (OFFSET-LINES)
 ;
CHILD ;EXTRACT EMPLOYMENT INCOME AND EXPENSES FOR A DEPENDENT CHILD
 ;This module is based on CHILD^DGMTSC31
 N DGIN0,DGIN1,TMP,Y
 S DGIN0=$G(^DGMT(408.21,+$G(DGINC("C",CHILD)),0)),DGIN1=$G(^(1))
 S TMP=$$INSERT^VAQUTL1((COUNT_"."),"",5)
 S Y=$E($P($$NAME^DGMTU1(+DGREL("C",CHILD)),",",2),1,12)
 S TMP=$$INSERT^VAQUTL1(Y,TMP,9)
 S Y=$J($$AMT^DGMTSCU1($P(DGIN0,"^",14)),10)
 S TMP=$$INSERT^VAQUTL1(Y,TMP,25)
 S Y=$J($S(($P(DGIN0,"^",14)-$P(DGMTPAR,"^",17))>0:$$AMT^DGMTSCU1($P(DGIN1,"^",3)),1:"N/A"),10)
 S TMP=$$INSERT^VAQUTL1(Y,TMP,45)
 S @ARRAY@("DISPLAY",OFFSET,0)=TMP
 S OFFSET=OFFSET+1
 Q