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

BQIVFTRM.m

Go to the documentation of this file.
BQIVFTRM ;VNGT/HS/ALA-Trigger Measurement ; 13 May 2010  6:54 AM
 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
 ;
 ;
EN(DATA,APCDTTYP) ;EP - BQI VFILE TRIGGER MEAS
 ;
 ; Input
 ;   TEXT  - Narrative Text
 ;
 NEW UID,II,VALUE,SOURCE,CLEAR,MSIEN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIVFTRM",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIVFTRM D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S APCDTTYP=$G(APCDTTYP)
 D HDR
 I APCDTTYP'?.N S MSIEN=$O(^AUTTMSR("B",APCDTTYP,""))
 S SOURCE="QUALIF",TYPE="C",VALUE="",HELP="",CLEAR=""
 I $O(^GMRD(120.52,"C",MSIEN,""))="" D  G DONE
 . S ABLE="N" D UP
 . S SOURCE="VITDTM",TYPE="D",VALUE="",HELP="",CLEAR="" D UP
 S IEN=""
 F  S IEN=$O(^GMRD(120.52,"C",MSIEN,IEN)) Q:IEN=""  D
 . S VALUE=VALUE_IEN_$C(29)_$P(^GMRD(120.52,IEN,0),U,1)_$C(28)
 S VALUE="BQIQLF="_$$TKO^BQIUL1(VALUE,$C(28)),ABLE="Y" D UP
 I VALUE'="" S SOURCE="VITDTM",TYPE="D",VALUE="",HELP="",CLEAR="" D UP
 ;
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
 ;
HDR ; Header for BQI VFILE TRIGGER MEAS
 S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T00001ABLE_FLAG^T01024PARMS^T00200HELP_TEXT^T01024CLEAR_FIELDS"_$C(30)
 Q
 ;
UP ; Update
 S II=II+1,@DATA@(II)=SOURCE_U_TYPE_U_ABLE_U_VALUE_U_HELP_U_CLEAR_$C(30)
 Q