AQAODIC ; IHS/ORDC/LJF - DIC AND DIE DRIVER FOR PKG ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn is called at entry point DIC and DIE to add or edit file
;entries after the proper variables have been set. The entry point
;SETNUM is called by an input transform.
;Variables required for DIC call: AQAODIC=DIC,AQAODIC(0)=DIC(0)
;Optional variables: AQAODIC("A"),AQAODIC("B"),AQAODIC("S"),AQAODICR
;
;Variables required for DIE call: AQAODIC,AQAODR,AQAODA
;Optional variables: AQAODEL,AQAODA1
;
DIC ;ENTRY POINT >>> set variables and make dic call
K AQAODA G END:'$D(AQAODIC),END:'$D(AQAODIC(0))
W ! K DIC S DIC=AQAODIC,DIC(0)=AQAODIC(0)
S:$D(AQAODIC("A")) DIC("A")=AQAODIC("A")
S:$D(AQAODIC("B")) DIC("B")=AQAODIC("B")
S:$D(AQAODIC("S")) DIC("S")=AQAODIC("S")
S:$D(AQAODICR) DIC("DR")=AQAODICR
S:AQAODIC(0)["L" X=DIC_"0)",DLAYGO=+$P((@X),U,2)
I $D(DLAYGO) S AQAOLCK=DIC_"0)" L +(@AQAOLCK):1 I '$T D G END
.W !!,"FILE LOCKED; CANNOT ADD. TRY AGAIN",! S Y=-1 K AQAOLCK
D ^DIC I $D(AQAOLCK) L -(@AQAOLCK) K AQAOLCK
G END:$D(DTOUT),END:$D(DUOUT),END:X="",DIC:Y=-1 S AQAODA=+Y
;
;
DIE ;ENTRY POINT >>> set variables and make die call
G END:'$D(AQAODIC),END:'$D(AQAODA),END:'$D(AQAODR)
K DIE S DIE=AQAODIC,DA=AQAODA,DR=AQAODR S:$D(AQAODEL) DIDEL=AQAODEL
S:$D(AQAODA1) DA(1)=AQAODA1
S AQAOLCK=DIE_AQAODA_")" L +(@AQAOLCK):1 I '$T W !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ENTRY. TRY AGAIN.",! G END
D ^DIE L -(@AQAOLCK) G END:$D(DTOUT),END:'$D(AQAODIC(0)) G DIC
;
;
END ; >>> end of utility
K DIC,DIE,DLAYGO,DIDEL Q
;
;
SETNUM ;ENTRY POINT to set variables needed in input transform
;for field NUMBER under CRITERIA in QI OCCURRENCE file
S AQAOLOW=$P(^AQAO1(6,AQAOCR,0),U,3) ;lowest number in range
S AQAOHI=$P(^AQAO1(6,AQAOCR,0),U,4) ;highest number in range
Q
AQAODIC ; IHS/ORDC/LJF - DIC AND DIE DRIVER FOR PKG ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn is called at entry point DIC and DIE to add or edit file
+4 ;entries after the proper variables have been set. The entry point
+5 ;SETNUM is called by an input transform.
+6 ;Variables required for DIC call: AQAODIC=DIC,AQAODIC(0)=DIC(0)
+7 ;Optional variables: AQAODIC("A"),AQAODIC("B"),AQAODIC("S"),AQAODICR
+8 ;
+9 ;Variables required for DIE call: AQAODIC,AQAODR,AQAODA
+10 ;Optional variables: AQAODEL,AQAODA1
+11 ;
DIC ;ENTRY POINT >>> set variables and make dic call
+1 KILL AQAODA
IF '$DATA(AQAODIC)
GOTO END
IF '$DATA(AQAODIC(0))
GOTO END
+2 WRITE !
KILL DIC
SET DIC=AQAODIC
SET DIC(0)=AQAODIC(0)
+3 IF $DATA(AQAODIC("A"))
SET DIC("A")=AQAODIC("A")
+4 IF $DATA(AQAODIC("B"))
SET DIC("B")=AQAODIC("B")
+5 IF $DATA(AQAODIC("S"))
SET DIC("S")=AQAODIC("S")
+6 IF $DATA(AQAODICR)
SET DIC("DR")=AQAODICR
+7 IF AQAODIC(0)["L"
SET X=DIC_"0)"
SET DLAYGO=+$PIECE((@X),U,2)
+8 IF $DATA(DLAYGO)
SET AQAOLCK=DIC_"0)"
LOCK +(@AQAOLCK):1
IF '$TEST
Begin DoDot:1
+9 WRITE !!,"FILE LOCKED; CANNOT ADD. TRY AGAIN",!
SET Y=-1
KILL AQAOLCK
End DoDot:1
GOTO END
+10 DO ^DIC
IF $DATA(AQAOLCK)
LOCK -(@AQAOLCK)
KILL AQAOLCK
+11 IF $DATA(DTOUT)
GOTO END
IF $DATA(DUOUT)
GOTO END
IF X=""
GOTO END
IF Y=-1
GOTO DIC
SET AQAODA=+Y
+12 ;
+13 ;
DIE ;ENTRY POINT >>> set variables and make die call
+1 IF '$DATA(AQAODIC)
GOTO END
IF '$DATA(AQAODA)
GOTO END
IF '$DATA(AQAODR)
GOTO END
+2 KILL DIE
SET DIE=AQAODIC
SET DA=AQAODA
SET DR=AQAODR
IF $DATA(AQAODEL)
SET DIDEL=AQAODEL
+3 IF $DATA(AQAODA1)
SET DA(1)=AQAODA1
+4 SET AQAOLCK=DIE_AQAODA_")"
LOCK +(@AQAOLCK):1
IF '$TEST
WRITE !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ENTRY. TRY AGAIN.",!
GOTO END
+5 DO ^DIE
LOCK -(@AQAOLCK)
IF $DATA(DTOUT)
GOTO END
IF '$DATA(AQAODIC(0))
GOTO END
GOTO DIC
+6 ;
+7 ;
END ; >>> end of utility
+1 KILL DIC,DIE,DLAYGO,DIDEL
QUIT
+2 ;
+3 ;
SETNUM ;ENTRY POINT to set variables needed in input transform
+1 ;for field NUMBER under CRITERIA in QI OCCURRENCE file
+2 ;lowest number in range
SET AQAOLOW=$PIECE(^AQAO1(6,AQAOCR,0),U,3)
+3 ;highest number in range
SET AQAOHI=$PIECE(^AQAO1(6,AQAOCR,0),U,4)
+4 QUIT