VistA-WorldVistAEHR/r/REGISTRATION-DGQE-DG-DPT-GR.../DGPMDD2.m

20 lines
1.4 KiB
Mathematica

DGPMDD2 ;ALB/MRL - FILE 405 'KILL' X-REFERENCES; 08 NOV 88 ; 11/5/03 1:25pm
;;5.3;Registration;**156,555**;Aug 13, 1993
D FLDS I DGPMDDER G Q
I "^1^2^3^22^"[("^"_+DGPMDDF_"^"),DGPMDD(3) K ^DGPM("ATT"_+DGPMDD(2),+DGPMDD(1),DA),^DGPM("APTT"_+DGPMDD(2),+DGPMDD(3),+DGPMDD(1),DA),^DGPM("AMV"_+DGPMDD(2),+DGPMDD(1),+DGPMDD(3),DA),^DGPM("ATID"_+DGPMDD(2),+DGPMDD(3),DGPMDDID,DA)
I DGPMDD(2)=4!(DGPMDD(2)=5) G Q
I "^1^3^22^"[("^"_+DGPMDDF_"^"),DGPMDD(3),DGPMDD(2)'=6 K ^DGPM("APID",+DGPMDD(3),DGPMDDID,DA),^DGPM("APRD",+DGPMDD(3),+DGPMDD(1),DA)
I "^1^3^9^22^"[("^"_+DGPMDDF_"^"),DGPMDD(9),DGPMDD(14),DGPMDD(3) K ^DGPM("ATS",+DGPMDD(3),+DGPMDD(14),DGPMDDID,+DGPMDD(9),DA)
I "^1^3^14^22^"[("^"_+DGPMDDF_"^"),DGPMDD(14),DGPMDD(2)'=6 K ^DGPM("APMV",+DGPMDD(3),+DGPMDD(14),DGPMDDID,DA),^DGPM("APCA",+DGPMDD(3),+DGPMDD(14),+DGPMDD(1),DA)
I "1^3^22^23^"[("^"_+DGPMDDF_"^"),DGPMDD(23) K ^DGPM("ADMMS",DGPMDD(3),DGPMDDID,DGPMDD(23),DA)
Q K DGPMDD,DGPMDDF,DGPMDDN,DGPMDDER,DGPMDDID Q
;
FLDS ;Determine DGPMDD Variables based on DGPMDDF
S DGPMDDER=0 I '$D(DGPMDDF) K X S DGPMDDER=1 Q
K DGPMDD S DGPMDDN=^DGPM(DA,0) ;Zeroth Node
F DGPMDD=1:1:14,22,23 S DGPMDD(DGPMDD)=$P(DGPMDDN,"^",DGPMDD)
S DGPMDD(DGPMDDF)=X
I $S(DGPMDD(22)=1:1,DGPMDD(22)=2:1,1:0) S DGPMDD(1)=DGPMDD(1)+(DGPMDD(22)/10000000) ;Append sequence number on dates for use in $O
S DGPMDDID=9999999.9999999-DGPMDD(1) F DGPMDD=1,2,3,14 I DGPMDD(DGPMDD)="" Q:(DGPMDD<(DGPMDDF*100)) S DGPMDDER=1 Q
Q