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

AQAOPC71.m

Go to the documentation of this file.
  1. AQAOPC71 ; IHS/ORDC/LJF - CALC FOR SINGLE CRIT RPT ;
  1. ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
  1. ;
  1. ;This routine contains the code for calculating the totals for each
  1. ;possible value of a review criterion by occurrence date grouped
  1. ;by month.
  1. ;
  1. ;start with clean globals
  1. K ^TMP("AQAOPC7",$J),^TMP("AQAOPC7A",$J),^TMP("AQAOPC7B",$J)
  1. ;
  1. LOOP ; >>for this indicator, find occ for date range
  1. S AQAODT=AQAOBD-.001
  1. F S AQAODT=$O(^AQAOC("AA",AQAOIND,AQAODT)) Q:AQAODT="" Q:AQAODT>(AQAOED_".24") D
  1. .S DFN=0
  1. .F S DFN=$O(^AQAOC("AA",AQAOIND,AQAODT,DFN)) Q:DFN="" D
  1. ..S AQAOIFN=0
  1. ..F S AQAOIFN=$O(^AQAOC("AA",AQAOIND,AQAODT,DFN,AQAOIFN)) Q:AQAOIFN="" D
  1. ...Q:'$D(^AQAOC(AQAOIFN,0)) S AQAOSTR=^(0) Q:$P(^(1),U)=2 ;deleted
  1. ...Q:$P(^AQAOC(AQAOIFN,0),U,9)'=DUZ(2) ;PATCH 3
  1. ...Q:$$EXCEP^AQAOLKP(AQAOIFN)
  1. ...I $D(AQAOXSN) Q:$$CHK^AQAOPCX(AQAOXSN)=0 ;flag for special searches
  1. ...; ;also returns AQAOARS arry
  1. ...;
  1. ...; >> loop thru criteria values for occurrence
  1. ...S AQAOCRT=0
  1. ...F S AQAOCRT=$O(^AQAOCC(5,"AC",AQAOIFN,AQAOCRT)) Q:AQAOCRT="" D
  1. ....Q:'$D(AQAOCR(AQAOCRT)) ;criteria not chosen for report
  1. ....S AQAOT=$P($G(^AQAO1(6,AQAOCRT,0)),U,2) ;set crit type
  1. ....S AQAOC=0
  1. ....F S AQAOC=$O(^AQAOCC(5,"AC",AQAOIFN,AQAOCRT,AQAOC)) Q:AQAOC="" D
  1. .....D SET ;set ^tmp and increment totals
  1. ;
  1. ;
  1. ;
  1. PRINT ; >>> go to print rtn
  1. I $D(AQAODLM) G ^AQAOPC73 ; ASCIIformat
  1. G ^AQAOPC72
  1. ;
  1. ;
  1. ;
  1. SET ; >> SUBRTN to set ^tmp & increment totals
  1. S AQAOMON=$E(AQAODT,1,5) ;month of occ
  1. I AQAOT="" Q ;no value
  1. S AQAOVAL=$P(^AQAOCC(5,AQAOC,0),U,AQAOT+4) ;crit value
  1. I AQAOVAL="" Q ;no value set, skip counts
  1. ;I AQAOT=2 S AQAOVAL=$P(^AQAO1(4,AQAOVAL,0),U,2) G SET1
  1. S X=$S(AQAOT=1:.05,AQAOT=2:.06,AQAOT=3:.07,1:.08),Y=AQAOVAL
  1. I X=.08 S AQAOVAL=$E(Y,4,5)_" "_$E(Y,6,7)_" "_$E(Y,2,3)
  1. E S C=$P(^DD(9002166.5,X,0),U,2) D Y^DIQ S AQAOVAL=Y ;printable form
  1. COMMAS I AQAOVAL["," S AQAOVAL=$P(AQAOVAL,",")_" "_$P(AQAOVAL,",",2,99) G COMMAS
  1. ;
  1. SET1 S AQAOSUB=0 I '$D(AQAOXSN) D SET2 Q
  1. F S AQAOSUB=$O(AQAOARS(AQAOSUB)) Q:AQAOSUB="" D SET2
  1. Q
  1. ;
  1. ;
  1. SET2 ; >> SUBRTN to increment counts
  1. Q:AQAOVAL="N/A"
  1. S AQAOCNT(AQAOSUB)=$G(AQAOCNT(AQAOSUB))+1 ;increment occ total
  1. S ^TMP("AQAOPC7",$J,AQAOSUB,AQAOVAL)=$G(^TMP("AQAOPC7",$J,AQAOSUB,AQAOVAL))+1
  1. S ^TMP("AQAOPC7",$J,AQAOSUB,AQAOVAL,AQAOMON)=$G(^TMP("AQAOPC7",$J,AQAOSUB,AQAOVAL,AQAOMON))+1
  1. S ^TMP("AQAOPC7B",$J,AQAOSUB,AQAOMON)=$G(^TMP("AQAOPC7B",$J,AQAOSUB,AQAOMON))+1
  1. I AQAOTYPE="L" D
  1. .S AQAOID=$P(^AQAOC(AQAOIFN,0),U)
  1. .K ^UTILITY("DIQ1",$J) S DIC="^AQAOC(",DA=AQAOIFN,DR=".025" D EN^DIQ1
  1. .S X=^UTILITY("DIQ1",$J,9002167,AQAOIFN,.025) ;age at time of occ
  1. .S DFN=$P(^AQAOC(AQAOIFN,0),U,2) Q:DFN=""
  1. .S X=X_U_$P(^DPT(DFN,0),U,2)_U_AQAOVAL
  1. .S ^TMP("AQAOPC7A",$J,AQAOSUB,AQAODT,AQAOID)=X
  1. Q