source: FOIAVistA/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLOSITE.m@ 794

Last change on this file since 794 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1HLOSITE ;ALB/CJM-HL7 - API for getting site parameters ;02/04/2004
2 ;;1.6;HEALTH LEVEL SEVEN;**126**;Oct 13, 1995
3 ;
4SYSPARMS(SYSTEM) ;Gets system parameters from file 779.1
5 ;Input: none
6 ;Output:
7 ;
8 N NODE,LINK
9 S NODE=$G(^HLD(779.1,1,0))
10 S SYSTEM("DOMAIN")=$P(NODE,"^")
11 S SYSTEM("STATION")=$P(NODE,"^",2)
12 S SYSTEM("PROCESSING ID")=$P(NODE,"^",3)
13 S SYSTEM("MAXSTRING")=$P(NODE,"^",4)
14 I 'SYSTEM("MAXSTRING") D
15 .N OS S OS=^%ZOSF("OS")
16 .S SYSTEM("MAXSTRING")=$S(OS["OpenM":512,OS["DSM":512,1:256)
17 S SYSTEM("HL7 BUFFER")=$P(NODE,"^",5)
18 S:'SYSTEM("HL7 BUFFER") SYSTEM("HL7 BUFFER")=15000
19 S SYSTEM("USER BUFFER")=$P(NODE,"^",6)
20 S:'SYSTEM("USER BUFFER") SYSTEM("USER BUFFER")=5000
21 S SYSTEM("NORMAL PURGE")=$P(NODE,"^",7)
22 I 'SYSTEM("NORMAL PURGE") S SYSTEM("NORMAL PURGE")=36
23 S SYSTEM("ERROR PURGE")=$P(NODE,"^",8)
24 I 'SYSTEM("ERROR PURGE") S SYSTEM("ERROR PURGE")=7
25 S LINK=$P(NODE,"^",10)
26 S:LINK SYSTEM("PORT")=$$PORT^HLOTLNK(LINK)
27 S:'$G(SYSTEM("PORT")) SYSTEM("PORT")=$S(SYSTEM("PROCESSING ID")="P":5001,1:5026)
28 Q
29 ;
30INC(VARIABLE,AMOUNT) ;
31 ;Increments VARIABLE by AMOUNT, using $I if available, otherwise by locking.
32 ;
33 N OS
34 ;if HLCSTATE has been defined, then we have already checked the OS, so use it.
35 I $D(HLCSTATE("SYSTEM","OS")) D
36 .S OS=HLCSTATE("SYSTEM","OS")
37 E D
38 .S OS=^%ZOSF("OS")
39 I '$G(AMOUNT) S AMOUNT=1
40 I (OS["OpenM")!(OS["DSM")!(OS["CACHE") Q $I(@VARIABLE,AMOUNT)
41 L +VARIABLE:100
42 S @VARIABLE=@VARIABLE+AMOUNT
43 L -VARIABLE
44 Q @VARIABLE
45 ;
46COUNT778() ;
47 ;This function returns the # of records in file 778.
48 N COUNT,IEN
49 S (COUNT,IEN)=0
50 F S IEN=$O(^HLB(IEN)) Q:'IEN S COUNT=COUNT+1
51 Q COUNT
52COUNT777() ;
53 ;This function returns the # of records in file 777.
54 N COUNT,IEN
55 S (COUNT,IEN)=0
56 F S IEN=$O(^HLA(IEN)) Q:'IEN S COUNT=COUNT+1
57 Q COUNT
58 ;
59UPDCNTS ;update the record counts for file 777,778
60 N COUNT
61 S COUNT=$$COUNT777^HLOSITE
62 S $P(^HLA(0),"^",4)=COUNT
63 S ^HLTMP("FILE 777 RECORD COUNT")=COUNT_"^"_$$NOW^XLFDT
64 S COUNT=$$COUNT778^HLOSITE
65 S $P(^HLB(0),"^",4)=COUNT
66 S ^HLTMP("FILE 778 RECORD COUNT")=COUNT_"^"_$$NOW^XLFDT
67 Q
Note: See TracBrowser for help on using the repository browser.