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

QANUTL5.m

Go to the documentation of this file.
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