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

BQIVFTRB.m

Go to the documentation of this file.
BQIVFTRB ;PRXM/HC/ALA-Trigger Problem Information ; 18 Dec 2007  3:21 PM
 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
 Q
 ;
EN(DATA,FLAG,TEXT,DXN) ;EP - BQI VFILE TRIGGER PRB
 ;
 ; Input
 ;   TEXT  - Narrative Text
 ;
 NEW UID,II,VALUE,NARR,SOURCE,CLEAR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIVFTRB",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIVFTRB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S TEXT=$G(TEXT,""),DXN=$G(DXN,"")
 D HDR
 I FLAG="D",DXN'="" D CLS
 I FLAG="N",TEXT'="" D NAR
 ;
DONE ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
ERR ;
 D ^%ZTER
 NEW Y,ERRDTM
 S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
 S BMXSEC="Recording that an error occurred at "_ERRDTM
 I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
NAR ;EP - Narrative Text
 NEW SOURCE,VALUE,DIC,DLAYGO,X,Y,IEN
 S SOURCE="APCDN",VALUE=""
 S DIC(0)="LX",DIC="^AUTNPOV(",DLAYGO=9999999.27,X=TEXT
 D ^DIC
 S IEN=+Y
 I IEN=-1 K DO,DD D FILE^DICN S IEN=+Y
 S VALUE=IEN_$C(29)_TEXT
 S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_U_U_$C(30)
 Q
 ;
CLS ;EP - Problem Classification
 NEW SOURCE,VALUE,HELP,CLS,NUM
 S SOURCE="APCDCLAS",VALUE="",HELP=""
 I $$VERSION^XPDUTL("BJPC")<2.0 D  Q
 . S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_"N"_U_HELP_U_$G(CLEAR)_$C(30)
 ; If diagnosis does not trigger a classification
 I '$$ASKCL^AUPNVPLC(DXN) D  Q
 . S CLEAR=SOURCE
 . S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_"N"_U_HELP_U_$G(CLEAR)_$C(30)
 ;
 S CLS=$O(^APCDPLCL("B","ASTHMA SEVERITY","")) I CLS="" D  Q
 . S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_"N"_U_HELP_U_$G(CLEAR)_$C(30)
 ;
 S N=0
 F  S N=$O(^APCDPLCL(CLS,11,N)) Q:'N  D
 . S NUM=$P(^APCDPLCL(CLS,11,N,0),U,1)
 . S VALUE=VALUE_NUM_$C(29)_NUM_"-"_$P(^APCDPLCL(CLS,11,N,0),U,2)_$C(28)
 S VALUE=$$TKO^BQIUL1(VALUE,$C(29))
 ;
 S N=0
 F  S N=$O(^APCDPLCL(CLS,12,N)) Q:'N  D
 . S HELP=HELP_^APCDPLCL(CLS,12,N,0)_$C(10)
 S HELP=$$TKO^BQIUL1(HELP,$C(10))
 S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_"Y"_U_HELP_U_$G(CLEAR)_$C(30)
 Q
 ;
INIT(DATA,BQPIEN) ; EP - BQI VFILE INITIAL PRB
 NEW UID,II,VALUE,SOURCE,HELP,DXN,ABLE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIVFIPR",UID))
 K @DATA
 S BQPIEN=$G(BQPIEN,"")
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIVFTRB D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00030PROP_VALUE^T00001ABLE_FLAG^T00200HELP_TEXT"_$C(30)
 S SOURCE="APCDCLAS",VALUE="",HELP="",ABLE="N"
 I BQPIEN'="",$$VERSION^XPDUTL("BJPC")'<2.0 D
 . S DXN=$$GET1^DIQ(9000011,BQPIEN,.01,"I")
 . I DXN'="",$$ASKCL^AUPNVPLC(DXN) S ABLE="Y"
 S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_U_U_ABLE_U_HELP_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
HDR ; Header for BQI VFILE TRIGGER PRB
 S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00030PROP_VALUE^T00001ABLE_FLAG^T00200HELP_TEXT^T01024CLEAR_FIELDS"_$C(30)
 Q