[613] | 1 | DGMSRPT2 ;ALB/LBD - Military Service Inconsistency Report; 01/05/04
|
---|
| 2 | ;;5.3;Registration;**562**; Aug 13,1993
|
---|
| 3 | ;
|
---|
| 4 | ; This routine prints the Military Service Data Inconsistencies
|
---|
| 5 | ; report from the extracted data stored in ^XTMP("DSMSRPT").
|
---|
| 6 | ;
|
---|
| 7 | ;
|
---|
| 8 | EN(DGBEG,DGEND,DGSRT) ; Entry point called from ^DGMSRPT
|
---|
| 9 | ; INPUT: DGBEG - Starting record number to print
|
---|
| 10 | ; DGEND - Ending record number to print
|
---|
| 11 | ; DGSRT - Sort order for report (Name or SSN)
|
---|
| 12 | N PG,LINE,RPTDT,CRT,OUT,DSH,CNT,MXLNE,DGXTMP,DGTOT,LOOP
|
---|
| 13 | S:$G(ZTSK) ZTREQ="@"
|
---|
| 14 | D PRTVAR
|
---|
| 15 | U IO D HDR
|
---|
| 16 | I 'DGTOT W !!,?10,"*** There are no records to print ***" S OUT=$$PAUSE Q
|
---|
| 17 | S LOOP="LOOP"_DGSRT
|
---|
| 18 | D @LOOP Q:OUT
|
---|
| 19 | D TOT Q:OUT
|
---|
| 20 | W ! S OUT=$$PAUSE
|
---|
| 21 | Q
|
---|
| 22 | LOOPN ; Sort by name. Loop through ^XTMP("DGMSRPT","MSINC","NAM", x-ref
|
---|
| 23 | N NM,DFN
|
---|
| 24 | S NM=""
|
---|
| 25 | F S NM=$O(@DGXTMP@("NAM",NM)) Q:NM=""!(CNT>DGEND)!OUT S DFN="" F S DFN=$O(@DGXTMP@("NAM",NM,DFN)) Q:DFN=""!(CNT>DGEND)!OUT S CNT=CNT+1 I CNT'<DGBEG,CNT'>DGEND D PRINT
|
---|
| 26 | Q
|
---|
| 27 | LOOPS ; Sort by SSN. Loop through ^XTMP("DGMSRPT","MSINC","SSN", x-ref
|
---|
| 28 | N S2,S4,S9,DFN
|
---|
| 29 | S S2=""
|
---|
| 30 | F S S2=$O(@DGXTMP@("SSN",S2)) Q:S2=""!(CNT>DGEND)!OUT S S4="" F S S4=$O(@DGXTMP@("SSN",S2,S4)) Q:S4=""!(CNT>DGEND)!OUT D
|
---|
| 31 | . S S9=""
|
---|
| 32 | . F S S9=$O(@DGXTMP@("SSN",S2,S4,S9)) Q:S9=""!(CNT>DGEND)!OUT S DFN="" F S DFN=$O(@DGXTMP@("SSN",S2,S4,S9,DFN)) Q:DFN=""!(CNT>DGEND)!OUT S CNT=CNT+1 I CNT'<DGBEG,CNT'>DGEND D PRINT
|
---|
| 33 | Q
|
---|
| 34 | PRINT ; Print detail
|
---|
| 35 | N VET,CT,CAT,IN
|
---|
| 36 | Q:'$D(@DGXTMP@(DFN))
|
---|
| 37 | S VET=$G(@DGXTMP@(DFN,0))
|
---|
| 38 | I LINE>MXLNE S OUT=$$PAUSE Q:OUT D HDR
|
---|
| 39 | W !,$P(VET,U,2),?12,$E($P(VET,U,1),1,25)
|
---|
| 40 | S LINE=LINE+1,CAT=0
|
---|
| 41 | F CT=1:1 S CAT=$O(@DGXTMP@(DFN,CAT)) Q:CAT=""!OUT D
|
---|
| 42 | . I CT>1 D
|
---|
| 43 | . . I LINE>MXLNE S OUT=$$PAUSE Q:OUT D HDR
|
---|
| 44 | . . W ! S LINE=LINE+1
|
---|
| 45 | . W ?37,CAT
|
---|
| 46 | . S IN="" F S IN=$O(@DGXTMP@(DFN,CAT,IN)) Q:IN=""!OUT D
|
---|
| 47 | . . I IN>1 D Q:OUT
|
---|
| 48 | . . . I LINE>MXLNE S OUT=$$PAUSE Q:OUT D HDR
|
---|
| 49 | . . . W ! S LINE=LINE+1
|
---|
| 50 | . . W ?43,@DGXTMP@(DFN,CAT,IN)
|
---|
| 51 | Q
|
---|
| 52 | TOT ; Print total records at the end of the report
|
---|
| 53 | I LINE+5>MXLNE S OUT=$$PAUSE Q:OUT D HDR
|
---|
| 54 | W !!," Starting Record #:",$$RJ^XLFSTR(DGBEG,7)
|
---|
| 55 | W !," Ending Record #:",$$RJ^XLFSTR(DGEND,7)
|
---|
| 56 | W !!,"Total Records Printed:",$$RJ^XLFSTR((DGEND-DGBEG)+1,7)," out of ",DGTOT
|
---|
| 57 | Q
|
---|
| 58 | PRTVAR ; Set up variables needed to print report
|
---|
| 59 | S CRT=$S($E(IOST,1,2)="C-":1,1:0)
|
---|
| 60 | S DGXTMP="^XTMP(""DGMSRPT"",""MSINC"")"
|
---|
| 61 | S DGTOT=+$G(@DGXTMP@("CNT","VET"))
|
---|
| 62 | S:'$G(DGBEG) DGBEG=1 S:'$G(DGEND) DGEND=DGTOT
|
---|
| 63 | S:$G(DGSRT)="" DGSRT="N"
|
---|
| 64 | S (PG,CNT,OUT)=0,RPTDT=$$FMTE^XLFDT(DT),MXLNE=$S(CRT:15,1:52)
|
---|
| 65 | S DSH="",$P(DSH,"=",80)=""
|
---|
| 66 | Q
|
---|
| 67 | HDR ; Print report header
|
---|
| 68 | S PG=PG+1,LINE=0
|
---|
| 69 | W @IOF
|
---|
| 70 | W ?0,"Report Date: ",RPTDT,?68,"Page: ",$$RJ^XLFSTR(PG,4)
|
---|
| 71 | W !,"Sorted By: "_$S(DGSRT="N":"Name",1:"SSN (Terminal Digits)")
|
---|
| 72 | W !!,$$CJ^XLFSTR("MILITARY SERVICE DATA INCONSISTENCIES DETAIL REPORT",80)
|
---|
| 73 | W !!,"SSN",?12,"Veteran's Name",?37,"Cat. Inconsistencies"
|
---|
| 74 | W !,DSH
|
---|
| 75 | Q
|
---|
| 76 | PAUSE() ; If report is sent to screen, prompt for next page or quit
|
---|
| 77 | N DIR,DIRUT,DUOUT,DTOUT,X,Y
|
---|
| 78 | I 'CRT Q 0
|
---|
| 79 | S DIR(0)="E"
|
---|
| 80 | D ^DIR I 'Y Q 1
|
---|
| 81 | Q 0
|
---|