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

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

initial load of WorldVistAEHR

File size: 1.8 KB
RevLine 
[613]1DG702PST ;BAY/JAT;
2 ;;5.3;Registration;**702**;Aug 13,1993
3 ;
4 ; This is a post-init routine for DG*5.3*702
5 ; The purpose is to relink File #2 and File #20 records
6 ;
7 ; do environment check
8ENV S XPDABORT=""
9 D PROGCHK(.XPDABORT)
10 I XPDABORT="" K XPDABORT
11 Q
12PROGCHK(XPDABORT) ; checks for necessary programmer variables
13 I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
14 .D MES^XPDUTL("Your programming variables are not set up properly.")
15 .D MES^XPDUTL("Installation aborted.")
16 .S XPDABORT=2
17 Q
18 ;
19CLEANUP ;
20 D BMES^XPDUTL("Synchronize Patient file records with file #20")
21 N DGIEN,DG20IEN,DG2PTR,DG2NAME,DG20PTR,DG20NAME,FDATA,DIERR,DGSTUFF,DA,DIK,CNT
22 S CNT=0
23 S DGIEN=0
24 F S DGIEN=$O(^VA(20,"BB",2,.01,DGIEN)) Q:'DGIEN D
25 .Q:DGIEN'[",0,"
26 .S DG20IEN=$O(^VA(20,"BB",2,.01,DGIEN,0))
27 .S DG2PTR=$P(DGIEN,",")
28 .S DG2NAME=$P($G(^DPT(DG2PTR,0)),U)
29 .S DG20PTR=$P($G(^DPT(DG2PTR,"NAME")),U)
30 .S DG20NAME=$P(^VA(20,DG20IEN,1),U)_","_$P(^VA(20,DG20IEN,1),U,2)
31 .I $P(^VA(20,DG20IEN,1),U,3)'="" S DG20NAME=DG20NAME_" "_$P(^VA(20,DG20IEN,1),U,3)
32 .I $P(^VA(20,DG20IEN,1),U,5)'="" S DG20NAME=DG20NAME_" "_$P(^VA(20,DG20IEN,1),U,5)
33 .I DG2NAME'=DG20NAME Q
34 .;repoint the Patient file record to the good file 20 record
35 .K FDATA,DIERR
36 .S FDATA(2,DG2PTR_",",1.01)=DG20IEN
37 .D FILE^DIE("","FDATA","DIERR")
38 .K FDATA,DIERR
39 .;kill the bad file 20 record - MUST KILL BEFORE REPOINTING THE OTHER
40 .S DA=DG20PTR
41 .S DIK="^VA(20,"
42 .D ^DIK
43 .K DA,DIK
44 .;repoint the good file 20 record to the Patient file record
45 .S DGSTUFF=DG2PTR_","
46 .S FDATA(20,DG20IEN_",",.03)=DGSTUFF
47 .D FILE^DIE("","FDATA","DIERR")
48 .K FDATA,DIERR
49 .D MES^XPDUTL("Patient file DFN "_DG2PTR_" synchronized with file #20 record IEN "_DG20IEN)
50 .S CNT=CNT+1
51 D BMES^XPDUTL("Total number of Patient file records synchronized: "_CNT)
52 Q
Note: See TracBrowser for help on using the repository browser.