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

AQAOVAL.m

Go to the documentation of this file.
  1. AQAOVAL ; IHS/ORDC/LJF - CLOSE OUT OCCURRENCES ;
  1. ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
  1. ;
  1. ;This rtn contains the user interface to close out an occurrence
  1. ;after all reviews have been performed. This can be called from
  1. ;the review process if the user has access and the action was not
  1. ;a referral.
  1. ;
  1. ASK ; >>> ask for occ id or patient name or indicator
  1. G EXIT:$D(AQAOENTR) ;called by ^AQAOENTR
  1. D ASK^AQAOLKP G EXIT:'$D(AQAOIFN),EXIT:$D(DUOUT),EXIT:$D(DTOUT)
  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
  1. ;
  1. FIND ; >> find all reviews for this occurrence
  1. D FIND^AQAOREV1
  1. ;
  1. ;
  1. CLOSE ;ENTRY POINT >>> close out occurrence
  1. W ! K DIR S DIR(0)="Y",DIR("B")="NO"
  1. S DIR("?",1)="Enter YES if the review process has been completed and"
  1. S DIR("?",2)="validated for this occurrence.",DIR("?")=" "
  1. S DIR("A")="Do you wish to CLOSE OUT this Occurrence" D ^DIR
  1. G EXIT:$D(DIRUT),ASK:Y'=1
  1. ;
  1. I '$$ALLREV^AQAOREV D G EXIT:$D(DIRUT),ASK:Y'=1 ;PATCH 3
  1. . W !!,*7,"There appears to be some outstanding referrals" ;PATCH 3
  1. . W ! K DIR S DIR(0)="Y",DIR("B")="NO" ;PATCH 3
  1. . S DIR("A")="Are you SURE you want to close out this occurrence" ;PATCH 3
  1. . D ^DIR ;PATCH 3
  1. L +^AQAGU(0):1
  1. I '$T W !!,"CANNOT CLOSE; AUDIT FILE LOCKED. TRY AGAIN!",! G ASK
  1. L +^AQAOC(AQAOIFN):1
  1. I '$T W !!,"CANNOT CLOSE; ANOTHER USER EDITING OCCURRENCE.",! G ASK
  1. W !!!?5,"Closing out Occurrence #",AQAOCID,". . . .",!!
  1. S AQAOUDIT("DA")=AQAOIFN,AQAOUDIT("ACTION")="C"
  1. S AQAOUDIT("COMMENT")="CLOSE OUT RECORD" D ^AQAOAUD
  1. K DIE S DIE="^AQAOC(",DA=AQAOIFN
  1. I '$O(^AQAOC(AQAOIFN,"REV",0)) D I 1
  1. .S X=^AQAOC(AQAOIFN,1) K AQAOCLS
  1. .S AQAOCLS(2)=$P(X,U,3),AQAOCLS(3)=$P(X,U,11),AQAOCLS(4)=$P(X,U,5)
  1. .S AQAOCLS(6)=$P(X,U,6),AQAOCLS(7)=$P(X,U,7)
  1. .S DR="[AQAO INITIAL CLOSE]" D ^DIE L -^AQAOC(AQAOIFN)
  1. E I $D(AQAORIFN) D I 1
  1. .K DIR S DIR(0)="Y"
  1. .S DIR("A")="Should I use this review as the final say for this occurrence"
  1. .S DIR("?",1)="Do you wish to use your answers for this review as the"
  1. .S DIR("?",2)="final ones for this occurrence?"
  1. .S DIR("?",3)="If you answer YES, I will automatically stuff your"
  1. .S DIR("?",4)="answers from this review as the final ones."
  1. .S DIR("?",5)="If you answer NO, I will ask you to answer each"
  1. .S DIR("?",6)="question for the final say on this occurrence"
  1. .S DIR("?")=" " D ^DIR
  1. .I Y=1 D I 1 ;stuff answers
  1. ..S X=^AQAOC(AQAOIFN,"REV",AQAORIFN,0) K AQAOCLS
  1. ..S AQAOCLS(2)=$P(X,U),AQAOCLS(3)=$P(X,U,11),AQAOCLS(4)=$P(X,U,5)
  1. ..S AQAOCLS(6)=$P(X,U,7),AQAOCLS(7)=$P(X,U,6)
  1. ..S DR="[AQAO INITIAL CLOSE]" D ^DIE L -^AQAOC(AQAOIFN)
  1. .E S DR="[AQAO CLOSE OUT]" D ^DIE L -^AQAOC(AQAOIFN)
  1. E S DR="[AQAO CLOSE OUT]" D ^DIE L -^AQAOC(AQAOIFN)
  1. I '$D(Y) D
  1. .S AQAOACT=$P(^AQAOC(AQAOIFN,"FINAL"),U,6) ;action
  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 ;calls data entry driver
  1. .I $P(^AQAOC(AQAOIFN,"FINAL"),U,2)>1 D ;not for non-clin prelim
  1. ..S AQAOPT=$O(^AQAQX("B","AQAO PROV LEVEL",0)) Q:AQAOPT=""
  1. ..K AQAOP D ^AQAOEDTS
  1. .W !! K DIR S DIR(0)="E"
  1. .S DIR("A")="Occurrence Closed. Press RETURN to continue" D ^DIR
  1. ;
  1. ;
  1. EXIT ; >> eoj
  1. D KILL^AQAOUTIL G EXIT1:$D(AQAOENTR)
  1. W ! K DIR S DIR(0)="Y",DIR("B")="NO"
  1. S DIR("A")="Do you wish to CLOSE OUT another occurrence" D ^DIR
  1. G EXIT1:$D(DIRUT),ASK:Y=1
  1. EXIT1 K DIR,DIC Q
  1. ;
  1. ;
  1. SUM ; >> SUBRTN to print occurrence summary
  1. N AQAOIFN,AQAORVW,AQAOARR,AQAOCID,AQAOPAT,AQAOIND,AQAODATE
  1. S AQAOIFN=X
  1. S X=$P(^AQAOC(AQAOIFN,0),U,2),AQAOARR(AQAOIFN)=$P(^DPT(X,0),U)
  1. S AQAODEV="HOME" D PRINT^AQAOPR3
  1. Q