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

AQAOREV.m

Go to the documentation of this file.
  1. AQAOREV ; IHS/ORDC/LJF - ENTER OCCURRENCE REVIEWS ;
  1. ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
  1. ;
  1. ;This rtn contains the user interface to enter occurrence reviews.
  1. ;
  1. ASK ; >> ask for occ id
  1. I $D(AQAOIFN) L -^AQAOC(AQAOIFN) ;unlock last occ reviewed
  1. S AQAORVW="" ;flag:allow referred to reviewer to see occ
  1. D INTRO^AQAOHREV ;intro text
  1. K AQAOIFN ;start out clean, no occ variable
  1. ;
  1. D ASK^AQAOLKP G EXIT:'$D(AQAOIFN),EXIT:$D(DUOUT),EXIT:$D(DTOUT)
  1. ;
  1. START ; >> lock entry, display summary, display reviews
  1. L +^AQAOC(AQAOIFN):1 I '$T D G ASK
  1. .W !!,"CANNOT EDIT; ANOTHER USER IS EDITING THIS OCCURRENCE.",!
  1. ;
  1. W !! K DIR S DIR(0)="Y",DIR("B")="NO"
  1. S DIR("A")="Do you wish to see this occurrence's SUMMARY" D ^DIR
  1. I Y=1 S X=AQAOIFN D SUM^AQAOREV1
  1. ;
  1. D FIND^AQAOREV1 G ASK:AQAOSTOP=U ;find and display all reviews
  1. ;
  1. CHOOSE ; >> choose review entry to add or edit
  1. I AQAONUM=0 D ADD G:'$D(AQAORIFN) ASK G EDIT ;if none, try add
  1. K DIR S DIR(0)="NO^1:"_(AQAONUM+1),DIR("A")="Choose ONE from list"
  1. S DIR("A",1)=(AQAONUM+1)_". ADD a NEW REVIEW Entry"
  1. D ^DIR G EXIT:$D(DIRUT)
  1. I Y=(AQAONUM+1) D G:'$D(AQAORIFN) ASK I 1 ;chose to add new entry
  1. .K AQAO,AQAORIFN D ADD
  1. E S AQAORIFN=$P(AQAO(+Y),U) ;chose to edit an entry
  1. ;
  1. EDIT ; edit review
  1. L +^AQAGU(0):1 I '$T D G EXIT
  1. .W !!,"CANNOT ENTER REVIEW; AUDIT FILE LOCKED. TRY AGAIN.",!
  1. S AQAOUDIT("DA")=AQAOIFN,AQAOUDIT("ACTION")="E"
  1. S AQAOUDIT("REV")=AQAORIFN
  1. S AQAOUDIT("COMMENT")="EDIT OCCURRENCE REVIEW" D ^AQAOAUD
  1. ;
  1. K DIE,DIR S DIE="^AQAOC("_AQAOIFN_",""REV"",",DA(1)=AQAOIFN,DA=AQAORIFN
  1. S DR=".01;S AQAORLX=X;.02;.04;I AQAORLX=1 S Y=""@1"";.011;.06;@1;.05;.07;S:$P(^AQAO(6,$P(^AQAOC(AQAOIFN,""REV"",AQAORIFN,0),U,7),0),U,4)'=1 Y=""@2"";.09;2;@2;1"
  1. D ^DIE
  1. ;
  1. S AQAOACT=$P($G(^AQAOC(AQAOIFN,"REV",AQAORIFN,0)),U,7) ;action;PATCH 1
  1. I AQAOACT]"",$P(^AQAO(6,AQAOACT,0),U,4)=2 D ;practitioner action
  1. .S AQAOPT=$O(^AQAQX("B","AQAO PROV ACTION",0)) Q:AQAOPT=""
  1. .K AQAOP D ^AQAOEDTS ;call data entry driver
  1. E D ;update prov list;PATCH 3
  1. .S AQAOPT=$O(^AQAQX("B","AQAO PROV LEVEL",0)) Q:AQAOPT="" ;PATCH 3
  1. .K AQAOP D ^AQAOEDTS ;PATCH 3
  1. ;
  1. I $D(^XUSEC("AQAOZVAL",DUZ)),$P($G(^AQAO(6,+AQAOACT,0)),U,4)'=1,'$O(^AQAOC(AQAOIFN,"REV",AQAORIFN)),$$ALLREV D ;PATCH 3
  1. .S AQAOENTR="" D CLOSE^AQAOVAL K AQAOENTR ;close out occ
  1. ;
  1. D PRTOPT^AQAOVAR G ASK
  1. ;
  1. EXIT ; >> eoj
  1. I $D(AQAOIFN) L -^AQAOC(AQAOIFN)
  1. D KILL^AQAOUTIL Q
  1. ;
  1. ADD ; SUBRTN to add new review to occ
  1. L +^AQAGU(0):1 I '$T D Q
  1. .W !!,"CANNOT ADD NEW REVIEW; AUDIT FILE LOCKED. TRY AGAIN.",!
  1. W !!,"(To add a review for a stage already used, enter in quotes, i.e. ""PEER"".)"
  1. I '$D(^AQAOC(AQAOIFN,"REV",0)) S ^AQAOC(AQAOIFN,"REV",0)="^9002167.01P^^"
  1. K DIC S DIC="^AQAOC("_AQAOIFN_",""REV"",",DA(1)=AQAOIFN
  1. S DIC(0)="AEMZQL" D ^DIC I +Y>0 S AQAORIFN=+Y
  1. Q:'$D(AQAORIFN) S AQAOUDIT("DA")=AQAOIFN,AQAOUDIT("ACTION")="E"
  1. S AQAOUDIT("COMMENT")="ADD OCCURRENCE REVIEW",AQAOUDIT("REV")=AQAORIFN
  1. D ^AQAOAUD
  1. Q
  1. ;
  1. ;
  1. ALLREV() ;EP; -- SUBRTN to return whether referrals covered by reviews;PATCH 3
  1. Q $S($$REFCNT>$$REVCNT:0,1:1)
  1. ;
  1. REFCNT() ; -- SUBRTN to return # of referrals;PATCH 3
  1. NEW AQAORF,X,Y S AQAORF=0
  1. ;
  1. ; -- initial review was referral?
  1. I $P($G(^AQAOC(AQAOIFN,1)),U,9)]"" S AQAORF=AQAORF+1
  1. ; -- any additional referrals on initial review?
  1. S X=0
  1. F S X=$O(^AQAOC(AQAOIFN,"IADDRV",X)) Q:X'=+X S AQAORF=AQAORF+1
  1. ;
  1. ; -- count referrals on other reviews
  1. S X=0 F S X=$O(^AQAOC(AQAOIFN,"REV",X)) Q:X'=+X D
  1. . I $P($G(^AQAOC(AQAOIFN,"REV",X,0)),U,9)]"" S AQAORF=AQAORF+1
  1. . S Y=0
  1. . F S Y=$O(^AQAOC(AQAOIFN,"REV",X,"ADDRV",Y)) Q:Y'=+Y D
  1. .. S AQAORF=AQAORF+1
  1. ;
  1. Q AQAORF
  1. ;
  1. REVCNT() ; -- SUBRTN to return # of reviews;PATCH 3
  1. NEW AQAORV,X S AQAORV=0
  1. S X=0 F S X=$O(^AQAOC(AQAOIFN,"REV",X)) Q:X'=+X S AQAORV=AQAORV+1
  1. Q AQAORV