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

ACDWRP5.m

Go to the documentation of this file.
ACDWRP5 ;IHS/ADC/EDE/KML - REPORT GENERATOR;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;Report 2,3,4,5,6,7,50,51,52,53,54,55,56,63,64,65
 I '$D(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL")) D ^ACDWK Q
 S (ACDGTOT,ACDGTOT1)=0
 D C S ACDP1="" F  D F Q:$D(DIRUT)  S ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1=""  W !,$E(ACDP1,1,24) D P1 Q:$D(DIRUT)
 I $D(DIRUT) D ^ACDWK Q  ;            quit if user entered "^"
 I ACDTG="G51"!(ACDTG="G3") W !!! F ACDLP=0:0 S ACDLP=$O(^ACDDRUG(ACDLP)) Q:'ACDLP  I $D(^(ACDLP,0)) S ACDRUG=$P(^(0),U,2)_"="_$P(^(0),U) I '$D(ACDRUG(ACDRUG)) W !,ACDRUG,?67,"NO DATA FOUND"
 I ACDTG="G51"!(ACDTG="G3")!(ACDTG="G7")!(ACDTG="G64") D COMB
 D ^ACDWK Q
P1 ;
 I ACDTG="G51"!(ACDTG="G3") S ACDRUG(ACDP1)=""
 S (ACDSTOT,ACDSTOT1)=0 F ACDP2=0:0 D F Q:$D(DIRUT)  S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) Q:'ACDP2  D P2 Q:$D(DIRUT)
 Q:$D(DIRUT)
 W ?26,ACDSTOT,?48,ACDSTOT1,?74,$J(ACDSTOT1/ACDSTOT,5,2),!
 Q
P2 ;
 S ACDSTOT=ACDSTOT+1,ACDSTOT1=ACDSTOT1+^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)
 Q
F ;Form feed
 I $Y+4>IOSL D F^ACDWUTL D:'$D(DIRUT) C
 Q
C ;Column
 W !!,ACDC(1),?26,ACDC(2),?48,ACDC(3),?72,ACDC(4),!,ACDH(1),!
 Q
COMB ;List patients on more than 1 drug i.e. combination drugs.
 W !!!,"COMBINATIONS ARE AS FOLLOWS:",!
 S ACDP1=""
 F  S ACDP1=$O(^TMP("CDMIS",$J,ACDP1)) Q:ACDP1=""  D  Q:$D(DIRUT)
 .  S ACDP2=0
 .  F ACDNUM=0:1 S ACDP2=$O(^TMP("CDMIS",$J,ACDP1,ACDP2)) Q:'ACDP2
 .  D F Q:$D(DIRUT)  W ACDP1,?67,"CLIENTS = ",?74,$J(ACDNUM,3),!
 .  Q
 Q