Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (15 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
21 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGOEC.m

    r628 r636  
    11PSGOEC ;BIR/CML3-CANCEL ORDERS ;02 Mar 99 / 9:29 AM
    2  ;;5.0; INPATIENT MEDICATIONS ;**23,58,110,175,201**;16 DEC 97;Build 2
     2 ;;5.0; INPATIENT MEDICATIONS ;**23,58,110,175**;16 DEC 97;Build 18
    33 ;
    44 ; Reference to ^PS(55 is supported by DBIA# 2191.
     
    9696 N PROVIDER,PROVNAME,RESULT,RSB S RESULT=0
    9797 S PROVIDER=+$P($G(^PS(55,DFN,5.1)),"^",2),PROVNAME=""
     98 I $G(PSJRQPND) S PROVIDER=0
    9899 I PROVIDER>0 D
    99100 .S DIC=200,DR="53.1;53.4",DIQ="RSB",DIQ(0)="I",DA=PROVIDER D EN^DIQ1
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGPLR.m

    r628 r636  
    1 PSGPLR ;BIR/CML3-PRINTS PICK LIST REPORT ; 6/15/07 1:12pm
    2  ;;5.0; INPATIENT MEDICATIONS ;**10,50,67,119,129,191**;16 DEC 97;Build 9
     1PSGPLR ;BIR/CML3-PRINTS PICK LIST REPORT ;04 May 98 / 11:23 AM
     2 ;;5.0; INPATIENT MEDICATIONS ;**10,50,67,119,129**;16 DEC 97
    33 ;
    44 ; Reference to ^PS(55 is supported by DBIA# 2191.
     
    3131 .N OSTOP,DRGND S (DDRG,OLDWARD)="" S DRGND=$O(PSGPLREN("B",PSGP,PSJJORD,0)) Q:'DRGND  S OSTOP=PSGPLREN("B",PSGP,PSJJORD,DRGND) Q:'OSTOP
    3232 .N ST,TMPDRG S CNT=0,ST=$P(ND0,"^",7) S TMPDRG=0 S TMPDRG=$O(PSGPLREN("B",PSGP,PSJJORD,TMPDRG)) S TMPDRG=$P(DRG,"^")_"^"_TMPDRG
    33  .F PSGPLXRX="AU","AC" Q:CNT  F I=0:1 S DDRG=$O(PSGPLREN(53.5,PSGPLXRX,PSGPLG,TM,WDN,RM,PN,PST,TMPDRG,DDRG)) Q:(DDRG="")!(DDRG="NO DISPENSE DRUG")  D
     33 .F PSGPLXRX="AU","AC" Q:CNT  F S DDRG=$O(PSGPLREN(53.5,PSGPLXRX,PSGPLG,TM,WDN,RM,PN,PST,TMPDRG,DDRG)) Q:(DDRG="")!(DDRG="NO DISPENSE DRUG")  D
    3434 ..S X=$G(PSGPLREN(53.5,PSGPLG,1,PSGP,1,+DRGND,1,$P(DDRG,"^",2),0)) S DR=+X,DND=$P(X,U,2,4) Q:'X
    3535 ..S DRN=$G(^PS(55,PSGP,5,PSJJORD,1,DR,0)),DR=$$ENDDN^PSGMI($P(DRN,"^")) I DND?7N1"DI" S DND=$E($$ENDTC^PSGMI(+DND),1,8)
    3636 ..S DIS=$P(DND,"^",2),NEED=$S($P(DND,"^")]"":$P(DND,"^"),1:0)
    37  ..;GMZ;PSJ*5*191;Allow for Multiple Dispensed Drug units needed
    38  ..S PSJRNW(I)=1_"^"_+NEED
     37 ..S PSJRNW=1_"^"_+NEED
    3938 ..Q
    4039 .K PSGPLREN("B",PSGP,PSJJORD),PSGPLREN(53.5,PSGPLG,1,PSGP,1,+DRGND) W !!
     
    4746 .I ATC S X=0,X=$O(^PS(59.7,X)) I $P($G(^(X,26)),U,2)=1,PST="OC" S ATC=0
    4847 .S UD=$S('UD:1,UD=.5:"1/2",UD=.25:"1/4",UD<1:"0"_UD,1:UD)
    49  .I $D(PSJRNW) D
    50  ..I 'CNT W !?35,"**** RENEWAL ****"
    51  ..S NEED=NEED-$P(PSJRNW(CNT),"^",2) S:NEED<0 NEED=0 S CNT=CNT+1
     48 .I $G(PSJRNW),'CNT W !?35,"**** RENEWAL ****" S CNT=CNT+1,NEED=NEED-$P(PSJRNW,"^",2) S:NEED<0 NEED=0
    5249 .W !?6,DR,?48,ST W:(ATC)&(NEED>0) ?57,"ATC" W ?61,$J(UD,4),?68,$J(NEED,4),?75,$S(DIS]"":$J(DIS,4),1:"____")
    5350 .S:ST="DISCONTINUED" OLDWARD=1 S ST=""
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGSICHK.m

    r628 r636  
    11PSGSICHK ;BIR/CML3-CHECKS SPECIAL INSTRUCTIONS ;17 Aug 98 / 8:33 AM
    2  ;;5.0; INPATIENT MEDICATIONS ;**3,9,26,29,44,49,59,110,139,146,160,175,201,185**;16 DEC 97;Build 6
     2 ;;5.0; INPATIENT MEDICATIONS ;**3,9,26,29,44,49,59,110,139,146,160,175**;16 DEC 97;Build 18
    33 ;
    4  ; Reference to ^PS(50.605 is supported by DBIA 696.
    54 ; Reference to EN^PSOORDRG is supported by DBIA 2190.
    65 ; Reference to ^PSI(58.1 is supported by DBIA 2284.
     
    1211 ; Reference to ^ORRDI1 is supported by DBIA 4659.
    1312 ; Reference to ^XTMP("ORRDI" is supported by DBIA 4660.
    14  ; Reference to GETDATA^GMRAOR supported by DBIA 4847.
    15  ; Reference to ^TMP("GMRAOC" supported by DBIA 4848.
    1613 ;
    1714START ;
     
    2825ENSET(X) ; expands the SPECIAL INSTRUCTIONS field contained in X into Y
    2926 N X1,X2,Y S Y=""
    30  ;BHW;PSJ*5*185;Modified Logic below to NOT strip spaces and allow existing logic to flow.
    31  ;             ;Removed code I X2]"" Before Set of Y and created argumentless DO structure.
    32  F X1=1:1:$L(X," ") S X2=$P(X," ",X1) D
    33  . I X2']"" S Y=Y_" " Q  ;if multiple spaces in text and were $P'ing through text, X2 will="" so just add space and continue
    34  . S Y=Y_$S($L(X2)>30:X2,'$D(^PS(51,+$O(^PS(51,"B",X2,0)),0)):X2,$P(^(0),"^",2)]""&$P(^(0),"^",4):$P(^(0),"^",2),1:X2)_" "
    35  . Q
    36  ;BHW;Modified stripping of spaces at end of string
    37  F X1=$L(Y):-1:0 Q:$E(Y,X1,X1)'=" "  S Y=$E(Y,1,X1-1)
    38  Q Y
     27 F X1=1:1:$L(X," ") S X2=$P(X," ",X1) I X2]"" S Y=Y_$S($L(X2)>30:X2,'$D(^PS(51,+$O(^PS(51,"B",X2,0)),0)):X2,$P(^(0),"^",2)]""&$P(^(0),"^",4):$P(^(0),"^",2),1:X2)_" "
     28 S Y=$E(Y,1,$L(Y)-1) Q Y
    3929 ;
    4030END ; used by DRUG (55.06,101 & 53.1,101) x-refs to warn user if patient is receiving or about to receive the drug just ordered
     
    5848 I $T(HAVEHDR^ORRDI1)]"",$$HAVEHDR^ORRDI1,'$D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) D
    5949 . I $P($G(^XTMP("ORRDI","PSOO",PSGP,0)),"^",3)<0 W !,"Remote data not available - Only local order checks processed." D PAUSE^PSJLMUT1
     50 K ^TMP($J,"DUPDRG")  ;DEM - Duplicate Drug Check Ehancement.
    6051 I $D(^TMP($J,"DD")) D ORDCHK^PSJLMUT1(PSGP,"DD",4)
    6152 I $D(^TMP($J,"DC")) D ORDCHK^PSJLMUT1(PSGP,"DC",6)
     
    6354 I '$D(PSJFST) N PSJFST S PSJFST=0
    6455 I $D(^TMP($J,"DI")) S INTERVEN=1 D ORDCHK^PSJLMUT1(PSGP,"DI",8)
     56 D DUPDRG^PSJLMUT2(PSGP) K ^TMP($J,"DUPDRG")  ;DEM - Duplicate Drug Check Ehancement.
    6557 ;*** Allergy/adverse reaction check.
    6658 N PTR,X
     
    7567 .W !!
    7668 K PSJACK,GMRAING,I,^TMP($J)
    77  D ALGCLASS
     69 D ALGCLASS^PSGSICH1
    7870CONT ; Ask user if they wish to continue in spite of an order check.
    79  Q:'$D(PSJPDRG)  N DIR S DIR(0)="Y",DIR("A")="Do you wish to continue entering this order",DIR("?",1)="Enter ""N"" if you wish to exit without creating a new order,"
    80  S DIR("?")="or ""Y"" to continue with the order entry process.",DIR("B")="NO" D ^DIR I 'Y S PSGORQF=1,X="^",COMQUIT=1 Q
     71 ;Variable PSJDDCON is the order continuation flag for Duplicate Drug Check Enhancement.
     72 I $D(PSJDDCON("DD")),'PSJDDCON("DD") Q
     73 I '$D(PSJDDCON("DD")) Q:'$D(PSJPDRG)  N DIR D  I 'Y S PSGORQF=1,X="^",COMQUIT=1 K PSJDDCON Q
     74 . S DIR(0)="Y",DIR("A")=$S($G(PSJDDCON("DI")):"Do you wish to continue with the current order",1:"Do you wish to continue entering this order")
     75 . S DIR("?",1)="Enter ""N"" if you wish to exit without creating a new order,",DIR("?")="or ""Y"" to continue with the order entry process.",DIR("B")=$S($G(PSJDDCON("DI")):"YES",1:"NO")
     76 . D ^DIR
     77 . Q
     78 ;
     79 K PSJDDCON  ;Order continuation flag for Duplicate Drug Check Enhancement.
    8180 I 'INTERVEN!($P(PSJSYSU,";")'=3) Q
    82  NEW PSJY
     81 N PSJY
    8382 W:PSJIREQ !!,"This is a CRITICAL interaction, you must enter an intervention log to continue"
    8483 S DIR(0)="Y",DIR("A")="Do you wish to log an intervention",DIR("?",1)="Enter ""N"" if you do not wish to log an intervention,",DIR("?")="or ""Y"" to log an intervention." D ^DIR S PSJY=Y D:Y ^PSJRXI
     
    8988 D ENCV^PSGSETU Q:$D(XQUIT)
    9089 F  S DIC="^PSDRUG(",DIC(0)="AEIMOQZ",DIC("A")="Select DRUG: " W ! D ^DIC K DIC Q:+Y'>0  D SF
    91  D ENKV^PSGSETU K N5,ND,Q,Y Q
     90 D ENKV^PSGSETU K N5,ND,Q,Y
     91 Q
    9292 ;
    9393SF ;
     94 N PSGID
    9495 S Y=+Y,ND=$G(^PSDRUG(Y,0)),PSGID=+$G(^("I")) I PSGID W !!,"THIS DRUG IS INACTIVE AS OF ",$E($$ENDTC^PSGMI(PSGID),1,8)
    9596 W !!,$S($P(ND,"^",9):"NON-",1:""),"FORMULARY ITEM" W:$P(ND,"^",10)]"" !,$P(ND,"^",10)
     
    116117 W ?10,$P(ND,U),!,?13,"Give: ",X," ",$$ENMRN^PSGMI(+$P(ND0,U,3))," ",$P(ND2,U),!!
    117118 Q
    118 ALGCLASS ; checks any Drug allergies or reactions to see if
    119  ;         the new drug is the same class
    120  ; this call can be removed by commenting out the call on IVSOL+16
    121  N PSJLIST,CT,CLS,CLCHK,CNT,PSJL,LIST,DCCNT,PSCLASS,LEN
    122  S PSCLASS=$P($G(^PSDRUG(PSJDD,0)),"^",2),LEN=4 I $E(PSCLASS,1,4)="CN10" S LEN=5 ;look at 5 chars if ANALGESICS
    123  I $T(GETDATA^GMRAOR)]"" G ALGC2
    124  S GMRA="0^0^111" D EN1^GMRADPT
    125  F PSJLIST=0:0 S PSJLIST=$O(GMRAL(PSJLIST)) Q:'PSJLIST  D
    126  .K PSJAGL D EN1^GMRAOR2(PSJLIST,"PSJAGL")
    127  .; is the allergy/reaction drug class first four digits the same as the
    128  .; the class for the drug being entered?
    129  .S (CT,CLS)="",DCCNT=0
    130  .I $D(PSJAGL("V")) D
    131  ..F  S DCCNT=$O(PSJAGL("V",DCCNT)) Q:'DCCNT  S:$E($P($G(PSJAGL("V",DCCNT)),"^"),1,LEN)=$E(PSCLASS,1,LEN) (PSJPDRG,CLCHK)=1,CNT=$S('$D(CNT):1,1:CNT+1),LIST(CNT)=$P($G(PSJAGL),"^")_"^"_$P($G(PSJAGL("V",DCCNT)),"^",2)
    132  D:$G(CLCHK)
    133  .W !!,$C(7),"A Drug-Allergy Reaction exists for this medication and/or class!"
    134  .F PSJL=0:0 S PSJL=$O(LIST(PSJL)) Q:'PSJL  D
    135  ..W !?6,"Drug: "_$P(LIST(PSJL),"^"),!,"Drug Class: "_$P(LIST(PSJL),"^",2),!
    136  Q
    137 ALGC2 ;
    138  K GMRADRCL
    139  D GETDATA^GMRAOR(DFN) Q:'$D(^TMP("GMRAOC",$J,"APC"))
    140  N GMRACL,RET
    141  S RET=0,GMRACL="" F  S GMRACL=$O(^TMP("GMRAOC",$J,"APC",GMRACL)) Q:'$L(GMRACL)  D
    142  .N GMRANM,GMRALOC
    143  .S GMRALOC=^TMP("GMRAOC",$J,"APC",GMRACL)
    144  .S GMRANM=$P(^PS(50.605,+$O(^PS(50.605,"B",GMRACL,0)),0),U,2)
    145  .S GMRADRCL(GMRACL)=GMRACL_U_GMRANM_" ("_GMRALOC_")"
    146  .S RET=RET+1
    147  Q:'RET  K ^TMP("GMRAOC",$J)
    148  S CLCHK="",CT="" F  S CT=$O(GMRADRCL(CT)) Q:CT=""  D
    149  .I $E(PSCLASS,1,LEN)=$E(CT,1,LEN) S CLCHK=$G(CLCHK)+1,^TMP($J,"PSJDRCLS",CLCHK)=CT_" "_$P(GMRADRCL(CT),"^",2)
    150 CLASSDSP ;
    151  I '$D(^TMP($J,"PSJDRCLS")) Q
    152  W $C(7),!,"A Drug-Allergy Reaction exists for this medication and/or class!",!
    153  W !,"Drug: "_$P($G(^PSDRUG(PSJDD,0)),"^")
    154  S CT="" F  S CT=$O(^TMP($J,"PSJDRCLS",CT)) Q:CT=""  W !,"Drug Class: "_^TMP($J,"PSJDRCLS",CT)
    155  K ^TMP($J,"PSJDRCLS")
    156  S DIR("?",1)="Answer 'YES' if you DO want to enter a reaction for this medication,"
    157  S DIR("?")="       'NO' if you DON'T want to enter a reaction for this medication,"
    158  S DIR(0)="SA^1:YES;0:NO",DIR("A")="Do you want to Intervene? ",DIR("B")="Y" W ! D ^DIR
    159  I Y D ^PSJRXI
    160  I '$G(Y) K DIR,DTOUT,DIRUT,DIROUT,DUOUT,Y Q
    161  Q
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR3.m

    r628 r636  
    1 PSGXR3 ; DRIVER FOR COMPILED XREFS FOR FILE #53.1 ; 12/12/07
     1PSGXR3 ; DRIVER FOR COMPILED XREFS FOR FILE #53.1 ; 01/17/08
    22 ;
    33 N DH,DU,DIKILL,DISET,DIKJ,DIKZ,DIKYR,DIKZA,DIK0Z,DIKZK,DIKDP,DIKM1,DIKUP,DIKUM,DV,DIIX,DIKF,DIAU,DIKNM,DIKDA,DIKLK,DIKLM,DIKY,DIXR,DIKCOND,DIKSVDA,DIKPUSH,X1,X2
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR31.m

    r628 r636  
    1 PSGXR31 ; COMPILED XREF FOR FILE #53.1 ; 12/12/07
     1PSGXR31 ; COMPILED XREF FOR FILE #53.1 ; 01/17/08
    22 ;
    33 S DIKZK=2
     
    3232 S X=$P(DIKZ(0),U,1)
    3333 I X'="" K ^PS(53.1,"B",$E(X,1,30),DA)
    34 CR1 S DIXR=502
     34CR1 S DIXR=498
    3535 K X
    3636 S DIKZ("DSS")=$G(^PS(53.1,DA,"DSS"))
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR310.m

    r628 r636  
    1 PSGXR310 ; COMPILED XREF FOR FILE #53.1114 ; 12/12/07
     1PSGXR310 ; COMPILED XREF FOR FILE #53.1114 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR311.m

    r628 r636  
    1 PSGXR311 ; COMPILED XREF FOR FILE #53.157 ; 12/12/07
     1PSGXR311 ; COMPILED XREF FOR FILE #53.157 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR312.m

    r628 r636  
    1 PSGXR312 ; COMPILED XREF FOR FILE #53.158 ; 12/12/07
     1PSGXR312 ; COMPILED XREF FOR FILE #53.158 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR32.m

    r628 r636  
    1 PSGXR32 ; COMPILED XREF FOR FILE #53.11 ; 12/12/07
     1PSGXR32 ; COMPILED XREF FOR FILE #53.11 ; 01/17/08
    22 ;
    33 S DA(1)=DA S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR33.m

    r628 r636  
    1 PSGXR33 ; COMPILED XREF FOR FILE #53.1112 ; 12/12/07
     1PSGXR33 ; COMPILED XREF FOR FILE #53.1112 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR34.m

    r628 r636  
    1 PSGXR34 ; COMPILED XREF FOR FILE #53.1114 ; 12/12/07
     1PSGXR34 ; COMPILED XREF FOR FILE #53.1114 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR35.m

    r628 r636  
    1 PSGXR35 ; COMPILED XREF FOR FILE #53.157 ; 12/12/07
     1PSGXR35 ; COMPILED XREF FOR FILE #53.157 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR36.m

    r628 r636  
    1 PSGXR36 ; COMPILED XREF FOR FILE #53.158 ; 12/12/07
     1PSGXR36 ; COMPILED XREF FOR FILE #53.158 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR37.m

    r628 r636  
    1 PSGXR37 ; COMPILED XREF FOR FILE #53.1 ; 12/12/07
     1PSGXR37 ; COMPILED XREF FOR FILE #53.1 ; 01/17/08
    22 ;
    33 S DIKZK=1
     
    4848 S X=$P(DIKZ(.2),U,8)
    4949 I X'="" S ^PS(53.1,"ACX",$E(X,1,30),DA)=""
    50 CR1 S DIXR=502
     50CR1 S DIXR=498
    5151 K X
    5252 S DIKZ("DSS")=$G(^PS(53.1,DA,"DSS"))
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR38.m

    r628 r636  
    1 PSGXR38 ; COMPILED XREF FOR FILE #53.11 ; 12/12/07
     1PSGXR38 ; COMPILED XREF FOR FILE #53.11 ; 01/17/08
    22 ;
    33 S DA(1)=DA S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGXR39.m

    r628 r636  
    1 PSGXR39 ; COMPILED XREF FOR FILE #53.1112 ; 12/12/07
     1PSGXR39 ; COMPILED XREF FOR FILE #53.1112 ; 01/17/08
    22 ;
    33 S DA=0
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLMPRU.m

    r628 r636  
    11PSJLMPRU ;BIR/MLM-INPATIENT LISTMAN UD PROFILE UTILITIES ;27 Aug 98 / 8:45 AM
    2  ;;5.0; INPATIENT MEDICATIONS ;**16,58,85,110,185**;16 DEC 97;Build 6
     2 ;;5.0; INPATIENT MEDICATIONS ;**16,58,85,110**;16 DEC 97
    33 ;
    44 ; Reference to ^PSDRUG is supported by DBIA 2192.
     
    4444 ;                       LM  = Begin display of text after LM spaces.
    4545 ;                       RM  = Length of display text.
    46  ;
    47  ;BHW;PSJ*5*185;Extra spaces causes display to "skip" part of the field.                     
    48  ;S PSJL="",$P(PSJL," ",LM)="" F X=1:1 S WRD=$P(TXT," ",X) Q:WRD=""  D
    49  S PSJL="",$P(PSJL," ",LM)=""
    50  F X=1:1:$L(TXT," ") S WRD=$P(TXT," ",X) D
    51  .;BHW;PSJ*5*185;check if end of string or just extra space.
    52  .I WRD="" S PSJL=PSJL_" " Q
     46 ;                       
     47 S PSJL="",$P(PSJL," ",LM)="" F X=1:1 S WRD=$P(TXT," ",X) Q:WRD=""  D
    5348 .I $L(PSJL_" "_WRD)'<RM D SETTMP(SUB,PSJL) S PSJL="",$P(PSJL," ",10)=""
    5449 .I $L(PSJL_" "_WRD)'<RM S PSJL=PSJL_" "_$E(WRD,1,(RM-10)) D SETTMP(SUB,PSJL) S PSJL="",$P(PSJL," ",10)="",WRD=$E(WRD,(RM-9),$L(WRD))
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLMUDE.m

    r628 r636  
    11PSJLMUDE ;BIR/MLM-SHOW FIELDS FOR EDIT (LISTMAN STYLE) ;01 JUNE 00 / 2:40 PM
    2  ;;5.0; INPATIENT MEDICATIONS ;**7,47,50,63,64,58,80,116,110,111,164,175,201**;16 DEC 97;Build 2
    3   ;NFI-UD Fr#:2 chgs@init+4 to display non-formulary (N/F)
    4   ;also chgs @init+23
     2 ;;5.0; INPATIENT MEDICATIONS ;**7,47,50,63,64,58,80,116,110,111,164,175**;16 DEC 97;Build 18
     3 ;NFI-UD Fr#:2 chgs@init+4 to display non-formulary (N/F)
     4 ;also chgs @init+23
    55 ;
    66 ; Reference to ^PS(55 is supported by DBIA# 2191
     
    1212 D CLEAN^VALM10
    1313 S PSJL=$S($D(PSGEFN(1)):$E(" *",PSGEFN(1)+1)_"(1)",1:"   "),PSJL=$$SETSTR^VALM1("Orderable Item: "_PSGPDN_$$OINF^PSJDIN(PSGPD),PSJL,5,74) D  D SETTMP D:$G(PSGOEEF(108))!($G(PSGOEEF(101))) HILITE(1)
    14  . NEW Q,PSJDDA,PSJVD F Q=0:0 S Q=$O(^PS(53.45,PSJSYSP,2,Q)) Q:'Q  S PSJDDA(+$G(^(Q,0)))=""
     14 . N Q,PSJDDA,PSJVD F Q=0:0 S Q=$O(^PS(53.45,PSJSYSP,2,Q)) Q:'Q  S PSJDDA(+$G(^(Q,0)))=""
    1515 . S PSJVD=$$DINFLUD^PSJDIN(PSGPD,.PSJDDA)
    1616 . S PSJL=$$SETSTR^VALM1(PSJVD,PSJL,75,80)
    1717 . D:PSJVD]"" CNTRL^VALM10(1,75,5,IORVON,IORVOFF,0)
    1818 I $G(PSJORD)["P" D REQDT^PSJLIVMD(PSJORD)
    19  S PSJL="Instructions: "_PSGOINST D PTXT^PSJLMPRU(PSJL,"PSJUDE",6,80)
     19 S PSJL="Instructions: "_PSGOINST D PTXT^PSJLMPRU(PSJL,"PSJUDE",6,120)
    2020 S PSJL=$S($D(PSGEFN(2)):$E(" *",PSGEFN(2)+1)_"(2)",1:"    "),PSJL=$$SETSTR^VALM1("Dosage Ordered: "_PSGDO,PSJL,5,76) D SETTMP D:$G(PSGOEEF(109)) HILITE(2)
    2121 I $G(PSGRDTX) S PSJDUR=$$FMTDUR^PSJLIVMD($P($G(PSGRDTX),U,2))
     
    4848 S PSJL=$S($D(PSGEFN(9)):$E(" *",PSGEFN(9)+1)_"(9)",1:"   "),PSJL=$$SETSTR^VALM1("Admin Times: "_PSGAT,PSJL,8,71) D SETTMP D:$G(PSGOEEF(39))!($G(PSGOEEF(41))) HILITE(9)
    4949 S PSJL=$S($D(PSGEFN(10)):$E(" *",PSGEFN(10)+1)_"(10)",1:"   "),PSJL=$$SETSTR^VALM1("Provider: "_PSGPRN,PSJL,11,68) D:$G(PSGOEEF(1)) HILITE(10) D SETTMP
    50  ;S PSJL=$$SETSTR^VALM1($S($D(PSGEFN(7)):$E(" *",PSGEFN(7)+1)_"(7)",1:"   ")_"Self Med: "_PSGSMN,PSJL,56,24) S:PSGSM&PSGHSM PSJL=$$SETSTR^VALM1("  (HS)",PSJL,71,7) D SETTMP D:$G(PSGOEEF(5)) HILITE(7)
    5150 S PSJL=$S($D(PSGEFN(11)):$E(" *",PSGEFN(11))_"(11)",1:"   ")_" Special Instructions"_$S($P(PSGSI,"^",2)=1:"!: ",1:": ")_$P(PSGSI,"^") D PTXT^PSJLMPRU(PSJL,"PSJUDE",1,80)
    5251 S PSJL="" D SETTMP D:$G(PSGOEEF(8)) HILITE(11)
     
    5453 I $O(^PS(53.45,PSJSYSP,2,1)) F  S PSJL="" D SETTMP Q:PSJLN>15
    5554 S PSJL=$S($D(PSGEFN(12)):$E(" *",PSGEFN(12))_" (12)",1:"   ")_" Dispense Drug",PSJL=$$SETSTR^VALM1("U/D",PSJL,54,60),PSJL=$$SETSTR^VALM1("Inactive Date",PSJL,65,16) D SETTMP,CNTRL^VALM10(13,1,80,IOUON,IOUOFF,0)
    56  ;S $P(PSJL,"-",80)="" D SETTMP
    57  NEW PSJX
     55 N PSJX,PSGID
    5856 F Q=0:0 S Q=$O(^PS(53.45,PSJSYSP,2,Q)) Q:'Q  S ND=$G(^(Q,0)) D
    5957 .S D=$P(ND,"^"),PSGID=$P(ND,"^",3) I PSGID S PSGID=$$ENDTC^PSGMI(PSGID)
     
    7573 .D SETTMP S PSJL="Order Checks:" D SETTMP
    7674 .F Q=0:0 S Q=$O(^PS(53.1,+PSGORD,10,Q)) Q:'Q  D
    77  ..S PSJL="" D SETTMP S PSJL=$G(^PS(53.1,+PSGORD,10,Q,0)) D SETTMP
     75 ..S PSJL="" D SETTMP S PSJL=$G(^PS(53.1,+PSGORD,10,Q,0)) S PSJWPL=PSJL D DISPLAY
    7876 ..S PSJL="Overriding Provider: "_$P($G(^PS(53.1,+PSGORD,10,Q,1)),U) D SETTMP
    7977 ..S PSJL="Overriding Reason: " F X=0:0 S X=$O(^PS(53.1,+PSGORD,10,Q,2,X)) Q:'X   D
    8078 ...S PSJL=PSJL_$G(^PS(53.1,+PSGORD,10,Q,2,X,0)) D SETTMP S PSJL="                   "
    8179ACTFLG ;
     80 N ND4,AT,Y,X
    8281 S ND4=$S(PSGORD["P":$G(^PS(53.1,+PSGORD,4)),1:$G(^PS(55,PSGP,5,+PSGORD,4)))
    8382 S AT="",Y="12,13,D,18,19,H1,22,23,H0,15,16,R" F X=1:3:12 I $P(ND4,"^",$P(Y,",",X)),$P(ND4,"^",$P(Y,",",X+1)) S AT=$P(Y,",",X+2) Q
     
    9695 I $G(PSGPI) S VALMSG=$S($G(VALMSG)="":"INVALID",1:VALMSG_",")_" PROVIDER"
    9796 Q
     97 ;
    9898DISPLAY ;
    99  S PSJL=PSJWPL D SETTMP
    100  ;F X=1:1 S WRD=$P(PSJWPL," ",X) Q:WRD=""  D
    101  ;.I $L(PSJL_" "_WRD)'<80 D SETTMP S PSJL=$P(PSJWPL,PSJL,2) S:$E(PSJL,1)=" " PSJL=$E(PSJL,2,999),PSJWPL="" Q
    102  ;.S PSJL=PSJL_$S(PSJL="":"",1:" ")_WRD
    103  Q
     99 N X,LEN,LIM,PCS
     100 S LIM=$L(PSJWPL," "),PCS=1
     101 F X=1:1:LIM S LEN=$L($P(PSJWPL," ",PCS,X)) D
     102 . I LEN'<72!(X=LIM) D
     103 .. S PSJL=$P(PSJWPL," ",PCS,X)
     104 .. I PCS>1 S PSJL="   "_PSJL
     105 .. S PCS=X+1
     106 .. D SETTMP
     107 Q
    104108 ;
    105109SETTMP ;
     
    108112 ;
    109113HILITE(FLD) ;
    110  N COL,LIN,WID,X
    111  ;Q:'$G(PSGOEENO)
     114 N COL,LAB,LIN,WID,X
    112115 S X="$T("_FLD_"^PSJLMUDE)",@("X="_X),X=$P(X,";;",2),LIN=+X,COL=$P(X,",",2),LAB=$P(X,",",3),X=$P(X,",",4),WID=(LAB+$L(@X))
    113  ;D CNTRL^VALM10(LIN,COL,WID,IORVON_IOBON,IOINORM,0)
    114116 I FLD=7 S LIN=+$G(PSJLN)-1 Q:LIN<13
    115117 D CNTRL^VALM10(LIN,COL,WID,IORVON_IOBON,IORVOFF_IOBOFF,0)
     
    12813011 ;;11,7,22,PSGSI
    129131ENKILL ;
    130  K PSGAT,PSGEB,PSGEFN,PSGFD,PSGHSM,PSGNEFD,PSGNESD,PSGOEEF,PSGOEER,PSGOFD,PSGOHSM,PSGOMR,PSGOMRN,PSGOPD,PSGOPDN,PSGOPR,PSGOSCH,PSGOSD,PSGOSM,PSGOST,PSGPD,PSGPDN,PSGPR,PSGSD,PSGSM Q
     132 K PSGAT,PSGDO,PSGEB,PSGEFN,PSGFD,PSGFDN,PSGHSM,PSGNEFD,PSGNESD,PSGOEEF,PSGOEER,PSGOFD,PSGOHSM,PSGOMR,PSGMRN,PSGOPD,PSGOPDN,PSGOPR,PSGOSCH,PSGOSD
     133 K PSGOSM,PSGOST,PSGPD,PSGPDN,PSGPR,PSGSD,PSGSM,PSGOINST,PSGPRN,PSGRFDN,PSGRSDN,PSGSCH,PSGSDN,PSGSI,PSGSTN,PSJWPL,RNDT
     134 Q
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLMUT1.m

    r628 r636  
    11PSJLMUT1 ;BIR/MLM-DRUG NAME DISPLAY ;05 Feb 98 / 1:39 PM
    2  ;;5.0; INPATIENT MEDICATIONS ;**4,27,29,49,58,107,110,146,175,201**;16 DEC 97;Build 2
     2 ;;5.0; INPATIENT MEDICATIONS ;**4,27,29,49,58,107,110,146,175**;16 DEC 97;Build 18
    33 ;
    44 ; Reference to ^PS(55 is supported by DBIA# 2191.
     
    2525 I +$O(@(F_"1,0)")),'+$O(@(F_"1,1)")),PSGUPDDO="" D DD(F,.DRUGNAME)
    2626 S:($G(DRUGNAME)=""!($G(DRUGNAME)["NOT FOUND")) DRUGNAME=$$OIDF(OIND)
    27  ;S PSGGV=$S(NOTGV:"*** NOT TO BE GIVEN *** ",1:"")_PSGINS_PSGUPDDO_" "_MR_" "_SCH
    2827 S PSGGV=$S(NOTGV:"*** NOT TO BE GIVEN *** ",1:"")_$S(('$D(PSJPDDDP)&('$L(PSGUPDDO))):PSGINS,1:PSGUPDDO)_" "_MR_" "_SCH
    2928 S PSGX=0 K PSJPDDDP
     
    3433 . S NAME(PSGX+X)=$S(X>1:"      ",1:"")_MARX(X)
    3534 Q
     35 ;
    3636OIDF(OIND)    ; Return Orderable Item name and Dosage form.
    3737 ;; +OIND = orderable item IEN
     
    5050 S PSJPDDDP=1
    5151 Q
     52 ;
    5253DSPLORDU(PSGP,ON)   ; Display UD order for order check as in the Inpat Profile.
    5354 NEW DRUGNAME,F,NODE0,NODE2,PSJID,PSJX,SCH,SD,STAT,X,Y
     
    6667 . S PSJLINE=PSJLINE+1
    6768 Q
     69 ;
    6870DSPLORDV(DFN,ON)   ; Display IV order for order check as in the Inpat Profile.
    69  N DRG,DRGI,DRGT,DRGX,FIL,ND,ON55,P,PSJIVFLG,PSJORIFN,TYP,X,Y
     71 N DRG,DRGI,DRGT,DRGX,FIL,ND,ON55,P,PSJCT,PSJIVFLG,PSJORIFN,TYP,X,Y
    7072 S TYP="?" I ON["V" D
    7173 .S Y=$G(^PS(55,DFN,"IV",+ON,0)) F X=2,3,4,5,8,9,17,23 S P(X)=$P(Y,U,X)
     
    7678 S PSJIVFLG=1 D PIVAD,SOL
    7779 Q
     80 ;
    7881SOL ;
    7982 S PSJL=$S($G(PSJIVFLG):PSJL,1:"")_"        in"
    8083 S DRG=0 F  S DRG=+$O(DRG("SOL",DRG)) Q:'DRG  D NAME^PSIVUTL(DRG("SOL",DRG),39,.NAME,0) S DRGX=0 F  S DRGX=$O(NAME(DRGX)) Q:'DRGX  S PSJL=$$SETSTR^VALM1(NAME(DRGX),PSJL,12,60) D:$G(PSJIVFLG) PIV1 D SETTMP S PSJL="      "
    8184 Q
     85 ;
    8286PIVAD ; Print IV Additives.
    8387 F DRG=0:0 S DRG=$O(DRG("AD",DRG)) Q:'DRG  D NAME^PSIVUTL(DRG("AD",DRG),39,.NAME,1) F DRGX=0:0 S DRGX=$O(NAME(DRGX)) Q:'DRGX  S PSJL=$$SETSTR^VALM1(NAME(DRGX),PSJL,9,60) D:$G(PSJIVFLG) PIV1 D SETTMP
     
    9094 E  S PSJL=$$SETSTR^VALM1(TYP,PSJL,50,1),PSJL=$$SETSTR^VALM1(P(2),53,7),PSJL=$$SETSTR^VALM1(P(3),PSJL,63,7),PSJL=$$SETSTR^VALM1(P(17),PSJL,73,1)
    9195 Q
     96 ;
    9297SETTMP ;
    9398 S PSJOC(ON,PSJLINE)=PSJL,PSJLINE=PSJLINE+1
    9499 Q
     100 ;
    95101ORDCHK(DFN,TYPE,PIECE)   ;
    96102 ;TYPE ="DD" - Duplicate drug
     
    114120 . ; Adding Drug Interactions check for use in Intervention defaults in PSJRXI.
    115121 . I TYPE="DI" S PSJRXREQ=$S($P(^TMP($J,TYPE,PSIVX,0),U,4)="CRITICAL":1,1:2)
    116  . ;I $P(PSJPACK,";",2)["O" D  Q
    117122 . N X S X=$P(PSJPACK,";",2) I X["O" D  Q
    118123 ..  D:PSJFST=1 PAUSE
     
    123128 . I ON=$G(PSIVOCON),+PSJORIEN Q
    124129 . I ON=$G(PSIVOCON),'+PSJORIEN D SETPSJOC Q
    125  . ;S PSJOC=PSJOC+1,PSJPDRG=1 D:PSJOC=1 WRITE(TYPE)
    126130 . I ON["V" D
    127131 .. I '$O(^PS(55,DFN,"IV",+ON,0)) D SETPSJOC Q
     
    129133 . I ON'["V" D DSPLORDU(DFN,ON) S PSJOC=PSJOC+1
    130134 . S PSJOC(ON,PSJLINE)="",PSJLINE=PSJLINE+1
    131  D:PSJOC WRITE(TYPE)
    132  S ON="" F  S ON=$O(PSJOC(ON)) Q:ON=""  W ! S PSJLINE=PSJLINE+1,PSJFST=PSJFST+1 D
    133  . F PSIVX=0:0 S PSIVX=$O(PSJOC(ON,PSIVX)) Q:'PSIVX  W !,PSJOC(ON,PSIVX) S PSJLINE=PSJLINE+1 D:'(PSIVX#6) PAUSE
    134  W !
     135 ;  DEM - If TYPE="DI", and there are "DI" orders,
     136 ;        then display "DI" orders.
     137 I TYPE="DI",PSJOC D WRITE(TYPE) D  ;DEM
     138 . S ON="" F  S ON=$O(PSJOC(ON)) Q:ON=""  S PSJLINE=PSJLINE+1,PSJFST=PSJFST+1 D  ;DEM
     139 .. F PSIVX=0:0 S PSIVX=$O(PSJOC(ON,PSIVX)) Q:'PSIVX  W !,PSJOC(ON,PSIVX) S PSJLINE=PSJLINE+1  ;DEM
     140 Q:(TYPE="DI")  ;DEM - Don't continue if TYPE="DI". Code that follows is for TYPEs "DD" and "DC" only.
     141 Q:'PSJOC  ;DEM - No need to continue if no "DD", or "DC" orders.
     142 ;  DEM - If we are here, then there are "DD", or "DC" orders in
     143 ;        PSJOC array. Loop on PSJOC array and set orders into
     144 ;        ^TMP($J,"DUPDRG",TYPE) global. The ^TMP($J,"DUPDRG",TYPE)
     145 ;        global will be used for display of "DD" and "DC" orders
     146 ;        for possible discontinuation of the "DD", or "DC" orders.
     147 ;        See subroutine DUPDRG and calling routine ENDDC^PSGSICHK
     148 ;        for details.
     149 S ON="" F  S ON=$O(PSJOC(ON)) Q:ON=""  D  ;DEM
     150 . F PSIVX=0:0 S PSIVX=$O(PSJOC(ON,PSIVX)) Q:'PSIVX  S ^TMP($J,"DUPDRG",TYPE,ON,PSIVX)=PSJOC(ON,PSIVX)  ;DEM
    135151 Q
     152 ;
    136153SETPSJOC ;Set PSJOC array to be displayed later
    137154 NEW PIECE S PIECE=$S(TYPE="DC":4,1:2)
     
    140157 S PSJOC(ON,PSJLINE)=X,PSJLINE=PSJLINE+1,PSJOC=PSJOC+1
    141158 Q
     159 ;
    142160WRITE(TYPE)        ;Display order check description
    143161 S PSJPDRG=1
     
    146164 I TYPE="DI" W !!,"This patient is receiving the following medication",$S(PSJOC>1:"s",1:"")," that ha",$S(PSJOC>1:"ve",1:"s")," an interaction",!,"with ",$P($G(^PSDRUG(PSJDD,0)),U),":",!
    147165 Q
     166 ;
    148167PAUSE ;
    149168 K DIR W ! S DIR(0)="EA",DIR("A")="Press Return to continue..." D ^DIR W !
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLMUT2.m

    r628 r636  
    11PSJLMUT2 ;BIR/JLC-DISPLAY UTILITIES ;22 Jun 05
    2  ;;5.0; INPATIENT MEDICATIONS ;**146,175,201**;16 DEC 97;Build 2
     2 ;;5.0; INPATIENT MEDICATIONS ;**146,175**;16 DEC 97;Build 18
    33 ;
     4 ; Reference to ^PS(55 is supported by DBIA# 2191.
     5 ; Reference to ^PSDRUG is supported by DBIA# 2192.
     6 ; Reference to ^PSSLOCK is supported by DBIA# 2789.
     7 ; Reference to ^VA(200 is supported by DBIA# 10060.
     8 ;
    49SHOR(PSJT,PSJI)       ;Display outpatient remote order checks.
    510 ;; PSJT = Type of order check in ^TMP
     
    2530 W !,PSJULN
    2631 Q
     32 ;
    2733FSIG(FSIG) ;Format sig from remote site
    2834 ;returned in the FSIG array
     
    3743 I $G(FSIG(1))=""!($G(FSIG(1))=" ") S FSIG(1)=$G(FSIG(2)) K FSIG(2)
    3844FQUIT Q
     45 ;
     46DUPDRG(DFN) ;DEM - Duplicate Drug Check Ehancement
     47 ;
     48 ;  Note: Display of Drug Interaction, Non-VA Meds, and Outpatient
     49 ;        orders is done by ORDCHK^PSJLMUT1. ORDCHK is called by
     50 ;        routine ENDDC^PSGSICHK before routine ENDDC^PSGSICHK calls
     51 ;        DUPDRG^PSJLMUT2. If ORDCHK finds "DD", or "DC" orders,
     52 ;        then ORDCHK will set "DD", or "DC" orders into
     53 ;        ^TMP($J,"DUPDRG",TYPE) global.
     54 ;
     55 K PSJDDCON  ;Order continuation flag used by routine PSGSICHK.
     56 S:$D(^TMP($J,"DI")) PSJDDCON("DI")=1  ;Order continuation flag used by routine PSGSICHK.
     57 ;  Quit if no duplicate drug orders(s), or duplicate drug class
     58 ;  order(s) found.
     59 Q:'$D(^TMP($J,"DUPDRG","DD"))&'$D(^TMP($J,"DUPDRG","DC"))
     60 S PSJDDCON("DD")=0  ;Order continuation flag used by routine PSGSICHK.
     61 ;
     62 ;  Display orders in ^TMP($J,"DUPDRG",DUPLICATE_TYPE,ON,LINE_#)
     63 ;  (DUPLICATE TYPEs: "DD" - "Duplicate Drug"
     64 ;                    "DC" - "Duplicate Drug Class"
     65 ;
     66 S PSJPDRG=1  ;If we are here, then set PSJPDRG=1. ORDCHK^PSJLMUT1 addresses this variable for Outpatient orders and "DI" orders.
     67 N X,Y,DIR,TYPE,ON,PSJOC,PSJOCPOP,PSJSYSL
     68 W !!,"This patient is already receiving the following INPATIENT order(s) for the same drug or in the same drug class as "_$S($G(PSJDD)]"":$P($G(^PSDRUG(PSJDD,0)),U),1:"the drug selected"),":",!!
     69 D DSPLDD  ;Display patients orders for the same drug or same drug class as drug selected.
     70 ;  Ask user if they wish to continue in spite of an order check.
     71 S DIR(0)="Y",DIR("A")="Do you wish to continue with the current order",DIR("?",1)="Enter ""N"" if you wish to exit without creating a new order,"
     72 S DIR("?")="or ""Y"" to continue with the order entry process.",DIR("B")="YES" D ^DIR I 'Y S PSGORQF=1,COMQUIT=1 K X,Y,DIR W ! Q
     73 K X,Y,DIR
     74 S PSJDDCON("DD")=1,PSJSYSL=0  ;Order continuation flag used by routine PSGSICHK.
     75 W !
     76 F  D  Q:('PSJOC)!(PSJOCPOP)  ;Order discontinuation loop.
     77 . N TYPE,ON,PSJOCSEQ
     78 . S PSJOCPOP=0
     79 . ;  Ask user if they wish to discontinue any of the listed orders.
     80 . S DIR(0)="Y",DIR("A")="Do you wish to DISCONTINUE any of the listed orders",DIR("?",1)="Enter ""N"" if you wish to exit without discontinuing any of the listed orders,"
     81 . S DIR("?")="or ""Y"" to discontinue any of the listed orders.",DIR("B")="NO" D ^DIR I 'Y K X,Y,DIR S PSJOCPOP=1 W ! Q
     82 . K X,Y,DIR
     83 . W !
     84 . ;  Choose for DISCONTINUE 1-PSJOC (PSJOC is the total number of duplicate and duplicate class orders).
     85 . S DIR(0)="N^1:"_PSJOC,DIR("A")="Choose for DISCONTINUE",DIR("?")="Choose an order 1-"_PSJOC D ^DIR I 'Y K X,Y,DIR S PSJOCPOP=1 W ! Q
     86 . S PSJOCSEQ=+Y
     87 . K X,Y,DIR
     88 . ;
     89 . ;  *** Discontinue order ***
     90 . S ON=$P(PSJOC(PSJOCSEQ),"^",2)
     91 . I '$$LS^PSSLOCK(DFN,ON) S PSJOCPOP=1 Q
     92 . S PSGSTAT=$$GTSTATUS^PSJOE(DFN,ON)
     93 . D  ;Set PSGOEEWF for order being discontinued - DRF
     94 .. I ON["P" S PSGOEEWF="^PS(53.1,"_+ON_"," Q
     95 .. I ON["U" S PSGOEEWF="^PS(55,"_DFN_",5,"_+ON_"," Q
     96 .. S PSGOEEWF="^PS(55,"_DFN_",""IV"","_+ON_","
     97 . D  ;The following variables must be newed or they are stomped on by the discontinue code
     98 .. N %DT,CF,D,D0,DA,DI,DIC,DIE,DISYS,DQ,DR,DRG,DRGT,DRGTMP,DRGX
     99 .. N DTIME,FIL,I,JJ,LOC,OCXDT,OCXI,OCXSEG,ORIFN,ORO,POP,PSGALR
     100 .. N PSGDT,PSGOEAV,PSJNOO,PSGOEDMR,PSGOEPR,PSGPDRG,PSGTOO,PSGTOL
     101 .. N PSGUOW,PSIVOI,PSIVX,PSJCOM,PSJDD,PSJHLMTN,PSJMSG,PSJQO,PSOC
     102 .. N Q,QQ,T,VA,VADM,VAERR,VAIN,XPARSYS,XQXFLG,Y,PSJRQPND
     103 .. D
     104 ... S PSJRQPND=1
     105 ... I ON["V" D  Q  ;IV order
     106 .... N PSJORD
     107 .... S PSJORD=ON
     108 .... D DC^PSJLIACT
     109 ... D DC^PSJOE(DFN,ON)  ;UD order
     110 .. I $$GTSTATUS^PSJOE(DFN,ON)="D" D  ;  Clean up PSJOC and ^TMP($J,"DUPDRG") arrays, and reset PSJOC counter IF and after selected order has been discontinued.
     111 ... S TYPE=$P(PSJOC(PSJOCSEQ),"^",1),ON=$P(PSJOC(PSJOCSEQ),"^",2),PSJOC=PSJOC-1
     112 ... K PSJOC(PSJOCSEQ),^TMP($J,"DUPDRG",TYPE,ON),PSJOCSEQ
     113 . D UNL^PSSLOCK(DFN,ON)
     114 . Q:'PSJOC
     115 . W !!,"Now, this patient is already receiving the following INPATIENT order(s) for the same drug or in the same drug class as "_$S($G(PSJDD)]"":$P($G(^PSDRUG(PSJDD,0)),U),1:"the drug selected"),":",!!
     116 . D DSPLDD
     117 . Q
     118 W !
     119 K PSJOCPOP,PSGSTAT
     120 Q
     121 ;
     122DSPLDD ;
     123 ;  Display patients orders for the same drug or same drug class as drug selected.
     124 N X,REQPROV,PSJLINE,PSJFLN
     125 K PSJOC
     126 ;  Requesting Provider
     127 S PSJOC=0
     128 F TYPE="DD","DC" S ON="" F  S ON=$O(^TMP($J,"DUPDRG",TYPE,ON)) Q:ON=""  S PSJFLN=1 D
     129 . I ON["U" S REQPROV=$P(^PS(55,DFN,5,+ON,0),"^",2)
     130 . I ON["V" S REQPROV=$P(^PS(55,DFN,"IV",+ON,0),"^",6)
     131 . I ON["P" S REQPROV=$P(^PS(53.1,+ON,0),"^",2)
     132 . S REQPROV=$S(REQPROV>0:$P($G(^VA(200,REQPROV,0)),"^",1),1:"") S:REQPROV="" REQPROV="Requesting Provider Unknown"
     133 . F PSJLINE=0:0 S PSJLINE=$O(^TMP($J,"DUPDRG",TYPE,ON,PSJLINE)) Q:'PSJLINE  D
     134 .. I PSJFLN=1 S PSJOC=PSJOC+1,PSJOC(PSJOC)=TYPE_"^"_ON W PSJOC_".",^TMP($J,"DUPDRG",TYPE,ON,PSJLINE),! S PSJFLN=PSJFLN+1 Q
     135 .. S X=^TMP($J,"DUPDRG",TYPE,ON,PSJLINE) S:PSJFLN=2 X=$$SETSTR^VALM1(REQPROV,X,(48+$L(PSJOC_".")),25) W ?($L(PSJOC_".")),X,! S PSJFLN=PSJFLN+1 Q
     136 .. Q
     137 . Q
     138 Q
     139 ;
    39140PAUSE ;
    40141 K DIR W ! S DIR(0)="EA",DIR("A")="Press Return to continue..." D ^DIR W !
  • FOIAVistA/tag/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJMPEND.m

    r628 r636  
    1 PSJMPEND ;BIR/CML3-MD MARS - GATHER ACK ORDERS INFO (MDWS) ; 6/18/07 12:11pm
    2  ;;5.0; INPATIENT MEDICATIONS ;**191**;16 DEC 97;Build 9
     1PSJMPEND ;BIR/CML3-MD MARS - GATHER ACK ORDERS INFO (MDWS) ;20 DEC 96 / 3:15 PM
     2 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
    33 ;
    44PEND ;*** Only select orders that were acknowledged by nurses and are
     
    88 F ON=0:0 S ON=$O(^PS(53.1,"AV",PSGP,ON)) Q:'ON  D
    99 . S ND=$G(^PS(53.1,ON,0)),TYPE=$P(ND,U,4)
    10  . S ND2=$G(^PS(53.1,ON,2)),PSGLSD=$P(ND2,U,2),PSGLFD=$P(ND2,U,4)
    1110 . I $P(ND,U,7)="P"!($P($G(^PS(53.1,ON,2)),U)["PRN") S QST="PZ"_$S($P(ND,U,4)="F":"V",1:"A")
    1211 . E  S QST="CZ"_$S($P(ND,U,4)="F":"V",1:"A")
     
    2524 D DRGDISP^PSJLMUT1(PSGP,+ON_"P",20,0,.MARX,1) S DRG=MARX(1)_U_ON
    2625 ;*** Set up ^TMP for sort by patients
    27  S PSJDOS=$P(^PS(53.1,ON,.2),U,2),PSJMR=$E($S($P(ND,U,3)]"":$P(ND,U,3),1:$P(ND,U)),1,5),PSJSCHE=$P($G(^PS(53.1,ON,2)),U)
     26 S PSJDOS=$P(^PS(53.1,ON,.2),U,2),PSJMR=$E($S($P(ND,U,3)]"":$P(ND,U,3),1:$P(ND,U)),1,5),PSJSCH=$P($G(^PS(53.1,ON,2)),U)
    2827 S PSJHOLD=$S($P(ND,U,9)["H":1,1:0),PSGLOD=$P(ND,U,14),PSJATME=9999,PSJADT=$S(QST["C":"8999999",1:"9999999")
    2928 D SI
Note: See TracChangeset for help on using the changeset viewer.