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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1DGPTFVC3 ;ALB/MTC - VAILIDATION CHECK FOR PTF ADDITIONAL QUESTIONS ; 18 MAR 91
2 ;;5.3;Registration;**164,729**;Aug 13, 1993;Build 59
3 ;
4 ; Called by Q+2^DGPTFTR
5 ; Variable Passed In: PTF - Current PTF record.
6 ; Variable Returned : DGERR - 1 if fails else ""
7 ;
8EN ;
9 D INIT G:DGOUT ENQ
10 D 401,501,701
11ENQ ;
12 K DGPTF,DGHOLD,DGMOV,DGJ,DGBPC,DGPTIT,DGOUT,DGSUR,DGREC
13 Q
14501 ;-- check 501's for inconsistent data
15 K DGPTIT
16 F DGMOV=0:0 S DGMOV=$O(^DGPT(DGPTF,"M",DGMOV)) Q:DGMOV'>0 I $D(^DGPT(DGPTF,"M",DGMOV,0)) S DGHOLD=^(0) D CHKFL5
17 K DGMOV
18 Q
19 ;
20CHKFL5 ;-- check field entries
21 F DGJ=5:1:9 I $P(DGHOLD,U,DGJ)]"" S DGPTIT($P(DGHOLD,U,DGJ)_";ICD9(")=""
22 D DC^DGPTSCAN,SCAN^DGPTSCAN
23 I '$D(DGBPC),'$D(^DGPT(DGPTF,"M",DGMOV,300)) G CHK5Q
24 S DGHOLD=$S($D(^DGPT(DGPTF,"M",DGMOV,300)):^(300),1:"")
25 D GETNUM^DGPTSCAN
26 ;F DGII=2:1:DGFNUM I ('$D(DGBPC(DGII))&($P(DGHOLD,U,DGII)]""))!($D(DGBPC(DGII))&($P(DGHOLD,U,DGII)']"")) S DGERR=1 D W501
27 F DGII=2:1:DGFNUM I ($D(DGBPC(DGII))&($P(DGHOLD,U,DGII)']"")) S DGERR=1 D W501
28 ;
29CHK5Q K DGFNUM,DGII,DGBPC,DGPTIT
30 Q
31 ;
32401 ;-- check 401's for inconsistent data
33 K DGPTIT
34 F DGSUR=0:0 S DGSUR=$O(^DGPT(DGPTF,"S",DGSUR)) Q:DGSUR'>0 I $D(^DGPT(DGPTF,"S",DGSUR,0)) S DGHOLD=^(0) D CHKFL4
35 Q
36 ;
37CHKFL4 ;-- check field entries
38 F DGJ=8:1:12 I $P(DGHOLD,U,DGJ)]"" S DGPTIT($P(DGHOLD,U,DGJ)_";ICD0(")=""
39 D DC^DGPTSCAN,SCAN^DGPTSCAN
40 I '$D(DGBPC),'$D(^DGPT(DGPTF,"S",+DGSUR,300)) G CHK4Q
41 S DGHOLD=$S($D(^DGPT(DGPTF,"S",+DGSUR,300)):^(300),1:"")
42 ;I ('$D(DGBPC(1))&($P(DGHOLD,U)]""))!($D(DGBPC(1))&($P(DGHOLD,U)']"")) S DGERR=1 D W401
43 I ($D(DGBPC(1))&($P(DGHOLD,U)']"")) S DGERR=1 D W401
44CHK4Q K DGBPC,DGPTIT
45 Q
46 ;
47701 ;-- process 701 load DGPTIT array
48 K DGPTIT
49 G CHK7Q:'$D(^DGPT(DGPTF,70)) S DGREC=^(70)
50 F DGI=10,16:1:24 I $P(DGREC,U,DGI) S DGPTIT($P(DGREC,U,DGI)_";ICD9(")=""
51 D DC^DGPTSCAN,SCAN^DGPTSCAN,ANYPSY^DGPTSCAN
52 I '$D(DGBPC),'$D(^DGPT(DGPTF,"M")) G CHK7Q
53 S DGTREC=$S($D(^DGPT(DGPTF,300)):^(300),1:"")
54 S DG701="" D FLAGCHK^DGPTSCAN
55 D GETNUM^DGPTSCAN
56 ;F DGII=2:1:DGFNUM I $D(DGBPC(DGII))&($P(DGTREC,U,DGII)']"")!('$D(DGBPC(DGII))&($P(DG701,U,DGII)]"")&($P(DGTREC,U,DGII)']""))!('$D(DGBPC(DGII))&($P(DGTREC,U,DGII)]"")&($P(DG701,U,DGII)']"")) S DGERR=1 D W701
57 F DGII=2:1:DGFNUM I $D(DGBPC(DGII))&($P(DGTREC,U,DGII)']"") S DGERR=1 D W701
58CHK7Q ;
59 K DGII,DGFNUM,DG701,DGHOLD,DGTREC,DGI
60 Q
61 ;
62W401 ;-- display error message for 401
63 N X S X=+^DGPT(DGPTF,"S",DGSUR,0),X=$TR($$FMTE^XLFDT(X,"5DF")," ","0")
64 W !,"401 Surgery date: ",X,"...",$P($T(ERRMSG+1),";",4)
65 Q
66W501 ;-- display error message for 501
67 N X S X=+$P(^DGPT(DGPTF,"M",DGMOV,0),"^",10),X=$TR($$FMTE^XLFDT(X,"5DF")," ","0")
68 W !,"501 Movement date: ",X,"...",$P($T(ERRMSG+DGII),";",4)
69 Q
70W701 ;-- display error messages for 701
71 W !,"701 ",$P($T(ERRMSG+DGII),";",4)
72 Q
73INIT ;
74 I '$D(PTF) S DGOUT=1 G INITQ
75 S DGOUT=0,DGPTF=PTF
76 I '$D(^DGPT(DGPTF)) S (DGOUT,DGERR)=1
77 D LO^DGUTL,HOME^%ZIS
78INITQ Q
79 ;
80ERRMSG ;-- error messages
81 ;;1;Kidney Transplant Status Data Error.
82 ;;2;Suicide Indicator Data Error.
83 ;;3;Legionnaire's Disease Indicator Data Error.
84 ;;4;Substance Abuse Type Data Error.
85 ;;5;Psychiatry Axis IV Data Error.
86 ;;6;Psychiatry Axis V Data Error.
87 ;;7;Psychiatry Axis V Data Error.
88 ;
89 ;
Note: See TracBrowser for help on using the repository browser.