source: FOIAVistA/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDECLN1.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1IBDECLN1 ;ALB/AAS - Clean up Data Qualifiers and Package interfaces ; 23-JUN-97
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**14**;APR 24, 1997
3 ;
4PROBLEM(PROBLEM) ; -- Find out if Problem is in PCE DIM NODE in 357.6
5 ;
6 ; pce dim node should not equal problem
7 N I,J
8 S I=0,PROBLEM=0
9 F S I=$O(^IBE(357.6,I)) Q:'I D
10 . I $P($G(^IBE(357.6,I,12)),"^",1)="PROBLEM" D
11 .. S PROBLEM=PROBLEM+1
12 .. S PROBLEM(0,I)=""
13 .. S PROBLEM(PROBLEM)=$P($G(^IBE(357.6,I,0)),"^",1)_" uses PROBLEM as the PCE DIM NODE"
14 . S J=0
15 . F S J=$O(^IBE(357.6,I,13,J)) Q:'J D
16 .. I $P($G(^IBE(357.6,I,13,J,0)),"^",4)="PROBLEM" D
17 ... S PROBLEM=PROBLEM+1
18 ... S PROBLEM(0,I)=""
19 ... S PROBLEM(PROBLEM)=$P($G(^IBE(357.6,I,0)),"^",1)_" uses PROBLEM as the PCE DIM NODE in the Allow. Qual. Multiple."
20 ;
21 Q
22 ;
23CLNSEL(TALK) ; -- Clean up selection list entries
24 ; -- should be run after running clnqlf, will update the zzbad pointers
25 ;
26 N I,J,K,L,X,Y,CNT,CNT1,CNT2,NAME,QLF,QLFNAM,PI,PINAM,PINPUT,REALQLF,REALNAM,PROBLEM,SELNAM,BLKNAM,IBQUIT,DIC,DIE,DIK,DA,DR,FRM,FRMNAM,FRMTYPE
27 S (CNT,CNT1,CNT2)=0
28 ;
29 D:TALK MES^XPDUTL(" ")
30 D:TALK MES^XPDUTL(">>> Now checking the SELECTION LIST file for inappropriate Data Qualifiers.")
31 ;
32 ; -- Find out if Problem is in PCE DIM NODE in 357.6
33 D PROBLEM(.PROBLEM)
34 ;
35 ; -- go through selection list file look at data qualifiers in
36 ; subcolumn multiple fields
37 S I=0
38 F S I=$O(^IBE(357.2,I)) Q:'I D
39 . S CNT=CNT+1
40 . S SELNAM=$P($G(^IBE(357.2,I,0)),"^",1)
41 . S BLKNAM=$P($G(^IBE(357.1,+$P($G(^IBE(357.2,I,0)),"^",2),0)),"^",1)
42 . S FRM=+$P($G(^IBE(357.1,+$P($G(^IBE(357.2,I,0)),"^",2),0)),"^",2)
43 . S FRMNAM=$P($G(^IBE(357,+FRM,0)),"^",1)
44 . S FRMTYPE=$P($G(^IBE(357,+FRM,0)),"^",13)
45 . S PI=+$P($G(^IBE(357.2,I,0)),"^",11)
46 . S PINPUT=+$P($G(^IBE(357.6,PI,0)),"^",13)
47 . S PINAM=$P($G(^IBE(357.6,+$P($G(^IBE(357.2,I,0)),"^",11),0)),"^",1)
48 . ;
49 . S J=0
50 . F S J=$O(^IBE(357.2,I,2,J)) Q:'J D
51 .. S QLF=+$P($G(^IBE(357.2,I,2,J,0)),"^",9)
52 .. Q:'QLF
53 .. S QLFNAM=$P($G(^IBD(357.98,QLF,0)),"^",1)
54 .. ;
55 .. Q:$E(QLFNAM,1,6)'="ZZBAD-"
56 .. S CNT1=CNT1+1
57 .. S REALNAM=$P(QLFNAM,"ZZBAD-",2)
58 .. Q:REALNAM=""
59 .. S REALQLF=+$O(^IBD(357.98,"B",REALNAM,0))
60 .. Q:'REALQLF
61 ..;
62 ..; -- don't change if uses Problem node
63 .. I PROBLEM>0 I $D(PROBLEM(0,PI))!($D(PROBLEM(0,PINPUT))) D Q
64 ... D MES^XPDUTL(" ")
65 ... D MES^XPDUTL(" >> The selection list "_SELNAM_" not updated, PCE DIM node set to PROBLEM")
66 ..
67 ..; -- now update the selection list to the real qualifier
68 .. S CNT2=CNT2+1
69 .. S $P(^IBE(357.2,I,2,J,0),"^",9)=REALQLF
70 ..;
71 ..D:TALK MESSAGE
72 ;
73 ; -- write out summary
74 K X
75 S X(1)=" ",X(2)=" >> Summary of Selection List Check:"
76 D:TALK MES^XPDUTL(.X)
77 K X
78 S X(1)=" "
79 S X(2)=" >> A total of "_CNT_" selection list"_$S(CNT=1:" was",1:"s were")_" checked."
80 I CNT1=0 S X(3)=" No problems were found."
81 I CNT1>0 S X(3)=" A total of "_CNT1_" problem"_$S(CNT1=1:" was",1:"s were")_" found and "_CNT2_" were corrected."
82 D:TALK MES^XPDUTL(.X)
83 Q
84 ;
85MESSAGE ; -- write out what happened
86 N K,X,CLIN,CLNLST
87 S CLNLST=""
88 S CLIN="^TMP(""CLST"",$J)"
89 D CLINICS^IBDFU4(FRM,CLIN)
90 S X(1)=" "
91 S X(2)=">>> Qualifier problem in Encounter form "_FRMNAM
92 I FRMTYPE S X(2)=X(2)_" Number "_FRMTYPE
93 I @CLIN@(0)=0 S X(3)=" This form was not used by clinics"
94 I @CLIN@(0)>0 D
95 . S X(3)=" This form is used in the following clinics:"
96 . S K=0,J=3 F S K=$O(@CLIN@(K)) Q:K="" S CLNLST=CLNLST_", "_K D
97 . . Q:$L(CLNLST)>55
98 . . S J=J+1,X(J)=" "_CLNLST
99 . . S CLNLST=""
100 S X(J+1)=" In the "_BLKNAM_" Block"
101 S X(J+2)=" In the "_SELNAM_" Selection List"
102 S X(J+3)=" the qualifier of "_QLFNAM_" Changed to "_REALNAM
103 D:TALK MES^XPDUTL(.X)
104 Q
Note: See TracBrowser for help on using the repository browser.