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

QAOSPRD0.m

Go to the documentation of this file.
  1. QAOSPRD0 ;HISC/DAD-INTER-REVIEWER RELIABILITY ASSESSMENT REPORT ;4/30/93 09:25
  1. ;;3.0;Occurrence Screen;;09/14/1993
  1. ;
  1. ; ^TMP($J , "QAOSPRD0" , ["N","L","1"] , ["CLIN","PEER"]) =
  1. ; Total_records ^ Records_selected
  1. ;
  1. ; ^TMP($J , "QAOSPRD0" , ["N","L","1"] , ["CLIN","PEER"] , SEQUENCE#) =
  1. ; IEN_in_file_#741 ^ $S(Selected:"*",1:"")
  1. ;
  1. EN ; *** Select the date range
  1. W !!,"Select the date range that the occurrences will be chosen from."
  1. D ^QAQDATE G:QAQQUIT EXIT
  1. ; *** Select the screens to include
  1. K DIR S DIR(0)="LO^1:3^K:X[""."" X",DIR("A")="Select screens to include"
  1. S DIR("?",1)="Choose from:",DIR("?",2)=" 1 National screens"
  1. S DIR("?",3)=" 2 Local screens",DIR("?",4)=" 3 Inactive screens"
  1. S DIR("?")="Choose any combination of the above, e.g., 1, 1-3, etc."
  1. S DIR("B")=1 D ^DIR G:$D(DIRUT) EXIT S QAOSTYPE="^"_$TR(Y,"123,","NL1^")
  1. ; *** Select the total number of records to capture
  1. K DIR S DIR(0)="NOA^1:999:0"
  1. S DIR("A")="Select number of occurrences to capture: ",DIR("B")=30
  1. S DIR("?",1)="Enter the number of occurrences to be printed out"
  1. S DIR("?")="for the inter-reviewer reliability assessment study."
  1. W ! D ^DIR G:$D(DIRUT) EXIT S QAOSNUM=Y
  1. BLANK ; *** Print blank worksheet
  1. W !!,"Include blank worksheets" S %=2 D YN^DICN G:%=-1 EXIT
  1. S QAOBLANK=$S(%=1:1,1:0) I '% D G BLANK
  1. . W !!,"Answer Y(es) to print blank worksheets in addition to the"
  1. . W !,"worksheets that are printed with data from the previous"
  1. . W !,"reviews. Answer N(o) to skip printing of blank worksheets."
  1. . Q
  1. DEV ; *** Select output device, force queueing
  1. K %ZIS S %ZIS="QM",%ZIS("B")="",IOP="Q" W !! D ^%ZIS G:POP EXIT
  1. I $D(IO("Q")) D G EXIT
  1. . K IO("Q")
  1. . S ZTRTN="ENTSK^QAOSPRD0"
  1. . S ZTSAVE("QAQ*")="",ZTSAVE("QAO*")=""
  1. . S ZTDESC="Inter-reviewer reliability assessment report"
  1. . D ^%ZTLOAD
  1. . Q
  1. E D G DEV
  1. . D ^%ZISC
  1. . W !?5,"This is a very long and time consuming"
  1. . W !?5,"report, it must be queued to print.",*7
  1. . Q
  1. ENTSK ; *** Tasked entry point
  1. K ^TMP($J,"QAOSPRD0")
  1. S QAOSCLIN=+$O(^QA(741.2,"C",1,0)),QAOSPEER=+$O(^QA(741.2,"C",2,0))
  1. S QAOSEXCP=+$O(^QA(741.6,"B",3,0)),QAOSDATE=QAQNBEG-.0000001
  1. ; *** Select all records that meet the user's specifications
  1. F S QAOSDATE=$O(^QA(741,"C",QAOSDATE)) Q:(QAOSDATE'>0)!(QAOSDATE>(QAQNEND+.9999999)) F QAOSD0=0:0 S QAOSD0=$O(^QA(741,"C",QAOSDATE,QAOSD0)) Q:QAOSD0'>0 D
  1. . S QAOSZERO=$G(^QA(741,QAOSD0,0)) Q:QAOSZERO=""!($P(QAOSZERO,"^",11)=2)
  1. . S QAOSSCRN=$G(^QA(741,QAOSD0,"SCRN")) Q:QAOSSCRN=""
  1. . S QAOSTYPE(0)=$P($G(^QA(741.1,+QAOSSCRN,0)),"^",4)
  1. . Q:QAOSTYPE'[("^"_QAOSTYPE(0)_"^")
  1. . S QAOSCD1=+$O(^QA(741,QAOSD0,"REVR","B",QAOSCLIN,0))
  1. . Q:$P($G(^QA(741,QAOSD0,"REVR",QAOSCD1,0)),"^",5)=QAOSEXCP
  1. . S QAOSPD1=+$O(^QA(741,QAOSD0,"REVR","B",QAOSPEER,0))
  1. . D SET("CLIN"):QAOSCD1,SET("PEER"):QAOSPD1
  1. . Q
  1. ; *** Randomly select the the specified number of records
  1. F QAOSTYP=2:1:$L(QAOSTYPE,"^")-1 F QAOSREVR="CLIN","PEER" D
  1. . S QAOSTYPE(0)=$P(QAOSTYPE,"^",QAOSTYP)
  1. . S QAOSTOT=+$G(^TMP($J,"QAOSPRD0",QAOSTYPE(0),QAOSREVR)) Q:QAOSTOT'>0
  1. . F QAOSSEQ=$S(QAOSTOT>QAOSNUM:QAOSNUM,1:QAOSTOT):-1:1 D
  1. .. F S QAOSRAND=$S(QAOSTOT>QAOSNUM:$R(QAOSTOT)+1,1:QAOSSEQ),X=$G(^TMP($J,"QAOSPRD0",QAOSTYPE(0),QAOSREVR,QAOSRAND)) I X,$P(X,"^",2)="" D Q
  1. ... S $P(^TMP($J,"QAOSPRD0",QAOSTYPE(0),QAOSREVR,QAOSRAND),"^",2)="*"
  1. ... S X=1+$P($G(^TMP($J,"QAOSPRD0",QAOSTYPE(0),QAOSREVR)),"^",2)
  1. ... S $P(^TMP($J,"QAOSPRD0",QAOSTYPE(0),QAOSREVR),"^",2)=X
  1. ... Q
  1. .. Q
  1. . Q
  1. PRINT ;
  1. U IO D ^QAOSPRD1
  1. EXIT ;
  1. D ^%ZISC
  1. K %,%ZIS,DIR,DIRUT,IOP,POP,QAOBLANK,QAOSCD1,QAOSCLIN,QAOSCNUM,QAOSD0
  1. K QAOSDATA,QAOSDATE,QAOSEXCP,QAOSHOW,QAOSNUM,QAOSPD1,QAOSPEER,QAOSPNUM
  1. K QAOSRAND,QAOSREVR,QAOSSCRN,QAOSSEQ,QAOSTOT,QAOSTYP,QAOSTYPE,QAOSZERO
  1. K QAOTODAY,X,Y,ZTDESC,ZTRTN,ZTSAVE,^TMP($J,"QAOSPRD0")
  1. D K^QAQDATE S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. SET(REVIEWER) ; *** Accumulate and count reviews
  1. N X S X=1+$G(^TMP($J,"QAOSPRD0",QAOSTYPE(0),REVIEWER))
  1. S ^TMP($J,"QAOSPRD0",QAOSTYPE(0),REVIEWER)=X
  1. S ^TMP($J,"QAOSPRD0",QAOSTYPE(0),REVIEWER,X)=QAOSD0
  1. Q