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

APCLTAXI.m

Go to the documentation of this file.
APCLTAXI ; IHS/CMI/LAB - INTERFACE TO SELECT ICD CODES ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;
 ;cmi/anch/maw 9/10/2007 code set versioning in DISPLAY
 ;
 D INIT
BEGIN D ASK1
 I Y="^" S APCLSTP=1 G X
 I $D(APCLTBLE) D CHECK I Y'=1 G @$S(Y=0:"BEGIN",1:"X")
X D EOJ
 Q
 ;
INIT ;
 S APCL("NO DISPLAY")=0
 I $D(APCLX) D  I 1
 . I $D(APCLTBLE) S APCL("MODIFY")=1 D RANGES I 1
 . E  S APCL("ENTER")=1
 E  S APCL("NOT TAX")=""
 Q
 ;
ASK1 ;
 S APCLA=0
 K APCL("LOW"),APCL("HI")
 S DIR("A")=$S('$D(APCLTBLE):"ENTER ICD PROCEDURE",1:"ENTER ANOTHER ICD PROCEDURE") D SETDIR^APCLTAXK,^DIR K DIR
 I "^"[Y G X1
 D PROCESS
 I $D(APCLTBLE),'APCL("NO DISPLAY") D RANGES
 S APCL("NO DISPLAY")=0
 G ASK1
X1 Q
 ;
PROCESS ;EVALUATE USER RESPONSE
 S (APCLSUB,APCLONE)=0 ;APCLSUB=0 => NO DELETE OF CODE(S),APCLONE=0 => RANGE OF CODES ENTERED
 I $E(X,1,2)="-[" W $C(7),"  ?? Not allowed" S APCL("NO DISPLAY")=1 G X2
 I $E(X)="[" D TAX G X2
 I X'["-" S APCLTYP="LOW",APCLONE=1 D LOOK^APCLTAXK G X2
 I $E(X)="-",'$D(APCLTBLE) W $C(7),"  ??  No previous codes entered!" G X2
 I $L(X,"-")>3 W $C(7),"  ??"  S APCLA=1 S APCL("NO DISPLAY")=1 G X2
 I $L(X,"-")=3,$E(X,$L(X))="-" W $C(7),"  ??" S APCLA=1 S APCL("NO DISPLAY")=1 G X2
 I $L(X,"-")=3,$P(X,"-")]"" W $C(7),"  ??" S APCLA=1 S APCL("NO DISPLAY")=1 G X2
 I $E(X)="-" S APCLSUB=1 D  I 1
 . S APCLSAVE("X")=X
 . I $L(X,"-")=3 S X=$P(APCLSAVE("X"),"-",2),APCLTYP="LOW" D LOOK^APCLTAXK I 'APCLA S X=$P(APCLSAVE("X"),"-",3),APCLTYP="HI" W ! D LOOK^APCLTAXK Q
 . I $L(APCLSAVE("X"),"-")=2 S X=$E(X,2,99),APCLTYP="LOW",APCLONE=1 D LOOK^APCLTAXK
 E  S APCLSAVE("X")=X S APCLTYP="LOW",X=$P(APCLSAVE("X"),"-") D LOOK^APCLTAXK I 'APCLA S APCLTYP="HI",X=$P(APCLSAVE("X"),"-",2) W ! D LOOK^APCLTAXK
X2 Q
 ;
DISPLAY ;EP - SHOW CODES IN RANGE SELECTED
 W:$D(IOF) @IOF
 ;W !!,"ICD codes in this range =>",!! W $P(APCL("LOW")," ") S APCLDFN=$O(^ICD0("BA",APCL("LOW"),"")) W ?9,$P(^ICD0(APCLDFN,0),U,3)  ;cmi/anch/maw 9/12/2007 orig line
 W !!,"ICD codes in this range =>",!! W $P(APCL("LOW")," ") S APCLDFN=$O(^ICD0("BA",APCL("LOW"),"")) W ?9,$P($$ICDOP^ICDEX(APCLDFN,"","","I"),U,4)  ;cmi/anch/maw 9/12/2007 csv
 ;S APCL=APCL("LOW"),APCLCNT=IOSL-2 F  S APCL=$O(^ICD0("BA",APCL)) Q:APCL]APCL("HI")  S APCLDFN=$O(^(APCL,"")) W !,$P(APCL," "),?9,$P(^ICD0(APCLDFN,0),U,3) S APCLCNT=APCLCNT-1 I APCLCNT=0 S APCLCNT=IOSL-2 D  I APCLR=U Q  ;cmi/maw orig line
 S APCL=APCL("LOW"),APCLCNT=IOSL-2 F  S APCL=$O(^ICD0("BA",APCL)) Q:APCL]APCL("HI")  S APCLDFN=$O(^(APCL,"")) W !,$P(APCL," "),?9,$P($$ICDOP^ICDEX(APCLDFN,"","","I"),U,4) S APCLCNT=APCLCNT-1 I APCLCNT=0 S APCLCNT=IOSL-2 D  I APCLR=U Q
