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

BGOUTL3.m

Go to the documentation of this file.
BGOUTL3 ; IHS/BAO/TMD - Utilities (continued)  ;11-Jul-2013 13:22;du
 ;;1.1;BGO COMPONENTS;**11,13**;Mar 20, 2007;Build 13
GETSET(RET,BGOFILE,BGOFLD,BGOCHK) ;gets set of codes
 ; RET(n)=code^text for code
 N BGOPCC,BGOPCCL,BGOPCCC,BGOLO,BGOHI,BGOPCCD,BGOPCCT
 S BGOCHK=$G(BGOCHK)
 S BGOLO="abcdefghijklmnopqrstuvwxyz"
 S BGOHI="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 D FIELD^DID(BGOFILE,BGOFLD,"","POINTER","BGOPCC","BGOPCC")
 S BGOPCCL=$L(BGOPCC("POINTER"),";")-1
 F BGOPCCC=1:1:BGOPCCL D
 . S BGOPCCD=$P($P(BGOPCC("POINTER"),";",BGOPCCC),":",1)
 . S BGOPCCT=$P($P(BGOPCC("POINTER"),";",BGOPCCC),":",2)
 . I BGOCHK'="" D CHK(BGOFILE,BGOPCCD,BGOCHK)
 . I BGOCHK="" S RET(BGOPCCC)=BGOPCCD_"^"_$E(BGOPCCT)_$TR($E(BGOPCCT,2,99),BGOHI,BGOLO)
 Q
CHK(BGOFILE,BGOPCCD,BGOCHK) ;See which codes are acceptable for this file
 N IEN,C
 I BGOFILE=9000010.13 D  Q         ;EXAM FILE
 .S IEN="" S IEN=$O(^AUTTEXAM("B",BGOCHK,IEN))
 .I IEN="" S BGOCHK="" Q
 .S C=$P($G(^AUTTEXAM(IEN,0)),U,2)
 .S X=BGOPCCD
 .D EXAM
 .I $D(X) S RET(BGOPCCC)=BGOPCCD_"^"_$E(BGOPCCT)_$TR($E(BGOPCCT,2,99),BGOHI,BGOLO)
 Q
EXAM ;Check exam codes
 I X="RF" Q  ;referral good for all exam types
 I X="PA",C'=34 K X Q
 I X="PR",C'=34 K X Q
 I X="PAP",C'=34 K X Q
 I X="A",C=34 K X Q
 I X="A",C=35 K X Q
 I X="A",C=36 K X Q
 I X="PO",(C'=35&(C'=36)) K X Q
 I X="L",(C'=42&(C'=43)) K X Q
 I X="M",(C'=42&(C'=43)) K X Q
 I X="H",(C'=42&(C'=43)) K X Q
 I C=42!(C=43),X'="L",X'="M",X'="H" K X Q
 Q