Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBDFUTL

IBDFUTL.m

Go to the documentation of this file.
  1. IBDFUTL ;ALB/MAF - Maintenance Utility Routine - APR 20 1995
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;**9,32**;APR 24, 1997
  1. ;
  1. ; -- Set up variables for display by clinic/form/group
  1. OUT 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"
  1. 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
  1. K DIR I $D(DIRUT)&('$D(IBDF1))!(Y<0) G EXIT
  1. I $D(DIRUT)&$D(IBDF1) G QUIT
  1. S X=$S("Gg"[X:2,"Ff"[X:3,"Ss"[X:4,1:1)
  1. ;I X="?" D ZSET1,HELP1 G OUT
  1. S IBDFSRT=$E(X) ;D IN^DGHELP W ! I %=-1 D ZSET1,HELP1 G OUT
  1. S IBDFDIS=$S(IBDFSRT=1:"CLIN",IBDFSRT=2:"GROUP",IBDFSRT=3:"FORM",1:"QUIT")
  1. D @(IBDFDIS) S:Y=-1 IBDFNCNG=1 G:Y=-1 QUIT
  1. ;
  1. ;
  1. OUT1 ; -- Ask for what type of package interface
  1. S DIC="^IBE(357.6,",DIC(0)="AEMN"
  1. S DIC("S")="I $P(^(0),U,6)=3,$P(^(0),U,9)=1,$G(^(11))'="""""
  1. S DIC("A")="Select Type of Code to Display: " D ^DIC K DIC G QUIT:Y<0
  1. S IBDFINT=+Y
  1. ;
  1. S IBDFACT=2 ;default of Inactive
  1. S X=$E($G(^IBE(357.6,IBDFINT,11)),7,9)
  1. ;
  1. ; -- for cpt and icd codes, let them choose active or inactive
  1. I X="CPT"!(X="VST")!(X="ICD") D
  1. .S DIR("B")="ACTIVE"
  1. .S DIR(0)="SBM^A:ACTIVE;I:INACTIVE"
  1. .S DIR("A")="Display codes [A]ctive, [I]nactive"
  1. .D ^DIR K DIR
  1. .Q:$D(DIRUT)
  1. .S X=$S("Ii"[$E(X,1):2,1:1)
  1. .S IBDFACT=$E(X)
  1. I $D(DIRUT)&('$D(IBDF1))!(Y<0) G EXIT
  1. I $D(DIRUT)&$D(IBDF1) G QUIT
  1. ;
  1. I $D(IBDF1) D
  1. .K VAUTP F IBI=0:0 S IBI=$O(VAUTJ(IBI)) Q:IBI']"" S VAUTP(IBI)=$G(VAUTJ(IBI))
  1. I IBDFACT=1 D
  1. .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="CPT" S DIC="^ICPT(",IBDFCODE="CPT "
  1. .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="ICD" S DIC="^ICD9(",IBDFCODE="ICD-9 "
  1. .I $E($G(^IBE(357.6,IBDFINT,11)),7,9)="VST" S DIC="^IBE(357.69,",IBDFCODE="Type of Visit "
  1. .I $G(DIC)]"" S VAUTVB="VAUTJ",VAUTNI=2,VAUTSTR=IBDFCODE_"code" S VAUTNALL=1 D FIRST^VAUTOMA
  1. ;
  1. I (Y<0)&$D(IBDF1) D K VAUTP G QUIT
  1. .F IBI=0:0 S IBI=$O(VAUTP(IBI)) Q:IBI']"" S VAUTJ(IBI)=$G(VAUTP(IBI))
  1. I IBDFACT=1,Y<0,'$D(IBDF1) G EXIT
  1. ;
  1. I '$D(IBDF1) K XQORS,VALMEVL D EN^VALM("IBDF UTIL PRIMARY SCREEN")
  1. I $D(IBDF1) D HDR,KILL,INIT S VALMBCK="R",VALMBG=1
  1. Q
  1. ;
  1. HDR ; -- header code
  1. I IBDFACT=1 D
  1. .S VALMHDR(1)="This screen lists Active codes on Encounter Forms."
  1. I IBDFACT'=1 D
  1. .S VALMHDR(1)="This screen lists Inactive codes on Encounter Forms."
  1. Q
  1. ;
  1. ; -- Set up list
  1. INIT D FULL^VALM1 S (IBDCNT,IBDCNT1,VALMCNT)=0
  1. K ^TMP("CPT",$J),^TMP("CPTIDX",$J) D KILL^VALM10()
  1. S IBDFCNT1=0 D @(IBDFDIS_"1^IBDFUTL1")
  1. I '$D(^TMP("CPT",$J)) D NUL
  1. Q
  1. ;
  1. ; -- Ask for clinics one/many/all
  1. CLIN 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
  1. Q
  1. ;
  1. ; -- Ask for forms one/many/all
  1. FORM S VAUTVB="VAUTF",DIC="^IBE(357,",VAUTSTR="Form",VAUTNI=2 D FIRST^VAUTOMA S:Y=-1 IBDFL=1 Q:IBDFL
  1. Q
  1. ;
  1. ; -- Ask for clinic groups one/many/all
  1. GROUP S VAUTVB="VAUTG",DIC="^IBD(357.99,",VAUTSTR="Clinic Group",VAUTNI=2 D FIRST^VAUTOMA S:Y=-1 IBDFL=1 Q:IBDFL
  1. Q
  1. ;
  1. ; -- Ask for divisions one/many/all
  1. DIV S IBDFL=0 D DIVISION^VAUTOMA
  1. S:Y=-1 IBDFL=1 Q:IBDFL
  1. Q
  1. ; -- Help for display choices
  1. HELP1 W !!,"Choose a number or first initial :" F K=2:1:4 W !?15,$P(Z,"^",K)
  1. W ! Q
  1. ;
  1. ; -- Listing of selections
  1. ZSET1 S Z="^1 [C]LINICS (Individual)^2 [G]ROUPS (CLINIC)^3 [F]ORMS^" Q
  1. ;
  1. ;
  1. QUIT ; -- Kill variables and reset to last display if no change has been taken place.
  1. I $D(IBDF1) S IBDFDIS=IBDFDIS1,IBDFINT=IBDFINT1,IBDFACT=IBDFACT1
  1. I '$D(IBDF1) G EXIT
  1. D KILL,INIT K IBDFNCNG S VALMBCK="R",VALMBG=1
  1. Q
  1. ;
  1. ;
  1. KILL ; -- Kill extra array variables
  1. N IBDFXX
  1. S IBDFXX=$S(IBDFDIS="FORM":"VAUTF",IBDFDIS="GROUP":"VAUTG",1:"VAUTC")
  1. I IBDFXX="VAUTF" K VAUTG,VAUTC,^TMP("CLN",$J),^TMP("CLN1",$J),^TMP("GRP",$J),^TMP("GRP1",$J)
  1. I IBDFXX="VAUTC" K VAUTG,VAUTF,^TMP("FRM",$J),^TMP("FRM1",$J),^TMP("GRP1",$J)
  1. I IBDFXX="VAUTG" K VAUTC,VAUTF,^TMP("FRM",$J),^TMP("FRM1",$J),^TMP("CLN",$J),^TMP("CLN1",$J)
  1. Q
  1. ;
  1. ;
  1. EXIT ; -- Code executed at action exit
  1. K IBDFDIS,IBDFINT,VAUTC,VAUTF,VAUTG,VAUTJ,VAUTP,IBDFINT1,IBDFDIS1,^TMP("CLN",$J),IBDFCODE,IBI,IBDFACT1
  1. EXIT1 K DIC,IBDBLK,IBDCLN,IBDCLNM,IBDCNODE,IBDCNT,IBDCNT1,IBDF,IBDFBK,IBDFCIFN,IBDFCLIN,IBDFL,IBDFLG,IBDFN,IBDFNAME,IBDFNM,IBDFNODE,IBDFORM1,IBDFRM,IBDFSEL,IBDFSRT,IBDFTMP,IBDFVAL
  1. K IBDFX,IBDORM,IBDVAL,IBDVAL1,IBDFCNT1,Z,IBDFRNM,IBDFX1,IBDFX2,IBDFX3
  1. 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
  1. ;
  1. ;
  1. HLP ; -- help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. ;
  1. EXP ; -- expand code
  1. Q
  1. NUL ; -- NULL MESSAGE
  1. 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
  1. Q