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

BQIRGHML.m

Go to the documentation of this file.
BQIRGHML ;PRXM/HC/ALA-HMS Multiples ; 07 Nov 2007  7:21 PM
 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
 ;
 Q
 ;
EN(HEADR,VALUE,BQIDFN,HFIL,HFLD,DISPLAY) ;
 NEW BQRIEN,HIVIEN,IENS,DA
 D FIELD^DID(HFIL,HFLD,"","GLOBAL SUBSCRIPT LOCATION;SPECIFIER","HARRAY")
 S NOD=$P($G(HARRAY("GLOBAL SUBSCRIPT LOCATION")),";",1)
 S SBFIL=$G(HARRAY("SPECIFIER"))
 S SBFIL=$$STRIP^XLFSTR(SBFIL,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")
 S IEN=0,HEADR="T00030IEN^",VALUE=""
 S ORD=""
 F  S ORD=$O(DISPLAY(ORD)) Q:ORD=""  D
 . S HDR=$P(DISPLAY(ORD),U,1)
 . S HEADR=HEADR_HDR_"^"
 ;
 S BQRIEN=$$BKMIEN^BKMIXX3(BQIDFN) I BQRIEN="" Q ""
 S HIVIEN=$$HIVIEN^BKMIXX3() I HIVIEN="" Q ""
 ;
 F  S IEN=$O(^BKM(90451,BQRIEN,1,HIVIEN,NOD,IEN)) Q:'IEN  D
 . NEW DA,IENS
 . S DA(2)=BQRIEN,DA(1)=HIVIEN,DA=IEN,IENS=$$IENS^DILF(.DA)
 . S VALUE(IEN)=IENS_"^"
 . ; Get an array of the display order fields
 . S ORD=""
 . F  S ORD=$O(DISPLAY(ORD)) Q:ORD=""  D
 .. S FLD=$P(DISPLAY(ORD),U,2),TYPE=$P(DISPLAY(ORD),U,3)
 .. I TYPE'="D"!(TYPE'="X") S VAL=$$GET1^DIQ(SBFIL,IENS,FLD,"E")
 .. I TYPE="C"!(TYPE="T") S VAL=$$GET1^DIQ(SBFIL,IENS,FLD,"I")_$C(28)_$$GET1^DIQ(SBFIL,IENS,FLD,"E")
 .. I TYPE="D" S VAL=$$GET1^DIQ(SBFIL,IENS,FLD,"I"),VAL=$$FMTE^BQIUL1(VAL)
 .. I TYPE="W" D
 ... K HARRAY
 ... S VAL=$$GET1^DIQ(SBFIL,IENS,FLD,"Z","HARRAY")
 ... S LIEN=0,VAL=""
 ... F  S LIEN=$O(HARRAY(LIEN)) Q:'LIEN  D
 .... S VAL=VAL_HARRAY(LIEN,0)_$C(10)
 ... S VAL=$$TKO^BQIUL1(VAL,$C(10))
 .. S VALUE(IEN)=VALUE(IEN)_VAL_"^"
 Q