source: FOIAVistA/trunk/r/INCIDENT_REPORTING-QAN/QANMAL0.m@ 1553

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1QANMAL0 ;HISC/GJC-Manually xmit data to the region (part 2) ;8/23/93 11:05
2 ;;2.0;Incident Reporting;**1,18,20**;08/07/1992
3 ;
4EN1 ;Patient data
5 F QAN1=0:0 S QAN1=$O(^QA(742,"BCS",QANIEN,QAN1)) Q:QAN1'>0 D
6 . S QAN742=$G(^QA(742,QAN1,0))
7 . I QAN742]"" S QANRSRV=0 D PAT
8 Q
9BULL ;Mail message
10 D KILL^XM
11 ;S QANSERV="CEBELINSKI,G",QANDOM="SUP.QUA.ISC-CHICAGO.VA.GOV"
12 S XMY(QANSERV_"@"_QANDOM)="",XMDUZ=.5
13 S XMSUB="QAN Incident Event (Manual): "_^DD("SITE")_" ("_^DD("SITE",1)_")"
14 S XMTEXT="^UTILITY($J,""QAN MAIL""," D ^XMD,KILL^XM
15 Q
16PAT ;Patient data
17 S QANSLEV=+$P(QAN742,U,10)
18 S (QANSRVCE,Y)=$P(QAN742,U,8),C=$P(^DD(742,.08,0),U,2) D:Y]"" Y^DIQ S QANSRVCE=$E(Y,1,35)
19 S QANINCR=QANINCR+1,QANQUIT=1
20 S (DFN,QANPAT)=$P(QAN742,U),QANDOB=$P(^DPT(DFN,0),U,3)
21 S ^UTILITY($J,"QAN PAT",QAN1)=$P(^DPT(QANPAT,0),U)
22 S:$D(^QA(742,QAN1,1,0)) QANRSRV=1
23 I +$P(QAN742,U,5) D
24 . S VAINDT=$G(QANDATE) D:VAINDT]"" INP^VADPT
25 . S QANADMIT=$P($G(VAIN(7)),U)
26 S ^UTILITY($J,"QAN SSN",QAN1)=$P(^DPT(QANPAT,0),U,9)
27 S ^UTILITY($J,"QAN MAIL",QANINCR)=QABANNER_"^"_$G(QANCASE)_"^INCD^"_$G(QANINCD)_"^"_$G(QANDATE)_"^"_$G(QANLVL)_"^"_$G(QANLRIN)_"^"_$G(QANLRCP)_"^"_$G(QANMLGP(0))_"^"_$G(VA1026)_"^"_$G(QANINLOC)_"^"_$G(QANPROV)_"^"
28 I QANDESC,$D(^UTILITY($J,"W",DIWL)) F QANY=0:0 S QANY=$O(^UTILITY($J,"W",DIWL,QANY)) Q:QANY'>0 S QANINCR=QANINCR+1,^UTILITY($J,"QAN MAIL",QANINCR)=QABANNER_"^"_QANCASE_"^DESC^"_^UTILITY($J,"W",DIWL,QANY,0)_"^"
29 I QANRSRV D
30 . S QAN=0
31 . F S QAN=$O(^QA(742,QAN1,1,QAN)) Q:QAN'>0 D
32 .. S QANRSRV("I")=$P($G(^QA(742,QAN1,1,QAN,0)),U)
33 .. Q:QANRSRV("I")']""
34 .. S QANRSRV("X")=$P($G(^ECC(730,QANRSRV("I"),0)),U)
35 .. S QANINCR=QANINCR+1
36 .. S ^UTILITY($J,"QAN MAIL",QANINCR)=QABANNER_"^"_$G(QANCASE)_"^RSRV^"_QANRSRV("X")_"^"
37 S QANINCR=QANINCR+1
38 S ^UTILITY($J,"QAN MAIL",QANINCR)=QABANNER_"^"_$G(QANCASE)_"^PAT^"_$G(^UTILITY($J,"QAN PAT",QAN1))_"^"_$G(^UTILITY($J,"QAN SSN",QAN1))_"^"_$G(QANSLEV)_"^"_$G(QANTYDTH)_"^"_$G(QANSRVCE)_"^"_$G(QANADMIT)_"^"_$G(QANDOB)_"^"
39 Q
Note: See TracBrowser for help on using the repository browser.