ORWLRRG1 ;SLC/STAFF- lab worksheet data processing ;07/28/09 11:35
;;3.0;ORDER ENTRY/RESULTS REPORTING;**280**;Dec 17, 1997;Build 85
;
NTESTS ; from ORWLRRG
N BTEST,ETEST,INFO,NUM,REFCHECK,TEST,TESTCNT
S TESTCNT=0
S NUM=0
F S NUM=$O(^TMP("ORWORK",$J,"TEST",NUM)) Q:NUM<1 D
. S INFO=^TMP("ORWORK",$J,"TEST",NUM)
. S TEST=+$P(INFO,U,2),BTEST=(TEST-1)_U_"Z",ETEST=TEST_U_"Z"
. S REFCHECK=BTEST
. F S REFCHECK=$O(^TMP("ORWORK",$J,"REFCHECK",REFCHECK)) Q:REFCHECK]ETEST Q:REFCHECK="" D
.. I $P(REFCHECK,U)=TEST D
... S TESTCNT=TESTCNT+1
... S ^TMP("ORWORK",$J,"NTESTS",TESTCNT)=TESTCNT_U_$P(INFO,U,2,3)_U_REFCHECK
... S ^TMP("ORWORK",$J,"REFCHECK",REFCHECK)=TESTCNT
S ^TMP("ORWORK",$J,"NTESTS",0)=TESTCNT
Q
;
NRESULTS ; from ORWLRRG
N ACNT,COL,COLNUM,CNT,FLAG,INFO,NUM,REFCHECK,RESULT,TESTNUM
S ACNT=0,CNT=0
S NUM=0
F S NUM=$O(^TMP("ORWORK",$J,"RESULTS",NUM)) Q:NUM<1 D
. S INFO=^TMP("ORWORK",$J,"RESULTS",NUM)
. S COL=+$P(INFO,U,3)
. S REFCHECK=+$P(INFO,U,2)_U_+$P(INFO,U,7)_U
. I $L($P(INFO,U,10,11)) S REFCHECK=REFCHECK_$P(INFO,U,10,11)
. E S REFCHECK=$G(^TMP("ORWORK",$J,"TESTSPEC",REFCHECK))
. I '$L(REFCHECK) Q
. S REFCHECK=$$UP^XLFSTR(REFCHECK)
. S TESTNUM=$G(^TMP("ORWORK",$J,"REFCHECK",REFCHECK))
. I 'TESTNUM Q
. S COLNUM=$G(^TMP("ORWORK",$J,"COL",COL))
. I 'COLNUM Q
. S CNT=CNT+1
. S RESULT=$P(INFO,U,5),FLAG=$P(INFO,U,6)
. S ^TMP("ORWORK",$J,"NRESULTS",CNT)=COLNUM_U_TESTNUM_U_RESULT_U_FLAG
. I $L(FLAG) D AB(.ACNT,REFCHECK,COL,RESULT,FLAG)
S ^TMP("ORWORK",$J,"NRESULTS",0)=CNT
D ARESULTS
Q
;
AB(ACNT,REFCHECK,COL,RESULT,FLAG) ;
S ACNT=ACNT+1
S ^TMP("ORWORK",$J,"RESULTSA",ACNT)=REFCHECK_U_COL_U_RESULT_U_FLAG
S ^TMP("ORWORK",$J,"REFCHECKA",REFCHECK)=""
S ^TMP("ORWORK",$J,"COLA",COL)=""
Q
;
ARESULTS ;
N COL,COLNUM,CNT,FLAG,INFO,NUM,REFCHECK,RESULT,TESTNUM
D ACOL
D NACOL
D ATESTS
S CNT=0,NUM=0
F S NUM=$O(^TMP("ORWORK",$J,"RESULTSA",NUM)) Q:NUM<1 D
. S INFO=^TMP("ORWORK",$J,"RESULTSA",NUM)
. S COL=+$P(INFO,U,5)
. S REFCHECK=$P(INFO,U,1,4)
. S TESTNUM=$G(^TMP("ORWORK",$J,"REFCHECKA",REFCHECK))
. I 'TESTNUM Q
. S COLNUM=$G(^TMP("ORWORK",$J,"COLA",COL))
. I 'COLNUM Q
. S CNT=CNT+1
. S RESULT=$P(INFO,U,6),FLAG=$P(INFO,U,7)
. S ^TMP("ORWORK",$J,"NRESULTSA",CNT)=COLNUM_U_TESTNUM_U_RESULT_U_FLAG
S ^TMP("ORWORK",$J,"NRESULTSA",0)=CNT
Q
;
ACOL ;
N COL,COLCNT
S COLCNT=0
S COL=""
F S COL=$O(^TMP("ORWORK",$J,"COLA",COL),-1) Q:COL="" D
. S COLCNT=COLCNT+1
. S ^TMP("ORWORK",$J,"COLA",COL)=COLCNT
S ^TMP("ORWORK",$J,"COLA",0)=COLCNT
Q
NACOL ;
N CNT,COL,COMMENT,INEXACT,INFO,NUM,SNUM,SPEC,SPECNAME
S CNT=0
S NUM=0
F S NUM=$O(^TMP("ORWORK",$J,"SPEC",NUM)) Q:NUM<1 D
. S INFO=^TMP("ORWORK",$J,"SPEC",NUM)
. S COL=$P(INFO,U,2)
. S SNUM=$G(^TMP("ORWORK",$J,"COLA",COL)) I SNUM D
.. S COMMENT=$P(INFO,U,1),INEXACT=$P(INFO,U,3),SPEC=$P(INFO,U,6)
.. S SPECNAME=$G(^TMP("ORWORK",$J,"SPECNAME",SPEC))
.. I INEXACT=1 S INEXACT=COL\1
.. E S INEXACT=COL
.. S ^TMP("ORWORK",$J,"NCOLA",NUM)=SNUM_U_COL_U_SPEC_U_SPECNAME_U_COMMENT_U_INEXACT
.. S CNT=CNT+1
S ^TMP("ORWORK",$J,"NCOLA",0)=CNT
Q
;
ATESTS ;
N BTEST,ETEST,INFO,NUM,REFCHECK,TEST,TESTCNT
S TESTCNT=0
S NUM=0
F S NUM=$O(^TMP("ORWORK",$J,"TEST",NUM)) Q:NUM<1 D
. S INFO=^TMP("ORWORK",$J,"TEST",NUM)
. S TEST=+$P(INFO,U,2),BTEST=(TEST-1)_U_"Z",ETEST=TEST_U_"Z"
. S REFCHECK=BTEST
. F S REFCHECK=$O(^TMP("ORWORK",$J,"REFCHECKA",REFCHECK)) Q:REFCHECK]ETEST Q:REFCHECK="" D
.. I $P(REFCHECK,U)=TEST D
... S TESTCNT=TESTCNT+1
... S ^TMP("ORWORK",$J,"NTESTSA",TESTCNT)=TESTCNT_U_$P(INFO,U,2,3)_U_REFCHECK
... S ^TMP("ORWORK",$J,"REFCHECKA",REFCHECK)=TESTCNT
S ^TMP("ORWORK",$J,"NTESTSA",0)=TESTCNT
Q
;
SPECREF ; from ORWLRRG
N CNT,HIGH,INFO,LOW,RANGE,REF,SNAME,SPEC,SUB,TEST,UNITS
S CNT=0
S REF=""
F S REF=$O(^TMP("ORWORK",$J,"REFCHECK",REF)) Q:REF="" D
. S SUB=+^TMP("ORWORK",$J,"REFCHECK",REF)
. S TEST=+$P(REF,U),SPEC=+$P(REF,U,2),RANGE=$P(REF,U,3),UNITS=$P(REF,U,4)
. S LOW=$P(RANGE,"!"),HIGH=$P(RANGE,"!",2)
. S SNAME=$G(^TMP("ORWORK",$J,"SPECNAME",SPEC))
. S CNT=CNT+1
. S ^TMP("ORWORK",$J,"SPECREF",SUB)=TEST_U_SNAME_U_SPEC_U_LOW_U_HIGH_U_UNITS
S ^TMP("ORWORK",$J,"SPECREF",0)=CNT
Q
;
COMBINE ; from ORWLRRG
N ACOLCNT,ARESCNT,ATESTCNT,CNT,COLCNT,INFO,RESCNT,SUB,TESTCNT,TOSPEC,TOCOM,TSCNT
S COLCNT=+$G(^TMP("ORWORK",$J,"NCOL",0))
S TESTCNT=+$G(^TMP("ORWORK",$J,"NTESTS",0))
S RESCNT=+$G(^TMP("ORWORK",$J,"NRESULTS",0))
S ACOLCNT=+$G(^TMP("ORWORK",$J,"NCOLA",0))
S ATESTCNT=+$G(^TMP("ORWORK",$J,"NTESTSA",0))
S ARESCNT=+$G(^TMP("ORWORK",$J,"NRESULTSA",0))
S TSCNT=^TMP("ORWORK",$J,"SPECREF",0)
S TOSPEC=COLCNT+TESTCNT+RESCNT+ACOLCNT+ATESTCNT+ARESCNT+2
S TOCOM=TOSPEC+TSCNT
S ^TMP("ORGRID",$J,1)=TESTCNT_U_COLCNT_U_RESCNT_U_TOSPEC_U_TOCOM
S CNT=1
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NTESTS",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NTESTS",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NCOL",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NCOL",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NRESULTS",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NRESULTS",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S CNT=CNT+1
S ^TMP("ORGRID",$J,CNT)=ATESTCNT_U_ACOLCNT_U_ARESCNT
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NTESTSA",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NTESTSA",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NCOLA",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NCOLA",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"NRESULTSA",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"NRESULTSA",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"SPECREF",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"SPECREF",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
S SUB=0
F S SUB=$O(^TMP("ORWORK",$J,"COMMENTS",SUB)) Q:SUB<1 D
. S INFO=^TMP("ORWORK",$J,"COMMENTS",SUB)
. S CNT=CNT+1
. S ^TMP("ORGRID",$J,CNT)=INFO
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWLRRG1 6234 printed Dec 13, 2024@02:36:43 Page 2
ORWLRRG1 ;SLC/STAFF- lab worksheet data processing ;07/28/09 11:35
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**280**;Dec 17, 1997;Build 85
+2 ;
NTESTS ; from ORWLRRG
+1 NEW BTEST,ETEST,INFO,NUM,REFCHECK,TEST,TESTCNT
+2 SET TESTCNT=0
+3 SET NUM=0
+4 FOR
SET NUM=$ORDER(^TMP("ORWORK",$JOB,"TEST",NUM))
if NUM<1
QUIT
Begin DoDot:1
+5 SET INFO=^TMP("ORWORK",$JOB,"TEST",NUM)
+6 SET TEST=+$PIECE(INFO,U,2)
SET BTEST=(TEST-1)_U_"Z"
SET ETEST=TEST_U_"Z"
+7 SET REFCHECK=BTEST
+8 FOR
SET REFCHECK=$ORDER(^TMP("ORWORK",$JOB,"REFCHECK",REFCHECK))
if REFCHECK]ETEST
QUIT
if REFCHECK=""
QUIT
Begin DoDot:2
+9 IF $PIECE(REFCHECK,U)=TEST
Begin DoDot:3
+10 SET TESTCNT=TESTCNT+1
+11 SET ^TMP("ORWORK",$JOB,"NTESTS",TESTCNT)=TESTCNT_U_$PIECE(INFO,U,2,3)_U_REFCHECK
+12 SET ^TMP("ORWORK",$JOB,"REFCHECK",REFCHECK)=TESTCNT
End DoDot:3
End DoDot:2
End DoDot:1
+13 SET ^TMP("ORWORK",$JOB,"NTESTS",0)=TESTCNT
+14 QUIT
+15 ;
NRESULTS ; from ORWLRRG
+1 NEW ACNT,COL,COLNUM,CNT,FLAG,INFO,NUM,REFCHECK,RESULT,TESTNUM
+2 SET ACNT=0
SET CNT=0
+3 SET NUM=0
+4 FOR
SET NUM=$ORDER(^TMP("ORWORK",$JOB,"RESULTS",NUM))
if NUM<1
QUIT
Begin DoDot:1
+5 SET INFO=^TMP("ORWORK",$JOB,"RESULTS",NUM)
+6 SET COL=+$PIECE(INFO,U,3)
+7 SET REFCHECK=+$PIECE(INFO,U,2)_U_+$PIECE(INFO,U,7)_U
+8 IF $LENGTH($PIECE(INFO,U,10,11))
SET REFCHECK=REFCHECK_$PIECE(INFO,U,10,11)
+9 IF '$TEST
SET REFCHECK=$GET(^TMP("ORWORK",$JOB,"TESTSPEC",REFCHECK))
+10 IF '$LENGTH(REFCHECK)
QUIT
+11 SET REFCHECK=$$UP^XLFSTR(REFCHECK)
+12 SET TESTNUM=$GET(^TMP("ORWORK",$JOB,"REFCHECK",REFCHECK))
+13 IF 'TESTNUM
QUIT
+14 SET COLNUM=$GET(^TMP("ORWORK",$JOB,"COL",COL))
+15 IF 'COLNUM
QUIT
+16 SET CNT=CNT+1
+17 SET RESULT=$PIECE(INFO,U,5)
SET FLAG=$PIECE(INFO,U,6)
+18 SET ^TMP("ORWORK",$JOB,"NRESULTS",CNT)=COLNUM_U_TESTNUM_U_RESULT_U_FLAG
+19 IF $LENGTH(FLAG)
DO AB(.ACNT,REFCHECK,COL,RESULT,FLAG)
End DoDot:1
+20 SET ^TMP("ORWORK",$JOB,"NRESULTS",0)=CNT
+21 DO ARESULTS
+22 QUIT
+23 ;
AB(ACNT,REFCHECK,COL,RESULT,FLAG) ;
+1 SET ACNT=ACNT+1
+2 SET ^TMP("ORWORK",$JOB,"RESULTSA",ACNT)=REFCHECK_U_COL_U_RESULT_U_FLAG
+3 SET ^TMP("ORWORK",$JOB,"REFCHECKA",REFCHECK)=""
+4 SET ^TMP("ORWORK",$JOB,"COLA",COL)=""
+5 QUIT
+6 ;
ARESULTS ;
+1 NEW COL,COLNUM,CNT,FLAG,INFO,NUM,REFCHECK,RESULT,TESTNUM
+2 DO ACOL
+3 DO NACOL
+4 DO ATESTS
+5 SET CNT=0
SET NUM=0
+6 FOR
SET NUM=$ORDER(^TMP("ORWORK",$JOB,"RESULTSA",NUM))
if NUM<1
QUIT
Begin DoDot:1
+7 SET INFO=^TMP("ORWORK",$JOB,"RESULTSA",NUM)
+8 SET COL=+$PIECE(INFO,U,5)
+9 SET REFCHECK=$PIECE(INFO,U,1,4)
+10 SET TESTNUM=$GET(^TMP("ORWORK",$JOB,"REFCHECKA",REFCHECK))
+11 IF 'TESTNUM
QUIT
+12 SET COLNUM=$GET(^TMP("ORWORK",$JOB,"COLA",COL))
+13 IF 'COLNUM
QUIT
+14 SET CNT=CNT+1
+15 SET RESULT=$PIECE(INFO,U,6)
SET FLAG=$PIECE(INFO,U,7)
+16 SET ^TMP("ORWORK",$JOB,"NRESULTSA",CNT)=COLNUM_U_TESTNUM_U_RESULT_U_FLAG
End DoDot:1
+17 SET ^TMP("ORWORK",$JOB,"NRESULTSA",0)=CNT
+18 QUIT
+19 ;
ACOL ;
+1 NEW COL,COLCNT
+2 SET COLCNT=0
+3 SET COL=""
+4 FOR
SET COL=$ORDER(^TMP("ORWORK",$JOB,"COLA",COL),-1)
if COL=""
QUIT
Begin DoDot:1
+5 SET COLCNT=COLCNT+1
+6 SET ^TMP("ORWORK",$JOB,"COLA",COL)=COLCNT
End DoDot:1
+7 SET ^TMP("ORWORK",$JOB,"COLA",0)=COLCNT
+8 QUIT
NACOL ;
+1 NEW CNT,COL,COMMENT,INEXACT,INFO,NUM,SNUM,SPEC,SPECNAME
+2 SET CNT=0
+3 SET NUM=0
+4 FOR
SET NUM=$ORDER(^TMP("ORWORK",$JOB,"SPEC",NUM))
if NUM<1
QUIT
Begin DoDot:1
+5 SET INFO=^TMP("ORWORK",$JOB,"SPEC",NUM)
+6 SET COL=$PIECE(INFO,U,2)
+7 SET SNUM=$GET(^TMP("ORWORK",$JOB,"COLA",COL))
IF SNUM
Begin DoDot:2
+8 SET COMMENT=$PIECE(INFO,U,1)
SET INEXACT=$PIECE(INFO,U,3)
SET SPEC=$PIECE(INFO,U,6)
+9 SET SPECNAME=$GET(^TMP("ORWORK",$JOB,"SPECNAME",SPEC))
+10 IF INEXACT=1
SET INEXACT=COL\1
+11 IF '$TEST
SET INEXACT=COL
+12 SET ^TMP("ORWORK",$JOB,"NCOLA",NUM)=SNUM_U_COL_U_SPEC_U_SPECNAME_U_COMMENT_U_INEXACT
+13 SET CNT=CNT+1
End DoDot:2
End DoDot:1
+14 SET ^TMP("ORWORK",$JOB,"NCOLA",0)=CNT
+15 QUIT
+16 ;
ATESTS ;
+1 NEW BTEST,ETEST,INFO,NUM,REFCHECK,TEST,TESTCNT
+2 SET TESTCNT=0
+3 SET NUM=0
+4 FOR
SET NUM=$ORDER(^TMP("ORWORK",$JOB,"TEST",NUM))
if NUM<1
QUIT
Begin DoDot:1
+5 SET INFO=^TMP("ORWORK",$JOB,"TEST",NUM)
+6 SET TEST=+$PIECE(INFO,U,2)
SET BTEST=(TEST-1)_U_"Z"
SET ETEST=TEST_U_"Z"
+7 SET REFCHECK=BTEST
+8 FOR
SET REFCHECK=$ORDER(^TMP("ORWORK",$JOB,"REFCHECKA",REFCHECK))
if REFCHECK]ETEST
QUIT
if REFCHECK=""
QUIT
Begin DoDot:2
+9 IF $PIECE(REFCHECK,U)=TEST
Begin DoDot:3
+10 SET TESTCNT=TESTCNT+1
+11 SET ^TMP("ORWORK",$JOB,"NTESTSA",TESTCNT)=TESTCNT_U_$PIECE(INFO,U,2,3)_U_REFCHECK
+12 SET ^TMP("ORWORK",$JOB,"REFCHECKA",REFCHECK)=TESTCNT
End DoDot:3
End DoDot:2
End DoDot:1
+13 SET ^TMP("ORWORK",$JOB,"NTESTSA",0)=TESTCNT
+14 QUIT
+15 ;
SPECREF ; from ORWLRRG
+1 NEW CNT,HIGH,INFO,LOW,RANGE,REF,SNAME,SPEC,SUB,TEST,UNITS
+2 SET CNT=0
+3 SET REF=""
+4 FOR
SET REF=$ORDER(^TMP("ORWORK",$JOB,"REFCHECK",REF))
if REF=""
QUIT
Begin DoDot:1
+5 SET SUB=+^TMP("ORWORK",$JOB,"REFCHECK",REF)
+6 SET TEST=+$PIECE(REF,U)
SET SPEC=+$PIECE(REF,U,2)
SET RANGE=$PIECE(REF,U,3)
SET UNITS=$PIECE(REF,U,4)
+7 SET LOW=$PIECE(RANGE,"!")
SET HIGH=$PIECE(RANGE,"!",2)
+8 SET SNAME=$GET(^TMP("ORWORK",$JOB,"SPECNAME",SPEC))
+9 SET CNT=CNT+1
+10 SET ^TMP("ORWORK",$JOB,"SPECREF",SUB)=TEST_U_SNAME_U_SPEC_U_LOW_U_HIGH_U_UNITS
End DoDot:1
+11 SET ^TMP("ORWORK",$JOB,"SPECREF",0)=CNT
+12 QUIT
+13 ;
COMBINE ; from ORWLRRG
+1 NEW ACOLCNT,ARESCNT,ATESTCNT,CNT,COLCNT,INFO,RESCNT,SUB,TESTCNT,TOSPEC,TOCOM,TSCNT
+2 SET COLCNT=+$GET(^TMP("ORWORK",$JOB,"NCOL",0))
+3 SET TESTCNT=+$GET(^TMP("ORWORK",$JOB,"NTESTS",0))
+4 SET RESCNT=+$GET(^TMP("ORWORK",$JOB,"NRESULTS",0))
+5 SET ACOLCNT=+$GET(^TMP("ORWORK",$JOB,"NCOLA",0))
+6 SET ATESTCNT=+$GET(^TMP("ORWORK",$JOB,"NTESTSA",0))
+7 SET ARESCNT=+$GET(^TMP("ORWORK",$JOB,"NRESULTSA",0))
+8 SET TSCNT=^TMP("ORWORK",$JOB,"SPECREF",0)
+9 SET TOSPEC=COLCNT+TESTCNT+RESCNT+ACOLCNT+ATESTCNT+ARESCNT+2
+10 SET TOCOM=TOSPEC+TSCNT
+11 SET ^TMP("ORGRID",$JOB,1)=TESTCNT_U_COLCNT_U_RESCNT_U_TOSPEC_U_TOCOM
+12 SET CNT=1
+13 SET SUB=0
+14 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NTESTS",SUB))
if SUB<1
QUIT
Begin DoDot:1
+15 SET INFO=^TMP("ORWORK",$JOB,"NTESTS",SUB)
+16 SET CNT=CNT+1
+17 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+18 SET SUB=0
+19 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NCOL",SUB))
if SUB<1
QUIT
Begin DoDot:1
+20 SET INFO=^TMP("ORWORK",$JOB,"NCOL",SUB)
+21 SET CNT=CNT+1
+22 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+23 SET SUB=0
+24 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NRESULTS",SUB))
if SUB<1
QUIT
Begin DoDot:1
+25 SET INFO=^TMP("ORWORK",$JOB,"NRESULTS",SUB)
+26 SET CNT=CNT+1
+27 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+28 SET CNT=CNT+1
+29 SET ^TMP("ORGRID",$JOB,CNT)=ATESTCNT_U_ACOLCNT_U_ARESCNT
+30 SET SUB=0
+31 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NTESTSA",SUB))
if SUB<1
QUIT
Begin DoDot:1
+32 SET INFO=^TMP("ORWORK",$JOB,"NTESTSA",SUB)
+33 SET CNT=CNT+1
+34 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+35 SET SUB=0
+36 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NCOLA",SUB))
if SUB<1
QUIT
Begin DoDot:1
+37 SET INFO=^TMP("ORWORK",$JOB,"NCOLA",SUB)
+38 SET CNT=CNT+1
+39 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+40 SET SUB=0
+41 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"NRESULTSA",SUB))
if SUB<1
QUIT
Begin DoDot:1
+42 SET INFO=^TMP("ORWORK",$JOB,"NRESULTSA",SUB)
+43 SET CNT=CNT+1
+44 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+45 SET SUB=0
+46 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"SPECREF",SUB))
if SUB<1
QUIT
Begin DoDot:1
+47 SET INFO=^TMP("ORWORK",$JOB,"SPECREF",SUB)
+48 SET CNT=CNT+1
+49 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+50 SET SUB=0
+51 FOR
SET SUB=$ORDER(^TMP("ORWORK",$JOB,"COMMENTS",SUB))
if SUB<1
QUIT
Begin DoDot:1
+52 SET INFO=^TMP("ORWORK",$JOB,"COMMENTS",SUB)
+53 SET CNT=CNT+1
+54 SET ^TMP("ORGRID",$JOB,CNT)=INFO
End DoDot:1
+55 QUIT