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

QAOC109.m

Go to the documentation of this file.
QAOC109 ;HISC/DAD-OCCURRENCE SCREEN AUTO ENROLLMENT ; 6/9/14 12:57pm
 ;;3.0;Occurrence Screen;**8,9**;09/14/1993;Build 4
 ;SCREEN 109 -- DEATH
 Q:$$INACTIVE^QAOC0(109)
 N QAO109,QAO109F
 F QAOSDOD=(QAMTODAY-1.0000001):0 S QAOSDOD=$O(^DGPM("ATT3",QAOSDOD)) Q:(QAOSDOD'>0)!(QAOSDOD>(QAMTODAY+.24))!(QAOSDOD\1'?7N)  F QAOSD0=0:0 S QAOSD0=$O(^DGPM("ATT3",QAOSDOD,QAOSD0)) Q:QAOSD0'>0  D LOOP1
 Q
LOOP1 ;
 S QAOSZERO=$G(^DGPM(QAOSD0,0)) Q:QAOSZERO=""
 S QAOSDFN=$P(QAOSZERO,"^",3),OUTYPE=$P(QAOSZERO,"^",18)
 D LOOP2
 Q:$G(QAO109F(QAOSDFN))
 S OUTYPE=$P($G(^DG(405.2,+OUTYPE,0)),"^",8) Q:OUTYPE<6
 N QAOENT
 S QAOENT=$G(^QA(741,"AA",109,QAOSDOD,QAOSDFN))  Q:QAOENT'=""
 D VADPT^QAOC0(QAOSDFN,QAOSD0)
 S QAOVISIT=$P($G(^DGPM(+VAIP(13),0)),"^")
 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAOSDFN,QAOSDOD)=""
 S WARDCLIN=+VAIP(5)_"^"
 S ^UTILITY($J,"QAM FALL OUT",QAMD0,QAOSDFN,QAOSDOD,"WARD")=WARDCLIN
 S ^UTILITY($J,"QAM FALL OUT",QAMD0,QAOSDFN,QAOSDOD,"TXSP")=+VAIP(8)
 S ^UTILITY($J,"QAM FALL OUT",QAMD0,QAOSDFN,QAOSDOD,"MVDT")=QAOVISIT
 S ^UTILITY($J,"QAM FALL OUT",QAMD0,QAOSDFN,QAOSDOD,"DIAG")=VAIP(9)
 S ^UTILITY($J,"QAM FALL OUT",QAMD0,QAOSDFN,QAOSDOD,"AADM")=VAIP(13)
 Q
LOOP2 ; Check if death was previously reported (QAO*3*9)
 Q:$G(QAO109F(QAOSDFN))
 S QAO109=""
 F  S QAO109=$O(^QA(741,"B",QAOSDFN,QAO109)) Q:QAO109=""  D
 . I $G(^QA(741,QAO109,"SCRN"))=109 S QAO109F(QAOSDFN)=1
 Q