| 1 | PRCHCHK ;WISC/DJM/DGL-IFCAP FILE COMPARE UTILITY ; 11/3/99 12:43pm
 | 
|---|
| 2 | V ;;5.1;IFCAP;;Oct 20, 2000
 | 
|---|
| 3 |  ;Per VHA Directive 10-93-142, this routine should not be modified.
 | 
|---|
| 4 |  ;
 | 
|---|
| 5 |  ;This routine compares the site's file 442.3 with DATA in PRCHCHK3.
 | 
|---|
| 6 |  ;
 | 
|---|
| 7 |  ;DATA is the information that will be compared with
 | 
|---|
| 8 |  ;the GLOBAL nodes.
 | 
|---|
| 9 |  ;
 | 
|---|
| 10 |  ;  All entries in DATA have one ";" in front.
 | 
|---|
| 11 |  ;
 | 
|---|
| 12 |  ;  The DATA section is set up with two lines of information.
 | 
|---|
| 13 |  ;  The first line is the full NODE of the record.
 | 
|---|
| 14 |  ;  The second line is the data entered into the NODE.  If there
 | 
|---|
| 15 |  ;  is no data for a NODE the second line will be empty.  The second
 | 
|---|
| 16 |  ;  line will always be entered, even if it has no data.
 | 
|---|
| 17 |  ;
 | 
|---|
| 18 |  ;  The terminator of DATA is always ";;END".
 | 
|---|
| 19 |  ;
 | 
|---|
| 20 | SETUP ;  FLAG STATES
 | 
|---|
| 21 |  ;
 | 
|---|
| 22 |  ;  FLAG=0   CONTINUE CHEKING.
 | 
|---|
| 23 |  ;  FLAG=1   STOP CHECKING, NODE DOESN'T MATCH DATA.
 | 
|---|
| 24 |  ;  FLAG=2   VERIFY THAT NO MORE NODES EXIST IN THE FILE.
 | 
|---|
| 25 |  ;           ";;END" FOUND.
 | 
|---|
| 26 |  ;
 | 
|---|
| 27 |  N DIFROM,FLAG,ROOT,START,LOOP,POINT,ND,SEARCH,NODE,VALUE,DATA,ZZ,X,FN
 | 
|---|
| 28 |  N XMY,XMDUN,XMSUB,XMDUZ,XMTEXT,COUNT,FILE,CC,Y
 | 
|---|
| 29 |  S FLAG=0
 | 
|---|
| 30 |  S ROOT="^PRCD(442.3"
 | 
|---|
| 31 |  S START=0
 | 
|---|
| 32 |  ;
 | 
|---|
| 33 | CHECK ;Site file compared to national DATA
 | 
|---|
| 34 |  ;
 | 
|---|
| 35 |  S LOOP=START
 | 
|---|
| 36 |  S POINT=2
 | 
|---|
| 37 |  S ND=0  ;ND=NODE or DATA
 | 
|---|
| 38 |  S SEARCH=ROOT_","
 | 
|---|
| 39 |  F  S LOOP=$O(@(SEARCH_LOOP_")")) Q:LOOP=""  Q:LOOP="AC"  D  Q:FLAG>0
 | 
|---|
| 40 |  .  S NODE=$P($T(DATA+POINT+ND^PRCHCHK3),";",2,99)
 | 
