Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSGAPIV

PSGAPIV.m

Go to the documentation of this file.
  1. PSGAPIV ;BIR/MV-ACTION PROFILE #1 IV ORDERS ;07 Apr 98 / 1:10 PM
  1. ;;5.0; INPATIENT MEDICATIONS ;**9,58,169**;16 DEC 97
  1. ;
  1. ; Reference to ^PS(55 is supported by DBIA# 2191
  1. ;
  1. START ;
  1. NEW P,ON,DRG S ON=""
  1. F PSGEXPDT=PSGDT:0 S PSGEXPDT=$O(^PS(55,PSGP,"IV","AIT",PST,PSGEXPDT)) Q:'PSGEXPDT F S ON=$O(^PS(55,PSGP,"IV","AIT",PST,PSGEXPDT,ON)) Q:ON="" D IV
  1. Q
  1. IV ;
  1. N X,ON55 S DFN=PSGP D GT55^PSIVORFB
  1. I STP'=9999999\1,(P(2)>STP) Q
  1. Q:"DE"[P(17)
  1. S X=$P(P("MR"),U,2) Q:XTYPE=2&(X["IV") Q:XTYPE=3&(PST="S")&'($S(X="IV":1,X="IVPB":1,1:0))
  1. S QST=$$ONE^PSJBCMA(DFN,ON,P(9),P(2),P(3))
  1. I QST'="O" S QST=$S(P(9)["PRN":"P",1:"C")
  1. I DRG S X=$S($G(DRG("AD",1)):DRG("AD",1),1:$G(DRG("SOL",1))),DRG=$S(P(4)="H":"* TPN *",1:$E($$ENPDN^PSGMI($P(X,U,6)),1,20))
  1. S ^TMP($J,$E(PSGAPWDN,1,20),TM,PN,QST_U_DRG,ON_"V")=""
  1. Q
  1. PRT(ON) ;*** Print IV on Action Profile #1.
  1. NEW TYPE S TYPE=$P(DRG,U),ON=+ON
  1. N ON55,DRG,P,PRTST S DFN=PSGP,PRTST=1 D GT55^PSIVORFB
  1. F X=2,3 S:P(X) P(X)=$E($$ENDTC^PSGMI(P(X)),1,5)
  1. S PSJSI=$$ENSET^PSGSICHK($P(P("OPI"),"^"))
  1. S QST=$$ONE^PSJBCMA(DFN,ON,P(9),P(2),P(3))
  1. I QST'="O" S QST=$S(P(9)["PRN":"P",1:"C")
  1. W !,$J(N,3),$S(QST="O":" ",1:" R")_" D N " ;PSJ*5*169 Don't allow RENEW on one-time orders.
  1. I '$D(DRG("AD",0)) D PRTST W !
  1. I $O(DRG("AD",0)) F X=0:0 S X=$O(DRG("AD",X)) Q:'X W ?11,$$WRTDRG^PSIVUTL(DRG("AD",X),41) D:X=1 PRTST D NP("AD") G:$G(PSJDLW) EXIT W !
  1. W ?11,"in "
  1. F X=0:0 S X=$O(DRG("SOL",X)) Q:'X D:X>1 NP("SOL") W:X>1 ! W ?14,$$WRTDRG^PSIVUTL(DRG("SOL",X),41) G:$G(PSJDLW) EXIT
  1. W:P(9)]"" " " W P(9)," ",P(8) D:'$G(DRG("AD",1))&PRTST PRTST
  1. I PSJSI]"" W !?11,"Special Instructions: " F Y=1:1:$L(PSJSI," ") S Y1=$P(PSJSI," ",Y) W:($L(Y1)+$X)>79 !?33 W Y1_" "
  1. W !
  1. Q
  1. PRTST ;*** Print the rest of the 1st line.
  1. W:PRTST ?52,TYPE,?55,P(2),?61,P(3),?67,P(17)
  1. S PRTST=0
  1. Q
  1. NP(TYPE) ;
  1. NEW X
  1. D:DRG(TYPE,0)>1&($Y+11>IOSL) NP^PSGAPP
  1. Q
  1. EXIT ;
  1. Q