ORDV06 ; slc/dkm - OE/RR Report Extracts ;10/8/03 11:17
;;3.0;ORDER ENTRY RESULTS REPORTING;**109,118,167,208,215,274,243**;Dec 17, 1997;Build 242
;Pharmacy Extracts
RXA(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Active Outpatient Pharmacy
;Call to PSOHCSUM
;
I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
. N BEG,END,MAX
. S BEG=0,END=9999999,MAX=9999
. D GCPR^OMGCOAS1(DFN,"RXA",BEG,END,MAX)
;
N ORRXSTAT,GO,PSOACT
Q:'$L(OREXT)
S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
Q:'$L($T(@GO))
S PSOACT=1,ORRXSTAT="^ACTIVE^ACTIVE/SUSP^"
D GET
Q
RXOP(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;All Outpatient Pharmacy
;Call to PSOHCSUM
;
I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
. N BEG,END,MAX
. S BEG=0,END=9999999,MAX=9999
. D GCPR^OMGCOAS1(DFN,"RXOP",BEG,END,MAX)
;
N ORRXSTAT,GO
Q:'$L(OREXT)
S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
Q:'$L($T(@GO))
S ORRXSTAT=""
D GET
Q
GET N J,ORDT,ORI,ORDRGIEN,ORDRG,ORRXNO,ORSTAT,ORQTY,OREXP,ORISSUE,ORLAST,ORREF,ORPRVD,ORCOST,ORSIG
N ECD,GMR,GMW,IX,PSOBEGIN,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
S PSOBEGIN=0
K ^TMP("ORDATA",$J)
I '$L($T(GCPR^OMGCOAS1)) D
. K ^TMP("PSOO",$J)
. D @GO
S (ORDT,ORI)=0
F S ORDT=$O(^TMP("PSOO",$J,ORDT)) Q:(ORDT'>0) S ORX0=$G(^(ORDT,0)) I ORX0'="" D
. I $L(ORRXSTAT),ORRXSTAT'[(U_$P($P(ORX0,U,5),";",2)) Q ;Check status
. S ORI=ORI+1
. S SITE=$S($L($G(^TMP("PSOO",$J,ORDT,"facility"))):^("facility"),1:ORSITE)
. S ^TMP("ORDATA",$J,ORDT,"WP",1)="1^"_SITE ;Station ID
. S ^TMP("ORDATA",$J,ORDT,"WP",2)="2^"_$P($P(ORX0,U,3),";",2) ;Drug Name
. S ^TMP("ORDATA",$J,ORDT,"WP",3)="3^"_$P($P(ORX0,U,3),";") ;Drug IEN
. S ^TMP("ORDATA",$J,ORDT,"WP",4)="4^"_$P(ORX0,U,6) ;RX #
. S ^TMP("ORDATA",$J,ORDT,"WP",5)="5^"_$P($P(ORX0,U,5),";",2) ;Status
. S ^TMP("ORDATA",$J,ORDT,"WP",6)="6^"_$P(ORX0,U,7) ;Quantity
. S ^TMP("ORDATA",$J,ORDT,"WP",7)="7^"_$$DATE^ORDVU($P(ORX0,U,11)) ;Exp/Cancel Date
. S ^TMP("ORDATA",$J,ORDT,"WP",8)="8^"_$$DATE^ORDVU($P(ORX0,U)) ;Issue Date
. S ^TMP("ORDATA",$J,ORDT,"WP",9)="9^"_$$DATE^ORDVU($P(ORX0,U,2)) ;Last Fill Date
. S ^TMP("ORDATA",$J,ORDT,"WP",10)="10^"_$P(ORX0,U,8) ;#Refills
. S ^TMP("ORDATA",$J,ORDT,"WP",11)="11^"_$P($P(ORX0,U,4),";",2) ;Provider
. S ^TMP("ORDATA",$J,ORDT,"WP",12)="12^"_$P(ORX0,U,10) ;Cost-fill
. S ^TMP("ORDATA",$J,ORDT,"WP",15)="15^"_$P(ORX0,U,9) ;PharmID
. S ^TMP("ORDATA",$J,ORDT,"WP",16)="16^"_$P(ORX0,U,11) ;Order Number
. S J=0
. F S J=$O(^TMP("PSOO",$J,ORDT,J)) Q:'J D
..S X=^(J,0),^TMP("ORDATA",$J,ORDT,"WP",14,J)="14^"_X
K ^TMP("PSOO",$J)
S ROOT=$NA(^TMP("ORDATA",$J))
Q
RXAV(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Active IV Pharmacy
;Call to ENHS^PSJEEU0
N ORIVSTAT,GO
Q:'$L(OREXT)
S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
Q:'$L($T(@GO))
S ORIVSTAT="^ACTIVE^"
D GET1
Q
RXIV(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ; All IV Pharmcy
;Call to ENHS^PSJEEU0
N ORIVSTAT,GO
Q:'$L(OREXT)
S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
Q:'$L($T(@GO))
S ORIVSTAT=""
D GET1
Q
GET1 N ORDT,ORI,ORX0,ORIDRG,ORDRGIEN,ORDRG,ORDOSE,ORREC,ORSTAT,ORSTRTDT,ORSTOPDT,ORROUT,ORSIG,ORWII,ORMORE
N GMI,GMTSIDT,MAX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,TN,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
S PSJEDT=1,PSJNKF=1
K ^TMP("ORDATA",$J),^UTILITY("PSG",$J),^UTILITY("PSIV",$J)
D @GO
S ORDT=-9999999,ORI=0
F S ORDT=$O(^UTILITY("PSIV",$J,ORDT)) Q:(ORDT="") S ORX0=$G(^(ORDT,0)) I ORX0'="" D
. I $L(ORIVSTAT),ORIVSTAT'[(U_$P($P(ORX0,U,4),";",2)_U) Q ;Check status
. S ORMORE=0,SITE=$S($L($G(^UTILITY("PSIV",$J,ORDT,"facility"))):^("facility"),1:ORSITE)
. S ^TMP("ORDATA",$J,ORDT,"WP",1)="1^"_SITE ;Station ID
. S ^TMP("ORDATA",$J,ORDT,"WP",6)="6^"_$$DATE^ORDVU($P(ORX0,U)) ;Start Date
. S ^TMP("ORDATA",$J,ORDT,"WP",7)="7^"_$$DATE^ORDVU($P(ORX0,U,2)) ;Stop Date
. S ^TMP("ORDATA",$J,ORDT,"WP",4)="4^"_$P(ORX0,U,5) ;Rate
. S ^TMP("ORDATA",$J,ORDT,"WP",5)="5^"_$P(ORX0,U,6) ;Schedule JEH
. S ORIDRG=0
. F S ORIDRG=$O(^UTILITY("PSIV",$J,ORDT,"A",ORIDRG)) Q:'ORIDRG S ORREC=$G(^(ORIDRG)) S:ORIDRG>1 ORMORE=1 D ;Additives
.. S ^TMP("ORDATA",$J,ORDT,"WP",2,ORIDRG)="2^"_$P($P(ORREC,U),";",2)_" "_$P(ORREC,U,2) ;Additive Dose
. S ORIDRG=0
. F S ORIDRG=$O(^UTILITY("PSIV",$J,ORDT,"S",ORIDRG)) Q:'ORIDRG S ORREC=$G(^(ORIDRG)) S:ORIDRG>1 ORMORE=1 D ;Solutions
.. S ^TMP("ORDATA",$J,ORDT,"WP",3,ORIDRG)="3^"_$P($P(ORREC,U),";",2)_" "_$P(ORREC,U,2) ;Solution Dose
. I ORMORE S ^TMP("ORDATA",$J,ORDT,"WP",8)="8^[+]" ;flag for detail
K ^UTILITY("PSG",$J),^UTILITY("PSIV",$J)
S ROOT=$NA(^TMP("ORDATA",$J))
Q
RXUD(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ; Get Unit Dose Pharmacy Component
;Call to ENHS^PSJEEU0
N J,ORDT,ORI,ORX0,ORDRGIEN,ORDRG,ORDOSE,ORSTAT,ORSTRTDT,ORSTOPDT,ORROUT,ORSIG,GO
N GMI,IX,MAX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,GMR,TN,UDS,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
Q:'$L(OREXT)
S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
Q:'$L($T(@GO))
S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
S PSJEDT=1,PSJNKF=1
K ^TMP("ORDATA",$J),^UTILITY("PSG",$J),^UTILITY("PSIV",$J)
D @GO
S ORDT=-9999999,ORI=0
F S ORDT=$O(^UTILITY("PSG",$J,ORDT)) Q:(ORDT="") S ORX0=$G(^(ORDT)) I ORX0'="" D
. S SITE=$S($L($G(^UTILITY("PSG",$J,ORDT,"facility"))):^("facility"),1:ORSITE)
. S ^TMP("ORDATA",$J,ORDT,"WP",1)="1^"_SITE ;Station ID
. S ^TMP("ORDATA",$J,ORDT,"WP",2)="2^"_$P($P(ORX0,U,3),":") ;DRUG IEN
. S ^TMP("ORDATA",$J,ORDT,"WP",3)="3^"_$P($P(ORX0,U,3),";",2) ;Drug Name
. S ^TMP("ORDATA",$J,ORDT,"WP",4)="4^"_$P(ORX0,U,6) ;Dose
. S ^TMP("ORDATA",$J,ORDT,"WP",5)="5^"_$P($P(ORX0,U,5),";",2) ;Status
. S ^TMP("ORDATA",$J,ORDT,"WP",6)="6^"_$$DATE^ORDVU($P(ORX0,U)) ;START Date
. S ^TMP("ORDATA",$J,ORDT,"WP",7)="7^"_$$DATE^ORDVU($P(ORX0,U,2)) ;Stop Date
. S ^TMP("ORDATA",$J,ORDT,"WP",8)="8^"_$P($P(ORX0,U,7),";",3) ;Route
. S ^TMP("ORDATA",$J,ORDT,"WP",9)="9^"_$P(ORX0,U,8) ;SIG
K ^UTILITY("PSG",$J),^UTILITY("PSIV",$J)
S ROOT=$NA(^TMP("ORDATA",$J))
Q
ORDV06 ; slc/dkm - OE/RR Report Extracts ;10/8/03 11:17
+1 ;;3.0;ORDER ENTRY RESULTS REPORTING;**109,118,167,208,215,274,243**;Dec 17, 1997;Build 242
+2 ;Pharmacy Extracts
RXA(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Active Outpatient Pharmacy
+1 ;Call to PSOHCSUM
+2 ;
+3 ; Call if FHIE station 200
IF $LENGTH($TEXT(GCPR^OMGCOAS1))
Begin DoDot:1
+4 NEW BEG,END,MAX
+5 SET BEG=0
SET END=9999999
SET MAX=9999
+6 DO GCPR^OMGCOAS1(DFN,"RXA",BEG,END,MAX)
End DoDot:1
+7 ;
+8 NEW ORRXSTAT,GO,PSOACT
+9 IF '$LENGTH(OREXT)
QUIT
+10 SET GO=$PIECE(OREXT,";")_"^"_$PIECE(OREXT,";",2)
+11 IF '$LENGTH($TEXT(@GO))
QUIT
+12 SET PSOACT=1
SET ORRXSTAT="^ACTIVE^ACTIVE/SUSP^"
+13 DO GET
+14 QUIT
RXOP(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;All Outpatient Pharmacy
+1 ;Call to PSOHCSUM
+2 ;
+3 ; Call if FHIE station 200
IF $LENGTH($TEXT(GCPR^OMGCOAS1))
Begin DoDot:1
+4 NEW BEG,END,MAX
+5 SET BEG=0
SET END=9999999
SET MAX=9999
+6 DO GCPR^OMGCOAS1(DFN,"RXOP",BEG,END,MAX)
End DoDot:1
+7 ;
+8 NEW ORRXSTAT,GO
+9 IF '$LENGTH(OREXT)
QUIT
+10 SET GO=$PIECE(OREXT,";")_"^"_$PIECE(OREXT,";",2)
+11 IF '$LENGTH($TEXT(@GO))
QUIT
+12 SET ORRXSTAT=""
+13 DO GET
+14 QUIT
GET NEW J,ORDT,ORI,ORDRGIEN,ORDRG,ORRXNO,ORSTAT,ORQTY,OREXP,ORISSUE,ORLAST,ORREF,ORPRVD,ORCOST,ORSIG
+1 NEW ECD,GMR,GMW,IX,PSOBEGIN,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
+2 SET ORSITE=$$SITE^VASITE
SET ORSITE=$PIECE(ORSITE,"^",2)_";"_$PIECE(ORSITE,"^",3)
+3 SET PSOBEGIN=0
+4 KILL ^TMP("ORDATA",$JOB)
+5 IF '$LENGTH($TEXT(GCPR^OMGCOAS1))
Begin DoDot:1
+6 KILL ^TMP("PSOO",$JOB)
+7 DO @GO
End DoDot:1
+8 SET (ORDT,ORI)=0
+9 FOR
SET ORDT=$ORDER(^TMP("PSOO",$JOB,ORDT))
IF (ORDT'>0)
QUIT
SET ORX0=$GET(^(ORDT,0))
IF ORX0'=""
Begin DoDot:1
+10 ;Check status
IF $LENGTH(ORRXSTAT)
IF ORRXSTAT'[(U_$PIECE($PIECE(ORX0,U,5),";",2))
QUIT
+11 SET ORI=ORI+1
+12 SET SITE=$SELECT($LENGTH($GET(^TMP("PSOO",$JOB,ORDT,"facility"))):^("facility"),1:ORSITE)
+13 ;Station ID
SET ^TMP("ORDATA",$JOB,ORDT,"WP",1)="1^"_SITE
+14 ;Drug Name
SET ^TMP("ORDATA",$JOB,ORDT,"WP",2)="2^"_$PIECE($PIECE(ORX0,U,3),";",2)
+15 ;Drug IEN
SET ^TMP("ORDATA",$JOB,ORDT,"WP",3)="3^"_$PIECE($PIECE(ORX0,U,3),";")
+16 ;RX #
SET ^TMP("ORDATA",$JOB,ORDT,"WP",4)="4^"_$PIECE(ORX0,U,6)
+17 ;Status
SET ^TMP("ORDATA",$JOB,ORDT,"WP",5)="5^"_$PIECE($PIECE(ORX0,U,5),";",2)
+18 ;Quantity
SET ^TMP("ORDATA",$JOB,ORDT,"WP",6)="6^"_$PIECE(ORX0,U,7)
+19 ;Exp/Cancel Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",7)="7^"_$$DATE^ORDVU($PIECE(ORX0,U,11))
+20 ;Issue Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",8)="8^"_$$DATE^ORDVU($PIECE(ORX0,U))
+21 ;Last Fill Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",9)="9^"_$$DATE^ORDVU($PIECE(ORX0,U,2))
+22 ;#Refills
SET ^TMP("ORDATA",$JOB,ORDT,"WP",10)="10^"_$PIECE(ORX0,U,8)
+23 ;Provider
SET ^TMP("ORDATA",$JOB,ORDT,"WP",11)="11^"_$PIECE($PIECE(ORX0,U,4),";",2)
+24 ;Cost-fill
SET ^TMP("ORDATA",$JOB,ORDT,"WP",12)="12^"_$PIECE(ORX0,U,10)
+25 ;PharmID
SET ^TMP("ORDATA",$JOB,ORDT,"WP",15)="15^"_$PIECE(ORX0,U,9)
+26 ;Order Number
SET ^TMP("ORDATA",$JOB,ORDT,"WP",16)="16^"_$PIECE(ORX0,U,11)
+27 SET J=0
+28 FOR
SET J=$ORDER(^TMP("PSOO",$JOB,ORDT,J))
IF 'J
QUIT
Begin DoDot:2
+29 SET X=^(J,0)
SET ^TMP("ORDATA",$JOB,ORDT,"WP",14,J)="14^"_X
End DoDot:2
End DoDot:1
+30 KILL ^TMP("PSOO",$JOB)
+31 SET ROOT=$NAME(^TMP("ORDATA",$JOB))
+32 QUIT
RXAV(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Active IV Pharmacy
+1 ;Call to ENHS^PSJEEU0
+2 NEW ORIVSTAT,GO
+3 IF '$LENGTH(OREXT)
QUIT
+4 SET GO=$PIECE(OREXT,";")_"^"_$PIECE(OREXT,";",2)
+5 IF '$LENGTH($TEXT(@GO))
QUIT
+6 SET ORIVSTAT="^ACTIVE^"
+7 DO GET1
+8 QUIT
RXIV(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ; All IV Pharmcy
+1 ;Call to ENHS^PSJEEU0
+2 NEW ORIVSTAT,GO
+3 IF '$LENGTH(OREXT)
QUIT
+4 SET GO=$PIECE(OREXT,";")_"^"_$PIECE(OREXT,";",2)
+5 IF '$LENGTH($TEXT(@GO))
QUIT
+6 SET ORIVSTAT=""
+7 DO GET1
+8 QUIT
GET1 NEW ORDT,ORI,ORX0,ORIDRG,ORDRGIEN,ORDRG,ORDOSE,ORREC,ORSTAT,ORSTRTDT,ORSTOPDT,ORROUT,ORSIG,ORWII,ORMORE
+1 NEW GMI,GMTSIDT,MAX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,TN,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
+2 SET ORSITE=$$SITE^VASITE
SET ORSITE=$PIECE(ORSITE,"^",2)_";"_$PIECE(ORSITE,"^",3)
+3 SET PSJEDT=1
SET PSJNKF=1
+4 KILL ^TMP("ORDATA",$JOB),^UTILITY("PSG",$JOB),^UTILITY("PSIV",$JOB)
+5 DO @GO
+6 SET ORDT=-9999999
SET ORI=0
+7 FOR
SET ORDT=$ORDER(^UTILITY("PSIV",$JOB,ORDT))
IF (ORDT="")
QUIT
SET ORX0=$GET(^(ORDT,0))
IF ORX0'=""
Begin DoDot:1
+8 ;Check status
IF $LENGTH(ORIVSTAT)
IF ORIVSTAT'[(U_$PIECE($PIECE(ORX0,U,4),";",2)_U)
QUIT
+9 SET ORMORE=0
SET SITE=$SELECT($LENGTH($GET(^UTILITY("PSIV",$JOB,ORDT,"facility"))):^("facility"),1:ORSITE)
+10 ;Station ID
SET ^TMP("ORDATA",$JOB,ORDT,"WP",1)="1^"_SITE
+11 ;Start Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",6)="6^"_$$DATE^ORDVU($PIECE(ORX0,U))
+12 ;Stop Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",7)="7^"_$$DATE^ORDVU($PIECE(ORX0,U,2))
+13 ;Rate
SET ^TMP("ORDATA",$JOB,ORDT,"WP",4)="4^"_$PIECE(ORX0,U,5)
+14 ;Schedule JEH
SET ^TMP("ORDATA",$JOB,ORDT,"WP",5)="5^"_$PIECE(ORX0,U,6)
+15 SET ORIDRG=0
+16 ;Additives
FOR
SET ORIDRG=$ORDER(^UTILITY("PSIV",$JOB,ORDT,"A",ORIDRG))
IF 'ORIDRG
QUIT
SET ORREC=$GET(^(ORIDRG))
IF ORIDRG>1
SET ORMORE=1
Begin DoDot:2
+17 ;Additive Dose
SET ^TMP("ORDATA",$JOB,ORDT,"WP",2,ORIDRG)="2^"_$PIECE($PIECE(ORREC,U),";",2)_" "_$PIECE(ORREC,U,2)
End DoDot:2
+18 SET ORIDRG=0
+19 ;Solutions
FOR
SET ORIDRG=$ORDER(^UTILITY("PSIV",$JOB,ORDT,"S",ORIDRG))
IF 'ORIDRG
QUIT
SET ORREC=$GET(^(ORIDRG))
IF ORIDRG>1
SET ORMORE=1
Begin DoDot:2
+20 ;Solution Dose
SET ^TMP("ORDATA",$JOB,ORDT,"WP",3,ORIDRG)="3^"_$PIECE($PIECE(ORREC,U),";",2)_" "_$PIECE(ORREC,U,2)
End DoDot:2
+21 ;flag for detail
IF ORMORE
SET ^TMP("ORDATA",$JOB,ORDT,"WP",8)="8^[+]"
End DoDot:1
+22 KILL ^UTILITY("PSG",$JOB),^UTILITY("PSIV",$JOB)
+23 SET ROOT=$NAME(^TMP("ORDATA",$JOB))
+24 QUIT
RXUD(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ; Get Unit Dose Pharmacy Component
+1 ;Call to ENHS^PSJEEU0
+2 NEW J,ORDT,ORI,ORX0,ORDRGIEN,ORDRG,ORDOSE,ORSTAT,ORSTRTDT,ORSTOPDT,ORROUT,ORSIG,GO
+3 NEW GMI,IX,MAX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,GMR,TN,UDS,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
+4 IF '$LENGTH(OREXT)
QUIT
+5 SET GO=$PIECE(OREXT,";")_"^"_$PIECE(OREXT,";",2)
+6 IF '$LENGTH($TEXT(@GO))
QUIT
+7 SET ORSITE=$$SITE^VASITE
SET ORSITE=$PIECE(ORSITE,"^",2)_";"_$PIECE(ORSITE,"^",3)
+8 SET PSJEDT=1
SET PSJNKF=1
+9 KILL ^TMP("ORDATA",$JOB),^UTILITY("PSG",$JOB),^UTILITY("PSIV",$JOB)
+10 DO @GO
+11 SET ORDT=-9999999
SET ORI=0
+12 FOR
SET ORDT=$ORDER(^UTILITY("PSG",$JOB,ORDT))
IF (ORDT="")
QUIT
SET ORX0=$GET(^(ORDT))
IF ORX0'=""
Begin DoDot:1
+13 SET SITE=$SELECT($LENGTH($GET(^UTILITY("PSG",$JOB,ORDT,"facility"))):^("facility"),1:ORSITE)
+14 ;Station ID
SET ^TMP("ORDATA",$JOB,ORDT,"WP",1)="1^"_SITE
+15 ;DRUG IEN
SET ^TMP("ORDATA",$JOB,ORDT,"WP",2)="2^"_$PIECE($PIECE(ORX0,U,3),":")
+16 ;Drug Name
SET ^TMP("ORDATA",$JOB,ORDT,"WP",3)="3^"_$PIECE($PIECE(ORX0,U,3),";",2)
+17 ;Dose
SET ^TMP("ORDATA",$JOB,ORDT,"WP",4)="4^"_$PIECE(ORX0,U,6)
+18 ;Status
SET ^TMP("ORDATA",$JOB,ORDT,"WP",5)="5^"_$PIECE($PIECE(ORX0,U,5),";",2)
+19 ;START Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",6)="6^"_$$DATE^ORDVU($PIECE(ORX0,U))
+20 ;Stop Date
SET ^TMP("ORDATA",$JOB,ORDT,"WP",7)="7^"_$$DATE^ORDVU($PIECE(ORX0,U,2))
+21 ;Route
SET ^TMP("ORDATA",$JOB,ORDT,"WP",8)="8^"_$PIECE($PIECE(ORX0,U,7),";",3)
+22 ;SIG
SET ^TMP("ORDATA",$JOB,ORDT,"WP",9)="9^"_$PIECE(ORX0,U,8)
End DoDot:1
+23 KILL ^UTILITY("PSG",$JOB),^UTILITY("PSIV",$JOB)
+24 SET ROOT=$NAME(^TMP("ORDATA",$JOB))
+25 QUIT