BQIRGDBL ;VNGT/HS/ALA-Register 'Multiples' ; 11 Oct 2010 7:19 AM
;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
;
Q
;
EN(HEADR,VALUE,BQIDFN,HFIL,DISPLAY) ;
NEW BQRIEN,HIVIEN,IENS,DA
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 ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S ROOT=$$ROOT^DILFD(HFIL,"",1)
;
S VLU=""
F S VLU=$O(@ROOT@("AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. NEW DA,IENS
. S BQRIEN=@ROOT@("AC",ACMIEN,BQIDFN,VLU)
. S DA=BQRIEN,IENS=$$IENS^DILF(.DA)
. S VALUE(BQRIEN)=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(HFIL,IENS,FLD,"E")
.. I TYPE="C"!(TYPE="T") S VAL=$$GET1^DIQ(HFIL,IENS,FLD,"I")_$C(28)_$$GET1^DIQ(HFIL,IENS,FLD,"E")
.. I TYPE="D" S VAL=$$GET1^DIQ(HFIL,IENS,FLD,"I"),VAL=$$FMTE^BQIUL1(VAL)
.. I TYPE="W" D
... K HARRAY
... S VAL=$$GET1^DIQ(HFIL,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(BQRIEN)=VALUE(BQRIEN)_VAL_"^"
Q
;
DXN(BQIDFN,REG) ;EP - Diagnoses
NEW ACMIEN,VLU,TEXT
;S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
S ACMIEN=$O(^ACM(41.1,"B",REG,""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(44,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S TEXT=TEXT_$P(^ACM(44.1,VLU,0),U,1)_$C(10)_$C(13)
Q $$TKO^BQIUL1(TEXT,$C(10)_$C(13))
;
ONS(BQIDFN) ; EP - Date of Onset for Diabetes Diagnoses
NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(44,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S BDRIEN=$G(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
. S TXT=$$GET1^DIQ(9002244,BDRIEN_",",2,"I") I TXT="" Q
. S TEXT=TEXT_$$FMTE^BQIUL1(TXT)_"; "
Q $$TKO^BQIUL1(TEXT,"; ")
;
SEV(BQIDFN) ; EP - Severity for Diabetes Diagnoses
NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(44,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S BDRIEN=$G(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
. S TXT=$$GET1^DIQ(9002244,BDRIEN_",",1,"E") I TXT="" Q
. S TEXT=TEXT_TXT_"; "
Q $$TKO^BQIUL1(TEXT,"; ")
;
COMP(BQIDFN) ; EP - Complications
NEW ACMIEN,VLU,TEXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(42,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S TEXT=TEXT_$P(^ACM(42.1,VLU,0),U,1)_"; "
Q $$TKO^BQIUL1(TEXT,"; ")
;
CONS(BQIDFN) ; EP - Complications Date of Onset
NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(42,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S BDRIEN=$G(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
. S TXT=$$GET1^DIQ(9002242,BDRIEN_",",1,"I") I TXT="" Q
. S TEXT=TEXT_$$FMTE^BQIUL1(TXT)_"; "
Q $$TKO^BQIUL1(TEXT,"; ")
;
CST(BQIDFN) ; EP - Complications Status
NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(42,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S BDRIEN=$G(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
. S TXT=$$GET1^DIQ(9002242,BDRIEN_",",2,"E") I TXT="" Q
. S TEXT=TEXT_TXT_"; "
Q $$TKO^BQIUL1(TEXT,"; ")
;
COMM(BQIDFN) ; EP - Complications Comments
NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
I ACMIEN="" S ACMIEN=$O(^ACM(41.1,"B","IHS DIABETES",""))
S VLU="",TEXT=""
F S VLU=$O(^ACM(42,"AC",ACMIEN,BQIDFN,VLU)) Q:VLU="" D
. S BDRIEN=$G(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
. ;
Q $$TKO^BQIUL1(TEXT,"; ")
BQIRGDBL ;VNGT/HS/ALA-Register 'Multiples' ; 11 Oct 2010 7:19 AM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
+2 ;
+3 QUIT
+4 ;
EN(HEADR,VALUE,BQIDFN,HFIL,DISPLAY) ;
+1 NEW BQRIEN,HIVIEN,IENS,DA
+2 SET IEN=0
SET HEADR="T00030IEN^"
SET VALUE=""
+3 SET ORD=""
+4 FOR
SET ORD=$ORDER(DISPLAY(ORD))
IF ORD=""
QUIT
Begin DoDot:1
+5 SET HDR=$PIECE(DISPLAY(ORD),U,1)
+6 SET HEADR=HEADR_HDR_"^"
End DoDot:1
+7 ;
+8 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+9 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+10 SET ROOT=$$ROOT^DILFD(HFIL,"",1)
+11 ;
+12 SET VLU=""
+13 FOR
SET VLU=$ORDER(@ROOT@("AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+14 NEW DA,IENS
+15 SET BQRIEN=@ROOT@("AC",ACMIEN,BQIDFN,VLU)
+16 SET DA=BQRIEN
SET IENS=$$IENS^DILF(.DA)
+17 SET VALUE(BQRIEN)=IENS_"^"
+18 ; Get an array of the display order fields
+19 SET ORD=""
+20 FOR
SET ORD=$ORDER(DISPLAY(ORD))
IF ORD=""
QUIT
Begin DoDot:2
+21 SET FLD=$PIECE(DISPLAY(ORD),U,2)
SET TYPE=$PIECE(DISPLAY(ORD),U,3)
+22 IF TYPE'="D"!(TYPE'="X")
SET VAL=$$GET1^DIQ(HFIL,IENS,FLD,"E")
+23 IF TYPE="C"!(TYPE="T")
SET VAL=$$GET1^DIQ(HFIL,IENS,FLD,"I")_$CHAR(28)_$$GET1^DIQ(HFIL,IENS,FLD,"E")
+24 IF TYPE="D"
SET VAL=$$GET1^DIQ(HFIL,IENS,FLD,"I")
SET VAL=$$FMTE^BQIUL1(VAL)
+25 IF TYPE="W"
Begin DoDot:3
+26 KILL HARRAY
+27 SET VAL=$$GET1^DIQ(HFIL,IENS,FLD,"Z","HARRAY")
+28 SET LIEN=0
SET VAL=""
+29 FOR
SET LIEN=$ORDER(HARRAY(LIEN))
IF 'LIEN
QUIT
Begin DoDot:4
+30 SET VAL=VAL_HARRAY(LIEN,0)_$CHAR(10)
End DoDot:4
+31 SET VAL=$$TKO^BQIUL1(VAL,$CHAR(10))
End DoDot:3
+32 SET VALUE(BQRIEN)=VALUE(BQRIEN)_VAL_"^"
End DoDot:2
End DoDot:1
+33 QUIT
+34 ;
DXN(BQIDFN,REG) ;EP - Diagnoses
+1 NEW ACMIEN,VLU,TEXT
+2 ;S ACMIEN=$P($G(^BQI(90508,1,"DM")),"^",2)
+3 SET ACMIEN=$ORDER(^ACM(41.1,"B",REG,""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET TEXT=TEXT_$PIECE(^ACM(44.1,VLU,0),U,1)_$CHAR(10)_$CHAR(13)
End DoDot:1
+7 QUIT $$TKO^BQIUL1(TEXT,$CHAR(10)_$CHAR(13))
+8 ;
ONS(BQIDFN) ; EP - Date of Onset for Diabetes Diagnoses
+1 NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET BDRIEN=$GET(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
+7 SET TXT=$$GET1^DIQ(9002244,BDRIEN_",",2,"I")
IF TXT=""
QUIT
+8 SET TEXT=TEXT_$$FMTE^BQIUL1(TXT)_"; "
End DoDot:1
+9 QUIT $$TKO^BQIUL1(TEXT,"; ")
+10 ;
SEV(BQIDFN) ; EP - Severity for Diabetes Diagnoses
+1 NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET BDRIEN=$GET(^ACM(44,"AC",ACMIEN,BQIDFN,VLU))
+7 SET TXT=$$GET1^DIQ(9002244,BDRIEN_",",1,"E")
IF TXT=""
QUIT
+8 SET TEXT=TEXT_TXT_"; "
End DoDot:1
+9 QUIT $$TKO^BQIUL1(TEXT,"; ")
+10 ;
COMP(BQIDFN) ; EP - Complications
+1 NEW ACMIEN,VLU,TEXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET TEXT=TEXT_$PIECE(^ACM(42.1,VLU,0),U,1)_"; "
End DoDot:1
+7 QUIT $$TKO^BQIUL1(TEXT,"; ")
+8 ;
CONS(BQIDFN) ; EP - Complications Date of Onset
+1 NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET BDRIEN=$GET(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
+7 SET TXT=$$GET1^DIQ(9002242,BDRIEN_",",1,"I")
IF TXT=""
QUIT
+8 SET TEXT=TEXT_$$FMTE^BQIUL1(TXT)_"; "
End DoDot:1
+9 QUIT $$TKO^BQIUL1(TEXT,"; ")
+10 ;
CST(BQIDFN) ; EP - Complications Status
+1 NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET BDRIEN=$GET(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
+7 SET TXT=$$GET1^DIQ(9002242,BDRIEN_",",2,"E")
IF TXT=""
QUIT
+8 SET TEXT=TEXT_TXT_"; "
End DoDot:1
+9 QUIT $$TKO^BQIUL1(TEXT,"; ")
+10 ;
COMM(BQIDFN) ; EP - Complications Comments
+1 NEW ACMIEN,VLU,TEXT,BDRIEN,TXT
+2 SET ACMIEN=$PIECE($GET(^BQI(90508,1,"DM")),"^",2)
+3 IF ACMIEN=""
SET ACMIEN=$ORDER(^ACM(41.1,"B","IHS DIABETES",""))
+4 SET VLU=""
SET TEXT=""
+5 FOR
SET VLU=$ORDER(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
IF VLU=""
QUIT
Begin DoDot:1
+6 SET BDRIEN=$GET(^ACM(42,"AC",ACMIEN,BQIDFN,VLU))
+7 ;
End DoDot:1
+8 QUIT $$TKO^BQIUL1(TEXT,"; ")