source: FOIAVistA/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGOE81.m@ 1608

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1PSGOE81 ;BIR/CML3-NON-VERIFIED ORDER EDIT (CONT.) ;10 Mar 99 / 10:55 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**26,50,64,58,82,110,111,136**;16 DEC 97
3 ;
439 ; admin times
5 S MSG=0,PSGF2=39 S:PSGOEEF(PSGF2) BACK="39^PSGOE81"
6A39 I $$ODD^PSGS0(PSGS0XT) G DONE
7 W !,"ADMIN TIMES: "_$S(PSGAT:PSGAT_"// ",1:"") R X:DTIME I X="^"!'$T W:'$T $C(7) S PSGOEE=0 G DONE
8 I X="" S:(($G(PSGS0XT)="D")&'PSGS0Y) PSGOEE=0 G DONE
9 I $E(X)="^" D ENFF^PSGOE82 G:Y>0 @Y G A39
10 I PSGS0XT="D"&'$G(X) I ((",P,R,")'[(","_$G(PSGST)_",")) D G A39
11 .W $C(7)," ??" S X="?" W !,"This is a 'DAY OF THE WEEK' schedule and MUST have admin times." D ENHLP^PSGOEM(53.1,39)
12 I X="@" D DEL G:%'=1 A39 S PSGAT="" G DONE
13 I X?1."?" D ENHLP^PSGOEM(53.1,39) G A39
14 D ENCHK^PSGS0 I '$D(X) W $C(7)," ??" S X="?" D ENHLP^PSGOEM(53.1,39) G A39
15 S (PSGS0Y,PSGAT)=X,PSGS0Y=PSGAT G DONE
16 ;
178 ; special instructions
18 S MSG=0,PSGF2=8 S:PSGOEEF(PSGF2) BACK="8^PSGOE81"
19A8 N DIR S DIR(0)="FO^1:180^D ^PSGSICHK",DIR("A")="SPECIAL INSTRUCTIONS",DIR("??")="^D ENHLP^PSGOEM(53.1,8)" S:$G(PSGSI)]"" DIR("B")=$P(PSGSI,"^") D ^DIR I $D(DUOUT)!$D(DTOUT) S PSGOEE=0 G DONE
20 I $E(X)=U D ENFF^PSGOE82 G:Y>0 @Y G A8
21 I X="@",PSGSI="" W $C(7)," ??" S X="?" D ENHLP^PSGOEM(53.1,8) G A8
22 I X="@" D DEL G:%'=1 A8 S PSGSI="" G DONE
23 I Y="",PSGSI="" G DONE
24 S PSGSI=$S(Y]"":Y,1:PSGSI),PSGSI=$$ENBCMA^PSJUTL("U") G DONE
25 Q
26 W !,"SPECIAL INSTRUCTIONS: "_$S(PSGSI]"":PSGSI_"// ",1:"") R X:DTIME I X="^"!'$T W:'$T $C(7) S PSGOEE=0 G DONE
27 I X="" S X=PSGSI I X="" G DONE
28 I $E(X)="^" D ENFF^PSGOE82 G:Y>0 @Y G A8
29 I X="@",PSGSI="" W $C(7)," ??" S X="?" D ENHLP^PSGOEM(53.1,8) G A8
30 I X="@" D DEL G:%'=1 A8 S PSGSI="" G DONE
31 I X?1."?" D ENHLP^PSGOEM(53.1,8) G A8
32 D ^PSGSICHK I '$D(X) W $C(7)," ??" S X="?" D ENHLP^PSGOEM(53.1,8) G A8
33 S PSGSI=X G DONE
34 ;
3510 ; start date/time
36 S MSG=0,PSGF2=10 S:PSGOEEF(PSGF2) BACK="10^PSGOE81"
37A10 ;
38 K PSGSDX N DUR,DURMIN,TMPFD
39 I $G(PSGORD)["P",$G(PSGP) I $$LASTREN^PSJLMPRI(PSGP,PSGORD) D Q
40 . W !?5,"Start Date may not be edited at this point. " D PAUSE^VALM1
41 W !,"START DATE/TIME: "_$S($P(PSGSDN,"^")]"":$P(PSGSDN,"^")_"// ",1:"") R X:DTIME I X="^"!'$T W:'$T $C(7) S PSGOEE=0 G DONE
42 I X="",PSGSD W " "_$P(PSGSDN,"^") G DONE
43 I X="P" D ENPREV^PSGDL W:'$D(X) $C(7) G:'$D(X) A10 S PSGSD=+X,PSGSDN=$$ENDD^PSGMI(PSGSD)_"^"_$$ENDTC^PSGMI(PSGSD) W " ",$P(PSGSDN,"^") G DONE
44 I X="@"!(X?1."?") W:X="@" $C(7)," (Required)" S:X="@" X="?" D ENHLP^PSGOEM(53.1,10)
45 I $E(X)="^" D ENFF^PSGOE82 G:Y>0 @Y G A10
46 NEW TMPX S TMPX=X,X1=+$G(PSGLI),X2=-7 D C^%DTC K %DT S %DT="ERTX",%DT(0)=X,X=TMPX D ^%DT K %DT I Y'>0 D ENHLP^PSGOEM(53.1,10) G A10
47 I PSGFD<Y W $C(7),!?5,"*** THE START DATE CANNOT BE AFTER THE STOP DATE! ***",! S MSG=1 G A10
48 S (PSGSDX,PSGSD,PSGNESD)=+Y,PSGSDN=$$ENDD^PSGMI(PSGSD)_"^"_$$ENDTC^PSGMI(PSGSD)
49 I $G(PSGORD)["P",$G(PSGP) S DUR=$$GETDUR^PSJLIVMD(PSGP,+PSGORD,"P",1) I DUR]"" S DURMIN=$$DURMIN^PSJLIVMD(DUR) I DURMIN D
50 . S TMPFD=$$FMADD^XLFDT(PSGSD,,,DURMIN) K:(TMPFD<PSGSD) TMPFD I $G(TMPFD) S PSGFD=TMPFD,PSGFDN=$$ENDD^PSGMI(PSGFD)_"^"_$$ENDTC^PSGMI(PSGFD)
51 G DONE
52 ;
5325 ; stop date
54 S MSG=0,PSGF2=25 S:PSGOEEF(PSGF2) BACK="25^PSGOE81"
55A25 ;
56 K PSGFDX
57 W !,"STOP DATE/TIME: "_$S($P(PSGFDN,"^")]"":$P(PSGFDN,"^")_"// ",1:"") R X:DTIME I X="^"!'$T W:'$T $C(7) S PSGOEE=0 G DONE
58 I X="",PSGFD W " "_$P(PSGFDN,"^") G W25
59 I $E(X)="^" D ENFF^PSGOE82 G:Y>0 @Y G A25
60 I X="@"!(X?1."?") W:X="@" $C(7)," (Required)" S:X="@" X="?" D ENHLP^PSGOEM(53.1,25)
61 I X=+X,(X>0),(X'>2000000) G A25:'$$ENDL^PSGDL(PSGSCH,X) K PSGDLS S PSGDL=X W " ...dose limit..." D ENE^PSGDL
62 K %DT S %DT="ERTX",%DT(0)=PSGSD D ^%DT K %DT G:Y'>0 A25 S (PSGFDX,PSGFD,PSGNEFD)=+Y,PSGFDN=$$ENDD^PSGMI(PSGFD)_"^"_$$ENDTC^PSGMI(PSGFD) ; I $P(PSGNEDFD,"^",3)="O",PSGNESD'=PSGNEFD S PSGNESD=PSGNEFD,PSGSD=PSGFD
63W25 I PSGFD<PSGDT W $C(7),!!?13,"*** WARNING! THE STOP DATE ENTERED IS IN THE PAST! ***",! S MSG=1
64 ;
65 ;
66DONE ;
67 ;Display Expected First Dose;BHW;PSJ*5*136
68 D EFDNV^PSJUTL
69 I PSGOEE G:'PSGOEEF(PSGF2) @BACK S PSGOEE=PSGOEEF(PSGF2)
70 Q
71 ;
72FF ; up-arrow to another field
73 D ENFF^PSGOEM I Y>0,Y'=39,Y'=8,Y'=10,Y'=25 S Y=Y_"^PSGOE8"_$S("^109^13^3^7^26^"[("^"_Y_"^"):"",1:2) S:Y=2 FB=PSGF2_"^PSGOE81"
74 Q
75 ;
76DEL ; delete entry
77 W !?3,"SURE YOU WANT TO DELETE" S %=0 D YN^DICN I %'=1 W $C(7)," <NOTHING DELETED>"
78 Q
Note: See TracBrowser for help on using the repository browser.