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

BCHALD.m

Go to the documentation of this file.
BCHALD ; IHS/CMI/LAB - PCC LINK - NO LONGER USED ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;
 ;
EP ;
 Q   ;PER V2.0 SPECS NO PCC LINK
 D PCCCHECK
 I $G(BCHQUIT) D EOJ Q  ;something is wrong or don't want to pass  data
 K BCHV("VISIT"),BCHV("VFILES")
 D ^BCHABCH
 D EOJ
 Q
PCCCHECK ;check to see if link to pcc active, set BCHLPCC IF SO
 I '$D(^AUTTSITE(1,0)) S BCHQUIT=1 Q  ;no site file
 I $P(^AUTTSITE(1,0),U,8)'="Y" S BCHQUIT=2 Q  ;pcc not running 
 I '$D(^APCCCTRL(DUZ(2),0))#2 S BCHQUIT=3 Q  ;no pcc master control file entry
 I $G(BCHPKG)="" S BCHQUIT=4 Q  ;required variable not passed
 I 'BCHPKG S BCHQUIT=5 Q  ;no package entry
 S BCHPKG("NAME")=$P(^DIC(9.4,BCHPKG,0),U)
 I '$D(^APCCCTRL(DUZ(2),11,BCHPKG,0))#2 S BCHQUIT=6 Q  ;no pcc master control entry for package
 I '$P(^APCCCTRL(DUZ(2),11,BCHPKG,0),U,2) S BCHQUIT=7 Q  ;don't want to pass data
 Q
 ;
EOJ ;
 K BCHPKG,BCHQUIT,BCHERR,XMB,BCHDUZ,BCHVL,BCHVI,BCHV("VISIT"),BCHV("VFILES")
 Q
LBULL ;EP - SEND BULLETIN - LINK FAILURE
 ;pass BCHERR as narrative
 ;DFN=patient
 ;BCHDATK=date of encounter
 ;BCHIEN=package ien of entry
 ;K XMB
 ;S XMB(1)=BCHIEN,XMB(2)=$P(^DPT(DFN,0),U)_" (IEN "_DFN_")",Y=BCHDATK D DD^%DT
 ;S XMB(8)=$$VAL^XBDIQ1(90002,BCHIEN,.03),XMB(9)=$$VAL^XBDIQ1(90002,BCHIEN,.02)
 ;S XMB(3)=Y,XMB(4)=BCHERR,XMB(5)=$G(BCHPKG("NAME")),XMB(6)=BCHFILE,XMB(7)=$$HRN^AUPNPAT(DFN,DUZ(2)),XMB="BCH PCC PACKAGE LINK FAIL",BCHDUZ=DUZ,DUZ=.5
 ;D ^XMB S DUZ=BCHDUZ K XMB,BCHERR
 Q
COMPLETE ;EP complete visit protocol call
 S BCHV("VISIT","9000010")=BCHVSIT
 I '$D(BCHV("VFILES")) S BCHVFLE=9000010 F BCHVL=0:0 S BCHVFLE=$O(^DIC(BCHVFLE)) Q:BCHVFLE>9000010.99!(BCHVFLE'=+BCHVFLE)  D COMP2
 D UPDPCC^BCHUTIL
 K BCHV,X,Y,BCHVFLE,BCHVDG,BCHVIGR,BCHVDFN
 Q
COMP2 ;
 S BCHVDG=^DIC(BCHVFLE,0,"GL"),BCHVIGR=BCHVDG_"""AD"",BCHVSIT,BCHVDFN)"
 S BCHVDFN="" F BCHVI=1:1 S BCHVDFN=$O(@BCHVIGR) Q:BCHVDFN=""  S BCHV(BCHVFLE,BCHVDFN)=""
 Q
 ;
 ;