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

PXBGSTP2.m

Go to the documentation of this file.
PXBGSTP2 ;ISL/JVS - DOUBLE ?? GATHERING OF STOP CODES ;1/24/97  14:14
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**11,19**;Aug 12, 1996
 ;
 ;
 ;
 W !,"NOT" Q
 ;
DOUBLE(FROM) ;--Entry point
 ;
 N FILE,FIELD,TITLE,HEADING,SUB,CODE,NAME,START,SCREEN,BACK,NUM
 N SCREEN,TEMP,NRD,SUB2
 S BACK="",NUM=0,SCREEN=""
 D LOC
 I $D(DIC("S")) S SCREEN=DIC("S")
 ;
START ;--RECYCLE
 ;
 S TITLE="- - A L L  S T O P  C O D E S - -"
 ;
 D SETUP
 D LIST^DIC(FILE,"",FIELD,BACK,10,.START,"","C",SCREEN,"","^TMP(""PXBTANA"",$J)","^TMP(""PXBTANA"",$J)")
 ;
 D LOC,HEAD,SUB
 ;
PROMPT ;--PROMPT
 D WIN17^PXBCC(PXBCNT),LOC^PXBCC(15,1)
 W !!,"Enter '^' to quit,  '-' for previous page."
 S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to continue: "
 S DIR("?")="Enter ITEM 'No' to select , '^' to quit,  '-' for previous page."
 S DIR(0)="N,A,O^0:10:0^I X'?.1""-"".1""^"".2N!(+X>10) K X"
 D ^DIR
 I X="-" S BACK="B" D BACK G START
 I X="" S BACK="" D FORWARD G START
 I $G(DIRUT) K DIRUT S VAL="^S" G EXIT
FINISH ;--FINISH
 ;
 S VAL=$G(^TMP("PXBTANA",$J,"DILIST",2,X))_"^"_$G(^TMP("PXBTANA",$J,"DILIST","ID",X,FIRST))_"--"_$G(^TMP("PXBTANA",$J,"DILIST","ID",X,SECOND))
EXIT ;--EXIT
 K DIR,^TMP("PXBTANA",$J),^TMP("PXBTOTAL",$J)
 Q VAL
 ;
DOUBLE1(FROM) ;--Entry point
 ;
 N FILE,FIELD,TITLE,HEADING,SUB,CODE,NAME,START,SCREEN,CNT,OK,INDEX,CYCLE
 N TOTAL,TEMP,SUB2
 ;---SETUP VARIABLES
 S BACK="",INDEX=""
 S START=DATA,SUB=0,SUB2=0
 ;
START1 ;--RECYCLE POINT
 S TITLE="- - S E L E C T E D  S T O P  C O D E S - -"
 S FILE=40.7
 S FIELD="1;.01"
 I DATA?1N S START=DATA*100,INDEX="C"
 I DATA?2N S START=DATA*10,INDEX="C"
 I DATA?3N S START=(DATA-(1)),INDEX="C"
 I DATA?2.A S START=$O(^DIC(40.7,"B",DATA),-1)
 I DATA?1A S DATA="*"
 ;
 D LIST^DIC(FILE,"",FIELD,BACK,"",.START,DATA,INDEX,DIC("S"),"","^TMP(""PXBTOTAL"",$J)","^TMP(""PXBTOTAL"",$J)")
 ;
 S TOTAL=$P(^TMP("PXBTOTAL",$J,"DILIST",0),"^",1)
 ;
 ;--DISPLAY IF NO MATCH FOUND
 I TOTAL=0 D
 .I DATA="*" W ! D HELP^PXBUTL0("CPT4")
 .I DATA'="*" W ! D HELP^PXBUTL0("CPTM")
 .S ERROR=1,CYCL=1
 I TOTAL=0 Q TOTAL
 ;
 ;
 ;----DISPLAY LIST TO THE SCREEN
 S HEADING="W !,""ITEM"",?6,""CODE"",?15,""DESCRIPTION   "",IOINHI,TOTAL,"" MATCHES"",IOINLOW"
