RMPR29L2 ;HOIFO/SPS - WORK ORDER HRS/RATE GRID OWL PROGRAM ;11/8/05 07:12
;;3.0;PROSTHETICS;**75**;Feb 09, 1996;Build 25
;
;
A1(RMPR6642) ;entry point for testing
D A2
Q
EN(RESULT,RMPR6642) ; -- Broker callback to get list to display
A2 ;
S DATE=2010101,CNT=0
K ^TMP($J)
I '$D(^RMPR(664.2,RMPR6642,0)) Q
S RM660=$P(^RMPR(664.2,RMPR6642,0),U,2)
I +RM660'>0 S RESULTS=1_"No Appliance/Repair record for this work order" Q
D REC
G EXIT
Q
K DATE,RESULTS,RM660,RMDTE
REC ;records to grid
;
;
N DIC,DIQ,DR,STOPDT
;
;Get Work Order Labor Data and add to array
S RMIE3="",RMIE33=0
F S RMIE3=$O(^RMPR(664.3,"C",RM660,RMIE3)) Q:RMIE3="" D
. Q:'$D(^RMPR(664.3,RMIE3,0))
. S RMDT=$P(^RMPR(664.3,RMIE3,0),U)
. S RMDTE=$$DAT2^RMPRUTL1(RMDT)
. S CNT=0
. F S RMIE33=$O(^RMPR(664.3,RMIE3,1,RMIE33)) Q:RMIE33="" D
.. Q:'$D(^RMPR(664.3,RMIE3,1,RMIE33,0))
.. S RMPAI=$P(^RMPR(664.3,RMIE3,1,RMIE33,0),U,1)
.. S RMPAE=$$EXTERNAL^DILFD(664.33,.01,"",RMPAI)
.. S RMHR=$P(^RMPR(664.3,RMIE3,1,RMIE33,0),U,2),RMRT=$P(^(0),U,3)
.. S CNT=CNT+1
.. S ^TMP($J,"RMLH",RMDT,CNT)=0_U_RMDTE_U_RMPAE_U_RMHR_U_RMRT_U_RMPR6642_U_RMPAI_U_RMIE3_U_RMIE33
K CNT,RMIE3,RMIE33,RMDT,RMPAI,RMPAE,RMHR,RMRT
;PUT RESULTS IN GLOBAL!!
Q
EXIT ;common exit point
S RESULT=$NA(^TMP($J))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPR29L2 1320 printed Dec 13, 2024@02:32:14 Page 2
RMPR29L2 ;HOIFO/SPS - WORK ORDER HRS/RATE GRID OWL PROGRAM ;11/8/05 07:12
+1 ;;3.0;PROSTHETICS;**75**;Feb 09, 1996;Build 25
+2 ;
+3 ;
A1(RMPR6642) ;entry point for testing
+1 DO A2
+2 QUIT
EN(RESULT,RMPR6642) ; -- Broker callback to get list to display
A2 ;
+1 SET DATE=2010101
SET CNT=0
+2 KILL ^TMP($JOB)
+3 IF '$DATA(^RMPR(664.2,RMPR6642,0))
QUIT
+4 SET RM660=$PIECE(^RMPR(664.2,RMPR6642,0),U,2)
+5 IF +RM660'>0
SET RESULTS=1_"No Appliance/Repair record for this work order"
QUIT
+6 DO REC
+7 GOTO EXIT
+8 QUIT
+9 KILL DATE,RESULTS,RM660,RMDTE
REC ;records to grid
+1 ;
+2 ;
+3 NEW DIC,DIQ,DR,STOPDT
+4 ;
+5 ;Get Work Order Labor Data and add to array
+6 SET RMIE3=""
SET RMIE33=0
+7 FOR
SET RMIE3=$ORDER(^RMPR(664.3,"C",RM660,RMIE3))
if RMIE3=""
QUIT
Begin DoDot:1
+8 if '$DATA(^RMPR(664.3,RMIE3,0))
QUIT
+9 SET RMDT=$PIECE(^RMPR(664.3,RMIE3,0),U)
+10 SET RMDTE=$$DAT2^RMPRUTL1(RMDT)
+11 SET CNT=0
+12 FOR
SET RMIE33=$ORDER(^RMPR(664.3,RMIE3,1,RMIE33))
if RMIE33=""
QUIT
Begin DoDot:2
+13 if '$DATA(^RMPR(664.3,RMIE3,1,RMIE33,0))
QUIT
+14 SET RMPAI=$PIECE(^RMPR(664.3,RMIE3,1,RMIE33,0),U,1)
+15 SET RMPAE=$$EXTERNAL^DILFD(664.33,.01,"",RMPAI)
+16 SET RMHR=$PIECE(^RMPR(664.3,RMIE3,1,RMIE33,0),U,2)
SET RMRT=$PIECE(^(0),U,3)
+17 SET CNT=CNT+1
+18 SET ^TMP($JOB,"RMLH",RMDT,CNT)=0_U_RMDTE_U_RMPAE_U_RMHR_U_RMRT_U_RMPR6642_U_RMPAI_U_RMIE3_U_RMIE33
End DoDot:2
End DoDot:1
+19 KILL CNT,RMIE3,RMIE33,RMDT,RMPAI,RMPAE,RMHR,RMRT
+20 ;PUT RESULTS IN GLOBAL!!
+21 QUIT
EXIT ;common exit point
+1 SET RESULT=$NAME(^TMP($JOB))
+2 QUIT