source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGOERNOT.m@ 1742

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1DGOERNOT ;ALB/LDB - OERR NOTIFICATIONS ;24 JUN 91
2 ;;5.3;Registration;**118,192**;Aug 13, 1993
3EN ;Entry point from event driver
4ADM D CHK G ADMQ:'DGCHK
5 N Y S Y=$P(DGPMA,"^")
6 I $P(DGPMA,"^",2)=1,'DGPMP S NIEN=18 D DATE S ORBPMSG="Admitted on "_DATE_$S($P(DGPMA,"^",6):" "_$P($G(^DIC(42,+$P(DGPMA,"^",6),0)),U),1:"")_$S($P(DGPMA,"^",7):" RmBd: "_$P($G(^DG(405.4,+$P(DGPMA,"^",7),0)),U),1:"") D NOTE
7DIS I $P(DGPMA,"^",2)=3,$P(DGPMA,"^",18)'=$P(DGPMP,"^",18),"^12^38^"[("^"_$P(DGPMA,"^",18)_"^") S NIEN=20 D DATE S ORBPMSG="Died while an inpatient on "_DATE D NOTE
8ADMQ K DGCHK Q
9 ;
10DATE X ^DD("DD") S DATE=Y K Y
11 Q
12 ;
13CHK S DGCHK=0 I $D(^DD(100,0,"VR")),^("VR")>2.09 S DGCHK=1
14 Q
15 ;
16DEATH ;Entry point from cross-reference on DATE OF DEATH field in PATIENT file
17 D CHK G DEATHQ:'DGCHK
18 S DATE=+^DPT(DA,.35) I $D(^DGPM("APRD",DA,+^DPT(DA,.35))),$D(^DGPM(+$O(^(DATE,0)),0)),"^12^38^"[("^"_$P(^(0),U,18)_"^") K DATE Q
19 N Y S NIEN=20,DFN=DA,Y=$P(^DPT(DA,.35),"^") D DATE S ORBPMSG="Died on "_DATE D NOTE
20DEATHQ K DGCHK Q
21 ;
22UNSCHED ;Entry point from STATUS field in DISPOSITION multiple in PATIENT file
23 D CHK G UNSCHEDQ:'DGCHK
24 N Y Q:X']""!(X>1)
25 I $S('$P(^DPT(DA(1),"DIS",DA,0),U,3)&'$D(DGOERNOT):1,'$D(DGOERNOT):0,(DGOERNOT>1):1,1:0) S DFN=DA(1),NIEN=19,Y=$P(^DPT(DA(1),"DIS",DA,0),"^") D DATE S ORBPMSG="Unscheduled visit on "_DATE D NOTE
26UNSCHEDQ K DGCHK,DGOERNOT Q
27 ;
28NOTE S ORNOTE(NIEN)="",ORVP=DFN_";DPT(" D NOTE^ORX3
29 K DATE,ORNOTE,ORBPMSG Q
Note: See TracBrowser for help on using the repository browser.