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

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

initial load of FOIAVistA 6/30/08 version

File size: 1011 bytes
Line 
1DGPATV ;ALB/MRL-PATIENT VARIABLES ;22 MAY 87
2 ;;5.3;Registration;**149**;Aug 13, 1993
3 Q:'$D(DFN) S DGNODE=$S($D(^DPT(DFN,0)):^(0),1:""),DGNAME=$S($P(DGNODE,"^",1)]"":$P(DGNODE,"^",1),1:"UNSPECIFIED #"_DFN),DOB=$S($P(DGNODE,"^",3)?7N:$P(DGNODE,"^",3),1:"DOB UNSPECIFIED")
4 I DOB]"" S Y=DOB X ^DD("DD") S DOB=DOB_"^"_Y
5 S SSN=$S($P(DGNODE,"^",9)]"":$P(DGNODE,"^",9),1:"UNSPECIFIED") I $E(SSN,1,9)?9N S SSN=SSN_"^"_$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,10)
6 S DGEC="0^UNSPECIFIED",DGVETS=$S($D(^DPT(DFN,.36)):+$P(^(.36),"^",1),1:0) I $D(^DIC(8,+DGVETS,0)) S DGEC=+DGVETS_"^"_$P(^(0),"^",1),DGVETS=$P(^(0),"^",5)
7 S:"^Y^N^"'[("^"_DGVETS_"^") DGVETS=$S('$D(^DPT(DFN,"VET")):"",1:^("VET")) S DGVETS=$S(DGVETS="Y":1,1:0)
8 S DGCMOR="UNSPECIFIED",DGMPI=$G(^DPT(+DFN,"MPI"))
9 S DGLOCATN=$$FIND1^DIC(4,"","MX","`"_+$P(DGMPI,U,3)),DGLOCATN=$S(+DGLOCATN>0:$P($$NS^XUAF4(DGLOCATN),U),1:"NOT LISTED")
10 I $D(DGMPI),$D(DGLOCATN) S DGCMOR=$P(DGLOCATN,"^")
11 Q
12KILL K DGCMOR,DGMPI,DGLOCATN,DGNODE,DGNAME,SSN,DOB,DGVETS,DGEC Q
Note: See TracBrowser for help on using the repository browser.