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

ORY608.m

Go to the documentation of this file.
ORY608 ;SLC/JLC - PRE/POST INSTALL OR*3.0*608 ;May 21, 2024@14:09:12
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**608**;Dec 17, 1997;Build 15
 ;
 ;
 Q
 ;
POST ;
 D RPT
 D SETPARAMS
 D DLGBULL
 D TASK("DDCIDQO^ORY608","OR*3.0*608 Quick Order Search")
 Q
 ;
RPT ;Update ORCV VITALS report
 N ORRIEN
 S ORRIEN=$$FIND1^DIC(8994,,"X","ORQQVI SWPVIT")
 I ORRIEN="" D MES^XPDUTL("Error updating the ORCV VITALS report. It must be corrected for the Vitals display on the cover sheet to function.") Q
 I $P(^ORD(101.24,34,0),"^",13)=ORRIEN Q
 S $P(^ORD(101.24,34,0),"^",13)=ORRIEN
 D MES^XPDUTL("ORCV VITALS report remote procedure call updated.")
 Q
 ;
SETPARAM(LEVEL,PARAM,VALUE) ;
 N ERR
 D EN^XPAR(LEVEL,PARAM,1,VALUE,.ERR)
 I +ERR>0 D
 .D BMES^XPDUTL("  Problem setting "_PARAM_" parameter to "_VALUE)
 Q
 ;
SETPARAMS ; Set package level settings of exported parameters
 D SETPARAM("PKG","OR CPRS EXCEPTION MODULE INFO",1)
 D SETPARAM("PKG","OR CPRS ACTIVITY LOG SIZE",0)
 D SETPARAM("PKG","OR CPRS WIN MESSAGE LOG SIZE",0)
 D SETPARAM("PKG","OR CPRS RPC EXCEPTION LOG SIZE",25)
 D SETPARAM("PKG","ORCDGMRC FUTURE DATE LIMIT",390)
 D SETPARAM("PKG","ORCDRA FUTURE DATE LIMIT",390)
 D SETPARAM("SYS","OR CPRS EXCEPTION EMAIL","CPRSDevsOnly@DVAGOV.onmicrosoft.com")
 D SETPARAM("SYS","OR CPRS EXCEPTION LOGGER","YES")
 Q
 ;
SENDDLG(ANAME) ;Return true if the current order dialog should be sent
 I ANAME="GMRCOR CONSULT" Q 1
 I ANAME="RA OERR EXAM" Q 1
 Q 0
 ;
DLGBULL ;Send bulletin about modified dialogs
 N ORD
 S ORD("GMRCOR CONSULT")=""
 S ORD("RA OERR EXAM")=""
 D EN^ORYDLG(608,.ORD)
 Q
 ;
TASK(ZTRTN,ZTDESC) ;
 N ZTDTH,ZTSAVE,ZTIO,TEXT,ZTSK
 S TEXT="  "_ZTDESC_" has been queued, task number "
 S ZTIO=""
 S ZTDTH=$$NOW^XLFDT
 D ^%ZTLOAD
 I $D(ZTSK) S TEXT=TEXT_ZTSK D MES^XPDUTL(.TEXT)
 Q
 ;
DDCIDQO ;search for QOs
 N RESULT,INPUT,SUB,RETMENU,RETSTRCT,SPINNER,SKIPDIS,ORGTXCLININD,ORGTXSDTM
 S ORGTXCLININD="",ORGTXCLININD=$O(^ORD(101.41,"B","OR GTX CLINICALLY INDICATED DATE",""))
 S ORGTXSDTM="",ORGTXSDTM=$O(^ORD(101.41,"B","OR GTX START DATE/TIME",""))
 S INPUT("GMRCOR CONSULT")=""
 S INPUT("RA OERR EXAM")=""
 S RETMENU=1,RETSTRCT=0,SPINNER=0,SKIPDIS=0
 S SUB="OR608 QO SEARCH"
 D FINDQO^ORQOUTL(.RESULT,.INPUT,SUB,RETMENU,RETSTRCT,SPINNER,SKIPDIS)
 D GETVALS,REPORT
 Q
 ;
