HLOSITE ;ALB/CJM-HL7 - API for getting site parameters ;02/04/2004
;;1.6;HEALTH LEVEL SEVEN;**126**;Oct 13, 1995
;
SYSPARMS(SYSTEM) ;Gets system parameters from file 779.1
;Input: none
;Output:
;
N NODE,LINK
S NODE=$G(^HLD(779.1,1,0))
S SYSTEM("DOMAIN")=$P(NODE,"^")
S SYSTEM("STATION")=$P(NODE,"^",2)
S SYSTEM("PROCESSING ID")=$P(NODE,"^",3)
S SYSTEM("MAXSTRING")=$P(NODE,"^",4)
I 'SYSTEM("MAXSTRING") D
.N OS S OS=^%ZOSF("OS")
.S SYSTEM("MAXSTRING")=$S(OS["OpenM":512,OS["DSM":512,1:256)
S SYSTEM("HL7 BUFFER")=$P(NODE,"^",5)
S:'SYSTEM("HL7 BUFFER") SYSTEM("HL7 BUFFER")=15000
S SYSTEM("USER BUFFER")=$P(NODE,"^",6)
S:'SYSTEM("USER BUFFER") SYSTEM("USER BUFFER")=5000
S SYSTEM("NORMAL PURGE")=$P(NODE,"^",7)
I 'SYSTEM("NORMAL PURGE") S SYSTEM("NORMAL PURGE")=36
S SYSTEM("ERROR PURGE")=$P(NODE,"^",8)
I 'SYSTEM("ERROR PURGE") S SYSTEM("ERROR PURGE")=7
S LINK=$P(NODE,"^",10)
S:LINK SYSTEM("PORT")=$$PORT^HLOTLNK(LINK)
S:'$G(SYSTEM("PORT")) SYSTEM("PORT")=$S(SYSTEM("PROCESSING ID")="P":5001,1:5026)
Q
;
INC(VARIABLE,AMOUNT) ;
;Increments VARIABLE by AMOUNT, using $I if available, otherwise by locking.
;
N OS
;if HLCSTATE has been defined, then we have already checked the OS, so use it.
I $D(HLCSTATE("SYSTEM","OS")) D
.S OS=HLCSTATE("SYSTEM","OS")
E D
.S OS=^%ZOSF("OS")
I '$G(AMOUNT) S AMOUNT=1
I (OS["OpenM")!(OS["DSM")!(OS["CACHE") Q $I(@VARIABLE,AMOUNT)
L +VARIABLE:100
S @VARIABLE=@VARIABLE+AMOUNT
L -VARIABLE
Q @VARIABLE
;
COUNT778() ;
;This function returns the # of records in file 778.
N COUNT,IEN
S (COUNT,IEN)=0
F S IEN=$O(^HLB(IEN)) Q:'IEN S COUNT=COUNT+1
Q COUNT
COUNT777() ;
;This function returns the # of records in file 777.
N COUNT,IEN
S (COUNT,IEN)=0
F S IEN=$O(^HLA(IEN)) Q:'IEN S COUNT=COUNT+1
Q COUNT
;
UPDCNTS ;update the record counts for file 777,778
N COUNT
S COUNT=$$COUNT777^HLOSITE
S $P(^HLA(0),"^",4)=COUNT
S ^HLTMP("FILE 777 RECORD COUNT")=COUNT_"^"_$$NOW^XLFDT
S COUNT=$$COUNT778^HLOSITE
S $P(^HLB(0),"^",4)=COUNT
S ^HLTMP("FILE 778 RECORD COUNT")=COUNT_"^"_$$NOW^XLFDT
Q
HLOSITE ;ALB/CJM-HL7 - API for getting site parameters ;02/04/2004
+1 ;;1.6;HEALTH LEVEL SEVEN;**126**;Oct 13, 1995
+2 ;
SYSPARMS(SYSTEM) ;Gets system parameters from file 779.1
+1 ;Input: none
+2 ;Output:
+3 ;
+4 NEW NODE,LINK
+5 SET NODE=$GET(^HLD(779.1,1,0))
+6 SET SYSTEM("DOMAIN")=$PIECE(NODE,"^")
+7 SET SYSTEM("STATION")=$PIECE(NODE,"^",2)
+8 SET SYSTEM("PROCESSING ID")=$PIECE(NODE,"^",3)
+9 SET SYSTEM("MAXSTRING")=$PIECE(NODE,"^",4)
+10 IF 'SYSTEM("MAXSTRING")
Begin DoDot:1
+11 NEW OS
SET OS=^%ZOSF("OS")
+12 SET SYSTEM("MAXSTRING")=$SELECT(OS["OpenM":512,OS["DSM":512,1:256)
End DoDot:1
+13 SET SYSTEM("HL7 BUFFER")=$PIECE(NODE,"^",5)
+14 IF 'SYSTEM("HL7 BUFFER")
SET SYSTEM("HL7 BUFFER")=15000
+15 SET SYSTEM("USER BUFFER")=$PIECE(NODE,"^",6)
+16 IF 'SYSTEM("USER BUFFER")
SET SYSTEM("USER BUFFER")=5000
+17 SET SYSTEM("NORMAL PURGE")=$PIECE(NODE,"^",7)
+18 IF 'SYSTEM("NORMAL PURGE")
SET SYSTEM("NORMAL PURGE")=36
+19 SET SYSTEM("ERROR PURGE")=$PIECE(NODE,"^",8)
+20 IF 'SYSTEM("ERROR PURGE")
SET SYSTEM("ERROR PURGE")=7
+21 SET LINK=$PIECE(NODE,"^",10)
+22 IF LINK
SET SYSTEM("PORT")=$$PORT^HLOTLNK(LINK)
+23 IF '$GET(SYSTEM("PORT"))
SET SYSTEM("PORT")=$SELECT(SYSTEM("PROCESSING ID")="P":5001,1:5026)
+24 QUIT
+25 ;
INC(VARIABLE,AMOUNT) ;
+1 ;Increments VARIABLE by AMOUNT, using $I if available, otherwise by locking.
+2 ;
+3 NEW OS
+4 ;if HLCSTATE has been defined, then we have already checked the OS, so use it.
+5 IF $DATA(HLCSTATE("SYSTEM","OS"))
Begin DoDot:1
+6 SET OS=HLCSTATE("SYSTEM","OS")
End DoDot:1
+7 IF '$TEST
Begin DoDot:1
+8 SET OS=^%ZOSF("OS")
End DoDot:1
+9 IF '$GET(AMOUNT)
SET AMOUNT=1
+10 IF (OS["OpenM")!(OS["DSM")!(OS["CACHE")