PSXOPUTL ;BIR/HTW-Utility for Hold/Can ;[ 04/08/97 2:06 PM ] ;;2.0;CMOP;;11 Apr 97 ;Required input: DA - internal entry # - ^PSRX ;Returns: ;PSXZ("L")=LAST FILL... if it is orig Rx =0 ;PSXZ(FILL #)=CMOP status from 52...Trans/0,DISP/1,RETRAN/2,NOT DISP/3 ;If suspended PSXZ("S")=CMOP suspense status Q,L,X,P,R ;All returned variables can be killed by K PSXZ ; N X S (PSXZ("L"),X)=0 F S X=$O(^PSRX(DA,1,X)) Q:'X S PSXZ("L")=X I $O(^PSRX(DA,4,0)) F X=0:0 S X=$O(^PSRX(DA,4,X)) Q:'X D .S PSXZ($P($G(^PSRX(DA,4,X,0)),"^",3))=$P($G(^(0)),"^",4) S X=$O(^PS(52.5,"B",DA,0)) I X]"" S PSXZ("S")=$P($G(^PS(52.5,X,0)),"^",7) K X Q UNHOLD N FDT S FDT=PSORX("FILL DATE"),PSXFROM="UNHOLD" G EN1 REINS S PSXFROM="REINSTATE" EN1 D SUS1^PSXNEW I '$G(PSXFLAG) G KILL D PSXOPUTL I $G(PSXEDREL)]""!($G(PSXZ(PSXZ("L")))=0)!($G(PSXZ(PSXZ("L")))=2) D G KILL .I PSXFROM="REINSTATE" W !!,RX_" REINSTATED -- ",! Q .I PSXFROM="UNHOLD" W !!,$P(^PSRX(DA,0),"^")_" Removed from Hold Status",!! I $G(PSXZ(PSXZ("L")))']"" D S^PSXNEW G KILL I $G(PSXZ(PSXZ("L")))=3,(FDT>DT) D S^PSXNEW G KILL I $G(PSXZ(PSXZ("L")))=3,((FDT