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

BQIUTB4.m

Go to the documentation of this file.
BQIUTB4 ;GDIT/HS/ALA-Tables ; 05 Dec 2012  12:40 PM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
 ;
ACM(DATA) ;EP - ACM Registers
 NEW RN
 S II=0,RN=0
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 F  S RN=$O(^ACM(41.1,RN)) Q:'RN  D
 . I $G(^ACM(41.1,RN,0))="" Q
 . I $P(^ACM(41.1,RN,0),U,14)'=1 Q
 . I '$D(^ACM(41.1,RN,"AU",DUZ)) Q
 . S II=II+1,@DATA@(II)=RN_U_$P(^ACM(41.1,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
WARD(DATA) ;EP - Ward
 NEW RN
 S II=0,RN=0
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 F  S RN=$O(^DIC(42,RN)) Q:'RN  D
 . S II=II+1,@DATA@(II)=RN_U_$P(^DIC(42,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
FSPEC(DATA) ;EP - Treating Specialty
 NEW RN,N
 S II=0,RN=0
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 F  S RN=$O(^DIC(45.7,RN)) Q:'RN  D
 . I '$D(^DIC(45.7,RN,"E")) Q
 . S N=0
 . F  S N=$O(^DIC(45.7,RN,"E",N)) Q:'N  D
 .. I $P(^DIC(45.7,RN,"E",N,0),"^",2)'=1 Q
 .. S II=II+1,@DATA@(II)=RN_U_$P(^DIC(45.7,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
IATYP(DATA) ; EP - Admit Type
 NEW RN
 S II=0,RN=0
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 F  S RN=$O(^DG(405.1,RN)) Q:'RN  D
 . I $$GET1^DIQ(405.1,RN_",",.02,"E")'="ADMISSION" Q
 . I $P(^DG(405.1,RN,0),U,4)'=1 Q
 . S II=II+1,@DATA@(II)=RN_U_$P(^DG(405.1,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
IDTYP(DATA) ; EP - Discharge type
 NEW RN
 S II=0,RN=0
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 F  S RN=$O(^DG(405.1,RN)) Q:'RN  D
 . I $$GET1^DIQ(405.1,RN_",",.02,"E")'="DISCHARGE" Q
 . I $P(^DG(405.1,RN,0),U,4)'=1 Q
 . S II=II+1,@DATA@(II)=RN_U_$P(^DG(405.1,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
EDTYP(DATA) ; EP - ER Disposition type
 NEW RN,ETY
 S II=0,RN=""
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 S ETY=$$FIND1^DIC(9009082,"","MOX","DISPOSITION","","","ERROR")
 F  S RN=$O(^AMER(3,"AC",ETY,RN)) Q:RN=""  D
 . S II=II+1,@DATA@(II)=RN_U_$P(^AMER(3,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
EVTYP(DATA) ; EP - ER Visit type
 NEW RN,ETY
 S II=0,RN=""
 S @DATA@(II)="T00010IEN^T00030"_$C(30)
 S ETY=$$FIND1^DIC(9009082,"","MOX","VISIT TYPE","","","ERROR")
 F  S RN=$O(^AMER(3,"AC",ETY,RN)) Q:RN=""  D
 . S II=II+1,@DATA@(II)=RN_U_$P(^AMER(3,RN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
EDACU(DATA) ;EP - ER Acuity
 S II=0,@DATA@(II)="T00010IEN^T00060"_$C(30)
 F I=1:1:5 S II=II+1,@DATA@(II)=I_U_"Acuity Level "_I_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
PRFC(DATA) ; EP - Preferred Communication
 NEW FLAG,VALUE,BJ,CODE,TEXT
 S II=0
 S @DATA@(II)="T00001CODE^T00030"_$C(30)
 S VALUE=$P(^DD(9000001,4002,0),U,3)
 F BJ=1:1:$L(VALUE,";") D
 . S CODE=$P(VALUE,";",BJ) Q:CODE=""
 . S TEXT=$P(CODE,":",2)
 . S II=II+1,@DATA@(II)=$P(CODE,":",1)_"^"_TEXT_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
ETOP(DATA) ; EP - Education Topics
 NEW LN,VALUE,TOP
 S II=0,LN=0
 S @DATA@(II)="T00030IEN^T00060"_$C(30)
 F  S LN=$O(^AUTTEDMT(LN)) Q:'LN  D
 . S II=II+1,@DATA@(II)=LN_U_$P(^AUTTEDMT(LN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
EDUC(DATA) ;EP - Education
 NEW LN
 S II=0,LN=0
 S @DATA@(II)="T00010IEN^T00060"_$C(30)
 F  S LN=$O(^AUPNVPED("B",LN)) Q:LN=""  D
 . I $G(^AUTTEDT(LN,0))="" Q
 . I $P(^AUTTEDT(LN,0),U,3)'="" Q
 . S II=II+1,@DATA@(II)=LN_U_$P(^AUTTEDT(LN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
TMFRAM(DATA,PARM) ;EP - List of timeframes by parameter
 NEW LN,BZ
 K BZ
 S II=0,LN=""
 S @DATA@(II)="T00010IEN^T00060"_$C(30)
 S II=II+1,@DATA@(II)="0^"_$C(30)
 S ORD=""
 F  S ORD=$O(^BQI(90506.9,"D",PARM,ORD)) Q:ORD=""  D
 . S LN=$O(^BQI(90506.9,"D",PARM,ORD,""))
 . S II=II+1,@DATA@(II)=LN_U_$P(^BQI(90506.9,LN,0),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
EPICK(DATA) ;EP - EHR Education Picklists
 NEW RET,INP,LN
 S $P(INP,U,3)=DUZ,$P(INP,U,5)=0
 D GETCATS^BGOEDTPR(.RET,INP)
 S II=0,@DATA@(II)="T00010IEN^T00060"_$C(30)
 S LN=0
 F  S LN=$O(@RET@(LN)) Q:LN=""  D
 . S II=II+1,@DATA@(II)=$P(@RET@(LN),U,2)_U_$P(@RET@(LN),U,1)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 K @RET
 Q
 ;
PKIT(DATA,PICK) ;EP - BQI GET PICKLIST ITEMS
 NEW UID,II,LN,RET
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUTB4P",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIUTB1 D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010IEN^T00030ED_ITEM"_$C(30)
 D GETITEMS^BGOEDTPR(.RET,PICK)
 S LN=0
 F  S LN=$O(@RET@(LN)) Q:LN=""  D
 . S II=II+1,@DATA@(II)=$P(@RET@(LN),U,1)_U_$P(@RET@(LN),U,2)_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 K @RET
 Q
 ;
MTIT(DATA,TOP) ;EP - BQI GET ED TOPIC ITEMS
 NEW UID,II,LN,RET,ZZ,TEXT,TOPN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIUTB4T",UID))
 K @DATA,ZZ
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIUTB1 D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010IEN^T00060"_$C(30)
 S TOPN=TOP,TOP=$P(^AUTTEDMT(TOPN,0),U,2)
 S LN=0
 F  S LN=$O(^AUTTEDT(LN)) Q:'LN  D
 . S RET=$G(^AUTTEDT(LN,0))
 . I RET="" Q
 . I $P(RET,U,3)'="" Q
 . I $P(RET,U,6)'=TOP Q
 . S TEXT=$P($P(RET,U,1),"-",2,99),ZZ(TEXT)=LN
 S TEXT=""
 F  S TEXT=$O(ZZ(TEXT)) Q:TEXT=""  D
 . S LN=ZZ(TEXT)
 . S II=II+1,@DATA@(II)=LN_U_TEXT_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
CRM(DATA) ;EP - Care Management Layout Sources
 NEW CIEN,TGIEN,RGIEN,REG,TAG,FMIEN,FORM,VIEW,REM,REPORT,KEY,PNDROP,PTDROP,MTDROP
 S @DATA@(II)="I00010IEN^T00030LAYOUT^T00030FORM^T00030TAG^I00010TAG_IEN^T00030REGISTER^T00001PAT_VIEW^T00001REMINDERS^T00030REPORT^T00001PAT_DROPDOWN^T00001PAN_DROPDOWN^T00001MAT_DROPDOWN"_$C(30)
 S CIEN=0
 F  S CIEN=$O(^BQI(90506.5,CIEN)) Q:'CIEN  D
 . NEW TGIEN,RGIEN,REG,TAG,FMIEN,FORM,VIEW,REM,REPORT,KEY,PNDROP,PTDROP
 . I $P(^BQI(90506.5,CIEN,0),U,4)'=1 Q
 . I $P(^BQI(90506.5,CIEN,0),U,10)=1 Q
 . S KEY=$P(^BQI(90506.5,CIEN,0),U,12)
 . I KEY'="",'$$KEYCHK^BQIULSC(KEY,DUZ) Q
 . S RGIEN=$P(^BQI(90506.5,CIEN,0),U,3)
 . I RGIEN'="" S REG=$$GET1^DIQ(90507,RGIEN_",",.01,"E")
 . I RGIEN'="" S TGIEN=$O(^BQI(90506.2,"AD",RGIEN,""))
 . I $G(TGIEN)'="" S TAG=$$GET1^DIQ(90506.2,TGIEN_",",.01,"E")
 . I $G(TAG)="" S TAG=$$GET1^DIQ(90506.5,CIEN_",",.11,"E"),TGIEN=$$GET1^DIQ(90506.5,CIEN_",",.11,"I")
 . S FMIEN=$O(^BQI(90506.3,"AC",CIEN,""))
 . I FMIEN'="",$P(^BQI(90506.3,FMIEN,0),U,3)'=1 S FORM=$$GET1^DIQ(90506.3,FMIEN_",",.01,"E")
 . ;S VIEW=$S($P(^BQI(90506.5,CIEN,0),U,7)'="":"Y",1:"N")
 . S REM=$S($P(^BQI(90506.5,CIEN,0),U,5)'="":"Y",1:"N")
 . S REPORT=$P(^BQI(90506.5,CIEN,0),U,8)
 . S VIEW=$S($G(FORM)'="":"F",$G(REPORT)'="":"R",1:"")
 . I $G(REG)="" S REG=$P(^BQI(90506.5,CIEN,0),U,1)
 . S PTDROP=$S($P(^BQI(90506.5,CIEN,0),U,13)'="":"Y",1:"")
 . S PNDROP=$S($P(^BQI(90506.5,CIEN,0),U,14)'="":"Y",1:"")
 . S MTDROP=$S($P(^BQI(90506.5,CIEN,0),U,15)'="":"Y",1:"")
 . ;
 . S II=II+1,@DATA@(II)=CIEN_U_$P(^BQI(90506.5,CIEN,0),U,1)_U_$G(FORM)_U_$G(TAG)_U_$G(TGIEN)_U_$G(REG)_U_$G(VIEW)_U_$G(REM)_U_$G(REPORT)_U_$G(PTDROP)_U_$G(PNDROP)_U_$G(MTDROP)_$C(30)
 . K REG,TGIEN,TAG,FMIEN,FORM,VIEW,RGIEN
 S II=II+1,@DATA@(II)=$C(31)
 Q