1 | DGPTFVC2 ;ALB/MJK - Expanded PTF Close-Out Edits ; Jul 20 88
|
---|
2 | ;;5.3;Registration;;Aug 13, 1993
|
---|
3 | ;called from Q+2^DGPTFTR
|
---|
4 | ; input : PTF
|
---|
5 | ; output: DGERR DGERR := 1 if record fails to pass a check
|
---|
6 | ; DGERR := "" if record passes all checks
|
---|
7 | EN ;
|
---|
8 | Q:'$D(PTF)
|
---|
9 | ; -- count mvts
|
---|
10 | S DGMAX=25,DGERR="" N C,DGM,I,Y
|
---|
11 | F DGM=501,535 S Y=PTF D @DGM I C>DGMAX S DGERR=1 W !,DGM," There are '",C,"' ",DGM," movements but only '",DGMAX,"' can be sent to Austin."
|
---|
12 | I DGERR W !," *** Contact PTF supervisor ***" G ENQ
|
---|
13 | ; -- check proc/surg dates
|
---|
14 | G ENQ:T1
|
---|
15 | S DGDCDT=+$S($D(^DGPT(PTF,70)):^(70),1:"")
|
---|
16 | F DGM="P","S" F I=0:0 S I=$O(^DGPT(PTF,DGM,I)) Q:'I I $D(^(I,0)),+^(0)>DGDCDT S Y=^(0) D ERROR
|
---|
17 | ENQ K DGMAX,DGDCDT Q
|
---|
18 | ;
|
---|
19 | ERROR ;
|
---|
20 | S:'$D(^UTILITY("DG",$J,$S(DGM="P":601,1:401),I)) ^(I)="^" S X=^(I) S:X'["^1^" ^(I)=X_"1^"
|
---|
21 | S DGERR=1,Y=+Y X ^DD("DD") W !,">>>> ",$S(DGM="P":"Procedure",1:"Surgery")," date/time of '",Y,"' is after the discharge date."
|
---|
22 | ;
|
---|
23 | LINES ; -- count the number of lines to be xmited for PTF rec
|
---|
24 | ; input : Y := ifn of ^DGPT
|
---|
25 | ; output: X := line count
|
---|
26 | ;
|
---|
27 | N NODE,C S X=2
|
---|
28 | D 501 S X=X+C D 535 S X=X+C F NODE="P","S" F %=0:0 S %=$O(^DGPT(Y,NODE,%)) Q:'% I $D(^(%,0)),+^(0)'<T1,+^(0)'>T2 S X=X+1
|
---|
29 | Q
|
---|
30 | ;
|
---|
31 | 501 ; -- count 501 mvts to xmit
|
---|
32 | ; input : Y := IFN
|
---|
33 | ; DGMTY := indicates entering from flag option [optional]
|
---|
34 | ; output: C := # of entries
|
---|
35 | ;
|
---|
36 | N Z,D S C=1 ; always one 501
|
---|
37 | ; count & check if between date range & ok to xmit
|
---|
38 | F %=1:0 S %=$O(^DGPT(Y,"M",%)) Q:'% S C=C+1 I '$D(DGMTY),$D(^(%,0)) S Z=^(0),D=$P(Z,U,10) I D<T1!(D>T2)!($P(Z,U,17)="n") S C=C-1
|
---|
39 | Q
|
---|
40 | ;
|
---|
41 | 535 ; -- count 535 mvts to xmit
|
---|
42 | ; input : Y := IFN
|
---|
43 | ; DGMTY := indicates entering from flag option [optional]
|
---|
44 | ; output: C := # of entries
|
---|
45 | ;
|
---|
46 | N Z,D S C=0
|
---|
47 | ; count & check if between date range & ok to xmit & not a 501 on date
|
---|
48 | F %=0:0 S %=$O(^DGPT(Y,535,%)) Q:'% S C=C+1 I '$D(DGMTY),$D(^(%,0)) S Z=^(0),D=$P(Z,U,10) I 'D!(D<T1)!(D>T2)!($P(Z,U,17)="n")!($D(^DGPT(Y,"M","AM",+D))) S C=C-1
|
---|
49 | Q
|
---|
50 | ;
|
---|