[613] | 1 | DGMSRPT ;ALB/LBD - Military Service Inconsistency Report; 01/05/04
|
---|
| 2 | ;;5.3;Registration;**562,603**; Aug 13,1993
|
---|
| 3 | ;
|
---|
| 4 | EN ; Called from DG MS INCONSISTENCIES RPT option
|
---|
| 5 | ; Prompt user to select to run extract or print report
|
---|
| 6 | N DGSEL
|
---|
| 7 | S DGSEL=$$SEL Q:'DGSEL
|
---|
| 8 | S DGSEL="SEL"_DGSEL
|
---|
| 9 | G @DGSEL
|
---|
| 10 | Q
|
---|
| 11 | ;
|
---|
| 12 | SEL() ; Select action: Extract or Print
|
---|
| 13 | ; INPUT: None
|
---|
| 14 | ; OUTPUT: 1=Extract; 2=Print; 0=Quit
|
---|
| 15 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 16 | W !!,"Military Service Data Inconsistencies Report"
|
---|
| 17 | W !,"============================================"
|
---|
| 18 | S DIR(0)="S^1:Extract and Count Inconsistencies;2:Print Inconsistencies Detail Report"
|
---|
| 19 | S DIR("A")="Enter 1 or 2"
|
---|
| 20 | S DIR("?",1)="(1) Extract and Count Inconsistencies - selecting this option will queue a"
|
---|
| 21 | S DIR("?",2)=" process to read through the Patient file and find records with"
|
---|
| 22 | S DIR("?",3)=" inconsistent military service data. The inconsistencies will be"
|
---|
| 23 | S DIR("?",4)=" totaled by category in the Military Service Data Inconsistencies Volume"
|
---|
| 24 | S DIR("?",5)=" Report that will be sent as a mail message to the DGEN ELIGIBILITY ALERT"
|
---|
| 25 | S DIR("?",6)=" mail group. This process must be run before the detail report can"
|
---|
| 26 | S DIR("?",7)=" be printed, and can be rerun as necessary."
|
---|
| 27 | S DIR("?",8)=""
|
---|
| 28 | S DIR("?",9)="(2) Print Inconsistencies Detail Report - selecting this option will"
|
---|
| 29 | S DIR("?",10)=" produce a detail report of the inconsistencies found for"
|
---|
| 30 | S DIR("?",11)=" individual veterans. The report can be sorted by veteran name"
|
---|
| 31 | S DIR("?",12)=" or SSN (terminal digits)."
|
---|
| 32 | S DIR("?")=" "
|
---|
| 33 | D ^DIR I 'Y!($D(DTOUT))!($D(DUOUT)) Q 0
|
---|
| 34 | Q Y
|
---|
| 35 | ;
|
---|
| 36 | SEL1 ; Extract and count military service data inconsistencies from Patient
|
---|
| 37 | ; file #2
|
---|
| 38 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 39 | I '$$CHK W ! S DIR(0)="E" D ^DIR Q
|
---|
| 40 | W !!
|
---|
| 41 | S DIR(0)="Y",DIR("A")="Queue Extract",DIR("B")="NO"
|
---|
| 42 | D ^DIR K DIR Q:'Y!($D(DTOUT))!($D(DUOUT))
|
---|
| 43 | K ^XTMP("DGMSRPT")
|
---|
| 44 | D EXTQUE
|
---|
| 45 | W ! S DIR(0)="E" D ^DIR
|
---|
| 46 | Q
|
---|
| 47 | SEL2 ; Print detail report of military service data inconsistencies
|
---|
| 48 | ; extracted and stored in ^XTMP("DGMSRPT",
|
---|
| 49 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,DGTOT,DGBEG,DGEND,DGSRT
|
---|
| 50 | I $P($G(^XTMP("DGMSRPT","DATE")),U,2)="" D Q
|
---|
| 51 | .W !!,*7,"*** The Extract of Military Service Data Inconsistencies must be run"
|
---|
| 52 | .W !," before the report can be printed."
|
---|
| 53 | .W ! S DIR(0)="E" D ^DIR
|
---|
| 54 | I '$$CHK W ! S DIR(0)="E" D ^DIR Q
|
---|
| 55 | I +$G(^XTMP("DGMSRPT","MSINC","CNT","VET"))=0 W !!,*7,"There are no records to print.",! S DIR(0)="E" D ^DIR Q
|
---|
| 56 | W !!
|
---|
| 57 | S DIR(0)="Y",DIR("A")="Print Report",DIR("B")="YES"
|
---|
| 58 | D ^DIR K DIR Q:'Y!($D(DTOUT))!($D(DUOUT))
|
---|
| 59 | S DGTOT=+$G(^XTMP("DGMSRPT","MSINC","CNT","VET"))
|
---|
| 60 | W !!,"Total veteran records to print: ",DGTOT
|
---|
| 61 | S DGBEG=$$BEG(DGTOT) Q:'DGBEG
|
---|
| 62 | S DGEND=$$END(DGBEG,DGTOT) Q:'DGEND
|
---|
| 63 | S DGSRT=$$SRT Q:DGSRT=""
|
---|
| 64 | D RPTQUE
|
---|
| 65 | Q
|
---|
| 66 | CHK() ; Check if extract can be tasked to run
|
---|
| 67 | ; INPUT: None
|
---|
| 68 | ; OUTPUT: 1=Run Extract; 0=Don't run Extract
|
---|
| 69 | N CHK S CHK=1
|
---|
| 70 | I $G(^XTMP("DGMSRPT","RUNNING")) D Q CHK
|
---|
| 71 | .N ZTSK
|
---|
| 72 | .S ZTSK=^XTMP("DGMSRPT","RUNNING") D STAT^%ZTLOAD
|
---|
| 73 | .I ZTSK(1)=1!(ZTSK(1)=2) W !!,*7,"*** Extract is currently running or queued as task ",^XTMP("DGMSRPT","RUNNING") S CHK=0
|
---|
| 74 | I $P($G(^XTMP("DGMSRPT","DATE")),U,2)'="" W !!,"Extract was last run ",$P(^XTMP("DGMSRPT","DATE"),U,2)
|
---|
| 75 | Q CHK
|
---|
| 76 | ;
|
---|
| 77 | BEG(TOT) ; Get starting record number to print
|
---|
| 78 | ; INPUT: TOT - Total number of veteran records to print
|
---|
| 79 | ; OUTPUT: Y - Starting record number
|
---|
| 80 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 81 | I '$G(TOT) Q 0
|
---|
| 82 | S DIR(0)="NA^1:"_TOT,DIR("A")="Print from record: ",DIR("B")=1
|
---|
| 83 | D ^DIR I 'Y!($D(DTOUT))!($D(DUOUT)) Q 0
|
---|
| 84 | Q Y
|
---|
| 85 | END(BEG,TOT) ; Get ending record number to print
|
---|
| 86 | ; INPUT: BEG - Starting record number to print
|
---|
| 87 | ; TOT - Total number of veteran records to print
|
---|
| 88 | ; OUTPUT: Y - Ending record number
|
---|
| 89 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 90 | I '$G(BEG),'$G(TOT) Q 0
|
---|
| 91 | S DIR(0)="NA^"_BEG_":"_TOT,DIR("A")=" to record: ",DIR("B")=DGTOT
|
---|
| 92 | D ^DIR I 'Y!($D(DTOUT))!($D(DUOUT)) Q 0
|
---|
| 93 | Q Y
|
---|
| 94 | SRT() ; Get sort order
|
---|
| 95 | ; OUPUT: Y - Sort (N=Name; S=SSN)
|
---|
| 96 | N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 97 | S DIR(0)="SA^N:Name;S:SSN (Terminal digits)",DIR("A")="Sort report by Name or SSN (Terminal digits): ",DIR("B")="NAME"
|
---|
| 98 | S DIR("?",1)="Indicate whether the report should be sorted by the"
|
---|
| 99 | S DIR("?")="Veteran's Name or the terminal digits of the Veteran's SSN"
|
---|
| 100 | D ^DIR I $D(DTOUT)!($D(DUOUT)) Q ""
|
---|
| 101 | Q Y
|
---|
| 102 | ;
|
---|
| 103 | EXTQUE ; Queue extract task
|
---|
| 104 | N ZTRTN,ZTDESC,ZTSK,ZTIO,ZTDTH,DIR
|
---|
| 105 | S ZTRTN="EN^DGMSRPT1",ZTIO="",ZTDTH=""
|
---|
| 106 | S ZTDESC="Extract Military Service Inconsistencies"
|
---|
| 107 | D ^%ZTLOAD
|
---|
| 108 | I $G(ZTSK) D Q
|
---|
| 109 | .S ^XTMP("DGMSRPT","RUNNING")=ZTSK
|
---|
| 110 | .W !,"Extract queued as task ",ZTSK
|
---|
| 111 | .W !!,"When the process is completed a message containing the Military Service Data"
|
---|
| 112 | .W !,"Inconsistencies Volume Report will be sent to mail group DGEN ELIGIBILITY ALERT.",!
|
---|
| 113 | W !,*7,"Extract could not be queued!"
|
---|
| 114 | Q
|
---|
| 115 | ;
|
---|
| 116 | RPTQUE ; Get report device. Queue report if requested.
|
---|
| 117 | N POP,ZTRTN,ZTDESC,ZTSAVE,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
|
---|
| 118 | K IOP,%ZIS
|
---|
| 119 | S %ZIS="MQ"
|
---|
| 120 | W !
|
---|
| 121 | D ^%ZIS I POP W !!,*7,"Report Cancelled!",! S DIR(0)="E" D ^DIR Q
|
---|
| 122 | I $D(IO("Q")) D Q
|
---|
| 123 | .S ZTRTN="EN^DGMSRPT2(DGBEG,DGEND,DGSRT)"
|
---|
| 124 | .S ZTDESC="Print Military Service Inconsistencies Report"
|
---|
| 125 | .S (ZTSAVE("DGBEG"),ZTSAVE("DGEND"),ZTSAVE("DGSRT"))=""
|
---|
| 126 | .D ^%ZTLOAD
|
---|
| 127 | .W !!,"Report "_$S($D(ZTSK):"Queued!",1:"Cancelled!")
|
---|
| 128 | .W ! S DIR(0)="E" D ^DIR
|
---|
| 129 | .D HOME^%ZIS
|
---|
| 130 | D EN^DGMSRPT2(DGBEG,DGEND,DGSRT)
|
---|
| 131 | D ^%ZISC
|
---|
| 132 | Q
|
---|
| 133 | ;
|
---|
| 134 | MSG(DGXTMP) ; Send message with counts of inconsistencies when extract completes.
|
---|
| 135 | ;INPUT: DGXTMP - ^XTMP global reference
|
---|
| 136 | N DGMSG,XMDUZ,XMSUB,XMTEXT,XMY,LN,SUB,SITE
|
---|
| 137 | S:$G(DGXTMP)="" DGXTMP="^XTMP(""DGMSRPT"",""MSINC"")"
|
---|
| 138 | S SITE=$P($$SITE^VASITE,U,3) S:SITE="" SITE="UNKNOWN"
|
---|
| 139 | S XMDUZ="STATION #"_SITE
|
---|
| 140 | I $$GET1^DIQ(869.3,"1,",.03,"I")'="P" S XMDUZ=XMDUZ_" [TEST]"
|
---|
| 141 | S XMSUB="MILITARY SERVICE DATA INCONSISTENCIES VOLUME REPORT"
|
---|
| 142 | S (XMY(DUZ),XMY("G.DGEN ELIGIBILITY ALERT"),XMY("HECDQSUPPORT@MED.VA.GOV"))="",XMTEXT="DGMSG("
|
---|
| 143 | S DGMSG(1)="The extract of Military Service data inconsistencies has completed"
|
---|
| 144 | S DGMSG(2)="successfully."
|
---|
| 145 | S DGMSG(3)=""
|
---|
| 146 | S DGMSG(4)="Extract process started: "_$P($G(^XTMP("DGMSRPT","DATE")),U,1)
|
---|
| 147 | S DGMSG(5)="Extract process ended: "_$P($G(^XTMP("DGMSRPT","DATE")),U,2)
|
---|
| 148 | S DGMSG(6)=""
|
---|
| 149 | S DGMSG(7)="Total Veterans with MS Data Inconsistencies: "_+@DGXTMP@("CNT","VET")
|
---|
| 150 | S DGMSG(8)=""
|
---|
| 151 | S DGMSG(9)=$$LJ^XLFSTR(" INCONSISTENCY CATEGORY",55)_$$RJ^XLFSTR("TOTAL",20)
|
---|
| 152 | S DGMSG(10)=$$LJ^XLFSTR("",79,"=")
|
---|
| 153 | S LN=10,SUB=""
|
---|
| 154 | F S SUB=$O(@DGXTMP@("CNT",SUB)) Q:'SUB S LN=LN+1,DGMSG(LN)=$$LJ^XLFSTR($P(^(SUB),U,2),55)_$$RJ^XLFSTR($P(^(SUB),U,1),20)
|
---|
| 155 | D ^XMD
|
---|
| 156 | Q
|
---|
| 157 | ;
|
---|
| 158 | INIT ; Set variables and initialize array for counts
|
---|
| 159 | S DGXTMP="^XTMP(""DGMSRPT"",""MSINC"")"
|
---|
| 160 | S @DGXTMP@("CNT",2)="0^Branch of Service=B.E.C."
|
---|
| 161 | S @DGXTMP@("CNT",3)="0^Branch of Service=Merchant Seaman, No WWII Service"
|
---|
| 162 | S @DGXTMP@("CNT",4)="0^Military Service Episode Data Missing"
|
---|
| 163 | S @DGXTMP@("CNT",5)="0^Military Service Episode Date Imprecise"
|
---|
| 164 | S @DGXTMP@("CNT",6)="0^Military Service Episode End Date Before Start Date"
|
---|
| 165 | S @DGXTMP@("CNT",7)="0^Military Service Episodes Overlap"
|
---|
| 166 | S @DGXTMP@("CNT",8)="0^Combat Data Missing"
|
---|
| 167 | S @DGXTMP@("CNT",9)="0^Combat Date Imprecise"
|
---|
| 168 | S @DGXTMP@("CNT",10)="0^Combat Date Not Valid for Location"
|
---|
| 169 | S @DGXTMP@("CNT",11)="0^Combat Date Not Within MSE"
|
---|
| 170 | S @DGXTMP@("CNT",12)="0^Conflict Data Missing"
|
---|
| 171 | S @DGXTMP@("CNT",13)="0^Conflict Date Imprecise"
|
---|
| 172 | S @DGXTMP@("CNT",14)="0^Conflict Date Not Valid for Location"
|
---|
| 173 | S @DGXTMP@("CNT",15)="0^Conflict Date Not Within MSE"
|
---|
| 174 | S @DGXTMP@("CNT",16)="0^Prisoner of War Data Missing"
|
---|
| 175 | S @DGXTMP@("CNT",17)="0^Prisoner of War Date Imprecise"
|
---|
| 176 | S @DGXTMP@("CNT",18)="0^Prisoner of War Date Not Valid for Location"
|
---|
| 177 | S @DGXTMP@("CNT",19)="0^Prisoner of War Date Not Within MSE"
|
---|
| 178 | S @DGXTMP@("CNT","VET")="0^Number of Veterans with Inconsistent MS Data"
|
---|
| 179 | Q
|
---|