source: WorldVistAEHR/trunk/r/INCIDENT_REPORTING-QAN/QANAUX1.m@ 1211

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1QANAUX1 ;;HISC/GJC-UTILITIES FOR INCIDENT REPORTING ;4/26/91
2 ;;2.0;Incident Reporting;**26**;08/07/1992
3 ;
4EN0 ;Mark a incident record for deletion, also the associated patient(s).
5 W !!,$C(7),"This option will allow the user to open, close, or delete a record at the local level.",!,"The appropriate patient(s) records are marked to reflect the change."
6 K DIC,DINUM,DLAYGO S DIC=742.4,DIC(0)="QEAMZ",DIC("A")="Select Incident: "
7 D ^DIC K DIC,DINUM,DLAYGO Q:+Y=-1
8 S QANIEN=+Y K DIE,DR S DIE="^QA(742.4,",DA=QANIEN,DR=".09" D ^DIE K DIE,DR,DA S QAN0=$G(^QA(742.4,QANIEN,0))
9 I $D(Y)!(QAN0="") W !!,$C(7),"No action taken, premature exit action encountered." G KILL
10 S QANMSS(0)="W !!,$C(7),""Appropriate Patient(s) records now being marked as deleted!"""
11 S QANMSS(1)="W !!,$C(7),""Appropriate Patient(s) records now being marked as closed!"""
12 S QANMSS(2)="W !!,$C(7),""Appropriate Patient(s) records now being marked as open!"""
13 X $S(+$P(QAN0,U,8)=2:QANMSS(0),+$P(QAN0,U,8)=0:QANMSS(1),1:QANMSS(2))
14 K DIE,DR S DIE="^QA(742,",DR=$S(+$P(QAN0,U,8)=2:".13///^S X=""-1""",+$P(QAN0,U,8)=0:".13///^S X=""0""",1:".13///^S X=""1""")
15 F QAN=0:0 S QAN=$O(^QA(742,"BCS",QANIEN,QAN)) Q:QAN'>0 S DA=QAN D ^DIE
16KILL K QANIEN,QAN0,QAN,DA,DIE,DR,QANMSS,Y
17 Q
18EN1 ;Choose the MAILGROUP.
19 L +^QA(740,1,0):5 I '$T W !!?16,$C(7),"Another person is editing this entry." Q
20 K DA,DIE,DR S DIE="^QA(740,",DA=1,DR="[QAQA QAN SITE PARAMETERS]" D ^DIE
21 L -^QA(740,1,0)
22 K %X,%Y,D,D0,DA,DI,DIC,DIE,DQ,DR
23 Q
24EN2 ;INCIDENT STATUS ENTER/EDIT
25 S (DIC,DIE)="^QA(742.1,",DIC("A")="Select Incident Type: ",DIC(0)="QEALMNZ",D="B^BUPPER",DIC("S")="I $P(^(0),U,6)'=""N"""
26 D MIX^DIC1 K DIC,DINUM,DLAYGO Q:+Y=-1
27 S QANQAN=+Y,DA=QANQAN
28 I $P(Y,U,3)=1 S DR=".07///"_"L" D ^DIE
29 L +^QA(742.1,QANQAN,0):5 I '$T W !!?16,$C(7),"Another person is editing this entry." Q
30 S DR=".01 INCIDENT" D ^DIE
31 I $D(Y) L -^QA(742.1,QANQAN,0) Q
32 S QAN0=$G(^QA(742.1,QANQAN,0))
33 S DA=QANQAN,DR=".02;.04;.06" D ^DIE ;remove .03 and .05 from DR in QAN26
34 K DIR S DIR(0)="SA^1:INACTIVE;L:LOCAL",DIR("A")="Incident Status: "
35 S DIR("?")="Enter ""1"" for Inactive, ""L"" for Local."
36 S DIR("B")=$S($P(QAN0,U,6)="L":"LOCAL",1:"INACTIVE") D ^DIR K DIR
37 I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) L -^QA(742.1,QANQAN,0) Q
38 S DR=$S(Y=1:".07///1",1:".07///L") D ^DIE
39 L -^QA(742.1,QANQAN,0)
40 Q
41EN3 ;Choose X again.
42 W !!?5,$C(7),"Number """_X_""" previously chosen, try again"
43 K X
44 Q
45HDR ;Header generator.
46 S PAGE=PAGE+1 W @IOF,!,?$S(IOM=132:114,1:69),TODAY,!,?$S(IOM=132:114,1:69),"Page: ",PAGE,!!
47 W ?(IOM-$L(QANHEAD(0))\2),QANHEAD(0)
48 I $D(QANCHOS),QANCHOS="I" W !,?(IOM-$L(QANHEAD(1))\2),QANHEAD(1)
49 I '$D(QANCHOS) W !,?(IOM-$L(QANHEAD(1))\2),QANHEAD(1)
50 I $D(QANCHOS),QANCHOS="W" W !,?(IOM-$L(QANHEAD(2))\2),QANHEAD(2)
51 W !,?(IOM-$L(QANHEAD(3))\2),QANHEAD(3),!
52 I $G(QANDVFLG)=1 W !,?(IOM-$L(QANHEAD(4))\2),QANHEAD(4),!
53 F LOOP=1:1:2 W BNDRY,!
54 W:$D(QANCHOS) !,$S(QANCHOS="I":"INCIDENT LOCATION",1:"PATIENT'S WARD"),?35,"INCIDENT",?70,"NUMBER",!,"------------------",?35,"--------",?70,"------",!
55 W:'$D(QANCHOS) !?17,"INCIDENT",?57,"NUMBER",!?17,"--------",?57,"------"
56 Q
57WARN ;Deleting a patient's record.
58 W !?5,"Patient: ",$P(^DPT($P(^QA(742,QANPAT,0),U),0),U)_"// "
59WARN1 F QAN=0:0 R QANST:DTIME S:'$T QANST="^" Q:QANST?1"@"!(QANST']"")!(QANST["^") W !!?5,$C(7),"Enter ""@"" to delete a record, <CR> to keep the patient active.",!!?5,"Patient: ",$P(^DPT($P(^QA(742,QANPAT,0),U),0),U)_"// "
60 Q:QANST["^"!(QANST']"")
61WARN2 ;Checks for associated incident deletion
62 S QANYN=0
63 I QANST["@" W !!,$C(7),"Are you sure you want to delete?",!,"Deletion marks the associated incident as deleted."
64 I K DIR S DIR(0)="Y" D ^DIR S QANYN=+Y
65 I QANYN K DA,DIE,DR S DIE="^QA(742,",DA=QANPAT,DR=".13///^S X=""-1""" D ^DIE K DA,DIE,DR S DIE="^QA(742.4,",DA=QANINCD,DR=".09///^S X=""2""" D ^DIE K DA,DIE,DR
66 I QANYN D AUDIT
67 ;CODE TO DELETE A PATIENT AND DELETE AN INCIDENT
68 Q
69AUDIT ;Enter entries in the QA Audit file.
70 K QAUDIT S QAUDIT("FILE")="742^50",QAUDIT("DA")=QANPAT,QAUDIT("ACTION")="d",QAUDIT("COMMENT")="Delete a patient record" D ^QAQAUDIT
71 K QAUDIT S QAUDIT("FILE")="742.4^50",QAUDIT("DA")=QANINCD,QAUDIT("ACTION")="d",QAUDIT("COMMENT")="Delete an incident record" D ^QAQAUDIT
72 Q
Note: See TracBrowser for help on using the repository browser.