source: FOIAVistA/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLIFNI.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1PSJLIFNI ;BIR/MV-U/D ORDER FINISHES AS IV ;13 Jan 98 / 11:32 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**1,29,34,37,50,94,116,110,111**;16 DEC 97
3 ;
4IV(PSJORD,OI) ; Prompt for missing data to be finished as IV.
5 L +^PS(53.1,+PSJORD):1 I '$T W !,$C(7),$C(7),"This order is being edited by another user. Try later." D PAUSE^VALM1 Q
6 D HOLDHDR^PSJOE
7 ;** PSIVFN1 is use so it will dipslay the AC/Edit screen
8 ;** instead of go to the "IS this O.K." prompt
9 ;** PSJLIFNI is a flag to indicate U/D finishes as IV.
10 K PSJIVBD
11 NEW PSIVFN1,ON55,PSGORQF,PSIVACEP,DRGOC,PSJLIFNI,PSIVOI
12 S PSJLIFNI=1
13 S PSIVAC="CF" S (P("PON"),ON,ON55)=+PSJORD_"P",DFN=PSGP
14 S PSIVUP=+$$GTPCI^PSIVUTL D GT531^PSIVORFA(DFN,ON) S P("PD")=OI_U_$$OIDF^PSJLMUT1(+OI)
15 D:'$D(P("OT")) GTOT^PSIVUTL(P(4))
16 S P("OPI")=$$ENPC^PSJUTL("V",+PSIVUP,60,P("OPI"))
17 D 53^PSIVORC1
18 I $E(P("OT"))="I" D GTDATA^PSJLIFN Q:P(4)=""
19 ;I $$SCHREQ^PSJLIVFD(.P),(P(9))]"",'$$PRNOK^PSGS0(P(9)) N PSGOES,X,PSGS0XT,PSJNSS S PSJNSS=1,PSGOES=1,X=P(9),PSGS0XT=P(15) D Q2^PSGS0
20 I $$SCHREQ^PSJLIVFD(.P),(P(9))]"",'$$PRNOK^PSGS0(P(9)) N PSJNSS,PSGOES,PSGS0XT,PSGS0Y,PSGAT S X=P(9),PSGS0XT=P(15),PSGAT=P(11) D
21 .D EN^PSGS0 I $G(X)="" S PSGORQF=1 Q
22 .I $G(PSGS0Y)>1 S P(11)=PSGS0Y
23 I $E(P("OT"))="I",'$D(DRG("AD")),('$D(DRG("SOL"))) S DNE=0 D GTIVDRG^PSIVORC2 S P(3)="" D ENSTOP^PSIVCAL D ORDCHK^PSJLIFN
24 I $D(PSGORQF) S VALMBCK="R",P(4)="" K DRG Q
25 S ^TMP("PSJI",$J,0)=""
26 S PSIVOK="1^3^10^25^26^39^57^58^59^63^64" D CKFLDS^PSIVORC1 D:EDIT]"" EDIT^PSIVEDT
27 I $G(DONE) S VALMBCK="R" D EXIT Q
28 D COMPLTE^PSIVORC1
29 S:$D(PSIVACEP) VALMBCK="Q"
30EXIT ;
31 L -^PS(53.1,+PSJORD)
32 Q
33ORDCHK(DFN,TYPE) ;
34 ;TYPE ="DD" - Duplicate drug
35 ; ="DC" - Duplicate class
36 ; -"DI" - Drug Interaction
37 ;
38 NEW ON,PSJL,PSIVX,PSJOC,PSJORIEN,PSJPACK,PSJLINE
39 S PSJOC=0,PSJLINE=1
40 F PSIVX=0:0 S PSIVX=$O(^TMP($J,TYPE,PSIVX)) Q:'PSIVX D
41 . I TYPE="DI",($P(^TMP($J,TYPE,PSIVX,0),U,4)="CRITICAL") S PSJIREQ=1
42 . D WRITE(TYPE),CONT^PSGSICHK
43 .; I ON["V" D
44 .;. I '$O(^PS(55,DFN,"IV",+ON,0)) D SETPSJOC Q
45 .;. D DSPLORDV(DFN,ON) S PSJOC=PSJOC+1
46 .; I ON'["V" D DSPLORDU(DFN,ON) S PSJOC=PSJOC+1
47 .; S PSJOC(ON,PSJLINE)="",PSJLINE=PSJLINE+1
48 ;D:PSJOC WRITE(TYPE)
49 ;S ON="" F S ON=$O(PSJOC(ON)) Q:ON="" W ! S PSJLINE=PSJLINE+1 D
50 ;. F PSIVX=0:0 S PSIVX=$O(PSJOC(ON,PSIVX)) Q:'PSIVX W !,PSJOC(ON,PSIVX) S PSJLINE=PSJLINE+1 D:'(PSIVX#6) PAUSE
51 ;W !
52 Q
53WRITE(TYPE) ;Display order check description
54 S PSJPDRG=1
55 I TYPE="DD" W !!,"There are duplicate ",$P(^TMP($J,TYPE,PSIVX,0),U,2),!,"medications prescribed for this order.",! Q
56 I TYPE="DC" W !!,"This medication: ",$P(^TMP($J,TYPE,PSIVX,0),U,4),!,"is in the same class as the following medication(s) within this order: "
57 I TYPE="DI" W !!,"This medication: ",$P(^TMP($J,TYPE,PSIVX,0),U,2),!,"has an interaction with the following medication(s) within this order: "
58 F X=0:0 S X=$O(^TMP($J,TYPE,X)) Q:'X W !,$S(TYPE="DC":$P(^TMP($J,TYPE,X,0),U,4),TYPE="DI":$P(^TMP($J,TYPE,X,0),U,6),1:$P(^TMP($J,TYPE,X,0),U,2)),!
59 Q
Note: See TracBrowser for help on using the repository browser.