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

PSOCST11.m

Go to the documentation of this file.
  1. PSOCST11 ;BHAM ISC/SAB - DRUG COSTS BY CLINIC ; 12/22/92 15:58
  1. ;;7.0;OUTPATIENT PHARMACY;**10,31**;DEC 1997
  1. BEG S RP=11 D HDC^PSOCSTX F D CDT^PSOCSTX Q:$G(CTR) D CLN Q:$G(CTR) S RP=0 D CTP^PSOCSTX Q:$G(CTR) I RP=0 D DEV Q
  1. D EX Q
  1. CLN D CMC^PSOCSTX Q:$G(CTR)
  1. I IFN S DIC(0)="AEQM",DIC="^SC(",DIC("A")="Select Clinic: " D ^DIC K DIC S:Y<0 CTR=1 Q:$G(CTR) S IFN=1,CLA=+Y
  1. Q
  1. DEV D DVC^PSOCSTX Q:$G(CTR)
  1. K PSOION I $D(IO("Q")) S ZTDESC="DRUG COST BY CLINIC",ZTRTN="START^PSOCST11" D PAS^PSOCSTX
  1. I K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"REPORT QUEUED TO PRINT !!",! D EX Q
  1. START U IO K ^TMP($J) F PSDT=(BEGDATE-1):0:ENDDATE S PSDT=$O(^PSCST(PSDT)) Q:'PSDT!(PSDT>ENDDATE) D @$S('IFN:"ACL",1:"SCL")
  1. D ZER^PSOCSTX S CLAX="" D HD I $O(^TMP($J,CLAX))']"" D HDN^PSOCSTX Q
  1. F S CLAX=$O(^TMP($J,CLAX)) Q:CLAX="" D HD:($Y+4)>IOSL Q:$G(CTR) S Y=^TMP($J,CLAX),TTX=CLAX D PRT^PSOCSTX
  1. D HD:($Y+2)>IOSL D FTX^PSOCSTX
  1. EX D EX^PSOCSTX Q
  1. ACL F CLA=0:0 S CLA=$O(^PSCST(PSDT,"S",CLA)) Q:'CLA D SCL
  1. Q
  1. SCL I $D(^PSCST(PSDT,"S",CLA,0)) S X=^(0) D STORE
  1. Q
  1. STORE Q:'$D(^SC(CLA,0)) S CLAX=$P(^(0),"^") S:'$D(^TMP($J,CLAX)) ^TMP($J,CLAX)="^0^0^0" S UTL=^(CLAX),^TMP($J,CLAX)="^"_($P(UTL,"^",2)+$P(X,"^",2))_"^"_($P(UTL,"^",3)+$P(X,"^",3))_"^"_($P(UTL,"^",4)+$P(X,"^",4))
  1. Q
  1. HD D HD^PSOCSTX Q