PSSDELOI ;BIR/RTR-Delete Orderable Item File and all pointers; 09/02/97 8:34
;;1.0;PHARMACY DATA MANAGEMENT;;9/30/97
S PSSITE=+$O(^PS(59.7,0)) I +$P($G(^PS(59.7,PSSITE,80)),"^",2)>1 W !?3,"Orderable Item Auto-create has already run to completion!",! K PSSITE Q
K DIR S DIR(0)="Y",DIR("A")="Are you sure it's OK to delete the Orderable Item File",DIR("B")="N" D ^DIR K DIR I Y'=1 W !!?3,"No action taken!",! G END
W !,"THIS WILL JUST TAKE A FEW MINUTES, PLEASE WAIT",!
S PSCREATE=1
W "." F ZZ=0:0 S ZZ=$O(^PS(50.7,ZZ)) Q:'ZZ S DA=ZZ,DIK="^PS(50.7," D ^DIK
W "." F XX=0:0 S XX=$O(^PSDRUG(XX)) Q:'XX S RR=$P($G(^PSDRUG(XX,2)),"^") I RR S DA=XX,DIE="^PSDRUG(",DR="2.1////"_"@" D ^DIE
W "." F YY=0:0 S YY=$O(^PS(52.6,YY)) Q:'YY S RR=$P($G(^PS(52.6,YY,0)),"^",11) I RR S DA=YY,DIE="^PS(52.6,",DR="15////"_"@" D ^DIE
W "." F BB=0:0 S BB=$O(^PS(52.7,BB)) Q:'BB S RR=$P($G(^PS(52.7,BB,0)),"^",11) I RR S DA=BB,DIE="^PS(52.7,",DR="9////"_"@" D ^DIE
S $P(^PS(59.7,PSSITE,80),"^",2)=0
W !,"DONE!",!
END K DIE,DA,YY,BB,XX,ZZ,PSSITE,PSCREATE Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSSDELOI 1058 printed Nov 22, 2024@17:40:48 Page 2
PSSDELOI ;BIR/RTR-Delete Orderable Item File and all pointers; 09/02/97 8:34
+1 ;;1.0;PHARMACY DATA MANAGEMENT;;9/30/97
+2 SET PSSITE=+$ORDER(^PS(59.7,0))
IF +$PIECE($GET(^PS(59.7,PSSITE,80)),"^",2)>1
WRITE !?3,"Orderable Item Auto-create has already run to completion!",!
KILL PSSITE
QUIT
+3 KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Are you sure it's OK to delete the Orderable Item File"
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF Y'=1
WRITE !!?3,"No action taken!",!
GOTO END
+4 WRITE !,"THIS WILL JUST TAKE A FEW MINUTES, PLEASE WAIT",!
+5 SET PSCREATE=1
+6 WRITE "."
FOR ZZ=0:0
SET ZZ=$ORDER(^PS(50.7,ZZ))
if 'ZZ
QUIT
SET DA=ZZ
SET DIK="^PS(50.7,"
DO ^DIK
+7 WRITE "."
FOR XX=0:0
SET XX=$ORDER(^PSDRUG(XX))
if 'XX
QUIT
SET RR=$PIECE($GET(^PSDRUG(XX,2)),"^")
IF RR
SET DA=XX
SET DIE="^PSDRUG("
SET DR="2.1////"_"@"
DO ^DIE
+8 WRITE "."
FOR YY=0:0
SET YY=$ORDER(^PS(52.6,YY))
if 'YY
QUIT
SET RR=$PIECE($GET(^PS(52.6,YY,0)),"^",11)
IF RR
SET DA=YY
SET DIE="^PS(52.6,"
SET DR="15////"_"@"
DO ^DIE
+9 WRITE "."
FOR BB=0:0
SET BB=$ORDER(^PS(52.7,BB))
if 'BB
QUIT
SET RR=$PIECE($GET(^PS(52.7,BB,0)),"^",11)
IF RR
SET DA=BB
SET DIE="^PS(52.7,"
SET DR="9////"_"@"
DO ^DIE
+10 SET $PIECE(^PS(59.7,PSSITE,80),"^",2)=0
+11 WRITE !,"DONE!",!
END KILL DIE,DA,YY,BB,XX,ZZ,PSSITE,PSCREATE
QUIT