source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFUTL.m@ 1739

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

initial load of WorldVistAEHR

File size: 5.1 KB
Line 
1IBDFUTL ;ALB/MAF - Maintenance Utility Routine - APR 20 1995
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**9,32,51**;APR 24, 1997
3 ;
4 ; -- Set up variables for display by clinic/form/group
5OUT S IBDFL=0 ;W !!,"Display output by: CLINICS// " D ZSET1 S X="" R X:DTIME G QUIT:X="^"!('$T) I X=""!("Cc"[X) S X="1"
6 S DIR("B")="CLINICS",DIR(0)="SBM^C:CLINICS (Individual);G:GROUPS (Clinics);F:FORMS",DIR("A")="Sort by [C]linics, [G]roups, [F]orms" D ^DIR
7 K DIR I $D(DIRUT)&('$D(IBDF1))!(Y<0) G EXIT
8 I $D(DIRUT)&$D(IBDF1) G QUIT
9 S X=$S("Gg"[X:2,"Ff"[X:3,"Ss"[X:4,1:1)
10 ;I X="?" D ZSET1,HELP1 G OUT
11 S IBDFSRT=$E(X) ;D IN^DGHELP W ! I %=-1 D ZSET1,HELP1 G OUT
12 S IBDFDIS=$S(IBDFSRT=1:"CLIN",IBDFSRT=2:"GROUP",IBDFSRT=3:"FORM",1:"QUIT")
13 D @(IBDFDIS) S:Y=-1 IBDFNCNG=1 G:Y=-1 QUIT
14 ;
15 ;
16OUT1 ; -- Ask for what type of package interface
17 S DIC="^IBE(357.6,",DIC(0)="AEMN"
18 S DIC("S")="I $P(^(0),U,6)=3,$P(^(0),U,9)=1,$G(^(11))'="""""
19 S DIC("A")="Select Type of Code to Display: " D ^DIC K DIC G QUIT:Y<0
20 S IBDFINT=+Y
21 ;
22 S IBDFACT=2 ;default of Inactive
23 S X=$E($G(^IBE(357.6,IBDFINT,11)),7,9)
24 ;
25 ; -- for cpt and icd codes, let them choose active or inactive
26 I X="CPT"!(X="VST")!(X="ICD") D
27 .S DIR("B")="ACTIVE"
28 .S DIR(0)="SBM^A:ACTIVE;I:INACTIVE"
29 .S DIR("A")="Display codes [A]ctive, [I]nactive"
30 .D ^DIR K DIR
31 .Q:$D(DIRUT)
32 .S X=$S("Ii"[$E(X,1):2,1:1)
33 .S IBDFACT=$E(X)
34 I $D(DIRUT)&('$D(IBDF1))!(Y<0) G EXIT
35 I $D(DIRUT)&$D(IBDF1) G QUIT
36 ;
37 I $D(IBDF1) D
38 .K VAUTP F IBI=0:0 S IBI=$O(VAUTJ(IBI)) Q:IBI']"" S VAUTP(IBI)=$G(VAUTJ(IBI))
39 I IBDFACT=1 D
40 .;;I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="CPT" S DIC="^ICPT(",IBDFCODE="CPT "
41 .;;I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="ICD" S DIC="^ICD9(",IBDFCODE="ICD-9 "
42 .;;I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="VST" S DIC="^IBE(357.69,",IBDFCODE="Type of Visit "
43 .;
44 .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="CPT" S DIC="^ICPT(",IBDFCODE="CPT ",DIC("S")="I $P($$CPT^ICPTCOD(Y),U,7)=1"
45 .;
46 .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="ICD" S DIC="^ICD9(",IBDFCODE="ICD-9 ",DIC("S")="I $P($$ICDDX^ICDCODE(Y),U,10)=1"
47 .;
48 .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="VST" S DIC="^IBE(357.69,",IBDFCODE="Type of Visit ",DIC("S")="I $P($$CPT^ICPTCOD(Y),U,7)=1"
49 .;
50 .I $G(DIC)]"" S VAUTVB="VAUTJ",VAUTNI=2,VAUTSTR=IBDFCODE_"code" S VAUTNALL=1 D FIRST^VAUTOMA
51 ;
52 I (Y<0)&$D(IBDF1) D K VAUTP G QUIT
53 .F IBI=0:0 S IBI=$O(VAUTP(IBI)) Q:IBI']"" S VAUTJ(IBI)=$G(VAUTP(IBI))
54 I IBDFACT=1,Y<0,'$D(IBDF1) G EXIT
55 ;
56 I '$D(IBDF1) K XQORS,VALMEVL D EN^VALM("IBDF UTIL PRIMARY SCREEN")
57 I $D(IBDF1) D HDR,KILL,INIT S VALMBCK="R",VALMBG=1
58 Q
59 ;
60HDR ; -- header code
61 I IBDFACT=1 D
62 .S VALMHDR(1)="This screen lists Active codes on Encounter Forms."
63 I IBDFACT'=1 D
64 .S VALMHDR(1)="This screen lists Inactive codes on Encounter Forms."
65 Q
66 ;
67 ; -- Set up list
68INIT D FULL^VALM1 S (IBDCNT,IBDCNT1,VALMCNT)=0
69 K ^TMP("CPT",$J),^TMP("CPTIDX",$J) D KILL^VALM10()
70 S IBDFCNT1=0 D @(IBDFDIS_"1^IBDFUTL1")
71 I '$D(^TMP("CPT",$J)) D NUL
72 Q
73 ;
74 ; -- Ask for clinics one/many/all
75CLIN S VAUTVB="VAUTC",DIC="^SC(",DIC("S")="I $P(^(0),U,3)=""C""",VAUTSTR="Clinic",VAUTNI=2 D FIRST^VAUTOMA K DIC S:Y=-1 IBDFL=1 Q:IBDFL
76 Q
77 ;
78 ; -- Ask for forms one/many/all
79FORM S VAUTVB="VAUTF",DIC="^IBE(357,",VAUTSTR="Form",VAUTNI=2 D FIRST^VAUTOMA S:Y=-1 IBDFL=1 Q:IBDFL
80 Q
81 ;
82 ; -- Ask for clinic groups one/many/all
83GROUP S VAUTVB="VAUTG",DIC="^IBD(357.99,",VAUTSTR="Clinic Group",VAUTNI=2 D FIRST^VAUTOMA S:Y=-1 IBDFL=1 Q:IBDFL
84 Q
85 ;
86 ; -- Ask for divisions one/many/all
87DIV S IBDFL=0 D DIVISION^VAUTOMA
88 S:Y=-1 IBDFL=1 Q:IBDFL
89 Q
90 ; -- Help for display choices
91HELP1 W !!,"Choose a number or first initial :" F K=2:1:4 W !?15,$P(Z,"^",K)
92 W ! Q
93 ;
94 ; -- Listing of selections
95ZSET1 S Z="^1 [C]LINICS (Individual)^2 [G]ROUPS (CLINIC)^3 [F]ORMS^" Q
96 ;
97 ;
98QUIT ; -- Kill variables and reset to last display if no change has been taken place.
99 I $D(IBDF1) S IBDFDIS=IBDFDIS1,IBDFINT=IBDFINT1,IBDFACT=IBDFACT1
100 I '$D(IBDF1) G EXIT
101 D KILL,INIT K IBDFNCNG S VALMBCK="R",VALMBG=1
102 Q
103 ;
104 ;
105KILL ; -- Kill extra array variables
106 N IBDFXX
107 S IBDFXX=$S(IBDFDIS="FORM":"VAUTF",IBDFDIS="GROUP":"VAUTG",1:"VAUTC")
108 I IBDFXX="VAUTF" K VAUTG,VAUTC,^TMP("CLN",$J),^TMP("CLN1",$J),^TMP("GRP",$J),^TMP("GRP1",$J)
109 I IBDFXX="VAUTC" K VAUTG,VAUTF,^TMP("FRM",$J),^TMP("FRM1",$J),^TMP("GRP1",$J)
110 I IBDFXX="VAUTG" K VAUTC,VAUTF,^TMP("FRM",$J),^TMP("FRM1",$J),^TMP("CLN",$J),^TMP("CLN1",$J)
111 Q
112 ;
113 ;
114EXIT ; -- Code executed at action exit
115 K IBDFDIS,IBDFINT,VAUTC,VAUTF,VAUTG,VAUTJ,VAUTP,IBDFINT1,IBDFDIS1,^TMP("CLN",$J),IBDFCODE,IBI,IBDFACT1
116EXIT1 K DIC,IBDBLK,IBDCLN,IBDCLNM,IBDCNODE,IBDCNT,IBDCNT1,IBDF,IBDFBK,IBDFCIFN,IBDFCLIN,IBDFL,IBDFLG,IBDFN,IBDFNAME,IBDFNM,IBDFNODE,IBDFORM1,IBDFRM,IBDFSEL,IBDFSRT,IBDFTMP,IBDFVAL
117 K IBDFX,IBDORM,IBDVAL,IBDVAL1,IBDFCNT1,Z,IBDFRNM,IBDFX1,IBDFX2,IBDFX3
118 K IBCLN,IBDFCLN,IBDFCLNM,IBDFDIV,IBDFGIFN,IBDFGN,IBDFGNM,IBDIV,IBDNAM,IBDNAME,IEN,^TMP("IBDF",$J),^TMP("UTIL",$J),^TMP("CPT",$J),^TMP("CPTIDX",$J),DIVISION,IBDF,IBDFACT,VAUTNALL Q
119 ;
120 ;
121HLP ; -- help code
122 S X="?" D DISP^XQORM1 W !!
123 Q
124 ;
125 ;
126EXP ; -- expand code
127 Q
128NUL ; -- NULL MESSAGE
129 S ^TMP("CPT",$J,1,0)=" ",^TMP("CPT",$J,2,0)="There are no "_$S(IBDFACT=1:"active",1:"inactive")_" codes on any forms.",^TMP("CPTIDX",$J,1)=1,^TMP("CPTIDX",$J,2)=2
130 Q
Note: See TracBrowser for help on using the repository browser.