|---|
| 41 |  .  I NODE["END" D  Q:FLAG>0
 | 
|---|
| 42 |  .  .  S NODE=$P(NODE,";",2,99)
 | 
|---|
| 43 |  .  .  I NODE=";;END" S FLAG=2 Q
 | 
|---|
| 44 |  .  .  I NODE[";" S FLAG=1 Q
 | 
|---|
| 45 |  .  .  Q
 | 
|---|
| 46 |  .  I ND=0 D
 | 
|---|
| 47 |  .  .  S NODE=$P($T(DATA+POINT+ND^PRCHCHK3),";",2,99)
 | 
|---|
| 48 |  .  .  S VALUE=SEARCH_LOOP_",0)"
 | 
|---|
| 49 |  .  .  I NODE=VALUE D  Q
 | 
|---|
| 50 |  .  .  .  S ND=ND+1#2
 | 
|---|
| 51 |  .  .  .  Q
 | 
|---|
| 52 |  .  .  S FLAG=1
 | 
|---|
| 53 |  .  .  Q
 | 
|---|
| 54 |  .  I ND=1 D
 | 
|---|
| 55 |  .  .  S NODE=$P($T(DATA+POINT+ND^PRCHCHK3),";",2,99)
 | 
|---|
| 56 |  .  .  S DATA=@(SEARCH_LOOP_",0)")
 | 
|---|
| 57 |  .  .  I DATA=NODE D  Q
 | 
|---|
| 58 |  .  .  .  S ND=ND+1#2
 | 
|---|
| 59 |  .  .  .  S POINT=POINT+2
 | 
|---|
| 60 |  .  .  .  Q
 | 
|---|
| 61 |  .  .  S FLAG=1
 | 
|---|
| 62 |  .  .  Q
 | 
|---|
| 63 |  .  Q
 | 
|---|
| 64 |  ;
 | 
|---|
| 65 | MESSAGE ;Determine results of comparison
 | 
|---|
| 66 |  ;
 | 
|---|
| 67 |  I FLAG=2 D
 | 
|---|
| 68 |  .  S LOOP=$O(@(SEARCH_LOOP_")")) Q:LOOP=""  D
 | 
|---|
| 69 |  .  .  S FLAG=1
 | 
|---|
| 70 |  .  Q
 | 
|---|
| 71 |  I FLAG=0,LOOP="" S FLAG=1
 | 
|---|
| 72 |  I FLAG=0,LOOP="AC" S FLAG=2
 | 
|---|
| 73 |  ;
 | 
|---|
| 74 |  I FLAG=1 D ERROR
 | 
|---|
| 75 |  I FLAG=2 D OK
 | 
|---|
| 76 |  Q
 | 
|---|
| 77 |  ;
 | 
|---|
| 78 | OK ;Site's file conforms to standard (Modified for MailMan 7.1 *50)
 | 
|---|
| 79 |  ;
 | 
|---|
| 80 |  K ZZ,XMY
 | 
|---|
| 81 |  X ^%ZOSF("UCI")
 | 
|---|
| 82 |  S FN=$P(ROOT,"(",2)
 | 
|---|
| 83 |  S ZZ(1)="File, "_FN_", has been checked by patch PRC*5*236 and"
 | 
|---|
| 84 |  S ZZ(2)="has been found to conform to the national standard."
 | 
|---|
| 85 |  S ZZ(3)="  "
 | 
|---|
| 86 |  S ZZ(4)="No further action is required by your SITE."
 | 
|---|
| 87 |  S ZZ(5)=" "
 | 
|---|
| 88 |  S ZZ(6)="SITE: "_$G(^DD("SITE"))
 | 
|---|
| 89 |  S ZZ(7)="UCI: "_Y
 | 
|---|
| 90 |  S XMY("I:G.STATUS UPDATES@FORUM.VA.GOV")=""
 | 
|---|
| 91 |  S XMY("I:G.IRM")=""
 | 
|---|
| 92 |  S XMY(DUZ)=""
 | 
|---|
| 93 |  S XMDUN="IFCAP File Checker"
 | 
|---|
| 94 |  S XMSUB="OK File "_FN_" at "_$G(^DD("SITE"))
 | 
|---|
| 95 |  S XMDUZ="IFCAP File Checker"
 | 
|---|
| 96 |  S XMBODY="ZZ"
 | 
|---|
| 97 |  D SENDMSG^XMXAPI(DUZ,XMSUB,XMBODY,.XMY)
 | 
|---|
| 98 |  Q
 | 
|---|
| 99 |  ;
 | 
|---|
| 100 | ERROR ;Site's file does NOT conform to standard (Modified for MailMan 7.1 *50)
 | 
|---|
| 101 |  ;Send notification of error to IRM and Status Updates
 | 
|---|
| 102 |  K ZZ,XMY
 | 
|---|
| 103 |  S FN=$P(ROOT,"(",2)
 | 
|---|
| 104 |  X ^%ZOSF("UCI")
 | 
|---|
| 105 |  S ZZ(1)="A discrepancy was noted in your data by patch PRC*5*236 in file "_FN_"."
 | 
|---|
| 106 |  S ZZ(2)="Both the data and the data dictionary for file "_FN_" were"
 | 
|---|
| 107 |  S ZZ(3)="sent to 'G.STATUS UPDATES' at FORUM."
 | 
|---|
| 108 |  S ZZ(4)="  "
 | 
|---|
| 109 |  S ZZ(5)="The Washington CIOFO will review the data."
 | 
|---|
| 110 |  S ZZ(6)="  "
 | 
|---|
| 111 |  S ZZ(7)="There is no action required of your SITE at this time."
 | 
|---|
| 112 |  S ZZ(8)="  "
 | 
|---|
| 113 |  S ZZ(9)="SITE: "_$G(^DD("SITE"))
 | 
|---|
| 114 |  S ZZ(10)="UCI: "_Y
 | 
|---|
| 115 |  S XMDUN="IFCAP File Checker"
 | 
|---|
| 116 |  S XMSUB="Problem in File "_FN
 | 
|---|
| 117 |  S XMDUZ="IFCAP File Checker"
 | 
|---|
| 118 |  S XMBODY="ZZ"
 | 
|---|
| 119 |  S XMY(DUZ)=""
 | 
|---|
| 120 |  S XMY("I:G.STATUS UPDATES@FORUM.VA.GOV")=""
 | 
|---|
| 121 |  S XMY("I:G.IRM")=""
 | 
|---|
| 122 |  D SENDMSG^XMXAPI(DUZ,XMSUB,XMBODY,.XMY)
 | 
|---|
| 123 |  ;
 | 
|---|
| 124 |  ;Send the 'DD' and the data from FILE 442.3 to 'G.STATUS UPDATES'
 | 
|---|
| 125 |  K ZZ,XMY
 | 
|---|
| 126 |  X ^%ZOSF("UCI")
 | 
|---|
| 127 |  S ZZ(1)="This file, "_FN_", does not match the data sent in patch PRC*5*236."
 | 
|---|
| 128 |  S ZZ(2)="  "
 | 
|---|
| 129 |  S ZZ(3)="SITE: "_$G(^DD("SITE"))
 | 
|---|
| 130 |  S ZZ(4)="UCI: "_Y
 | 
|---|
| 131 |  S ZZ(5)="  "
 | 
|---|
| 132 |  S XMDUN="IFCAP File Checker"
 | 
|---|
| 133 |  S XMSUB="Problem in File "_FN_" "_$G(^DD("SITE"))
 | 
|---|
| 134 |  S XMDUZ="IFCAP File Checker"
 | 
|---|
| 135 |  S XMBODY="ZZ"
 | 
|---|
| 136 |  S XMY("I:G.STATUS UPDATES@FORUM.VA.GOV")=""
 | 
|---|
| 137 |  ;
 | 
|---|
| 138 |  ;Load DD for file 442.3 into message array
 | 
|---|
| 139 |  S COUNT=6
 | 
|---|
| 140 |  S ZZ(COUNT)="DD FOR FILE 442.3"
 | 
|---|
| 141 |  S COUNT=COUNT+1
 | 
|---|
| 142 |  S FILE="^DD(442.3)"
 | 
|---|
| 143 |  F  S FILE=$Q(@FILE) Q:FILE=""  Q:$P($P(FILE,"(",2),",",1)>FN  D
 | 
|---|
| 144 |  .  S ZZ(COUNT)=FILE_" = "_@FILE
 | 
|---|
| 145 |  .  S COUNT=COUNT+1
 | 
|---|
| 146 |  .  Q
 | 
|---|
| 147 |  ;
 | 
|---|
| 148 |  ;Put space between DD and data
 | 
|---|
| 149 |  F CC=1:1:3 S ZZ(COUNT)="  ",COUNT=COUNT+1
 | 
|---|
| 150 |  S ZZ(COUNT)="DATA FROM FILE 442.3"
 | 
|---|
| 151 |  S COUNT=COUNT+1
 | 
|---|
| 152 |  ;
 | 
|---|
| 153 |  ;Load data from file 442.3 into message array
 | 
|---|
| 154 |  S FILE="^PRCD(442.3)"
 | 
|---|
| 155 |  F  S FILE=$Q(@FILE) Q:FILE=""  Q:$P($P(FILE,"(",2),",",1)>FN  D
 | 
|---|
| 156 |  .  S ZZ(COUNT)=FILE_" = "_@FILE
 | 
|---|
| 157 |  .  S COUNT=COUNT+1
 | 
|---|
| 158 |  .  Q
 | 
|---|
| 159 |  ;
 | 
|---|
| 160 |  ;Send completed message
 | 
|---|
| 161 |  D SENDMSG^XMXAPI(DUZ,XMSUB,XMBODY,.XMY)
 | 
|---|
| 162 |  Q
 | 
|---|