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

BKMVFLD.m

Go to the documentation of this file.
BKMVFLD ;PRXM/HC/CLT - SELECT THE SUBFILE AND FIELD NUMBER ; 17 Mar 2005  5:40 PM
 ;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
 QUIT
 ;
FLDINFO(BKMVIEN) ;EP - Called by EN1^BKMVAUP - Determine field name based on IEN from File 90455
 ; Replaced former call to ^BKMVFLD 
 ; Input variables:
 ;  BKMVIEN - IEN from File 90455 Audit
 ; Output variables:
 ;  Returns FIELDNAME^FIELDTYP
 N BKMFLDNO,BKMFLDNM,BKMFLDTY,BKMFILNO,BKMV
 S (BKMFLDNM,BKMFLDTY,BKMFILNO,BKMFLDNO)=""
 S BKMFLDNO=$$GET1^DIQ(90455,BKMVIEN_",",3)
 I BKMFLDNO'="" D
 . ; Determine the appropriate subfile reference, if necessary
 . S BKMFILNO=$S(BKMFLDNO>40&(BKMFLDNO<50):90451.03,BKMFLDNO>50:90451.07,1:90451.01)
 . ;I BKMFLDNO>20,BKMFLDNO<40 S BKMFLDNO=BKMFLDNO-20
 . I BKMFLDNO>40,BKMFLDNO<41 S BKMFLDNO=$S(BKMFLDNO=40.01:.01,BKMFLDNO=40.1:1,BKMFLDNO=40.2:2,BKMFLDNO=40.3:3,1:"")
 . I BKMFLDNO>50,BKMFLDNO<51 S BKMFLDNO=$S(BKMFLDNO=50.01:.01,BKMFLDNO=50.1:1,BKMFLDNO=50.2:2,1:"")
 . ;I BKMFLDNO>41 S BKMFLDNO=$S(BKMFLDNO=41.1:1,1:.01)
 . I BKMFILNO'="",BKMFLDNO'="" D
 . . K BKMV
 . . D FIELD^DID(BKMFILNO,BKMFLDNO,"","LABEL;TYPE","BKMV")
 . . S BKMFLDNM=$G(BKMV("LABEL"))
 . . S BKMFLDTY=$G(BKMV("TYPE"))
 . . K BKMV
 Q BKMFLDNM_"^"_BKMFLDTY_"^"_BKMFILNO_"^"_BKMFLDNO
 ;
CODEDESC(BKMFILNO,BKMFLDNO,BKMFLD) ; EP
 N BKMDESC,BKMSLCT,BKMSET,BKMI
 S BKMDESC=""
 S BKMSET=$$GET1^DID(BKMFILNO,BKMFLDNO,"","POINTER")
 I $L(BKMSET,";")>1 D
 . ;S BKMSET=$TR(BKMSET,";",",")
 . S BKMSLCT=""
 . ; Loop through SET of CODES to build $SELECT statement
 . F BKMI=1:1:$L(BKMSET,";")-1 D
 . . S BKMSLCT=BKMSLCT_"BKMFLD="""_$P($P(BKMSET,";",BKMI),":",1)_""":"""_$P($P(BKMSET,";",BKMI),":",2)_""","
 . S BKMSLCT=BKMSLCT_"1:"""""
 . S BKMSLCT="S BKMDESC=$S("_BKMSLCT_")"
 . X BKMSLCT
 Q BKMDESC
 ;
PNTRDESC(BKMFILNO,BKMFLDNO,BKMFLD) ; EP
 N BKMDESC,BKMSPCFR,BKMPFLNO
 S BKMDESC=""
 S BKMSPCFR=$$GET1^DID(BKMFILNO,BKMFLDNO,"","SPECIFIER")
 I BKMSPCFR'="" D
 . S BKMPFLNO=$P($P(BKMSPCFR,"P",2),"'",1)
 . I BKMPFLNO'="" S BKMDESC=$$GET1^DIQ(BKMPFLNO,BKMFLD_",",.01,"E")
 Q BKMDESC
 ;
 ;