source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VADPT.m@ 1365

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1VADPT ;ALB/MRL/MJK - RETURN PATIENT VARIABLE ARRAYS [DRIVER];07 DEC 1988
2 ;;5.3;Registration;**193,343,389,415,489,498**;Aug 13, 1993
3 ;DFN = Patient IFN [if not passed entire array returned as null]
4 ;
5DEM ;Demographic Variables
6 S VAN=1,VAN(1)=12,VAV="VADM" D ^VADPT0 Q
7 ;
8OPD ;Other Patient Data
9 S VAN=2,VAN(1)=7,VAV="VAPD" D ^VADPT0 Q
10 ;
11ADD ;Current Address
12 S VAN=3,VAN(1)=22,VAV="VAPA" D ^VADPT0 Q
13 ;
14OAD ;Other Patient Variables
15 S VAN=4,VAN(1)=11,VAV="VAOA" D ^VADPT0 Q
16 ;
17INP ;Inpatient Data [pre-version 5]
18 N VAINDTT S VAN=5,VAN(1)=11,VAV="VAIN",VAINDTT=$G(VAINDT) N VAINDT S:VAINDTT VAINDT=$$DATIM(VAINDTT) D ^VADPT0 Q
19 ;
20IN5 ;Inpatient Data [v5.0 and above]
21 N VAINDTT S VAN=6,VAN(1)=19,VAV=$S('$D(VAIP("V")):"VAIP",VAIP("V")'?1A.E:"VAIP",1:VAIP("V")),VAINDTT=$G(VAIP("D")) S:$L(VAINDTT) VAIP("D")=VAINDTT S:VAINDTT VAIP("D")=$$DATIM(VAINDTT) D ^VADPT0 S:$L(VAINDTT) VAIP("D")=VAINDTT Q
22 ;
23ELIG ;Eligibility Information
24 S VAN=7,VAN(1)=9,VAV="VAEL" D ^VADPT0 Q
25 ;
26MB ;Monetary Benefits
27 S VAN=8,VAN(1)=9,VAV="VAMB" D ^VADPT0 Q
28 ;
29SVC ;Service Information
30 S VAN=9,VAN(1)=9,VAV="VASV" D ^VADPT0 Q
31 ;
32REG ;Registration data
33 S VAN=10,VAV="VARP" D ^VADPT0 Q
34 ;
35SDE ;Enrollment Information
36 S VAN=11,VAV="VAEN" D ^VADPT0 Q
37 ;
38SDA ;Appointment Information
39 S VAN=12,VAV="VASD" D ^VADPT0 Q
40 ;
41PID ;Patient Id
42 S VAN=13,VAV="VA" D ^VADPT0 Q
43 ;
44TESTPAT(DFN) ;Test patient ? Returns 0 (No) or 1 (Yes)
45 S DFN=+$G(DFN) I 'DFN Q 0
46 I $D(^DPT("ATEST",DFN)) Q 1
47 N NODE S NODE=$G(^DPT(DFN,0))
48 I $P(NODE,"^",21)=1 Q 1
49 I $E($P(NODE,"^",9),1,5)="00000" Q 1
50 Q 0
51 ;
52V5 S X=$S($D(^DG(43,1,"VERSION")):+^("VERSION"),1:""),VADPT("V")=$S(X<5:0,1:1) K X Q
53OERR ;
541 S VATAG=1 D MULT Q
552 S VATAG=2 D MULT Q
563 S VATAG=3 D MULT Q
574 S VATAG=4 D MULT Q
585 S VATAG=5 D MULT Q
596 S VATAG=6 D MULT Q
607 S VATAG=7 D MULT Q
618 S VATAG=8 D MULT Q
629 S VATAG=9 D MULT Q
6310 S VATAG=10 D MULT Q
6451 S VATAG=11 D MULT Q
6552 S VATAG=12 D MULT Q
6653 S VATAG=13 D MULT Q
67ALL S VATAG=14 D MULT Q
68A5 S VATAG=15 D MULT Q
69SEL Q:$O(VARRAY(0))']"" S VATAG=0,VATAG(2)=$P($T(TAG),";;",2)
70 F VATAG(1)=0:0 S VATAG=$O(VARRAY(VATAG)) Q:VATAG="" I VATAG(2)[("^"_VATAG_"^") S VARRAY(VATAG)=1,VAROOT=$S($D(VAROOT(VATAG)):VAROOT(VATAG),1:"") D @VATAG
71 G Q
72 ;
73MULT S VATAG=$P($T(TG+VATAG),";;",2)
74 F VATAG(1)=1:1 S VATAG(2)=$P(VATAG,"^",VATAG(1)) Q:VATAG(2)="" S VAROOT=$S($D(VAROOT(VATAG(2))):VAROOT(VATAG(2)),1:"") D @(VATAG(2))
75Q S VAROOT="" K:$D(VAROOT)'=11 VAROOT K VATAG Q
76 ;
77KVA K VA
78KVAR D KVAR^VADPT0 K:$D(VAIP("V")) @(VAIP("V")) K I,X,Y,VARRAY,VADM,VAPD,VADPT,VAOA,VASV,VAEL,VAMB,VARP,VAEN,VASD,VAIN,VAIP,VAPA,VAHOW,VAINDT,VAERR,^UTILITY("VADPT",$J),VA200,VATEST Q
79DATIM(DATIM) ;If time not specified see if movement on that date
80 Q:DATIM'?7N DATIM
81 N A,B S A=$O(^DGPM("ADFN"_DFN,DATIM)),B=+$O(^(+A,0))
82 I 'A Q DATIM
83 I $P($G(^DGPM(+B,0)),"^",2)=3 Q DATIM ;Next movement is discharge
84 F Q:"^4^5^7^"'[(U_$P($G(^DGPM(+B,0)),"^",2)) S A=$O(^DGPM("ADFN"_DFN,A)),B=+$O(^(+A,0)) I $E(A,1,7)'=DATIM Q
85 I 'A Q DATIM
86 I $E(A,1,7)'=DATIM Q DATIM
87 Q A
88 ;
89TG ;
90 ;;DEM^INP
91 ;;DEM^ELIG
92 ;;ELIG^INP
93 ;;DEM^ADD
94 ;;ADD^INP
95 ;;DEM^ELIG^ADD
96 ;;ELIG^SVC
97 ;;ELIG^SVC^MB
98 ;;DEM^REG^SDE^SDA
99 ;;SDE^SDA
100 ;;DEM^IN5
101 ;;ELIG^IN5
102 ;;ADD^IN5
103 ;;DEM^OPD^INP^ADD^ELIG^SVC^OAD^MB^REG^SDE^SDA
104 ;;DEM^OPD^IN5^ADD^ELIG^SVC^OAD^MB^REG^SDE^SDA
105 ;
106TAG ;;^DEM^OPD^INP^IN5^ADD^OAD^ELIG^SVC^MB^REG^SDE^SDA^
Note: See TracBrowser for help on using the repository browser.