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

HMPMONX.m

Go to the documentation of this file.
  1. HMPMONX ;ASMR/BL,JCH, ^XTMP size support code ;Jan 20, 2017 17:18:18
  1. ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2,3**;April 14,2016;Build 15
  1. ;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q ; no entry from top
  1. ; DE6644 - refactored, fixes to remote procedures, 7 September 2016
  1. ;
  1. XTMPSIZE() ; function, eHMP storage in ^XTMP in kilobytes
  1. Q $J($$GETSIZE^HMPUTILS/1024,5,2)_" KB" ; formatted
  1. ;
  1. SIZE(HMPRSLT) ; remote procedure HMP GLOBAL SIZE returns ^XTMP size in kilobytes, HMPRSLT passed by ref.
  1. K HMPRSLT S HMPRSLT(1)=$J($$GETSIZE^HMPUTILS/1024,5,2)_" KB" Q
  1. ;
  1. CHKXTMP(HMPRSLT) ; remote procedure HMP CHKXTMP, return data about ^XTMP, HMPRSLT passed by ref.
  1. ; returns 2 '^' delimited, lines, 1st line is value headers, 2nd line is the values
  1. ; Goes through ^XTMP, gets total patients, patients complete, and patients staging
  1. ; PTCNT - patient counter and list
  1. ; PTSTG - staging counter and list
  1. ;
  1. N ND,BTCH,PTCNT,PTIEN,PTSTG,S,SRVR,T,Y
  1. K HMPRSLT ; clear any residual data
  1. S SRVR=$$GETSRVR^HMPMONM
  1. ; must have server
  1. I '(SRVR>0) S HMPRSLT(1)="Error^",HMPRSLT(2)="*server not found*" Q
  1. ;
  1. S SRVR(0)=^HMP(800000,SRVR,0),PTCNT=0,PTSTG=0 ; total and staging counts
  1. S ND="HMPFS~"_$P(SRVR(0),U)_"~",ND("L")=$L(ND) ; starting node
  1. S BTCH=ND_"9999999" ; past all dates
  1. F S BTCH=$O(^XTMP(BTCH),-1) Q:'($E(BTCH,1,ND("L"))=ND) D ; iterate in reverse
  1. . S T=0 F S T=$O(^XTMP(BTCH,T)) Q:'T S Y=$G(^(T)) D:Y ; only patients
  1. .. S PTIEN=+Y,S=$P(Y,U,6) S:'$D(PTCNT(PTIEN)) PTCNT(PTIEN)="",PTCNT=PTCNT+1 Q:S ;if S, domain done
  1. .. Q:$D(PTSTG(PTIEN)) ; already counted
  1. .. S PTSTG=PTSTG+1,PTSTG(PTIEN)=""
  1. ;
  1. S HMPRSLT(1)="site hash^site local date time^Patients in queue^Patients complete^Patients staging^XTMP('HMP') bytes^XTMP('HMP') objects"
  1. S HMPRSLT(2)=$$SYS^HMPUTILS_"^"_$$NOW^HMPMONL_"^"_PTCNT_"^"_(PTCNT-PTSTG)_"^"_PTSTG_"^"_$$GETSIZE^HMPUTILS
  1. Q
  1. ;