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

AMHEXC1.m

Go to the documentation of this file.
AMHEXC1 ; IHS/CMI/LAB - RECORD REVIEW PROCESS ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
 ;
START ;
 S (AMHBT,AMHBTH)=$H,AMHJOB=$J,AMH("ERROR COUNT")=0,AMHO("RUN")="NEW"
 D DATE,XIT
 Q
 ;
DATE ; Run by encounter date
 S X1=AMHBD,X2=-1 D C^%DTC S AMHSD=X
 S AMHODAT=AMHSD_".9999" F  S AMHODAT=$O(^AMHREC("AEX",AMHODAT)) Q:AMHODAT=""!((AMHODAT\1)>AMHED)  D D1
 Q
 ;
XIT ;
 S AMHET=$H
 D EOJ
 Q
EOJ ;
 Q
D1 ;
 S (AMHR,AMHRCNT)=0 F  S AMHR=$O(^AMHREC("AEX",AMHODAT,AMHR)) Q:AMHR'=+AMHR  S AMHREC=^AMHREC(AMHR,0) D PROC
 Q
PROC ;
 K AMHE,AMHTX D RECORD^AMHEXD2
 Q:AMHE=""
 S AMH("ERROR COUNT")=AMH("ERROR COUNT")+1
 S AMHE("ERR DFN")=$O(^AMHERR("B",AMHE,"")) I AMHE("ERR DFN")="" S AMHE("MSG")=AMHE_"-ERROR INFORMATION NOT IN ERROR FILE" G ERR
 S AMHE("MSG")=AMHE_"-"_$P(^AMHERR(AMHE("ERR DFN"),0),U,2) S:$L(AMHE("MSG"))=5 AMHE("MSG")=AMHE("MSG")_"- ERROR INFORMATION NOT IN ERROR FILE" S AMHE("MSG")=$E(AMHE("MSG"),1,45)
ERR S ^XTMP("AMHEXC",AMHJOB,AMHBT,"ERRORS",AMHR)=AMHE("MSG")
 Q
 ;