- APCDFOA4 ; IHS/CMI/LAB - EXTENSION OF ROUTINE APCDFOA3 ;
- ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
- ;
- LOOK ; ENTRY POINT - LOOKUP USER RESPONSE; SET TMP NODES
- S DIC="^ICD0(",DIC(0)="EMF",ICDSYS=APCDSYS D ^DIC K DIC,DR
- I Y<0 S APCDA=1 W $C(7),!," ?? Invalid ",$S(APCDTYP="LOW":"LOW",1:"HIGH")," Code" S APCD("NO DISPLAY")=1 G X3
- LOOKSTAR ;
- S:APCDTYP="LOW" APCD("LOW")=$P($$ICDOP^ICDEX(+Y,,,"I"),U,2)_" "
- I APCDTYP="LOW",APCDONE S APCD("HI")=APCD("LOW") D ^APCDFOA5
- I APCDTYP="HI" S APCD("HI")=$P($$ICDOP^ICDEX(+Y,,,"I"),U,2)_" " D I 'APCD("NO DISPLAY") D DISPLAY^APCDFOA3,^APCDFOA5
- . I $E(APCD("HI"))?1N&($E(APCD("LOW"))?1N)!($E(APCD("LOW"))'?1N&($E(APCD("HI"))'?1N))
- . E W !,$C(7),"Low and high codes of range must both start either with a letter or a number.",! S APCD("NO DISPLAY")=1
- . I 'APCD("NO DISPLAY") I APCD("LOW")]APCD("HI") W !,$C(7),"Low code is higher than high code.",! S APCD("NO DISPLAY")=1
- X3 Q
- ;
- SETDIR ; ENTRY POINT - SETS HELP AND DIR FOR INIT SUBROUTINE OF APCDFOA3
- S DIR(0)="FO",DIR("?",1)="Enter ICD diagnosis code or narrative. You may enter a range of",DIR("?",2)="codes by placing a ""-"" between two codes. Codes in a range will"
- S DIR("?",3)="include the first and last codes indicated and all codes that fall",DIR("?",4)="between. Only one code or one range of codes at a time. "
- S DIR("?",5)="To select all codes in a set you can use a '*' wildcard. E.g. E11*, 250*"
- S DIR("?",6)="You can also ""de-select"" a code or range of codes by placing a ""-"" in",DIR("?",7)="front of it. (e.g. '-250.00' or '-250.01-250.91') Enter ""??"" to see"
- S DIR("?")="code ranges selected so far."
- S DIR("??")="^D ASK2^APCDFOA4"
- Q
- ;
- ASK2 ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
- I '$D(APCDTABL) W !!,"A code range has yet to be selected. A display cannot be generated.",! Q
- W !!,"Do you want to display the codes from a range you have already selected" S %=1 D YN^DICN I %=1 D SHOW^APCDFOA3
- I %=2!(%=-1) Q
- I %=0 W !!,"A table of ranges you have selected is displayed above. You may ask for the",!,"codes in one of the ranges to be displayed.",! G ASK2
- Q
- ;
- APCDFOA4 ; IHS/CMI/LAB - EXTENSION OF ROUTINE APCDFOA3 ;
- +1 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
- +2 ;
- LOOK ; ENTRY POINT - LOOKUP USER RESPONSE; SET TMP NODES
- +1 SET DIC="^ICD0("
- SET DIC(0)="EMF"
- SET ICDSYS=APCDSYS
- DO ^DIC
- KILL DIC,DR
- +2 IF Y<0
- SET APCDA=1
- WRITE $CHAR(7),!," ?? Invalid ",$SELECT(APCDTYP="LOW":"LOW",1:"HIGH")," Code"
- SET APCD("NO DISPLAY")=1
- GOTO X3
- LOOKSTAR ;
- +1 IF APCDTYP="LOW"
- SET APCD("LOW")=$PIECE($$ICDOP^ICDEX(+Y,,,"I"),U,2)_" "
- +2 IF APCDTYP="LOW"
- IF APCDONE
- SET APCD("HI")=APCD("LOW")
- DO ^APCDFOA5
- +3 IF APCDTYP="HI"
- SET APCD("HI")=$PIECE($$ICDOP^ICDEX(+Y,,,"I"),U,2)_" "
- Begin DoDot:1
- +4 IF $EXTRACT(APCD("HI"))?1N&($EXTRACT(APCD("LOW"))?1N)!($EXTRACT(APCD("LOW"))'?1N&($EXTRACT(APCD("HI"))'?1N))
- +5 IF '$TEST
- WRITE !,$CHAR(7),"Low and high codes of range must both start either with a letter or a number.",!
- SET APCD("NO DISPLAY")=1
- +6 IF 'APCD("NO DISPLAY")
- IF APCD("LOW")]APCD("HI")
- WRITE !,$CHAR(7),"Low code is higher than high code.",!
- SET APCD("NO DISPLAY")=1
- End DoDot:1
- IF 'APCD("NO DISPLAY")
- DO DISPLAY^APCDFOA3
- DO ^APCDFOA5
- X3 QUIT
- +1 ;
- SETDIR ; ENTRY POINT - SETS HELP AND DIR FOR INIT SUBROUTINE OF APCDFOA3
- +1 SET DIR(0)="FO"
- SET DIR("?",1)="Enter ICD diagnosis code or narrative. You may enter a range of"
- SET DIR("?",2)="codes by placing a ""-"" between two codes. Codes in a range will"
- +2 SET DIR("?",3)="include the first and last codes indicated and all codes that fall"
- SET DIR("?",4)="between. Only one code or one range of codes at a time. "
- +3 SET DIR("?",5)="To select all codes in a set you can use a '*' wildcard. E.g. E11*, 250*"
- +4 SET DIR("?",6)="You can also ""de-select"" a code or range of codes by placing a ""-"" in"
- SET DIR("?",7)="front of it. (e.g. '-250.00' or '-250.01-250.91') Enter ""??"" to see"
- +5 SET DIR("?")="code ranges selected so far."
- +6 SET DIR("??")="^D ASK2^APCDFOA4"
- +7 QUIT
- +8 ;
- ASK2 ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
- +1 IF '$DATA(APCDTABL)
- WRITE !!,"A code range has yet to be selected. A display cannot be generated.",!
- QUIT
- +2 WRITE !!,"Do you want to display the codes from a range you have already selected"
- SET %=1
- DO YN^DICN
- IF %=1
- DO SHOW^APCDFOA3
- +3 IF %=2!(%=-1)
- QUIT
- +4 IF %=0
- WRITE !!,"A table of ranges you have selected is displayed above. You may ask for the",!,"codes in one of the ranges to be displayed.",!
- GOTO ASK2
- +5 QUIT
- +6 ;