LIST ;-DISPLAY LIST TO THE SCREEN
 I TOTAL=1 S X=1 G VAL
 D LOC W !
 X HEADING
 S SUB=SUB-1
 S NUM=0 F  S SUB=$O(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB)) S NUM=NUM+1 Q:NUM=11  Q:SUB'>0  S SUB2=SUB2+1 D
 .S CODE=$G(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB,1))
 .S NAME=$G(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB,.01))
 .W !,SUB,?6,CODE,?15,NAME
 ;
 ;----If There is only one selection go to proper prompting
 I TOTAL=1 G PRMPT2
 ;
PRMPT ;---WRITE PROMPT HERE
 D WIN17^PXBCC(PXBCNT)
 D LOC^PXBCC(15,1)
 W !
 I SUB>0 W !,"Enter '^' to quit"
 E  I TOTAL>10 W !,"               END OF LIST"
 I SUB>0 S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to continue: "
 E  S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to exit: "
 S DIR("?")="Enter ITEM 'No' to select , '^' to quit"
 S DIR(0)="N,A,O^0:"_SUB2_":0^I X'?.1""^"".N K X"
 D ^DIR
 I X="",SUB>0 G LIST
 I X="",SUB'>0 S X="^"
VAL ;-----Set the VAL equal to the value
 S VAL=$G(^TMP("PXBTOTAL",$J,"DILIST",2,X))_"^"_$G(^TMP("PXBTOTAL",$J,"DILIST","ID",X,1))_"--"_$G(^TMP("PXBTOTAL",$J,"DILIST","ID",X,.01))
EXITNEW ;--EXIT
 K DIR,^TMP("PXBTANA",$J),^TMP("PXBTOTAL",$J)
 K TANA,TOTAL
 Q VAL
 Q
 ;
 ;-----------------SUBROUTINES--------------
BACK ;
 S START=$G(^TMP("PXBTANA",$J,"DILIST",1,1))
 S START("IEN")=$G(^TMP("PXBTANA",$J,"DILIST",2,1))
 Q
FORWARD ;
 S START=$G(^TMP("PXBTANA",$J,"DILIST",1,10))
 S START("IEN")=$G(^TMP("PXBTANA",$J,"DILIST",2,10))
 Q
LOC ;--LOCATE CURSOR
 D LOC^PXBCC(3,1) ;--LOCATE THE CURSOR
 W IOEDEOP ;--CLEAR THE PAGE
 Q
 W !,IOCUU,IOBON,"HELP SCREEN",IOSGR0,?(IOM-$L(TITLE))\2,IOINHI,TITLE,IOINLOW,IOELEOL
 Q
SUB ;--DISPLAY LIST TO THE SCREEN
 I $P(^TMP("PXBTANA",$J,"DILIST",0),"^",1)=0 W !!,"     E N D  O F  L I S T" Q
 X HEADING
 S SUB=0,CNT=0 F  S SUB=$O(^TMP("PXBTANA",$J,"DILIST","ID",SUB)) Q:SUB'>0  S CNT=CNT+1 D
 .S CODE=$G(^TMP("PXBTANA",$J,"DILIST","ID",SUB,FIRST))
 .S NAME=$G(^TMP("PXBTANA",$J,"DILIST","ID",SUB,SECOND))
 .W !,SUB,?6,CODE,?15,NAME
 Q
SETUP ;-SETP VARIABLES
 S FILE=40.7,FIRST=1,SECOND=.01 D
 S FIELD=FIRST_";"_SECOND
 S HEADING="W !,""ITEM"",?6,""CODE"",?15,""DESCRIPTION"""
 Q
PRMPT2 ;-----Yes and No prompt if onlyi choice
 D WIN17^PXBCC(PXBCNT)
 D LOC^PXBCC(15,1)
 S DIR("A")="Is this the correct entry "
 S DIR("B")="YES"
 S DIR(0)="Y"
 D ^DIR
 I Y=0 S X="^"
 I Y=1 S X=1
 G VAL