ORWGAPI7 ; SLC/STAFF - Graph Data ;12/21/05 08:17
;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
;
;
BCMA(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
N DATE,NODE,RESULT,VALUE
S DATE="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
F S DATE=$O(^PSB(53.79,"AOIP",DFN,ITEM,DATE)) Q:DATE="" D
. I DATE>START Q
. I DATE<BACKTO Q
. S NODE=""
. F S NODE=$O(^PSB(53.79,"AOIP",DFN,ITEM,DATE,NODE)) Q:NODE="" D
.. S VALUE=$P($G(^PSB(53.79,NODE,0)),U,9) I VALUE'="G" Q
.. S RESULT=53.79_U_ITEM_U_DATE_"^^"
.. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
Q
;
INRX(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
N DATE,DATE2,NODE,RESULT,VALUE K VALUE
S DATE="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
F S DATE=$O(^PXRMINDX(55,"PI",DFN,ITEM,DATE)) Q:DATE="" D
. I DATE>START Q
. I DATE<BACKTO Q
. S DATE2=""
. F S DATE2=$O(^PXRMINDX(55,"PI",DFN,ITEM,DATE,DATE2)) Q:DATE2="" D
.. S NODE=""
.. F S NODE=$O(^PXRMINDX(55,"PI",DFN,ITEM,DATE,DATE2,NODE)) Q:NODE="" D
... D RXIN^ORWGAPIC(NODE,.VALUE) S VALUE=VALUE("STAT")
... S VALUE=VALUE_" "_$$INSIG^ORWGAPIC(NODE)
... S RESULT=55_U_ITEM_U_DATE_U_DATE2_U_VALUE
... D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
Q
;
NVA(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
D NVA3^ORWGAPIE(.DATA,ITEM,START,DFN,.CNT,.TMP)
Q
;
OUTRX(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
N DATE1,DATE2,LNUM,NODE,RESULT,VALUE K VALUE
S DATE1="",DATE2="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
F S DATE1=$O(^PXRMINDX(52,"PI",DFN,ITEM,DATE1)) Q:DATE1="" D
. I DATE1>START Q
. I DATE1<BACKTO Q
. S DATE2=""
. F S DATE2=$O(^PXRMINDX(52,"PI",DFN,ITEM,DATE1,DATE2)) Q:DATE2="" D
.. S NODE=""
.. F S NODE=$O(^PXRMINDX(52,"PI",DFN,ITEM,DATE1,DATE2,NODE)) Q:NODE="" D
... D RXOUT^ORWGAPIC(NODE,.VALUE) S VALUE=$$EXTERNAL^ORWGAPIX(52,100,"",VALUE("STATUS"))
... S VALUE=VALUE_" "_$$SIG^ORWGAPIC(DFN,+NODE)_" "_$$RXNUM^ORWGAPIC(DFN,+NODE)
... S RESULT=52_U_ITEM_U_DATE1_U_DATE2_U_VALUE
... D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWGAPI7 2059 printed Oct 16, 2024@18:36:50 Page 2
ORWGAPI7 ; SLC/STAFF - Graph Data ;12/21/05 08:17
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
+2 ;
+3 ;
BCMA(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
+1 NEW DATE,NODE,RESULT,VALUE
+2 SET DATE=""
SET CNT=$GET(CNT)
SET BACKTO=+$GET(BACKTO)
+3 FOR
SET DATE=$ORDER(^PSB(53.79,"AOIP",DFN,ITEM,DATE))
if DATE=""
QUIT
Begin DoDot:1
+4 IF DATE>START
QUIT
+5 IF DATE<BACKTO
QUIT
+6 SET NODE=""
+7 FOR
SET NODE=$ORDER(^PSB(53.79,"AOIP",DFN,ITEM,DATE,NODE))
if NODE=""
QUIT
Begin DoDot:2
+8 SET VALUE=$PIECE($GET(^PSB(53.79,NODE,0)),U,9)
IF VALUE'="G"
QUIT
+9 SET RESULT=53.79_U_ITEM_U_DATE_"^^"
+10 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:2
End DoDot:1
+11 QUIT
+12 ;
INRX(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
+1 NEW DATE,DATE2,NODE,RESULT,VALUE
KILL VALUE
+2 SET DATE=""
SET CNT=$GET(CNT)
SET BACKTO=+$GET(BACKTO)
+3 FOR
SET DATE=$ORDER(^PXRMINDX(55,"PI",DFN,ITEM,DATE))
if DATE=""
QUIT
Begin DoDot:1
+4 IF DATE>START
QUIT
+5 IF DATE<BACKTO
QUIT
+6 SET DATE2=""
+7 FOR
SET DATE2=$ORDER(^PXRMINDX(55,"PI",DFN,ITEM,DATE,DATE2))
if DATE2=""
QUIT
Begin DoDot:2
+8 SET NODE=""
+9 FOR
SET NODE=$ORDER(^PXRMINDX(55,"PI",DFN,ITEM,DATE,DATE2,NODE))
if NODE=""
QUIT
Begin DoDot:3
+10 DO RXIN^ORWGAPIC(NODE,.VALUE)
SET VALUE=VALUE("STAT")
+11 SET VALUE=VALUE_" "_$$INSIG^ORWGAPIC(NODE)
+12 SET RESULT=55_U_ITEM_U_DATE_U_DATE2_U_VALUE
+13 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:3
End DoDot:2
End DoDot:1
+14 QUIT
+15 ;
NVA(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
+1 DO NVA3^ORWGAPIE(.DATA,ITEM,START,DFN,.CNT,.TMP)
+2 QUIT
+3 ;
OUTRX(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
+1 NEW DATE1,DATE2,LNUM,NODE,RESULT,VALUE
KILL VALUE
+2 SET DATE1=""
SET DATE2=""
SET CNT=$GET(CNT)
SET BACKTO=+$GET(BACKTO)
+3 FOR
SET DATE1=$ORDER(^PXRMINDX(52,"PI",DFN,ITEM,DATE1))
if DATE1=""
QUIT
Begin DoDot:1
+4 IF DATE1>START
QUIT
+5 IF DATE1<BACKTO
QUIT
+6 SET DATE2=""
+7 FOR
SET DATE2=$ORDER(^PXRMINDX(52,"PI",DFN,ITEM,DATE1,DATE2))
if DATE2=""
QUIT
Begin DoDot:2
+8 SET NODE=""
+9 FOR
SET NODE=$ORDER(^PXRMINDX(52,"PI",DFN,ITEM,DATE1,DATE2,NODE))
if NODE=""
QUIT
Begin DoDot:3
+10 DO RXOUT^ORWGAPIC(NODE,.VALUE)
SET VALUE=$$EXTERNAL^ORWGAPIX(52,100,"",VALUE("STATUS"))
+11 SET VALUE=VALUE_" "_$$SIG^ORWGAPIC(DFN,+NODE)_" "_$$RXNUM^ORWGAPIC(DFN,+NODE)
+12 SET RESULT=52_U_ITEM_U_DATE1_U_DATE2_U_VALUE
+13 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:3
End DoDot:2
End DoDot:1
+14 QUIT
+15 ;