source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCOPAY.m@ 841

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

initial load of WorldVistAEHR

File size: 673 bytes
Line 
1PSOCOPAY ;BHAM ISC/RTR - DAYS SUPPLY TOTAL FOR ACCOUNTS RECEIVABLE ; 07/28/93
2 ;;7.0;OUTPATIENT PHARMACY;;DEC 1997
3POT(DFN) N FILL,RECNO,DAYS S X=0 G:'$G(DFN) END
4 S FILL="" F S FILL=$O(^PSRX("ACP",DFN,DT,FILL)) Q:FILL="" F RECNO=0:0 S RECNO=$O(^PSRX("ACP",DFN,DT,FILL,RECNO)) Q:'RECNO D
5 .I 'FILL,$P($G(^PSRX(RECNO,0)),"^",11)="W",$G(^PSRX(RECNO,"IB")),'+$P($G(^(2)),"^",13) S X=X+$S($P(^(0),"^",8)>60:3,$P(^(0),"^",8)>30:2,1:1) Q
6 .I FILL,$P($G(^PSRX(RECNO,1,FILL,0)),"^",2)="W",'+$P($G(^(0)),"^",18),$G(^PSRX(RECNO,"IB")) S DAYS=$S($P(^PSRX(RECNO,1,FILL,0),"^",10):$P(^(0),"^",10),1:$P($G(^PSRX(RECNO,0)),"^",8)) S X=X+$S(DAYS>60:3,DAYS>30:2,1:1) K DAYS Q
7END ;
8 Q X
Note: See TracBrowser for help on using the repository browser.