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

AMQQAT11.m

Go to the documentation of this file.
  1. AMQQAT11 ; IHS/CMI/THL - GETS OVERFLOW FROM AMQQAT1 ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. ;-----
  1. RUN W !,"Maximum sample size allowed is 50% of this total (",AMQQRNDN,")"
  1. W !!,"There are 2 ways to determine sample size =>",!
  1. W !?5,"1) Sample a certain NUMBER of cohort members"
  1. W !?5,"2) Sample a certain PERCENT of cohort members",!
  1. S AMQQCRFL=""
  1. D GET^AMQQAT1
  1. I $D(AMQQQUIT) Q
  1. I X=1 D S1^AMQQAT1 Q:$D(AMQQQUIT) S AMQQCHNN=X G RAND
  1. D S2^AMQQAT1
  1. Q:$D(AMQQQUIT)
  1. S X=X*.01*AMQQCHTT
  1. S AMQQCHNN=X\1
  1. RAND I $D(AMQQFFIL) Q
  1. N I,X,Y,Z,N,I
  1. I IOST["C-" W !!,"Collecting a random sample",!
  1. I +AMQQCHRT K ^UTILITY("AMQQ RAND",$J,+AMQQCHRT)
  1. S X=0
  1. S AMQQCHRT=AMQQCHRT_";"_$J_";"_AMQQCHNN
  1. S I=0
  1. S N=AMQQCHTT-1
  1. S AMQQLINK=$S(AMQQCCLS="P":166,1:86)
  1. F S Y=$R(N)+1,Z=$O(^UTILITY("AMQQ TEMP",$J,Y,"")) I Z,'$D(^UTILITY("AMQQ RAND",$J,+AMQQCHRT,Z)) S ^(Z)="",I=I+1 W:IOST["C-" $C(13),I I I=AMQQCHNN Q
  1. K ^UTILITY("AMQQ TEMP",$J),AMQQRNDN
  1. Q
  1. ;
  1. COUNT ; ENTRY POINT FROM AMQQAT1
  1. I IOST["C-" W !!!,"Counting " W:$D(AMQQCRFG) "cohort before sampling" W "...",!
  1. S X=0
  1. F I=0:1 S X=$O(^DIBT(AMQQCHRT,1,X)) Q:'X W:IOST["C-"&('(I#100)) $C(13),I I $D(AMQQCRFG) S ^UTILITY("AMQQ TEMP",$J,I+1,X)=""
  1. I IOST["C-" W $C(13)," ",$C(13),!!,"There are ",I," entries in this cohort" W:'$D(AMQQCRFG) !!!
  1. Q
  1. ;
  1. STUFF ; ENTRY POINT FROM METADICTIONARY
  1. S AMQQCHRT=%
  1. S AMQQCRFG=""
  1. S AMQQCHNN=%(1)
  1. D COUNT
  1. K AMQQCRFG
  1. S AMQQCHTT=I
  1. D RAND
  1. K %,AMQQCHNN,AMQQCHRT,AMQQCHTT
  1. Q
  1. ;