[613] | 1 | VADPT32 ;ALB/MRL/MJK - PATIENT VARIABLES [IN5], CONT.; 12 DEC 1988
|
---|
| 2 | ;;5.3;Registration;;Aug 13, 1993
|
---|
| 3 | ;Inpatient variables [Version 5.0 and above]
|
---|
| 4 | ;
|
---|
| 5 | BLD ; build array of mvt in reverse order up one before E mvt
|
---|
| 6 | K ^UTILITY("VADPTZ",$J,DFN) S (VANN,VAQ,VAZ,VACC)=0
|
---|
| 7 | I "^4^5^"[("^"_$P(VAMV0,"^",2)_"^") D LODGER G BLDQ
|
---|
| 8 | F I=0:0 S VAZ=$O(^DGPM("APMV",DFN,VAX("CA"),VAZ)),VAZ(1)=0 Q:VAQ!(VAZ'>0) F I1=0:0 S VAZ(1)=$O(^DGPM("APMV",DFN,VAX("CA"),VAZ,VAZ(1))) Q:VAQ!(VAZ(1)'>0) S VACC=VACC+1 D BA
|
---|
| 9 | BLDQ K VACC,VAQ,VAZ Q
|
---|
| 10 | ;
|
---|
| 11 | BA ;Build Movement Array
|
---|
| 12 | I VANN,VACC=(VANN+2) S VAQ=1 Q
|
---|
| 13 | S:VAZ(1)=+E VANN=VACC S X=$S($D(^DGPM(+VAZ(1),0)):^(0),1:""),^UTILITY("VADPTZ",$J,DFN,VACC)=VAZ(1)_"||"_X Q
|
---|
| 14 | ;
|
---|
| 15 | LODGER ;
|
---|
| 16 | S VANN=1,X=^DGPM(E,0)
|
---|
| 17 | I $P(X,"^",2)=5 S ^UTILITY("VADPTZ",$J,DFN,1)=E_"||"_X S:$D(^DGPM(+$P(X,"^",14),0)) ^UTILITY("VADPTZ",$J,DFN,2)=+$P(X,"^",14)_"||"_^(0)
|
---|
| 18 | I $P(X,"^",2)=4 S:$D(^DGPM(+$P(X,"^",17),0)) ^UTILITY("VADPTZ",$J,DFN,1)=+$P(X,"^",17)_"||"_^(0),VANN=2 S ^UTILITY("VADPTZ",$J,DFN,VANN)=E_"||"_X
|
---|
| 19 | Q
|
---|