Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORY297

ORY297.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ;
  1. EN1 ; -- main entry point
  1. I $G(DUZ)="" W "Your DUZ is not defined.",! Q
  1. N ZTDESC,ZTIO,ZTRTN,ZTSK,ZTSAVE
  1. TASK S ZTRTN="EN^ORY297",ZTIO=""
  1. S ZTDESC="Check of Orderable Items"
  1. D ^%ZTLOAD
  1. W !!,"The check of Orderable Item Quick Order Restrictions is",$S($D(ZTSK):"",1:" NOT")," queued",!
  1. I $D(ZTSK) W " (to start NOW).",!!,"YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
  1. Q
  1. ;
  1. EN ; -- tasked entry point
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. N CREAT,EXPR,%
  1. D NOW^%DTC S CREAT=$E(%,1,7),EXPR=$$FMADD^XLFDT(CREAT,30,0,0,0)
  1. N NAME,OI
  1. S NAME="" F S NAME=$O(^ORD(101.43,"S.RX",NAME)) Q:NAME="" D
  1. . S OI=0 F S OI=$O(^ORD(101.43,"S.RX",NAME,OI)) Q:'OI D
  1. .. I $D(MSG(OI)) Q
  1. .. I $P(^ORD(101.43,"S.RX",NAME,OI),U,5) D
  1. ... S MSG(OI)=$P($G(^ORD(101.43,OI,0)),U)
  1. ... I ^ORD(101.43,OI,.1) S MSG(OI)=MSG(OI)_"(INACTIVE)"
  1. I $D(MSG) S MSG(0)=EXPR_"^"_CREAT
  1. D SEND
  1. K ZTQUEUED,ZTREQ Q
  1. SEND ;Send message
  1. K ^TMP($J,"ORMSG"),XMY
  1. N OI,CNT,OCNT,XMDUZ,XMSUB,XMTEXT
  1. S XMDUZ="CPRS, SEARCH",XMSUB="ORDERABLE ITEM QUICK ORDER RESTRICTION SEARCH",XMTEXT="^TMP("_$J_",""ORMSG"",",XMY(DUZ)=""
  1. S ^TMP($J,"ORMSG",1,0)=" The check of Orderable Item Quick Order Restrictions is complete."
  1. S ^TMP($J,"ORMSG",2,0)=" "
  1. s ^TMP($J,"ORMSG",3,0)=" Here is the list of all orderable items that should be reviewed:"
  1. S ^TMP($J,"ORMSG",4,0)=" "
  1. s ^TMP($J,"ORMSG",5,0)="These orderable items are marked with PHARMACY as the usage and"
  1. S ^TMP($J,"ORMSG",6,0)="have QO ONLY set to YES. Please follow the instructions provided"
  1. S ^TMP($J,"ORMSG",7,0)="in the patch description of OR*3.0*297 to confirm the quick order"
  1. S ^TMP($J,"ORMSG",8,0)="restrictions are correct for these items."
  1. S ^TMP($J,"ORMSG",9,0)=" "
  1. S OI=0,OCNT=9,CNT=0
  1. 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)=" "
  1. D ^XMD
  1. Q