source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDADJB.m@ 1154

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

initial load of WorldVistAEHR

File size: 1.1 KB
Line 
1PSDADJB ;BIR/LTL-Review Adjustment Transactions for a Drug; 2 Nov 94 [ 05/01/95 3:11 PM ]
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3START ;compiles and prints output
4 S PSDTI="Adjustments from "_PSDTB(2)_" to "_PSDTB(3)
5 N PSDR,PG S PSDT=PSDTB,CNT=0 S $P(LN,"-",81)=""
6LOOP 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
7 .S PSDR(2)=$G(^PSD(58.81,+$O(^PSD(58.81,"ACT",PSDT,PSDLOC,+PSDT(1),9,0)),0))
8 .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)=LN
9 .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)=PSDA(+PSDT(1))
10 .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)
11 .S CNT=$G(CNT)+1,^TMP("PSD",$J,CNT)="Reason: "_$P(PSDR(2),U,16)
12 D BROWSE^DDBR("^TMP(""PSD"",$J)","NR",PSDTI)
13END W:$E(IOST)'="C" @IOF
14 I $E(IOST)="C",'PSDOUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
15 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
16 K ^TMP("PSD",$J) Q
Note: See TracBrowser for help on using the repository browser.