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

EDPCDBG.m

Go to the documentation of this file.
  1. EDPCDBG ;SLC/KCM - Debugging for Controller ;2/28/12 08:33am
  1. ;;2.0;EMERGENCY DEPARTMENT;;May 2, 2012;Build 103
  1. ;
  1. DEBUG(SWFID) ; return TRUE if debugging
  1. N CTS,DTS,DIF
  1. S CTS=$H,DTS=$$GET^XPAR("SYS","EDPF DEBUG START TIME",1,"I")
  1. Q:'DTS 0 ;no debug param
  1. Q:($P(CTS,",")'=$P(DTS,",")) 0 ;not the same day
  1. S DIF=$P(CTS,",",2)-$P(DTS,",",2)
  1. I DIF<0 Q 0 ;future debug time
  1. I DIF<1800 Q $$NEXTSEQ(SWFID) ;TRUE, within 30 minutes of start
  1. Q 0
  1. ;
  1. NEXTSEQ(LOGID) ; return sequence for this session as EDPF-DEBUG-LOG-swfid^sequence
  1. S:'$L(LOGID) LOGID="init"
  1. I '$D(^XTMP("EDP-DEBUG-LOG",0)) S ^XTMP("EDP-DEBUG-LOG",0)=$$FMADD^XLFDT(DT,1)_U_DT_U_"ED debug log"
  1. L +^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"):2 E Q 0
  1. S ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")=+$G(^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"))+1
  1. L -^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")
  1. Q ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")_U_LOGID
  1. ;
  1. PUTREQ(SEQ,REQ) ; save the request at this sequence number
  1. M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"REQ")=REQ
  1. Q
  1. PUTXML(SEQ,XML) ; save the XML result at this sequence number
  1. M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"XML")=XML
  1. Q
  1. ;
  1. SETON ; turn on debugging for EDIS
  1. N DIR,X,Y
  1. W !,"Enable EDIS Debugging Log"
  1. W !,"Logging will occur for 30 minutes after start time."
  1. W !,"Log is stored in ^XTMP(""EDP-DEBUG-LOG"")",!
  1. S DIR(0)="DO^::EFR"
  1. S DIR("A")="Logging Start Time"
  1. S DIR("B")="NOW"
  1. D ^DIR
  1. Q:'Y
  1. K ^XTMP("EDP-DEBUG-LOG")
  1. D EN^XPAR("SYS","EDPF DEBUG START TIME",1,$$FMTH^XLFDT(Y))
  1. Q
  1. SETOFF ; turn off debugging for EDIS
  1. W !,"EDIS Debugging Log Stopped"
  1. D DEL^XPAR("SYS","EDPF DEBUG START TIME",1)
  1. Q