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

INHMR20.m

Go to the documentation of this file.
  1. INHMR20 ;KN; 18 Jul 95 09:07; Statistical Report - Display Utilities
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. ; PURPOSE:
  1. ; The purpose of the routine INHMR20 is used to contain
  1. ; the utility functions and support for INHMR2.
  1. ;
  1. ; DESCRIPTION:
  1. ; The processing of this routine is used to collect for
  1. ; utility functions to support INHMR2 Statistical Report
  1. ; Display module.
  1. ;
  1. GNDP(INFL,INFD) ; Get node and piece
  1. ;
  1. ; Description: The function GNDP is used to get node and piece
  1. ; where data are at.
  1. ; Return: Node#^Piece#
  1. ; Parameters:
  1. ; INFL = File ien (internal entry into ^INTHU)
  1. ; INFD = Field ien
  1. ; CODE BEGINS:
  1. Q $P($P($G(^DD(INFL,INFD,0)),U,4),";",1,2)
  1. ;
  1. GLN(INFL) ; Get global name
  1. ;
  1. ; Description: The function GLN is used to get global name ^INTHU.
  1. ; Return: Global name (ex. ^INTHU)
  1. ; Parameters:
  1. ; INFL = File ien ( internal entry number )
  1. ; Code begins:
  1. Q $G(^DIC(INFL,0,"GL"))
  1. ;
  1. PRVF(CF,AR) ; Previous field
  1. ;
  1. ; Description: The function PRVF is used to return previous
  1. ; field ien, given current field ien CF.
  1. ; Return: Field ien for previous field of CF
  1. ; Parameters:
  1. ; CF = current field ien
  1. ; AR = Name of array which contains an array of field ien
  1. ; Code begins:
  1. N TMP
  1. I $G(CF)="" S TMP=$G(CF) Q TMP
  1. I (@AR["S")!(@AR["P") S TMP=$O(@AR@(CF),-1)
  1. E S TMP=CF-.1
  1. Q TMP
  1. ;
  1. NXTF(CF,AR) ; Next field ien
  1. ;
  1. ; Description: The function NXTF is used to return next field
  1. ; ien, given current field ien CF
  1. ; Return: Field ien for next field of CF
  1. ; Parameters:
  1. ; CF = current field ien
  1. ; AR = Name of array which contains an array of field ien
  1. ; Code begins:
  1. N TMP
  1. I $G(CF)="" S TMP=$G(CF)
  1. E D
  1. .I (@AR["S")!(@AR["P") S TMP=$O(@AR@(CF))
  1. .E S TMP=CF+.1
  1. Q TMP
  1. ;
  1. CMP(S,INF,IINA,TMP,TMN) ; Compare
  1. ;
  1. ; Description: The function CMP is used to compare if S is
  1. ; in the range from TMP to TMN, and determine
  1. ; any type of data date, numeric, or string in a
  1. ; specific range.
  1. ; Return: 1 = True
  1. ; 0 = False
  1. ; Parameters:
  1. ; S = Selected items to compare
  1. ; INF = Order of items selected by user
  1. ; IINA =
  1. ; TMP = Lower limit
  1. ; TMN = Uper limit
  1. ; Code begins:
  1. N INTMP
  1. S INTMP=0
  1. I IINA["P" S C=$P(^DD(INIEN,INA(INF,1),0),U,2),Y=S D Y^DIQ S S=Y
  1. I $L($G(INA(INF,3)))=0 S:(S]"") INTMP=1
  1. E D
  1. .I (TMN'="") D
  1. ..I (IINA["N")!(IINA["D") S:(S>TMP)&(S<TMN) INTMP=1
  1. ..E S:(S]TMP)&(TMN]S) INTMP=1
  1. .E D
  1. ..I (IINA["N")!(IINA["D") S:(S>TMP) INTMP=1
  1. ..E S:(S]TMP) INTMP=1
  1. Q INTMP
  1. ;
  1. FILL(INC,REF) ; Fill up incount array
  1. ;
  1. ; Description: The function FILL is used to fill an array with
  1. ; all the subtotals (count) and totals.
  1. ; Return: none
  1. ; Parameters:
  1. ; INC = The counter array
  1. ; REF = Name of INC array
  1. ; Code begins:
  1. N LEV,TREF,ZLEV S LEV=""
  1. F S LEV=$O(@REF@(LEV)) Q:LEV="" D
  1. . S ZLEV=LEV S:LEV'=(0+LEV) ZLEV=""""_LEV_""""
  1. . S:REF[")" TREF=$E(REF,1,$L(REF)-1)_","_ZLEV_")"
  1. . S:REF'[")" TREF=REF_"("_ZLEV_")"
  1. . D FILL(.INC,TREF)
  1. . S @REF=$G(@REF)+$G(@TREF)
  1. Q