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

HLEVREP0.m

Go to the documentation of this file.
  1. HLEVREP0 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
  1. ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
  1. ;
  1. RECIP ; Called by [HLEV REPORT MONITOR RECIPIENTS]
  1. N OPTYPE
  1. S OPTYPE=""
  1. RECIP1 KILL ^TMP($J,"HLMREP")
  1. D HD("Monitor Recipients Reports")
  1. D EXRECIP
  1. S OPTYPE=$$RECIPO(OPTYPE) QUIT:OPTYPE']"" ;->
  1. D RECIPLD
  1. D @OPTYPE
  1. G RECIP1 ;->
  1. ;
  1. RECIPMR ; List by monitor/recipient...
  1. D RECIPR("M")
  1. D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Monitor Recipient ")
  1. Q
  1. ;
  1. RECIPRM ; List by recipient/monitor...
  1. D RECIPR("R")
  1. D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Recipient Monitor ")
  1. Q
  1. ;
  1. RECIPR(SUB) ; Create displayable report...
  1. N CT,CTIN,SUB1,SUB1L,SUB2,SUB2L,STAT,TXT
  1. S SUB1="",CT=0,CTIN=0,SUB1L="",SUB2L=""
  1. F S SUB1=$O(^TMP($J,"HLMREP",SUB,SUB1)) Q:SUB1']"" D
  1. . S SUB2=""
  1. . F S SUB2=$O(^TMP($J,"HLMREP",SUB,SUB1,SUB2)) Q:SUB2']"" D
  1. . . S STAT=$G(^TMP($J,"HLMREP",SUB,SUB1,SUB2))
  1. . . I STAT'="A" S CTIN=CTIN+1 ; Inactive status counter
  1. . . S STAT=$S(STAT'="A":"* ",1:" ")
  1. . . S TXT=$$PRT(SUB1,SUB1L,STAT)_$$PRT(SUB2,SUB2L)
  1. . . D ADD(TXT)
  1. . . S CT=CT+1
  1. . . S SUB1L=SUB1,SUB2L=SUB2
  1. Q
  1. ;
  1. PRT(P1,P1L,ST) ; Format part of display line...
  1. ; CT -- req
  1. N TXT
  1. S TXT=$S($G(ST)]"":" ",1:"")_$E($S(P1'=P1L:P1,1:"")_$$REPEAT^XLFSTR("-",35),1,33)_" "
  1. Q TXT
  1. ;
  1. ADD(TXT) ;
  1. N NO
  1. S NO=$O(^TMP($J,"HLMREP","REP",":"),-1)+1
  1. S ^TMP($J,"HLMREP","REP",+NO)=TXT
  1. Q
  1. ;
  1. RECIPLD ; Load monitor and recipient data...
  1. N DATA,IEN7761,MONM,STAT
  1. S IEN7761=0
  1. F S IEN7761=$O(^HLEV(776.1,IEN7761)) Q:IEN7761'>0 D
  1. . S DATA=$G(^HLEV(776.1,+IEN7761,0)) QUIT:DATA']"" ;->
  1. . S MONM=$$UP^XLFSTR($P(DATA,U)) QUIT:DATA']"" ;->
  1. . S STAT=$S($P(DATA,U,2)="A":"ACTIVE",1:"INACTIVE")
  1. . D RECIPM(MONM,IEN7761,STAT,60) ; Load mail groups...
  1. . D RECIPM(MONM,IEN7761,STAT,61) ; Load local recipients...
  1. . D RECIPM(MONM,IEN7761,STAT,62) ; Load remotes...
  1. Q
  1. ;
  1. RECIPM(MONM,IEN7761,STAT,SUBDD) ; Load two globals...
  1. N MIEN,RECIP
  1. S MIEN=0
  1. F S MIEN=$O(^HLEV(776.1,+IEN7761,SUBDD,MIEN)) Q:MIEN'>0 D
  1. . S RECIP=$$UP^XLFSTR($P($G(^HLEV(776.1,+IEN7761,+SUBDD,MIEN,0)),U))
  1. . QUIT:RECIP']"" ;->
  1. . I SUBDD=60 D QUIT:RECIP']"" ;->
  1. . . S RECIP=$P($G(^XMB(3.8,+RECIP,0)),U) QUIT:RECIP']"" ;->
  1. . . S RECIP="G."_RECIP
  1. . I SUBDD=61 D QUIT:RECIP']"" ;->
  1. . . S RECIP=$P($G(^VA(200,+RECIP,0)),U)
  1. . S ^TMP($J,"HLMREP","M",MONM_"[#"_IEN7761_"]",RECIP)=STAT
  1. . S ^TMP($J,"HLMREP","R",RECIP,MONM_"[#"_IEN7761_"]")=STAT
  1. Q
  1. ;
  1. RECIPO(PMT) ; Mon/Recip or Recip/Mon
  1. N DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. S DIR(0)="S^1:List monitors/recipients;2:List recipients/monitors;3:Exit"
  1. S DIR("A")="Select REPORT FORMAT"
  1. S DIR("B")=$S(PMT="RECIPMR":"List recipients/monitors",1:"List monitors/recipients")
  1. D ^DIR
  1. QUIT:+Y<1!(+Y>2) "" ;->
  1. Q $P("RECIPMR^RECIPRM",U,+Y)
  1. ;
  1. EXRECIP N I,T F I=1:1 S T=$T(EXRECIP+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
  1. ;;This option lists the monitors and monitor recipients in two formats: sorted
  1. ;;by monitor and within monitor by recipient. And, by recipient, and withing
  1. ;;recipient by monitor.
  1. QUIT
  1. ;
  1. CONDMON ; Called by [HLEV REPORT CONDENSED MONITOR]
  1. N BY,DIC,FLDS,L
  1. D HD("Short Monitor Report")
  1. W !
  1. D EXCMON
  1. S L="",DIC="^HLEV(776.1,",FLDS="[HLEV REPORT MONITOR-ONE LINE]"
  1. S BY="[HLEV REPORT MONITOR]"
  1. D EN1^DIP
  1. D TELL^HLEVMST0("")
  1. Q
  1. ;
  1. EXCMON N I,T F I=1:1 S T=$T(EXCMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
  1. ;;This option displays monitor information in brief format. If you wish to see
  1. ;;more of the information for this monitor, please use the 'Expanded monitor
  1. ;;report' menu option.
  1. QUIT
  1. ;
  1. EXPMON ; Called by [HLEV REPORT EXPANDED MONITOR]
  1. N BY,DIC,FLDS,L
  1. D HD("Expanded Monitor Report")
  1. W !
  1. D EXPCMON
  1. S L="",DIC="^HLEV(776.1,",FLDS="[CAPTIONED]"
  1. S BY="[HLEV REPORT MONITOR - FF]"
  1. D EN1^DIP
  1. D TELL^HLEVMST0("")
  1. Q
  1. ;
  1. EXPCMON N I,T F I=1:1 S T=$T(EXCPMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
  1. ;;This option displays monitor information in expanded format. If you wish to
  1. ;;see more of the information for this monitor, please use the 'Condensed
  1. ;;monitor report' menu option.
  1. QUIT
  1. ;
  1. ;
  1. HD(TXT) W @IOF,$$CJ^XLFSTR(TXT,IOM)
  1. W !,$$REPEAT^XLFSTR("=",IOM)
  1. QUIT
  1. ;
  1. DETAILS ; Show details of an event monitor occurence...
  1. ;
  1. W !!,"Not implemented yet..."
  1. W !
  1. S X=$$BTE^HLCSMON("Press RETURN to continue... ")
  1. ;
  1. Q
  1. ;
  1. EOR ;HLEVREP0 - Event Monitor REPORTS ;5/16/03 14:42