source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXBPSTP.m@ 1147

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

initial load of WorldVistAEHR

File size: 4.0 KB
Line 
1PXBPSTP ;ISL/JVS - PROMPT FOR STOP CODE ;7/24/96 09:55
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**11**;Aug 12, 1996
3 ;
4 ; VARIABLE LIST
5 ; SELINE= LILine number of selected item
6 ;
7STP ;-----First Stop Code Entry point
8 I $D(PXBNSTPL) D LOC^PXBCC(2,0) W IOUON,"Previous Entry: ",$G(PXBNSTPL(1)) F I=1:1:10 W " "
9 W IOUOFF
10 N TIMED,EDATA,DIC,LINE,XFLAG,SELINE,NOT,STOPC,STOPI
11 I '$D(IOSC) D TERM^PXBCC
12 S DOUBLEQQ=0,TIMED="I '$T!(DATA=""^"")",FROM="STP"
13 I $P($G(^AUPNVSIT(PXBVST,0)),"^",22)&($P(^SC($P(^AUPNVSIT(PXBVST,0),"^",22),0),"^",7)) D
14 .S STOPC=$P(^DIC(40.7,$P(^SC($P(^AUPNVSIT(PXBVST,0),"^",22),0),"^",7),0),"^",2)
15 .S STOPI=$P(^SC($P(^AUPNVSIT(PXBVST,0),"^",22),0),"^",7)
16 S DIC("S")="I '$P(^DIC(40.7,Y,0),""^"",3)!($P(^DIC(40.7,Y,0),""^"",3)>$P(IDATE,""."",1))&($G(STOPI)'=Y)"
17 ;
18 ;
19 D LOC^PXBCC(15,0)
20S ;-----Second Stop Code Entry point
21 D WIN17^PXBCC(PXBCNT)
22 I PXBCNT>10 W !,"Enter '+' for next page, '-' for previous page."
23 I '$D(PXKSTP) W !,"Enter a STOP CODE: " W IOELEOL
24 I $D(PXKSTP) W !,"Enter ",IOINHI,"NEXT",IOINLOW," STOP CODE: " W IOELEOL
25 R DATA:DTIME S EDATA=DATA
26 ;
27 ;
28S1 ;-----Third Stop Code Entry point
29 X TIMED I S PXBUT=1 S:DATA="^" LEAVE=1 G STPX
30 I DATA?1.N1"E".NAP S DATA=" "_DATA
31 I $L(DATA)>200 S (DATA,EDATA)=$E(DATA,1,199)
32 I DATA?24.N S (DATA,EDATA)=$E(DATA,1,24)
33 D CASE^PXBUTL
34 I DATA=$G(STOPC),DATA'="" W !,"You cannot select main STOP CODE "_$G(STOPC) G S
35 ;---SPACE BAR--
36 I DATA=" ",$D(^DISV(DUZ,"PXBPOV-6")) S (DATA,EDATA)=^DISV(DUZ,"PXBPOV-6") W DATA
37 I DATA="^^" S PXBEXIT=0 G STPX
38S2 ;-----Fourth Stop Code Entry point
39 W IOEDEOP
40 ;-----If this Prompt can jump to other prompts put symbols in here
41 I DATA["^S" S PXBDIC=1 G STPX
42 I DATA="" S PXBUT=1 G STPX
43 ;
44 ;
45 I PXBCNT>10&((DATA="+")!(DATA="-")) D DSTP4^PXBDSTP(DATA) W IORC D WIN17^PXBCC(PXBCNT) G S
46 ;
47 ;
48M ;-----IF Multiple entries can be added
49 D ADDM^PXBPSTP1
50 I $G(NF) G S1
51 ;-----IF Multiple entries can be deleted
52 D DELM^PXBPSTP1
53 I $G(NF) G S1
54 ;
55LI ;-----If picked a line number--no for it reason at this time
56 ;I (DATA>0)&(DATA<(PXBCNT+1))&($L(DATA)'>$L(PXBCNT)) S XFLAG=1 D:PXBCNT>10 DSTP4^PXBDSTP(DATA) S SELINE=DATA,HERE=1 D
57 ;.F I=1:1:$L(DATA) W IOCUB,IOECH
58 ;.S DATA=$P($G(PXBSAM(DATA)),"^",1)
59 ;I $D(XFLAG),XFLAG=1 S Y=DATA K XFLAG G SFIN
60 ;
61 ;
62 ;-----If Stop Code selected is already in the file
63 I '$G(DOUBLEQQ),$D(PXBKY(DATA)) D
64 .S HERE=1
65 .I PXBCNT>10 D DSTP4^PXBDSTP($O(PXBKY(DATA,0)))
66 .K Q D TIMES^PXBUTL(DATA)
67 .I Q=1 S LINE=$O(PXBKY(DATA,0)) S XFLAG=1 D REVSTP^PXBCC(LINE)
68 .I Q>1 S NLINE=0 F S NLINE=$O(Q(NLINE)) Q:NLINE="" D REVSTP^PXBCC(NLINE)
69 I $D(Q),Q>1 D WHICH^PXBPWCH G LI
70 I $D(XFLAG),XFLAG=1 S Y=DATA G SFIN
71 ;
72 ;
73 ;-----If it is Needed to do a DIC lookup on data
74 I '$D(PXBWIN) D WIN17^PXBCC(PXBCNT)
75 ;
76 ;-----If a ?? is entered by the user
77 I DATA'="??" D:DATA="?" EN1^PXBHLP0("PXB","STP",1,"",1) G:DATA="^S" S1 I DATA="?" G S
78 I DATA="??" S DOUBLEQQ=1 D EN1^PXBHLP0("PXB","STP","",1,2) S:$L(DATA,"^")>1 (Y,DATA,EDATA)=$P($P(DATA,"^",2),"--",1) G:Y>0 SFIN I DATA<1 S DATA="^S" G S2
79 ;
80 ;
81 ;-----If a "?" is NOT entered and needs a lookup
82 S (VAL,Y)=$$DOUBLE1^PXBGSTP2(WHAT) I Y<1 S DATA="^S" G S2
83 S (X,DATA,EDATA)=$P($P(VAL,"^",2),"--",1),DIC=40.7,DIC(0)="MZ" D ^DIC
84 ;
85 ;
86 ;
87SFIN ;-----Finish up the Variables of the STOP CODE
88 I $G(HERE) K HERE G STP
89 I $L(Y,"^")'>1 S X=Y,DIC=40.7,DIC(0)="ZM" D ^DIC
90 I +Y<0 D CPTMNO^PXBUTL0 G S ;-HELP MESSAGE'CPTM'IS OK
91 S STP=Y(0)
92 S PXBNSTP($P(Y(0),"^",2))=""
93 S PXBNSTP($P(Y(0),"^",1))=""
94 S PXBNSTPL(1)=$P(STP,"^",2) S ^DISV(DUZ,"PXBPOV-6")=$P(STP,"^",2)
95 I $D(PXBKY($P(Y(0),"^"))),$G(SELINE) S $P(REQI,"^",11)=$O(PXBSKY(SELINE,0))
96 I $D(PXBKY($P(Y(0),"^"))),'$G(SELINE) S $P(REQI,"^",11)=$O(PXBSKY($O(PXBKY($P(Y(0),"^"),0)),0))
97 S $P(REQI,"^",10)=+Y
98 S $P(REQE,"^",10)=$P(STP,"^",2)
99 ;-----If the Stop code is inactive issur a warning
100 I DATA]"" S NOT=$$ACTIVE^PXBPSTP1(REQI,REQE) I $G(NOT) K NOT D RSET^PXBDREQ("STP") G S
101 I $D(PXBKY($P(STP,"^",2))) W "--"_$P(PXBSAM($O(PXBKY($P(STP,"^",2),0))),"^",2)
102STPX ;-----Exit the routine and clean up the variabLES
103 I $G(WHAT)="INTV",DATA="^" S PXBEXIT="^^"
104 I '$D(REQE) S REQE=""
105 Q
Note: See TracBrowser for help on using the repository browser.