QANUTL5 ;HISC/GJC-Utilities for Incident Reporting (Incident Status) ;10/6/92
;;2.0;Incident Reporting;**1,10,18,26**;08/07/1992
;
BDCAST ;Required message broadcast.
S MSSG0="W !?10,""This incident requires immediate phone notification to the VISN."""
S MSSG1="W !?10,""This incident requires E-MAIL to the VISN."""
S MSSG2="W !?10,""This incident requires further investigation."""
S MSSG3="W !?10,""This incident requires a Mortality and Morbidity (M&M) report."""
S MSSG4="W !?10,""This incident requires Psychological Autopsy."""
S QANGLB1=$S($D(^QA(742,QANDFN,0))#2:^(0),1:""),QANGLB2=$S($D(^QA(742.4,QANIEN,0))#2:^(0),1:"") Q:QANGLB1']""!(QANGLB2']"")
S INCQAN("SUICIDE")=$O(^QA(742.1,"BUPPER","SUICIDE",0))
S INCQAN("SUICIDE ATTEMPT")=$O(^QA(742.1,"BUPPER","SUICIDE ATTEMPT",0))
S INCQAN("SEXUAL ASSAULT")=$O(^QA(742.1,"BUPPER","SEXUAL ASSAULT",0))
S INCQAN("HOMICIDE")=$O(^QA(742.1,"BUPPER","HOMICIDE",0))
S INCQAN("PATIENT ABUSE")=$O(^QA(742.1,"BUPPER","PATIENT ABUSE",0))
S INCQAN("FALL")=$O(^QA(742.1,"BUPPER","FALL",0))
S INCQAN("TRANSFUSION ERROR")=$O(^QA(742.1,"BUPPER","TRANSFUSION ERROR",0))
S INCQAN("MEDICATION ERROR")=$O(^QA(742.1,"BUPPER","MEDICATION ERROR",0))
S INCQAN("INJURY NOT OTHERWISE LISTED")=$O(^QA(742.1,"BUPPER","INJURY NOT OTHERWISE LISTED",0))
S INCQAN("FIRE-PATIENT INVOLVED IN")=$O(^QA(742.1,"BUPPER","FIRE-PATIENT INVOLVED IN",0))
S INCQAN("ASSAULT-PATIENT TO PATIENT")=$O(^QA(742.1,"BUPPER","ASSAULT-PATIENT TO PATIENT",0))
S INCQAN("ASSAULT-PATIENT/STAFF")=$O(^QA(742.1,"BUPPER","ASSAULT-PATIENT/STAFF",0))
S INCQAN("DEATH")=$O(^QA(742.1,"BUPPER","DEATH",0))
S INCQAN("MISSING PATIENT")=$O(^QA(742.1,"BUPPER","MISSING PATIENT",0))
S INCQAN("INFORMED CONSENT-FAIL. TO OBTAIN")=$O(^QA(742.1,"BUPPER","INFORMED CONSENT-FAIL. TO OBTAIN",0))
I $P(QANGLB2,U,2)=INCQAN("DEATH") D DEATH^QANUTL Q
I $P(QANGLB2,U,2)=INCQAN("SUICIDE") X MSSG0,MSSG1,MSSG4
I $P(QANGLB2,U,2)=INCQAN("SUICIDE ATTEMPT"),("01"[$P(QANGLB1,U,10)) X MSSG1,MSSG3
I $P(QANGLB2,U,2)=INCQAN("SUICIDE ATTEMPT"),($P(QANGLB1,U,10)["2") X MSSG0,MSSG1,MSSG3
I $P(QANGLB2,U,2)=INCQAN("PATIENT ABUSE") D ABUSE^QANUTL Q
I $P(QANGLB2,U,2)=INCQAN("INFORMED CONSENT-FAIL. TO OBTAIN") X MSSG1
I $P(QANGLB2,U,2)=INCQAN("FALL"),($P(QANGLB1,U,10)["2") X MSSG1
I $P(QANGLB2,U,2)=INCQAN("FALL"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("HOMICIDE") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("MEDICATION ERROR"),($P(QANGLB1,U,10)["2") X MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("MEDICATION ERROR"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("MISSING PATIENT"),($P(QANGLB1,U,10)["2") X MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("MISSING PATIENT"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT/STAFF"),($P(QANGLB1,U,10)["2") X MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT/STAFF"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT TO PATIENT"),("23"[$P(QANGLB1,U,10)) X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("INJURY NOT OTHERWISE LISTED"),($P(QANGLB1,U,10)["2") X MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("INJURY NOT OTHERWISE LISTED"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("FIRE-PATIENT INVOLVED IN"),("23"[$P(QANGLB1,U,10)) X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("SEXUAL ASSAULT") X MSSG0,MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("TRANSFUSION ERROR"),($P(QANGLB1,U,10)["2") X MSSG1,MSSG2
I $P(QANGLB2,U,2)=INCQAN("TRANSFUSION ERROR"),($P(QANGLB1,U,10)["3") X MSSG0,MSSG1,MSSG2
EXIT ;Exit and Quit!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HQANUTL5 3637 printed Dec 13, 2024@02:00:15 Page 2
QANUTL5 ;HISC/GJC-Utilities for Incident Reporting (Incident Status) ;10/6/92
+1 ;;2.0;Incident Reporting;**1,10,18,26**;08/07/1992
+2 ;
BDCAST ;Required message broadcast.
+1 SET MSSG0="W !?10,""This incident requires immediate phone notification to the VISN."""
+2 SET MSSG1="W !?10,""This incident requires E-MAIL to the VISN."""
+3 SET MSSG2="W !?10,""This incident requires further investigation."""
+4 SET MSSG3="W !?10,""This incident requires a Mortality and Morbidity (M&M) report."""
+5 SET MSSG4="W !?10,""This incident requires Psychological Autopsy."""
+6 SET QANGLB1=$SELECT($DATA(^QA(742,QANDFN,0))#2:^(0),1:"")
SET QANGLB2=$SELECT($DATA(^QA(742.4,QANIEN,0))#2:^(0),1:"")
if QANGLB1']""!(QANGLB2']"")
QUIT
+7 SET INCQAN("SUICIDE")=$ORDER(^QA(742.1,"BUPPER","SUICIDE",0))
+8 SET INCQAN("SUICIDE ATTEMPT")=$ORDER(^QA(742.1,"BUPPER","SUICIDE ATTEMPT",0))
+9 SET INCQAN("SEXUAL ASSAULT")=$ORDER(^QA(742.1,"BUPPER","SEXUAL ASSAULT",0))
+10 SET INCQAN("HOMICIDE")=$ORDER(^QA(742.1,"BUPPER","HOMICIDE",0))
+11 SET INCQAN("PATIENT ABUSE")=$ORDER(^QA(742.1,"BUPPER","PATIENT ABUSE",0))
+12 SET INCQAN("FALL")=$ORDER(^QA(742.1,"BUPPER","FALL",0))
+13 SET INCQAN("TRANSFUSION ERROR")=$ORDER(^QA(742.1,"BUPPER","TRANSFUSION ERROR",0))
+14 SET INCQAN("MEDICATION ERROR")=$ORDER(^QA(742.1,"BUPPER","MEDICATION ERROR",0))
+15 SET INCQAN("INJURY NOT OTHERWISE LISTED")=$ORDER(^QA(742.1,"BUPPER","INJURY NOT OTHERWISE LISTED",0))
+16 SET INCQAN("FIRE-PATIENT INVOLVED IN")=$ORDER(^QA(742.1,"BUPPER","FIRE-PATIENT INVOLVED IN",0))
+17 SET INCQAN("ASSAULT-PATIENT TO PATIENT")=$ORDER(^QA(742.1,"BUPPER","ASSAULT-PATIENT TO PATIENT",0))
+18 SET INCQAN("ASSAULT-PATIENT/STAFF")=$ORDER(^QA(742.1,"BUPPER","ASSAULT-PATIENT/STAFF",0))
+19 SET INCQAN("DEATH")=$ORDER(^QA(742.1,"BUPPER","DEATH",0))
+20 SET INCQAN("MISSING PATIENT")=$ORDER(^QA(742.1,"BUPPER","MISSING PATIENT",0))
+21 SET INCQAN("INFORMED CONSENT-FAIL. TO OBTAIN")=$ORDER(^QA(742.1,"BUPPER","INFORMED CONSENT-FAIL. TO OBTAIN",0))
+22 IF $PIECE(QANGLB2,U,2)=INCQAN("DEATH")
DO DEATH^QANUTL
QUIT
+23 IF $PIECE(QANGLB2,U,2)=INCQAN("SUICIDE")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG4
+24 IF $PIECE(QANGLB2,U,2)=INCQAN("SUICIDE ATTEMPT")
IF ("01"[$PIECE(QANGLB1,U,10))
XECUTE MSSG1
XECUTE MSSG3
+25 IF $PIECE(QANGLB2,U,2)=INCQAN("SUICIDE ATTEMPT")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG3
+26 IF $PIECE(QANGLB2,U,2)=INCQAN("PATIENT ABUSE")
DO ABUSE^QANUTL
QUIT
+27 IF $PIECE(QANGLB2,U,2)=INCQAN("INFORMED CONSENT-FAIL. TO OBTAIN")
XECUTE MSSG1
+28 IF $PIECE(QANGLB2,U,2)=INCQAN("FALL")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
+29 IF $PIECE(QANGLB2,U,2)=INCQAN("FALL")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+30 IF $PIECE(QANGLB2,U,2)=INCQAN("HOMICIDE")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+31 IF $PIECE(QANGLB2,U,2)=INCQAN("MEDICATION ERROR")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
XECUTE MSSG2
+32 IF $PIECE(QANGLB2,U,2)=INCQAN("MEDICATION ERROR")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+33 IF $PIECE(QANGLB2,U,2)=INCQAN("MISSING PATIENT")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
XECUTE MSSG2
+34 IF $PIECE(QANGLB2,U,2)=INCQAN("MISSING PATIENT")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+35 IF $PIECE(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT/STAFF")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
XECUTE MSSG2
+36 IF $PIECE(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT/STAFF")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+37 IF $PIECE(QANGLB2,U,2)=INCQAN("ASSAULT-PATIENT TO PATIENT")
IF ("23"[$PIECE(QANGLB1,U,10))
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+38 IF $PIECE(QANGLB2,U,2)=INCQAN("INJURY NOT OTHERWISE LISTED")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
XECUTE MSSG2
+39 IF $PIECE(QANGLB2,U,2)=INCQAN("INJURY NOT OTHERWISE LISTED")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+40 IF $PIECE(QANGLB2,U,2)=INCQAN("FIRE-PATIENT INVOLVED IN")
IF ("23"[$PIECE(QANGLB1,U,10))
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+41 IF $PIECE(QANGLB2,U,2)=INCQAN("SEXUAL ASSAULT")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
+42 IF $PIECE(QANGLB2,U,2)=INCQAN("TRANSFUSION ERROR")
IF ($PIECE(QANGLB1,U,10)["2")
XECUTE MSSG1
XECUTE MSSG2
+43 IF $PIECE(QANGLB2,U,2)=INCQAN("TRANSFUSION ERROR")
IF ($PIECE(QANGLB1,U,10)["3")
XECUTE MSSG0
XECUTE MSSG1
XECUTE MSSG2
EXIT ;Exit and Quit!
+1 QUIT