source: FOIAVistA/trunk/r/INCIDENT_REPORTING-QAN/QANUTL.m@ 1742

Last change on this file since 1742 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1QANUTL ;;HISC/GJC-Utilities for Incident Reporting ;10/6/92
2 ;;2.0;Incident Reporting;**1,3,32**;08/07/1992;Build 3
3EN0 ;Sets up and builds the patients ID.
4 S QANDFN(0)=X,QANZERO(3)=^DPT(QANDFN(0),0),QANAME=$P(QANZERO(3),U),QANSSN=$P(QANZERO(3),U,9)
5 S QANPID=$$QANPID^QANCDNT(QANAME)
6 K QANDFN(0),QANZERO(3),QANAME,QANSSN
7 Q
8EN1 ;Used for DIC("W") used in QANMAIL and QANVAL.
9 I QANTYPE=1 S QANTEMP=Y,Y=$P(^QA(742.4,+Y,0),U,3) X ^DD("DD") W " "_Y_" " S Y=QANTEMP W $P(^QA(742.1,$P(^QA(742.4,+Y,0),U,2),0),U) K QANTEMP Q
10 I QANTYPE=2 W " "_$P(^QA(742.1,$P(^QA(742.4,+Y,0),U,2),0),U) Q
11 I QANTYPE=4 S QANTEMP=Y,Y=$P(^QA(742.4,+QANTEMP,0),U,3) X ^DD("DD") W " "_Y S Y=QANTEMP K QANTEMP
12 Q
13EN10 ;Medication Errors (Other).
14 K DIE,DR S DIE="^QA(742,",DR=".14",DA=QANDFN D ^DIE K DA,DR,DIE
15 Q
16HOMCIDE ;Patient Abuse changed to Homicide.
17 W !!,*7,"Incident: Patient Abuse Severity Level: Death (3)"
18 W !,"Changed to Incident: Homicide Severity Level: Death (3)",!!,*7
19 K DA,DIE,DR
20 S DA=QANIEN,DIE="^QA(742.4,",DR=".02///"_$O(^QA(742.1,"BUPPER","HOMICIDE",0)) D ^DIE
21 K DA,DIE,DR
22 S:$G(QANIRIN)]"" QANIRIN=+$O(^QA(742.1,"BUPPER","HOMICIDE",0))
23 Q
24SUIATMP ;Suicide Attempt changed to Suicide.
25 W !!,*7,"Incident: Suicide Attempt Severity Level: Death (3)"
26 W !,"Changed to Incident: Suicide Severity Level: Death (3)",!!,*7
27 K DA,DIE,DR
28 S DA=QANIEN,DIE="^QA(742.4,",DR=".02///"_$O(^QA(742.1,"BUPPER","SUICIDE",0)) D ^DIE
29 K DA,DIE,DR
30 S:$G(QANIRIN)]"" QANIRIN=+$O(^QA(742.1,"BUPPER","SUICIDE",0))
31 Q
32ABUSE ;Abuse Message
33 I +$P(QANGLB1,U,10)=0 X MSSG1,MSSG2
34 E X MSSG0,MSSG1,MSSG2
35 Q
36DEATH ;Special broadcasts for 'Death' cases.
37 S DTHQAN("DEATH CONJ PROC")=$O(^QA(742.14,"BUPPER","CONJUNCTION WITH A PROCEDURE",0))
38 S DTHQAN("DURING ANES.")=$O(^QA(742.14,"BUPPER","DURING INDUCTION OF ANES.",0))
39 S DTHQAN("DIAG/TREAT")=$O(^QA(742.14,"BUPPER","FAILURE TO DIAGNOSE OR TREAT",0))
40 S DTHQAN("MED CNTR GRNDS")=$O(^QA(742.14,"BUPPER","ON MEDICAL CENTER GROUNDS",0))
41 S DTHQAN("OR")=$O(^QA(742.14,"BUPPER","OPERATING ROOM",0))
42 S DTHQAN("RR")=$O(^QA(742.14,"BUPPER","RECOVERY ROOM",0))
43 S DTHQAN("EQUIPT")=$O(^QA(742.14,"BUPPER","EQUIPMENT MALFUNCTION",0))
44 S DTHQAN("48 HOURS")=$O(^QA(742.14,"BUPPER","WITHIN 48 HOURS OF SURGERY",0))
45 S DTHQAN("CASES M.E.")=$O(^QA(742.14,"BUPPER","CASES ACCEPTED BY M.E.",0))
46 I +$P(QANGLB2,U,14)=DTHQAN("CASES M.E.") X MSSG0,MSSG1
47 I +$P(QANGLB2,U,14)=DTHQAN("DEATH CONJ PROC") X MSSG1
48 I +$P(QANGLB2,U,14)=DTHQAN("DURING ANES.") X MSSG1
49 I +$P(QANGLB2,U,14)=DTHQAN("DIAG/TREAT") X MSSG1,MSSG2
50 I +$P(QANGLB2,U,14)=DTHQAN("MED CNTR GRNDS") X MSSG1
51 I +$P(QANGLB2,U,14)=DTHQAN("OR") X MSSG1
52 I +$P(QANGLB2,U,14)=DTHQAN("RR") X MSSG1
53 I +$P(QANGLB2,U,14)=DTHQAN("EQUIPT") X MSSG0,MSSG1,MSSG2
54 I +$P(QANGLB2,U,14)=DTHQAN("48 HOURS") X MSSG1
55 K DTHQAN
56 Q
Note: See TracBrowser for help on using the repository browser.