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

PSDADJB.m

Go to the documentation of this file.
  1. PSDADJB ;BIR/LTL-Review Adjustment Transactions for a Drug; 2 Nov 94 [ 05/01/95 3:11 PM ]
  1. ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
  1. START ;compiles and prints output
  1. S PSDTI="Adjustments from "_PSDTB(2)_" to "_PSDTB(3)
  1. N PSDR,PG S PSDT=PSDTB,CNT=0 S $P(LN,"-",81)=""
  1. LOOP F S PSDT=$O(^PSD(58.81,"ACT",PSDT)) Q:'PSDT!(PSDT>PSDTB(1)) I $O(^PSD(58.81,"ACT",PSDT,0))=PSDLOC S PSDT(1)=$O(^PSD(58.81,"ACT",PSDT,PSDLOC,0)) I $D(PSDA(+PSDT(1))),$O(^PSD(58.81,"ACT",PSDT,PSDLOC,+PSDT(1),9,0)) D
  1. .S PSDR(2)=$G(^PSD(58.81,+$O(^PSD(58.81,"ACT",PSDT,PSDLOC,+PSDT(1),9,0)),0))
  1. .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)=LN
  1. .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)=PSDA(+PSDT(1))
  1. .S Y=$E($P(PSDR(2),U,4),1,12),CNT=$G(CNT)+1 X ^DD("DD") S ^TMP("PSD",$J,CNT)=Y_" "_" -> "_$P(PSDR(2),U,6)_" adjusted by "_$P($G(^VA(200,+$P(PSDR(2),U,7),0)),U)
  1. .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)="Reason: "_$P(PSDR(2),U,16)
  1. D BROWSE^DDBR("^TMP(""PSD"",$J)","NR",PSDTI)
  1. END W:$E(IOST)'="C" @IOF
  1. I $E(IOST)="C",'PSDOUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
  1. D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
  1. K ^TMP("PSD",$J) Q