| 1 | MAGJINI ;;WIRMFO/JHC VistaRad Maintenance functions [ 07/07/1999  2:42 PM ] | 
|---|
| 2 | ;;3.0;IMAGING;;Mar 01, 2002 | 
|---|
| 3 | ;990707--created routine | 
|---|
| 4 | ; Subroutines for VistaRad KIDS  inits | 
|---|
| 5 | ; | 
|---|
| 6 | ENV ; "Environment Check" for KIDS Install | 
|---|
| 7 | Q | 
|---|
| 8 | KOLDDD ; K ^DD(2006.631,3),^(4),^DD(2006.631,"B","SEARCH"),^DD(2006.631,"B","SEARCH2") | 
|---|
| 9 | ; K ^DD(2006.631,"GL",3),^(4),^DD(2006.631,"SB",2006.6313,3),^DD(2006.631,"SB",2006.6314,4) | 
|---|
| 10 | Q | 
|---|
| 11 | MAG30T5A ; EP for KIDS PRE-Install init magj 3.0t5 | 
|---|
| 12 | D PREFKIL | 
|---|
| 13 | Q | 
|---|
| 14 | MAG30T5B ; EP for KIDS POST-Install init magj 3.0t5 | 
|---|
| 15 | D B2006631,D2006631 | 
|---|
| 16 | Q | 
|---|
| 17 | MAG30T7A ; EP for KIDS PRE-Install init magj 3.0t7 | 
|---|
| 18 | D BGCSTOP | 
|---|
| 19 | Q | 
|---|
| 20 | MAG30T7B ; EP for KIDS POST-Install init magj 3.0t7 | 
|---|
| 21 | D BGCSTRT | 
|---|
| 22 | Q | 
|---|
| 23 | ; | 
|---|
| 24 | MAG30T8A ; EP for KIDS Pre-Install init magj 3.0t8 | 
|---|
| 25 | ;D BGCSTOP | 
|---|
| 26 | Q | 
|---|
| 27 | MAG30T8B ; EP for KIDS POST-Install init magj 3.0t8 | 
|---|
| 28 | D B2006631,BGCSTRT | 
|---|
| 29 | Q | 
|---|
| 30 | ; | 
|---|
| 31 | MG30T11A ; EP for KIDS Pre-Install init magj 3.0t11 | 
|---|
| 32 | D BGCSTOP | 
|---|
| 33 | Q | 
|---|
| 34 | MG30T11B ; EP for KIDS POST-Install init magj 3.0t11 | 
|---|
| 35 | D BUILD72,B2006631,BGCSTRT | 
|---|
| 36 | Q | 
|---|
| 37 | ; | 
|---|
| 38 | MG30T18A ; EP for KIDS Pre-Install init magj 3.0t18 | 
|---|
| 39 | D INIT63 | 
|---|
| 40 | Q | 
|---|
| 41 | MG30T18B ; EP for KIDS POST-Install init magj 3.0t18 | 
|---|
| 42 | D B2006631 | 
|---|
| 43 | Q | 
|---|
| 44 | ; | 
|---|
| 45 | BUILD72 ; copy Exam Status Category data to RAD file #72 | 
|---|
| 46 | N IEN,CAT,RAIEN S IEN=0 | 
|---|
| 47 | I $D(^MAG(2006.69,"FILE72")) Q  ; already did this | 
|---|
| 48 | F  S IEN=$O(^MAG(2006.61,IEN)) Q:'IEN  S X=$G(^(IEN,0)) D | 
|---|
| 49 | . I X S RAIEN=+X,CAT=$P(X,U,2) I CAT]"",("DETW"[CAT) D | 
|---|
| 50 | . . I '$D(^RA(72,RAIEN)) Q  ; should never occur, but . . . | 
|---|
| 51 | . . S DIE=72,DA=RAIEN,DR="9////"_CAT D ^DIE | 
|---|
| 52 | . . K DIE,DA,DR,DIC | 
|---|
| 53 | S ^MAG(2006.69,"FILE72")=$H | 
|---|
| 54 | Q | 
|---|
| 55 | ; | 
|---|
| 56 | BGCSTOP ; Stop Background Compile program | 
|---|
| 57 | S MAGCSTRT=0,GO=1 K RETRY | 
|---|
| 58 | K ^MAG(2006.69,"KIDS") | 
|---|
| 59 | S X=$G(^MAG(2006.69,1,0)) | 
|---|
| 60 | I X]"",$P(X,U,8) D | 
|---|
| 61 | . S ^MAG(2006.69,"KIDS")=X  ; save current settings for restore later | 
|---|
| 62 | . S MAGCSTRT=1 | 
|---|
| 63 | . S $P(X,U,8)=0 | 
|---|
| 64 | . S ^MAG(2006.69,1,0)=X  ; disable compile | 
|---|
| 65 | . W !!,*7,"Wait for Background Compile program to stop;" | 
|---|
| 66 | . W !,"     this might take up to a few minutes." | 
|---|
| 67 | . S NTRY=100 | 
|---|
| 68 | . F I=1:1:NTRY L +^XTMP("MAGJ2","BKGND2","RUN"):3 I  Q | 
|---|
| 69 | . W !!,"Background Compile " | 
|---|
| 70 | . I  W "Stopped; proceed with install."  L -^XTMP("MAGJ2","BKGND2","RUN") | 
|---|
| 71 | . E  W "NOT Stopped -- Try again? Y// " D | 
|---|
| 72 | . . R X:120 S X=$TR($E(X),"ynYN","YNYN") S RETRY="Y"[X,GO=0 | 
|---|
| 73 | . . S ^MAG(2006.69,1,0)=^MAG(2006.69,"KIDS") K ^MAG(2006.69,"KIDS") | 
|---|
| 74 | I 'GO G BGCSTOP:RETRY W !!,"Exiting out of Install" S XPDQUIT=1 | 
|---|
| 75 | Q | 
|---|
| 76 | BGCSTRT ; re-enable Background Compile | 
|---|
| 77 | I '$D(^MAG(2006.69,"KIDS")) Q  ; had not been enabled | 
|---|
| 78 | S ^MAG(2006.69,1,0)=^MAG(2006.69,"KIDS") K ^MAG(2006.69,"KIDS") | 
|---|
| 79 | W !!,"Background Compile Enabled again" | 
|---|
| 80 | Q | 
|---|
| 81 | ; | 
|---|
| 82 | PREFKIL ; initialize the Prior Exams Logic File (Prefetch logic) | 
|---|
| 83 | I $D(^MAG(2006.65,0)) S X=^(0) D | 
|---|
| 84 | . S $P(X,U,3,4)="0^0" | 
|---|
| 85 | . K ^MAG(2006.65) S ^MAG(2006.65,0)=X | 
|---|
| 86 | Q | 
|---|
| 87 | ; | 
|---|
| 88 | D2006631 ; Clean Up old vs List Definition file | 
|---|
| 89 | K DIU S DIU=2006.6313 S DIU(0)="DS" D EN^DIU2 | 
|---|
| 90 | K DIU S DIU=2006.6314 S DIU(0)="DS" D EN^DIU2 | 
|---|
| 91 | K DIU | 
|---|
| 92 | Q | 
|---|
| 93 | ; | 
|---|
| 94 | INIT63 ; Initialize 2006.63 for re-create updated version | 
|---|
| 95 | ; This must always be followed by running B2006631 | 
|---|
| 96 | K ^MAG(2006.63) | 
|---|
| 97 | Q | 
|---|
| 98 | ; | 
|---|
| 99 | B2006631 ; Create "DEF" nodes, Button labels for updated List Def'ns | 
|---|
| 100 | N SS,LSTDAT,LSTNUM,BUTTON,LSTTYP | 
|---|
| 101 | S SS=0 | 
|---|
| 102 | F  S SS=$O(^MAG(2006.631,SS)) Q:'SS  S LSTDAT=$G(^(SS,0)) I LSTDAT]"" D | 
|---|
| 103 | . S LSTNUM=$P(LSTDAT,U,2),BUTTON=$P(LSTDAT,U,7),LSTTYP=$P(LSTDAT,U,3) | 
|---|
| 104 | . I LSTNUM>9900!$P(LSTDAT,U,6) D BLDDEF^MAGJMN1(SS)  ; build DEF nodes for System Lists & any Enabled lists | 
|---|
| 105 | . I BUTTON="",(LSTTYP]"") D           ; Create Button Labels | 
|---|
| 106 | . . S BUTTON=$S(LSTTYP="U":"Unread #",LSTTYP="R":"Recent #",LSTTYP="A":"All Active #",LSTTYP="P":"Pending #",1:"List #")_LSTNUM | 
|---|
| 107 | . . S $P(^MAG(2006.631,SS,0),U,7)=BUTTON | 
|---|
| 108 | Q | 
|---|
| 109 | END ; | 
|---|