A1 . R !,"<>",APCLR:DTIME W:APCLR["?" " Enter ""^"" to stop display, return to continue" G:APCLR["?" A1
 I $S('$D(APCLR):1,APCLR'=U:1,1:0) R !!,"Press return to continue",APCLR:DTIME
 W !
 K APCLR Q
 ;
RANGES ;DISPLAY TABLE OF ALL RANGES
 W:$D(IOF) @IOF
 W !!,"ICD Procedure Code Range(s) Selected So Far =>",!
 S (APCL("NUM"),APCL)=0 F  S APCL=$O(APCLTBLE(APCL)) Q:APCL=""  S APCL("NUM")=APCL("NUM")+1 W !,APCL("NUM"),")  ",APCL,$S(APCL'=APCLTBLE(APCL):"- "_APCLTBLE(APCL),1:"")
 I '$D(APCL("BANG")) W !
 Q
 ;
SHOW ; ENTRY POINT - ALLOW USER TO SELECT FROM RANGES TO DISPLAY CODES
 D RANGES
A W !,"Enter an Item Number from the table above to display code(s): " R APCL("N"):300 W:"^"[APCL("N") ! Q:"^"[APCL("N")  I APCL("N")'?1N!(APCL("N")>APCL("NUM")) W "  ??",$C(7) G A
 F APCLI=1:1:APCL("N") S APCL=$O(APCLTBLE(APCL)) I APCLI=APCL("N") S APCL("LOW")=APCL,APCL("HI")=APCLTBLE(APCL) D DISPLAY Q
 S APCL("BANG")="" D RANGES K APCL("BANG")
 Q
 ;
TAX ;PLACE CODES FROM SELECTED TAXONOMY IN APCLTBLE
 S APCL("S")="I Y'=APCLX",APCL("S")=$S($D(APCLX):APCL("S")_",$O(^ATXAX(Y,21,0))",1:"I $O(^(21,0))"),DIC("A")="TAXONOMY FROM WHICH TO SELECT CODES: ",APCL("S")=APCL("S")_$S('$D(APCLX):"",1:",$P(^ATXAX(APCLX,0),U,15)=$P(^ATXAX(Y,0),U,15)")
 I $E(X,2)="?" S X="?",DIC="^ATXAX(",DIC(0)="EM",DIC("S")=APCL("S") D ^DIC S DIC(0)="AEMQ",DIC("S")=APCL("S"),DIC="^ATXAX(" D ^DIC K DIC I 1
 E  S X=$E(X,2,99),DIC(0)="EMQ",DIC("S")=APCL("S"),DIC="^ATXAX(" D ^DIC K DIC
 I Y=-1 G X3
 S APCL("CODE")=0 F  S APCL("CODE")=$O(^ATXAX(+Y,21,"AA",APCL("CODE"))) Q:APCL("CODE")=""  S APCLTBLE(APCL("CODE"))=$O(^(APCL("CODE"),""))
X3 W ! Q
 ;
CHECK ;ASKS USER IF SATISFIED WITH ENTERED RANGES
 W ! S DIR(0)="Y",DIR("B")="Y",DIR("A")="Is everything okay" D ^DIR K DIR
 W !
 Q
 ;
EOJ ;
 K APCLSUB,APCLTYP,APCLDFN,DIR,APCLSAVE,APCLA,APCLCNT,APCL,APCLR,APCLI,APCLONE,APCLFLG,APCLSTP
 Q
 ;