35 lines
1.6 KiB
Mathematica
35 lines
1.6 KiB
Mathematica
ORWORR1 ; SLC/JLI - Utilities for Retrieve Orders for Broker ;9/10/02 3PM [9/16/02 2:56pm]
|
|
;;3.0;ORDER ENTRY/RESULTS REPORTING;**141**;Dec 17, 1997
|
|
;Called from ORWORR
|
|
GET1 ;
|
|
S TOT=^TMP("ORR",$J,ORLIST,"TOT") K ^TMP("ORR",$J,ORLIST,"TOT")
|
|
S I=.1 F S I=$O(^TMP("ORR",$J,ORLIST,I)) Q:'I S IFN=^(I) D
|
|
. I ORWTS,(+$P($G(^OR(100,+IFN,0)),U,13)'=ORWTS) K ^TMP("ORR",$J,ORLIST,I) S TOT=TOT-1 Q
|
|
. S PTEVTID=$P($G(^OR(100,+IFN,0)),U,17)
|
|
. S:PTEVTID>0 EVTNAME=$$NAME^OREVNTX(PTEVTID)
|
|
. S ^TMP("ORR",$J,ORLIST,I)=IFN_U_$P($G(^OR(100,+IFN,0)),U,11)_U_$P($G(^(8,+$P(IFN,";",2),0)),U)_U_PTEVTID_U_EVTNAME
|
|
S TXTVW=$S(MULT:0,FILTER=2:2,1:1) D:FILTER=2 ORYD^ORDD100
|
|
S ^TMP("ORR",$J,ORLIST,.1)=TOT_U_TXTVW_U_$G(ORYD,0)
|
|
S REF=$NA(^TMP("ORR",$J,ORLIST))
|
|
Q
|
|
GET2 ; For AUTO DC/Event Release Orders
|
|
N JDND,JDIX,JDCNT,DCSPLIT
|
|
S JDCNT=1,DCSPLIT=0
|
|
S TOT=^TMP("ORR",$J,ORLIST,"TOT") K ^TMP("ORR",$J,ORLIST,"TOT")
|
|
F JDND="RL","DC" D
|
|
. S I=.1 F S I=$O(^TMP("ORR",$J,ORLIST,I)) Q:'I D
|
|
. . I '$D(^TMP("ORR",$J,ORLIST,I,JDND)) Q
|
|
. . S JDIX=0 F S JDIX=$O(^TMP("ORR",$J,ORLIST,I,JDND,JDIX)) Q:'JDIX S IFN=^(JDIX) D
|
|
. . . I 'DCSPLIT,(JDND="DC") D
|
|
. . . . S ^TMP("ORRJD",$J,JDCNT)="DC START"
|
|
. . . . S DCSPLIT=1,JDCNT=JDCNT+1,TOT=TOT+1
|
|
. . . I ORWTS,(+$P($G(^OR(100,+IFN,0)),U,13)'=ORWTS) S TOT=TOT-1 Q
|
|
. . . S PTEVTID=$P($G(^OR(100,+IFN,0)),U,17)
|
|
. . . S:PTEVTID>0 EVTNAME=$$NAME^OREVNTX(PTEVTID)
|
|
. . . S ^TMP("ORRJD",$J,JDCNT)=IFN_U_$P($G(^OR(100,+IFN,0)),U,11)_U_$P($G(^(8,+$P(IFN,";",2),0)),U)_U_PTEVTID_U_EVTNAME
|
|
. . . S JDCNT=JDCNT+1
|
|
S TXTVW=$S(MULT:0,FILTER=2:2,1:1) D:FILTER=2 ORYD^ORDD100
|
|
S ^TMP("ORRJD",$J,.1)=TOT_U_TXTVW_U_$G(ORYD,0)
|
|
S REF=$NA(^TMP("ORRJD",$J))
|
|
Q
|