source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGOEE0.m@ 1361

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

initial load of WorldVistAEHR

File size: 4.9 KB
RevLine 
[613]1PSGOEE0 ;BIR/CML3-ORDER EDIT UTILITIES ;09 JAN 97 / 9:27 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**58,95**;16 DEC 97
3 ;
4 ; Reference to ^DICN is supported by DBIA 10009.
5 ; Reference to ^DIR is supported by DBIA 10026.
6 ;
7ENSFE(PSGP,PSGORD) ; Determine editable fields, and fields that cause new order.
8 D @$S(PSGORD["P":"ENSFE3^PSGOEE0",1:"ENSFE5^PSGOEE0")
9 Q
10ENSFE3 ; set-up fields to edit for 53.1
11 I PSGSTAT="PENDING" S PSGEFN="1:13" F X=1:1:13 S PSGEFN(+X)=$P($T(@(3_X)),";",7),PSGOEEF(+$P($T(@(3_X)),";",3))="",PSGOEEF=PSGOEEF+1
12 E S PSGEFN="1:13" F X=1,2,3,4,5,6,7,8,9,10,11,12 S Y=$T(@(3_X)),@("PSGEFN("_+X_")="_$S($D(PSGOETOF):0,1:$P(Y,";",7))),PSGOEEF(+$P(Y,";",3))="",PSGOEEF=PSGOEEF+1
13 E S:$P(PSJSYSU,";",3)>1 PSGEFN(9)=0,PSGOEEF(+$P($T(39),";",3))="",PSGOEEF=PSGOEEF+1
14 E I PSGEB'=PSGOPR F X=10,13 S Y=$T(@(3_X)),@("PSGEFN("_X_")="_$S($D(PSGOETOF):0,1:$P(Y,";",7))),PSGOEEF(+$P(Y,";",3))="",PSGOEEF=PSGOEEF+1
15 K PSGOEEND S PSGOEEG=3,PSGPDRG=PSGOPD,PSGPDRGN=PSGOPDN Q
16 ;
17ENSFE5 ; set-up fields to edit for 55
18 S PSGEFN="1:13"
19 F X=1:1:13 S Y=$T(@(5_X)),@("PSGEFN("_+X_")="_$S($D(PSGOETO):0,1:$P(Y,";",7))),PSGOEEF(+$P(Y,";",3))="",PSGOEEF=PSGOEEF+1
20 I $P(PSJSYSU,";",3)>1 S PSGEFN(9)=0,PSGOEEF(+$P($T(59),";",3))="",PSGOEEF=PSGOEEF+1
21 S PSGPDRG=PSGPD,PSGPDRGN=PSGPDN,PSGOEEND=1,PSGOEEG=5
22 Q
23 ;
24ENOK ;
25 I $P($G(PSJSYSP0),U,2),'$O(^PS(53.45,+PSJSYSP,2,0)) D
26 .W !!,"No dispense drugs found for this order." D ENDRG^PSGOEF1(PSGPD,0) I '$O(^PS(53.45,+PSJSYSP,2,0)) S PSGOEENO=0,DR=""
27 W ! I DR="",'PSGOEENO D ABORT^PSGOEE S %=1 Q
28 W:PSGOEENO !,"(Accepting these changes will cause a new order to be created.)"
29 F W !!,"ACCEPT THESE CHANGES" S %=1 D YN^DICN Q:% D ;
30 .W !!?2,"Answer 'YES' (or press RETURN) if you have completed editing this order." W:PSGOEENO !,"Accepting this changes will cause a new order to be created, and this order",!,"will be discontinued."
31 .W:$D(PSGOEF) !,"Accepting these changes will convert this order to a non-verifed, Unit Dose",!,"order."
32 .W !!,"Answer 'NO' to re-edit this order. Enter an '^' to abort this edit."
33 ;I %=1,PSGOEENO,'$D(PSJOERR),PSGOEORF S PSJNOO=$S(PSGPR=DUZ:"E",1:"W"),PSJNOON=$S(PSJNOO="E":"PROVIDER ENTERED",1:"WRITTEN") I PSGPR'=DUZ S F1=53.1,PSGF2=106 K PSGFOK D A106^PSGOER0 S %='$D(PSGFOK)+1 K PSGFOK
34 ;S:%<0 PSGOEENO=0
35 S PSJNOO=$$ENNOO^PSJUTL5("E")
36 K F,F0,F1,F3,PSGDL,PSGDLS,PSGF2,PSGFOK,ND2,PSGOROE1,PSGRO,SDT
37 S:PSJNOO<0 (PSGOROE1,PSGOEENO)=0
38 Q
39 ;
40ENNOU ; create new order or update old order
41 I $G(MSG) K DIR S DIR(0)="E" W !! D ^DIR
42 K DR S DR="",(PSGOEENO,Q)=0
43 F S Q=$O(PSGEFN(Q)) Q:'Q S Y=$T(@(PSGOEEG_Q)) I $P(Y,";",4)]"",@$P(Y,";",4)'=@$P(Y,";",5) S:PSGEFN(Q) PSGOEENO=1 Q:PSGOEENO S DR=DR_$P(Y,";",6)_$S(@$P(Y,";",5)]"":"////^S X="_$P(Y,";",5),1:"////@")_";W ""."";"
44 I PSGSI="",PSGOSI]"" S DR=DR_"122////@;W ""."";"
45 I '$P(PSGSI,"^",2),$P(PSGOSI,"^",2)=1 S DR=DR_"122////@;W ""."";"
46 ; PSJ*5*95 quick fix to prevent long string error; true fix in PSJ*5*91 (upd^psgoee)
47 I PSGSI]"" S DR=DR_122_"////^S X="_+$P(PSGSI,"^",2)_";" I '$G(PSJLMFIN),'$G(PSGOEENO),$L($G(PSGOSI),"^")>20 S PSGSI=$P(PSGSI,"^")
48 I PSGSM,PSGOHSM'=PSGHSM S DR=DR_"6////"_PSGHSM_";W ""."";"
49 N P I 'PSGOEENO F P="1^3^10" I $D(PSGEFN($P(P,U,3))) S (Q,QQ)=0 F S Q=$O(@("^PS(53.45,"_PSJSYSP_","_+P_","_Q_")")) Q:'Q S QQ=Q,X=$G(^(Q,0)),Y=$G(@(PSGOEEWF_$P(P,U,2)_","_Q_",0)")) I X'=Y S:+P=1 DR="*" Q
50 I 'PSGOEENO F P="1^3^10" I $D(PSGEFN($P(P,U,3))) S (Q,QQ)=0 F S Q=$O(@(PSGOEEWF_$P(P,U,2)_","_Q_")")) Q:'Q S QQ=Q,X=$G(^(Q,0)),Y=$G(^PS(53.45,PSJSYSP,+P,Q,0)) I X'=Y S:+P=1 DR="*" Q
51 Q:$S(DR]"":1,1:PSGOEENO) S (Q,QQ)=0 F S Q=$O(^PS(53.45,PSJSYSP,2,Q)) Q:'Q S QQ=Q,X=$G(^(Q,0)),Y=$G(@(PSGOEEWF_"1,"_Q_",0)")) I X'=Y S DR="*" Q
52 Q:$S(DR]"":1,1:PSGOEENO) S (Q,QQ)=0 F S Q=$O(@(PSGOEEWF_"1,"_Q_")")) Q:'Q S QQ=Q,X=$G(^(Q,0)),Y=$G(^PS(53.45,PSJSYSP,2,Q,0)) I X'=Y S DR="*" Q
53 Q
54 ;
55ENF ; finish order from edit
56 F S %=1 W !!,"Finish this order now" D YN^DICN Q:% D ;
57 .W !!,"Answer 'YES' to finish this order now. Finishing the order converts it to a",!,"non-verified Unit Dose order. Enter 'NO' (or an '^') if you do not want to",!,"finish this order now."
58 I %=1 S PSGOEFF=0 D UPD^PSGOEF1 K PSGOEFF,PSGND,PSGSD
59 Q
60 ;
61FIELDS ;
6231 ;;108^PSGOE8;PSGOPD;PSGPD;108;1
6332 ;;109^PSGOE8;PSGODO;PSGDO;109;1
6433 ;;10^PSGOE81;PSGOSD;PSGSD;10;0
6534 ;;3^PSGOE8;PSGOMR;PSGMR;3;1
6635 ;;25^PSGOE81;PSGOFD;PSGFD;25;0
6736 ;;7^PSGOE8;PSGOST;PSGST;7;0
6837 ;;5^PSGOE82;PSGOSM;PSGSM;5;0
6938 ;;26^PSGOE8;PSGOSCH;PSGSCH;26;1
7039 ;;39^PSGOE81;PSGOAT;PSGAT;39;0
71310 ;;1^PSGOE82;PSGOPR;PSGPR;1;1
72311 ;;8^PSGOE81;PSGOSI;PSGSI;8;0
73312 ;;2^PSGOE82;;;2;0
74313 ;;66^PSGOE82;;;66;0
75314 ;;40^PSGOE82;;;40;0
7651 ;;108^PSGOE9;PSGOPD;PSGPD;108;1
7752 ;;109^PSGOE9;PSGODO;PSGDO;109;1
7853 ;;10^PSGOE91;PSGOSD;PSGSD;10;1
7954 ;;3^PSGOE9;PSGOMR;PSGMR;3;1
8055 ;;34^PSGOE91;PSGOFD;PSGFD;34;1
8156 ;;7^PSGOE9;PSGOST;PSGST;7;0
8257 ;;5^PSGOE82;PSGOSM;PSGSM;5;0
8358 ;;26^PSGOE9;PSGOSCH;PSGSCH;26;1
8459 ;;41^PSGOE91;PSGOAT;PSGAT;41;0
85510 ;;1^PSGOE92;PSGOPR;PSGPR;1;1
86511 ;;8^PSGOE92;PSGOSI;PSGSI;8;0
87512 ;;2^PSGOE92;;;2;0
88513 ;;15^PSGOE92;;;15;0
89514 ;;72^PSGOE92;;;72;1
Note: See TracBrowser for help on using the repository browser.