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

QAOEDT0.m

Go to the documentation of this file.
  1. QAOEDT0 ;HISC/DAD-CLINICAL, PEER, & MANAGER REVIEW ;6/24/93 15:34
  1. ;;3.0;Occurrence Screen;;09/14/1993
  1. ASKDFN ;
  1. D HOME^%ZIS
  1. S QALIMIT="I $P(^(0),""^"",11)'>0",QAOSPROG="EN1^QAOEDT0" D EN2^QAOEDT
  1. K %,D,D0,D1,DA,DD,DIC,DIE,DINUM,DO,DR,DZ,QAOS,QAOSD0,QAOSD1,QAOSD2
  1. K QAOSDATA,QAOSDATE,QAOSDFN,QAOSFIND,QAOSFOND,QAOSLEVL,QAOSLVNO
  1. K QAOSMDUE,QAOSNEWF,QAOSPDUE,QAOSQUIT,QAOSSCRN,QAOSWARD,QAOSWHAT
  1. K QAOSX,QAOSZERO,SAVEX,SAVEY,UNDL,X,Y,QA,QAOSFDSP,QAOSFIND,QAUDIT
  1. K QAOSLOC,QAOSMGMT,QAOSREVR,QALIMIT,QAOSONE,QAOSPROG,QAOFIELD,QAOSNODE
  1. K QAOSSERV,QAOSUBDD
  1. Q
  1. EN1 ;
  1. ; *** FINAL DISPOSITION ACTIONS AND FINDINGS
  1. S (QAOSQUIT,QAOSFDSP)=0,QAOSFDSP("A")="^1^1.1^",QAOSFDSP("F")="^1^3^11^"
  1. S QAOSWHAT="REVIEWED" D ENDISP^QAOUTL0
  1. K DR S DIE="^QA(741,",DR="19;5;6;7;8;9",DA=QAOSD0
  1. D ^DIE I $D(Y) S QAOSQUIT=1 D AUDIT("e","CLINICAL/PEER/MANAGEMENT REVIEW") G DONE
  1. W !!?5,"Select CLINICAL, PEER, or MANAGEMENT review level."
  1. W !?5,"Only one CLINICAL review level may be entered."
  1. D ASKLEVL
  1. I QAOSQUIT D AUDIT("e","CLINICAL/PEER/MANAGEMENT REVIEW") G DONE
  1. ASKDISP ;
  1. S QAOSMGMT=+$O(^QA(741.2,"C",3,0))
  1. S QAOSFDSP=$S($O(^QA(741,QAOSD0,"REVR","B",QAOSMGMT,0)):1,1:QAOSFDSP)
  1. G:QAOSFDSP'>0 DONE
  1. W !!?5,"Do you wish to enter a FINAL DISPOSITION"
  1. S %=2 D YN^DICN G:(%=-1)!(%=2) DONE
  1. I '% D G ASKDISP
  1. . W !!?10,"Enter Y(es) to edit the FINAL DISPOSITION DATE and FINAL"
  1. . W !?10,"DISPOSITION REACHED BY data."
  1. . W !?10,"Enter N(o) to skip the FINAL DISPOSITION and select the next patient."
  1. . Q
  1. S QAOSWHAT="CLOSED OUT" D ENDISP^QAOUTL0
  1. K DR S DIE="^QA(741,",DR="14//TODAY;16;11//CLOSED",DA=QAOSD0
  1. D ^DIE I $D(Y) S QAOSQUIT=1
  1. D AUDIT("c","CLOSE A RECORD")
  1. DONE ;
  1. Q
  1. ASKLEVL ;
  1. R !!,"Select REVIEW LEVEL: ",X:DTIME S:'$T X="^"
  1. I "^"[$E(X) S QAOSQUIT=($E(X)="^") Q
  1. I $E(X)="?" D
  1. . N X K DIC S DIC="^QA(741,"_QAOSD0_",""REVR"",",DIC(0)="MQZ"
  1. . S D="B",DZ="??",(D0,DA,DA(1))=QAOSD0
  1. . W !!,"Already existing reviews for this occurrence:"
  1. . S QAOSDATA=$O(^QA(741,QAOSD0,"REVR",0)) D:QAOSDATA DQ^DICQ
  1. . W:QAOSDATA'>0 !?5,"*** NONE ***",!!,"Other review level choices:"
  1. . Q
  1. K DIC S DIC="^QA(741.2,",DIC(0)="EMNQZ"
  1. S DIC("S")="I $P(^(0),""^"",2)'>3" D ^DIC K DIC G:Y'>0 ASKLEVL
  1. S QAOSLEVL=+Y,QAOSLEVL(0)=Y(0,0),QAOSLVNO=$P(Y(0),"^",2)
  1. K QAOSFOND
  1. S QAOSFOND="",QAOSD1=$O(^QA(741,QAOSD0,"REVR","B",QAOSLEVL,0))
  1. I QAOSLVNO=1,QAOSD1,$D(^QA(741,QAOSD0,"REVR",QAOSD1,0))#2 G EDIT
  1. W:QAOSD1 !!,"Choose from:"
  1. F QAOSD1=0:0 S QAOSD1=$O(^QA(741,QAOSD0,"REVR","B",QAOSLEVL,QAOSD1)) Q:QAOSD1'>0 S QAOS=$G(^QA(741,QAOSD0,"REVR",QAOSD1,0)) D:QAOS]""
  1. . S QAOSFOND=QAOSFOND_QAOSD1_","
  1. . S QAOSFOND(QAOSD1)=QAOSLEVL(0)_" "_$P($G(^VA(200,+$P(QAOS,"^",2),0)),"^")_" "_$P($G(^DIC(49,+$P(QAOS,"^",10),0)),"^")
  1. . W !?5,QAOSD1,?15,QAOSFOND(QAOSD1)
  1. . Q
  1. S QAOSFOND=$E(QAOSFOND,1,$L(QAOSFOND)-1) G:QAOSFOND'>0 ASKADD
  1. W !!,"Choose (",QAOSFOND,"): "
  1. R QAOSD1:DTIME S:'$T QAOSD1="^" G:$E(QAOSD1)="^" ASKLEVL
  1. I QAOSD1]"" D G:QA SEARCH
  1. . S QA=($D(^QA(741,QAOSD0,"REVR",+QAOSD1,0))[0)
  1. . S QA=((","_QAOSFOND_",")'[(","_QAOSD1_","))+QA
  1. . I QA D
  1. .. W:$E(QAOSD1)'="?" " ??",*7
  1. .. W !!?5,"Enter one of the numbers listed below, or press RETURN"
  1. .. W !?5,"to add a new ",QAOSLEVL(0)," review level. "
  1. .. W "Up-arrow (^) to exit."
  1. .. Q
  1. . Q
  1. W " ",$G(QAOSFOND(+QAOSD1))
  1. G:QAOSD1 EDIT
  1. ASKADD ;
  1. G:$O(^QA(741,QAOSD0,"REVR","B",QAOSLEVL,0))'>0 ADD
  1. W *7,!!?5,"Are you adding ",QAOSLEVL(0)," as a new review level"
  1. S %=2 D YN^DICN G:(%=-1)!(%=2) ASKLEVL
  1. I '% D G ASKADD
  1. . W !!?5,"Enter Y(es) to create a new review level."
  1. . W !?5,"Enter N(o) to skip adding another review level."
  1. . Q
  1. ADD S:$D(^QA(741,QAOSD0,"REVR",0))[0 ^(0)="^741.01IPA^^"
  1. K DD,DIC,DINUM,DO S DIC="^QA(741,"_QAOSD0_",""REVR"",",DIC(0)="LM"
  1. S X=QAOSLEVL,(D0,DA,DA(1))=QAOSD0
  1. D FILE^DICN S QAOSD1=+Y
  1. EDIT ;
  1. W ! D ^QAOEDT0C:QAOSLVNO=1,^QAOEDT0P:QAOSLVNO=2,^QAOEDT0M:QAOSLVNO=3
  1. D AUDIT("e","CLINICAL/PEER/MANAGEMENT REVIEW") G ASKLEVL
  1. CHKACT ;
  1. F QA=0:0 S QA=$O(^QA(741,QAOSD0,"REVR",QAOSD1,2,"B",QA)) Q:QA'>0 S QAOS=$P($G(^QA(741.7,QA,0)),"^") I QAOSFDSP("A")[("^"_QAOS_"^") S (QAOSQUIT,QAOSFDSP)=1 Q
  1. Q
  1. RESET ;
  1. W *7
  1. W !!?5,"You may not change the review level, but you may delete it (@)"
  1. W !?5,"if you wish. Resetting the review level to its original value."
  1. W !,*7
  1. K DR S DIE="^QA(741,"_QAOSD0_",""REVR"","
  1. S DR=".01////"_QAOSREVR(0),(D0,DA(1))=QAOSD0,(D1,DA)=QAOSD1
  1. D ^DIE
  1. Q
  1. AUDIT(A,C) ; AUDIT: A = ACTION, C = COMMENT
  1. N QAUDIT S QAUDIT("ACTION")=A,QAUDIT("COMMENT")=C
  1. S QAUDIT("FILE")="741^27",QAUDIT("DA")=QAOSD0
  1. D ^QAQAUDIT
  1. Q