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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1DGPATN ;ALB/MRL - NEW PATIENT ENTRY ; 22 MAY 87
2 ;;5.3;Registration;**41,278**;Aug 13, 1993
3 ;Name Changed/Patient Deleted Bulletin
4 I $S('$D(DFN):1,'$D(X):1,1:0) Q
5 I $D(DGNEWVAL),(DGNEWVAL=X) Q ; edit and edited to same value
6 S DGDATA=X D ^DGPATV S DGB=$S(DGNAME'=X:3,1:9) G Q:'DGB S XMSUB="PATIENT "_$S(DGB=3:"NAME CHANGED",1:"DELETED")
7 ;
8 ;Delete entries in PT/IHS file when entries deleted from PT file.
9 I XMSUB="PATIENT DELETED" D
10 . N DA,DIK
11 . S DA=DFN,DIK="^AUPNPAT(" D ^DIK
12 ;
13 S DGTEXT(1,0)="NAME: "_DGNAME,DGTEXT(2,0)="SSN : "_$P(SSN,"^",2),DGTEXT(3,0)="DOB : "_$P(DOB,"^",2),DGTEXT(4,0)="" I DGB=3 S DGTEXT(5,0)="Previous name was '"_DGDATA_"'."
14 G T
15 ;
16S ;SSN Changed/New Patient Added Bulletin
17 I $S('$D(DFN):1,'$D(X):1,1:0) Q
18 S DGDATA=X D ^DGPATV S DGB=$S(SSN=X:2,SSN="UNSPECIFIED":2,DGDATA'=$P(SSN,"^",1):4,1:0) I 'DGB G Q
19 S XMSUB=$S(DGB=2:"NEW PATIENT ADDED TO SYSTEM",1:"SSN CHANGED"),DGTEXT(1,0)="NAME: "_DGNAME,DGTEXT(2,0)="SSN : "_$E(DGDATA,1,3)_"-"_$E(DGDATA,4,5)_"-"_$E(DGDATA,6,10),DGTEXT(3,0)="DOB : "_$P(DOB,"^",2)
20 I DGB=4 S DGTEXT(4,0)="",DGTEXT(5,0)="Previous SSN was '"_$P(SSN,"^",2)_"'."
21 I DGB=2 D H^DGUTL S $P(^DPT(DFN,0),"^",16)=DGDATE I $D(DUZ)#2,DUZ>0 S $P(^DPT(DFN,0),"^",15)=DUZ ;New patient Who & When
22T K XMTEXT D ^DGBUL
23Q S X=DGDATA D KILL^DGPATV K DGDATA,DGTIME,DGDATE Q
Note: See TracBrowser for help on using the repository browser.