[613] | 1 | PXBPSTP1 ;ISL/JVS - STOP CODE,ACTIVE,MULTIPLE ADD/DELETE ;7/24/96 08:24
|
---|
| 2 | ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
|
---|
| 3 | ;
|
---|
| 4 | ;
|
---|
| 5 | ;
|
---|
| 6 | ACTIVE(REQI,REQE) ;---Check to see if stop code is active on visit date
|
---|
| 7 | N STOPI,STOPE,VISIT,DR,DA,INACTIVE,OK
|
---|
| 8 | S NOT=0
|
---|
| 9 | S STOPI=$P(REQI,"^",10) ;--STOP CODE IEN IN STOP CODE FILE
|
---|
| 10 | S STOPE=$P(REQE,"^",10) ;--STOP CODE EXTERNAL VALUE
|
---|
| 11 | S VISIT=$P(IDATE,".",1) ;--VISIT DATE INTERNAL FORM
|
---|
| 12 | S DIC=40.7,DR=2,DA=STOPI,DIQ="INACTIVE",DIQ(0)="IN" D EN^DIQ1
|
---|
| 13 | I $D(INACTIVE),$G(INACTIVE(40.7,2,"I"))<VISIT S NOT=1
|
---|
| 14 | I $G(NOT) W !,IOEDEOP,IORVON,"--INACTIVE!-",STOPE," was INACTIVE on the date of this ENCOUNTER.",IORVOFF
|
---|
| 15 | Q NOT
|
---|
| 16 | ADDM ;--------If Multiple STOP CODE entries have been entered.
|
---|
| 17 | ;
|
---|
| 18 | N OK,PXBLEN,BAD,BDATA
|
---|
| 19 | S NF=0,PXBLEN=0
|
---|
| 20 | I DATA'["," Q
|
---|
| 21 | I $P(DATA,",",1)'>0,$P(DATA,",",1)'<(PXBCNT+(1)) Q
|
---|
| 22 | I DATA[",",$E(DATA,1)'["@" S NF=1 D WAIT^DICD D
|
---|
| 23 | .S PXBLEN=$L(DATA,",") F PXI=1:1:PXBLEN S PXBPIECE=$P(DATA,",",PXI) D
|
---|
| 24 | ..S X=PXBPIECE,DIC=40.7,DIC(0)="IMZ" D ^DIC
|
---|
| 25 | ..I Y=-1 S BAD(+$G(PXBPIECE))="" Q
|
---|
| 26 | ..S $P(REQI,"^",10)=+Y
|
---|
| 27 | ..S PXBNSTP(PXBPIECE)=""
|
---|
| 28 | ..S PXBNSTP($P(Y,"^",2))=""
|
---|
| 29 | ..D STP^PXBSTOR1
|
---|
| 30 | ..D RSET^PXBDREQ("STP")
|
---|
| 31 | I $G(NF)&($D(BAD)) D Q
|
---|
| 32 | .S (BDATA,EDATA)="" F S BDATA=$O(BAD(BDATA)) Q:BDATA="" S EDATA=EDATA_BDATA_" "
|
---|
| 33 | .W ! D HELP^PXBUTL0("CPTM") W !
|
---|
| 34 | .S DIR(0)="E" D ^DIR K DIR,DIRUT
|
---|
| 35 | .S:Y=1 DATA="^S" S:Y=0!(Y="") DATA="^" K Y
|
---|
| 36 | I $G(NF)&('$D(BAD)) S DATA="^S" Q
|
---|
| 37 | ;
|
---|
| 38 | Q
|
---|
| 39 | ;
|
---|
| 40 | DELM ;--------If Multiple deleting
|
---|
| 41 | I DATA'["@" Q
|
---|
| 42 | N DELM,PXBJ,BAD,PXBLEN,BDATA
|
---|
| 43 | S NF=0,PXBLEN=0 S $P(DELM,"^",3)=1
|
---|
| 44 | I $E(DATA,1)="@" S DATA=$P(DATA,"@",2),NF=1 D WAIT^DICD D
|
---|
| 45 | .S PXBLEN=$L(DATA,",") F PXI=1:1:PXBLEN S PXBPIECE=$P(DATA,",",PXI) D
|
---|
| 46 | ..I PXBPIECE'["-"&(PXBPIECE'>0!(PXBPIECE'<(PXBCNT+1))) S BAD(+$G(PXBPIECE))="" Q
|
---|
| 47 | ..I PXBPIECE'["-" D
|
---|
| 48 | ...I $D(GONE(PXBPIECE)) Q
|
---|
| 49 | ...Q:PXBPIECE'?.N
|
---|
| 50 | ...;S $P(REQI,"^",9)=$O(PXBSKY(PXBPIECE,0)) ;-IEN
|
---|
| 51 | ...S $P(REQI,"^",10)="@"
|
---|
| 52 | ...S $P(REQI,"^",11)=$O(PXBSKY(PXBPIECE,0))
|
---|
| 53 | ...S GONE(PXBPIECE)=""
|
---|
| 54 | ...D STP^PXBSTOR1
|
---|
| 55 | ..I PXBPIECE["-" D
|
---|
| 56 | ...I DATA'?.N1"-".N S BAD(PXBPIECE)="" Q
|
---|
| 57 | ...F PXBJ=$P(PXBPIECE,"-",1):1:$P(PXBPIECE,"-",2) D
|
---|
| 58 | ....I $D(GONE(PXBJ)) Q
|
---|
| 59 | ....I PXBJ'>0!(PXBJ'<(PXBCNT+1)) S BAD(PXBJ)="" Q
|
---|
| 60 | ....S $P(REQI,"^",10)="@"
|
---|
| 61 | ....S $P(REQI,"^",11)=$O(PXBSKY(PXBJ,0))
|
---|
| 62 | ....S GONE(PXBJ)=""
|
---|
| 63 | ....D STP^PXBSTOR1
|
---|
| 64 | K GONE
|
---|
| 65 | I $G(NF)&($D(BAD)) D Q
|
---|
| 66 | .S (BDATA,EDATA)="" F S BDATA=$O(BAD(BDATA)) Q:BDATA="" S EDATA=EDATA_BDATA_" "
|
---|
| 67 | .W ! D HELP^PXBUTL0("CPTMD") W !
|
---|
| 68 | .S DIR(0)="E" D ^DIR K DIR
|
---|
| 69 | .S:Y=1 DATA="^S" S:Y=0!(Y="") DATA="^" K Y
|
---|
| 70 | I $G(NF)&('$D(BAD)) S DATA="^S" Q
|
---|
| 71 | Q
|
---|
| 72 | ;
|
---|
| 73 | PROMPT(PXBCNT) ;--DETERMINE WHERE PROMPT SHOULD START
|
---|
| 74 | ;
|
---|
| 75 | N START,DIFF
|
---|
| 76 | S START=$G(^TMP("PXBDSTP",$J,"START"))
|
---|
| 77 | S DIFF=PXBCNT-START
|
---|
| 78 | I DIFF<10 S LINE=DIFF+5
|
---|
| 79 | I DIFF>9 S LINE=15
|
---|
| 80 | Q LINE
|
---|
| 81 | ;
|
---|