source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVLBDL.m@ 619

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1PSIVLBDL ;BIR/PR,CML3-DELETE LBLS FROM SUSPENSE ;02 FEB 94 / 1:54 PM
2 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
3 ;
4 D ^PSIVXU I $D(XQUIT) K XQUIT Q
5 S PSIVAC="PRO" D ENGETP^PSIV G:DFN<0 DONE W !?3,"...one moment, please..." D EXPCHK
6START ;
7 D HDR I '$D(^PS(55,"PSIVSUS",PSIVSN,DFN)) W !!,"There are no labels on suspense for this patient." G PSIVLBDL
8 D SUSLP1 G:X?1."?" START
9DONE ;
10 K %,A,B1,B2,BB,DFN,DIC,FL,HELP,J,K,KK,ON,P,PSGDT,PSIV,PSIVAC,PSIVCT,PSIVDT,PSIVRD,TN,VAERR,X,X1,X2,Y,Z D ENIVKV^PSGSETU Q
11 ;
12SUSLP1 ;
13 S X="" F ON=0:0 S ON=$O(^PS(55,"PSIVSUS",PSIVSN,DFN,ON)) Q:'ON D:$Y+7>IOSL DELINE Q:X="^" Q:X?1."?" D LP S X=""
14 Q:$E(X)="^" Q:X?1."?"
15DELINE ;
16 W !,"Select Order Number: " I ON W !,"or press return to view more "
17 R X:DTIME W:'$T $C(7) S:'$T X="^" I "^"[X D:X=""&ON HDR Q
18 I X?1."?" S HELP="LBSUSD" D ^PSIVHLP1 R !,"Press return to continue ",Y:DTIME W:'$T $C(7) S:Y="^"!'$T X="^" Q
19 D:X'="ALL" ONC W:'$D(X) $C(7)," ??" G:'$D(X) DELINE D KILL W !,"Deleted." Q
20HDR ;
21 W:$Y @IOF W !!,"Patient Name ",VADM(1)," (",$S(VAIN(4):$P(VAIN(4),U,2),1:"Outpatient IV"),")",!,"Order Number",?30,"Order",?IOM-11,"Suspended",! F X=1:1:IOM-1 W "-"
22 Q
23LP S Y=^PS(55,DFN,"IV",ON,0) F X=1:1:23 S P(X)=$P(Y,"^",X)
24 F PSIVDT=0:0 S PSIVDT=$O(^PS(55,"PSIVSUS",PSIVSN,DFN,ON,PSIVDT)) Q:'PSIVDT D PRNT
25 Q
26PRNT S Y=PSIVDT X ^DD("DD") S Y=+^PS(55,"PSIVSUS",PSIVSN,DFN,ON,PSIVDT)_"^"_$P(Y,"@")_" "_$P(Y,"@",2)
27 W !,ON,$J(+Y_" label"_$S(+Y>1:"s",1:"")_" "_$P(Y,"^",2),IOM-1-$X),!
28 S PSIV=0,SSNF=1 D ENP3^PSIVRNL K SSNF Q
29KILL ;
30 I X'="ALL" F B1=1:1:Y F B2=1:1:$L(Y(B1),",")-1 S ON=$P(Y(B1),",",B2) K ^PS(55,"PSIVSUS",PSIVSN,DFN,ON)
31 I X="ALL" F ON=0:0 S ON=$O(^PS(55,"PSIVSUS",PSIVSN,DFN,ON)) Q:'ON K ^PS(55,"PSIVSUS",PSIVSN,DFN,ON)
32 I '$D(^PS(55,"PSIVSUS",PSIVSN,DFN)) S PSIVD="" F KK=0:0 S PSIVD=$O(^PS(55,"PSIVSUS",PSIVSN,PSIVD)) Q:PSIVD="" K ^PS(55,"PSIVSUS",PSIVSN,PSIVD,DFN)
33 S X="^" Q
34 ;
35ONC ;
36 K Y S Y=1,Y(1)=""
37 F Q=1:1:$L(X,",") S X1=$P(X,",",Q) D SET Q:'$D(X)
38 Q
39 ;
40SET ;
41 I $S('X1:1,1:'$D(^PS(55,"PSIVSUS",PSIVSN,DFN,X1))) K X Q
42 I $L(Y(Y))+$L(X1)>244 S Y=Y+1,Y(Y)=""
43 S Y(Y)=Y(Y)_X1_"," Q
44 ;
45EXPCHK ;
46 D NOW^%DTC
47 F ON=0:0 S ON=$O(^PS(55,"PSIVSUS",PSIVSN,DFN,ON)) Q:'ON S X=$S($D(^PS(55,DFN,"IV",ON,0)):^(0),1:"") I $P(X,U,2)'=$P(X,U,3),$P(X,U,3)'>%!("D"[$P(X,U,17)) K ^PS(55,"PSIVSUS",PSIVSN,DFN,ON)
48 Q
Note: See TracBrowser for help on using the repository browser.