1 | RGEQSTAT ;BHM/RGY-Statistics ;17-Feb-98
|
---|
2 | ;;1.0; CLINICAL INFO RESOURCE NETWORK ;;30 Apr 99
|
---|
3 | ENT(TYPE) ;Get available entry
|
---|
4 | NEW DATE
|
---|
5 | I TYPE'?1N.N S TYPE=+$O(^RGEQASN("B",TYPE,0))
|
---|
6 | I '$D(^RGEQASN(TYPE,0)) Q 0
|
---|
7 | S DATE=$$NOW^XLFDT\1
|
---|
8 | I '$O(^RGSTAT(995.2,"AX",TYPE,DATE,0)) D ADD(TYPE,DATE)
|
---|
9 | Q $O(^RGSTAT(995.2,"AX",TYPE,DATE,0))
|
---|
10 | ;
|
---|
11 | ADD(TYPE,DATE) ;Add statistics entry for type of event
|
---|
12 | NEW DIC,D0,DIE,DA,X,DLAYGO,DR,RGOK,EVN
|
---|
13 | I $G(TYPE)="" Q
|
---|
14 | I $G(DATE)="" Q
|
---|
15 | I TYPE'?1N.N S TYPE=$O(^RGEQASN("B",TYPE,0)) I TYPE="" G Q
|
---|
16 | F EVN=+$P(^RGSTAT(995.2,0),"^",3)+1:1 L +^RGSTAT(995.2,EVN):0 I $T S RGOK=0 D L -^RGSTAT(995.2,EVN) Q:RGOK
|
---|
17 | .I $D(^RGSTAT(995.2,EVN)) Q
|
---|
18 | .S DINUM=EVN,DIC="^RGSTAT(995.2,",DIC(0)="L",DLAYGO=995.2,X=EVN K DD,D0 D FILE^DICN K DIC,DLAYGO,D0
|
---|
19 | .S DIE="^RGSTAT(995.2,",DR="[RGEQ NEW STATISTIC]",DA=EVN D ^DIE
|
---|
20 | .S RGOK=1
|
---|
21 | .Q
|
---|
22 | Q Q
|
---|