GETVALS ; get date values for report display
 Q:'$D(^TMP($J,SUB))
 N INDEX S INDEX=""
 N NAME,ODIEN,DSGRP,DSGPAR
 F NAME="GMRCOR CONSULT","RA OERR EXAM" D
 . S ODIEN=$O(^ORD(101.41,"AB",NAME,"")) Q:ODIEN=""
 . S DSGRP=0 F  S DSGRP=$O(^ORD(100.98,DSGRP)) Q:DSGRP'>0  D
 . . I $P(^ORD(100.98,DSGRP,0),U,4)=ODIEN S DSGPAR(NAME,DSGRP)=DSGRP
 F  S INDEX=$O(^TMP($J,SUB,INDEX)) Q:INDEX=""  D
 . I $D(DSGPAR("GMRCOR CONSULT",$P(^ORD(101.41,INDEX,0),U,5))) D CONS
 . I $D(DSGPAR("RA OERR EXAM",$P(^ORD(101.41,INDEX,0),U,5))) D RAD
 Q
 ;
PAD(X,WIDTH,CHAR) ; -- returns X padded with CHAR to total WIDTH
 N Y S:$G(CHAR)="" CHAR=" "
 S Y=X_$$REPEAT^XLFSTR(CHAR,WIDTH-$L(X))
 Q Y
 ;
REPORT ; show data
 K ^TMP("OR MSG",$J),XMY
 N CNT,INDEX,ITEM,XMDUZ,XMSUB,XMTEXT,DIFROM
 S CNT=0,XMDUZ="OR*3.0*608 SEARCH",XMSUB="DATE DESIRED & CID QO DEFAULTS",XMTEXT="^TMP(""OR MSG"",$J,",XMY(DUZ)="",XMY("G.OR CACS")=""
 S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="This report lists Imaging and Consult Quick Orders with a default date"
 S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="value in Date Desired or Clinically Indicated Date."
 S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)=$$PAD("=",78,"=")
 S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)=$$PAD("QO NAME",63," ")_"  QO DATE VALUE"
 S INDEX=""
 F  S INDEX=$O(^TMP($J,SUB,INDEX)) Q:INDEX=""  D
 . S ITEM=^TMP($J,SUB,INDEX)
 . S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)=$$PAD($P(ITEM,U,1),63," ")_"  "_$P(ITEM,U,5)
 . I $D(^TMP($J,"OR608 QO SEARCH",INDEX,"ORDER MENUS")) D
 . . S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="  Used on the following order menu(s):"
 . . N OM S OM="" F  S OM=$O(^TMP($J,"OR608 QO SEARCH",INDEX,"ORDER MENUS",OM)) Q:OM=""  D
 . . . S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="     "_$P(^TMP($J,"OR608 QO SEARCH",INDEX,"ORDER MENUS",OM),U)
 . I $D(^TMP($J,"OR608 QO SEARCH",INDEX,"REMINDER DIALOGS")) D
 . . S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="  Used on the following reminder dialog(s):"
 . . N DM,DM1 S DM="" F  S DM=$O(^TMP($J,"OR608 QO SEARCH",INDEX,"REMINDER DIALOGS",DM)) Q:DM=""  D
 . . . S DM1="" F  S DM1=$O(^TMP($J,"OR608 QO SEARCH",INDEX,"REMINDER DIALOGS",DM,DM1)) Q:DM1=""  D
 . . . . S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="     "_$P(^TMP($J,"OR608 QO SEARCH",INDEX,"REMINDER DIALOGS",DM,DM1),U)
 I CNT=4 S CNT=CNT+1,^TMP("OR MSG",$J,CNT,0)="None Found"
 D ^XMD
 Q
 ;
CONS ; consult
 N CID
 S CID=+$O(^ORD(101.41,INDEX,6,"D",ORGTXCLININD,""))
 I $G(CID)>0 D
 . S CID=^ORD(101.41,INDEX,6,CID,1)
 . I $G(CID)="" D  Q
 . . S CID=0 ;don't report empty values for CID
 . S $P(^TMP($J,SUB,INDEX),U,5)=CID
 I $G(CID)=0 K ^TMP($J,SUB,INDEX)
 Q
 ;
RAD ; radiology
 N DD
 S DD=+$O(^ORD(101.41,INDEX,6,"D",ORGTXSDTM,""))
 I $G(DD)>0 D
 . S DD=^ORD(101.41,INDEX,6,DD,1)
 . I $G(DD)="" D  Q  ;don't report empty values for date desired
 . . S DD=0
 . S $P(^TMP($J,SUB,INDEX),U,5)=DD
 I $G(DD)=0 K ^TMP($J,SUB,INDEX)
 Q