- INHMSR22 ;KN; 31 Oct 95 07:27; Statistical Report-Utility
- ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- ;COPYRIGHT 1991-2000 SAIC
- ;
- ; MODULE NAME: Statistical Report Display Module (INHMSR22).
- ;
- ; DESCRIPTION: The purpose of the INHMSR22 is used to contain
- ; the functions and support for INHMSR2, INHMSR20,
- ; and INHMSR21.
- ;
- ;
- HDCON(INFL,INFD,INVAL) ; conversion for header
- ;
- ; Description: Convert to external format to use in header
- ; Return: External value
- ; Parameters:
- ; INFL = File ien
- ; INFD = Field ien
- ; INVAL= Internal value
- ;
- ; Code begins:
- N A,INT,STMP
- ; Get piece 2 and piece 3
- S INT=$$GPC2^INHMSR10(INFL,INFD),STMP=$$GPC3^INHMSR10(INFL,INFD)
- ; If piece 2 is a pointer reference to a file
- I INT["P" S A="^"_$E(STMP,1,$L(STMP)-1) Q $P(@A@(INVAL,0),U)
- ;Convert for set of code
- I INT["S" S C=$P(^DD(INFL,INFD,0),U,2),Y=INVAL D Y^DIQ Q Y
- ;Convert for date
- I INT["D" S Y=INVAL D DD^%DT Q Y
- ;If free text, leave it alone
- Q INVAL
- ;
- INXMVG(INFL,INFD,INVAL) ; Internal to external, move variable into global
- ;
- ; Description: Check if see INVAL before, convert and store in
- ; INAP array if neccessary for look up later. If
- ; INAP is too large, then move it to global.
- ; Return: External value
- ; : Null
- ; Parameters:
- ; INFL = File ien
- ; INFD = Field ien
- ; INVAL= Internal value
- ;
- ; Code begins:
- ; Merge over to ^UTILITY when the space is full
- I $S<20000 K ^UTILITY("INAP",$J) M ^UTILITY("INAP",$J)=INAP K INAP S INAP="^UTILITY(""INAP"",$J)"
- ; If see internal before, get external value
- I $D(INAP(INFL,INFD,INVAL)) Q $G(INAP(INFL,INFD,INVAL))
- ; If not see internal before, convert to external then store in INAP array
- I '$D(INAP(INFL,INFD,INVAL)) S C=$P(^DD(INFL,INFD,0),U,2),Y=INVAL D Y^DIQ S INAP(INFL,INFD,INVAL)=Y Q Y
- INHMSR22 ;KN; 31 Oct 95 07:27; Statistical Report-Utility
- +1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- +2 ;COPYRIGHT 1991-2000 SAIC
- +3 ;
- +4 ; MODULE NAME: Statistical Report Display Module (INHMSR22).
- +5 ;
- +6 ; DESCRIPTION: The purpose of the INHMSR22 is used to contain
- +7 ; the functions and support for INHMSR2, INHMSR20,
- +8 ; and INHMSR21.
- +9 ;
- +10 ;
- HDCON(INFL,INFD,INVAL) ; conversion for header
- +1 ;
- +2 ; Description: Convert to external format to use in header
- +3 ; Return: External value
- +4 ; Parameters:
- +5 ; INFL = File ien
- +6 ; INFD = Field ien
- +7 ; INVAL= Internal value
- +8 ;
- +9 ; Code begins:
- +10 NEW A,INT,STMP
- +11 ; Get piece 2 and piece 3
- +12 SET INT=$$GPC2^INHMSR10(INFL,INFD)
- SET STMP=$$GPC3^INHMSR10(INFL,INFD)
- +13 ; If piece 2 is a pointer reference to a file
- +14 IF INT["P"
- SET A="^"_$EXTRACT(STMP,1,$LENGTH(STMP)-1)
- QUIT $PIECE(@A@(INVAL,0),U)
- +15 ;Convert for set of code
- +16 IF INT["S"
- SET C=$PIECE(^DD(INFL,INFD,0),U,2)
- SET Y=INVAL
- DO Y^DIQ
- QUIT Y
- +17 ;Convert for date
- +18 IF INT["D"
- SET Y=INVAL
- DO DD^%DT
- QUIT Y
- +19 ;If free text, leave it alone
- +20 QUIT INVAL
- +21 ;
- INXMVG(INFL,INFD,INVAL) ; Internal to external, move variable into global
- +1 ;
- +2 ; Description: Check if see INVAL before, convert and store in
- +3 ; INAP array if neccessary for look up later. If
- +4 ; INAP is too large, then move it to global.
- +5 ; Return: External value
- +6 ; : Null
- +7 ; Parameters:
- +8 ; INFL = File ien
- +9 ; INFD = Field ien
- +10 ; INVAL= Internal value
- +11 ;
- +12 ; Code begins:
- +13 ; Merge over to ^UTILITY when the space is full
- +14 IF $STORAGE<20000
- KILL ^UTILITY("INAP",$JOB)
- MERGE ^UTILITY("INAP",$JOB)=INAP
- KILL INAP
- SET INAP="^UTILITY(""INAP"",$J)"
- +15 ; If see internal before, get external value
- +16 IF $DATA(INAP(INFL,INFD,INVAL))
- QUIT $GET(INAP(INFL,INFD,INVAL))
- +17 ; If not see internal before, convert to external then store in INAP array
- +18 IF '$DATA(INAP(INFL,INFD,INVAL))
- SET C=$PIECE(^DD(INFL,INFD,0),U,2)
- SET Y=INVAL
- DO Y^DIQ
- SET INAP(INFL,INFD,INVAL)=Y
- QUIT Y