ORY297 ;SLC/JLC-Search for OIs with PHARMACY restriction ; 3/8/11 11:02am
;;3.0;ORDER ENTRY/RESULTS REPORTING;**297**;Dec 17, 1997;Build 14
;
;
EN1 ; -- main entry point
I $G(DUZ)="" W "Your DUZ is not defined.",! Q
N ZTDESC,ZTIO,ZTRTN,ZTSK,ZTSAVE
TASK S ZTRTN="EN^ORY297",ZTIO=""
S ZTDESC="Check of Orderable Items"
D ^%ZTLOAD
W !!,"The check of Orderable Item Quick Order Restrictions is",$S($D(ZTSK):"",1:" NOT")," queued",!
I $D(ZTSK) W " (to start NOW).",!!,"YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
Q
;
EN ; -- tasked entry point
S:$D(ZTQUEUED) ZTREQ="@"
N CREAT,EXPR,%
D NOW^%DTC S CREAT=$E(%,1,7),EXPR=$$FMADD^XLFDT(CREAT,30,0,0,0)
N NAME,OI
S NAME="" F S NAME=$O(^ORD(101.43,"S.RX",NAME)) Q:NAME="" D
. S OI=0 F S OI=$O(^ORD(101.43,"S.RX",NAME,OI)) Q:'OI D
.. I $D(MSG(OI)) Q
.. I $P(^ORD(101.43,"S.RX",NAME,OI),U,5) D
... S MSG(OI)=$P($G(^ORD(101.43,OI,0)),U)
... I ^ORD(101.43,OI,.1) S MSG(OI)=MSG(OI)_"(INACTIVE)"
I $D(MSG) S MSG(0)=EXPR_"^"_CREAT
D SEND
K ZTQUEUED,ZTREQ Q
SEND ;Send message
K ^TMP($J,"ORMSG"),XMY
N OI,CNT,OCNT,XMDUZ,XMSUB,XMTEXT
S XMDUZ="CPRS, SEARCH",XMSUB="ORDERABLE ITEM QUICK ORDER RESTRICTION SEARCH",XMTEXT="^TMP("_$J_",""ORMSG"",",XMY(DUZ)=""
S ^TMP($J,"ORMSG",1,0)=" The check of Orderable Item Quick Order Restrictions is complete."
S ^TMP($J,"ORMSG",2,0)=" "
s ^TMP($J,"ORMSG",3,0)=" Here is the list of all orderable items that should be reviewed:"
S ^TMP($J,"ORMSG",4,0)=" "
s ^TMP($J,"ORMSG",5,0)="These orderable items are marked with PHARMACY as the usage and"
S ^TMP($J,"ORMSG",6,0)="have QO ONLY set to YES. Please follow the instructions provided"
S ^TMP($J,"ORMSG",7,0)="in the patch description of OR*3.0*297 to confirm the quick order"
S ^TMP($J,"ORMSG",8,0)="restrictions are correct for these items."
S ^TMP($J,"ORMSG",9,0)=" "
S OI=0,OCNT=9,CNT=0
F S OI=$O(MSG(OI)) Q:OI="" S OCNT=OCNT+1,^TMP($J,"ORMSG",OCNT,0)=MSG(OI),CNT=CNT+1 I '(CNT#10) S OCNT=OCNT+1,^TMP($J,"ORMSG",OCNT,0)=" "
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY297 2082 printed Nov 22, 2024@17:50:43 Page 2
ORY297 ;SLC/JLC-Search for OIs with PHARMACY restriction ; 3/8/11 11:02am
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**297**;Dec 17, 1997;Build 14
+2 ;
+3 ;
EN1 ; -- main entry point
+1 IF $GET(DUZ)=""
WRITE "Your DUZ is not defined.",!
QUIT
+2 NEW ZTDESC,ZTIO,ZTRTN,ZTSK,ZTSAVE
TASK SET ZTRTN="EN^ORY297"
SET ZTIO=""
+1 SET ZTDESC="Check of Orderable Items"
+2 DO ^%ZTLOAD
+3 WRITE !!,"The check of Orderable Item Quick Order Restrictions is",$SELECT($DATA(ZTSK):"",1:" NOT")," queued",!
+4 IF $DATA(ZTSK)
WRITE " (to start NOW).",!!,"YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
+5 QUIT
+6 ;
EN ; -- tasked entry point
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 NEW CREAT,EXPR,%
+3 DO NOW^%DTC
SET CREAT=$EXTRACT(%,1,7)
SET EXPR=$$FMADD^XLFDT(CREAT,30,0,0,0)
+4 NEW NAME,OI
+5 SET NAME=""
FOR
SET NAME=$ORDER(^ORD(101.43,"S.RX",NAME))
if NAME=""
QUIT
Begin DoDot:1
+6 SET OI=0
FOR
SET OI=$ORDER(^ORD(101.43,"S.RX",NAME,OI))
if 'OI
QUIT
Begin DoDot:2
+7 IF $DATA(MSG(OI))
QUIT
+8 IF $PIECE(^ORD(101.43,"S.RX",NAME,OI),U,5)
Begin DoDot:3
+9 SET MSG(OI)=$PIECE($GET(^ORD(101.43,OI,0)),U)
+10 IF ^ORD(101.43,OI,.1)
SET MSG(OI)=MSG(OI)_"(INACTIVE)"
End DoDot:3
End DoDot:2
End DoDot:1
+11 IF $DATA(MSG)
SET MSG(0)=EXPR_"^"_CREAT
+12 DO SEND
+13 KILL ZTQUEUED,ZTREQ
QUIT
SEND ;Send message
+1 KILL ^TMP($JOB,"ORMSG"),XMY
+2 NEW OI,CNT,OCNT,XMDUZ,XMSUB,XMTEXT
+3 SET XMDUZ="CPRS, SEARCH"
SET XMSUB="ORDERABLE ITEM QUICK ORDER RESTRICTION SEARCH"
SET XMTEXT="^TMP("_$JOB_",""ORMSG"","
SET XMY(DUZ)=""
+4 SET ^TMP($JOB,"ORMSG",1,0)=" The check of Orderable Item Quick Order Restrictions is complete."
+5 SET ^TMP($JOB,"ORMSG",2,0)=" "
+6 SET ^TMP($JOB,"ORMSG",3,0)=" Here is the list of all orderable items that should be reviewed:"
+7 SET ^TMP($JOB,"ORMSG",4,0)=" "
+8 SET ^TMP($JOB,"ORMSG",5,0)="These orderable items are marked with PHARMACY as the usage and"
+9 SET ^TMP($JOB,"ORMSG",6,0)="have QO ONLY set to YES. Please follow the instructions provided"
+10 SET ^TMP($JOB,"ORMSG",7,0)="in the patch description of OR*3.0*297 to confirm the quick order"
+11 SET ^TMP($JOB,"ORMSG",8,0)="restrictions are correct for these items."
+12 SET ^TMP($JOB,"ORMSG",9,0)=" "
+13 SET OI=0
SET OCNT=9
SET CNT=0
+14 FOR
SET OI=$ORDER(MSG(OI))
if OI=""
QUIT
SET OCNT=OCNT+1
SET ^TMP($JOB,"ORMSG",OCNT,0)=MSG(OI)
SET CNT=CNT+1
IF '(CNT#10)
SET OCNT=OCNT+1
SET ^TMP($JOB,"ORMSG",OCNT,0)=" "
+15 DO ^XMD
+16 QUIT