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

BQIPTTR.m

Go to the documentation of this file.
BQIPTTR ;VNGT/HS/ALA-Patient Triggers ; 15 Jan 2009  1:08 PM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
 ;
 ;
EDIN(DATA,DFN) ; EP -- BQI PATIENT TRIGGER EDIT
 ; Description - Initial Patient Edit trigger
 NEW UID,II,ETHN,VALUE,PGIEN,LGIEN,OIEN,VAL,BQIL,LGN,IEN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIPTTR",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPTTR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00200HELP_TEXT^T00030PROP_VALUE^T00001ABLE_FLAG"_$C(30)
 ;
 S ETHN=$$ETHN^BQIPTDMG(DFN,.01)
 S $P(VALUE,U,1)="AGMETH",$P(VALUE,U,4)="Method used to collect patient's ethnicity"
 S $P(VALUE,U,6)=$S(ETHN="":"N",1:"Y")
 ;
 S II=II+1,@DATA@(II)=VALUE_$C(30)
 ;
 D PAT9
 ;
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
 ;
EN(DATA,AGETH) ; EP - BQI TRIGGER PAT ETHNICITY
 NEW UID,II
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIPTTR1",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPTTR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S @DATA@(II)="T00008SOURCE^T00001ABLE_FLAG^T01024CLEAR_FIELDS"_$C(30)
 S AGETH=$G(AGETH,"")
 I AGETH'="" S II=II+1,@DATA@(II)="AGMETH^Y^"_$C(30)
 I AGETH="" S II=II+1,@DATA@(II)="AGMETH^N^AGMETH"_$C(30)
 ;
 G DONE
 ;
PAT9 ;EP - Patch 9
 K BQIL
 ; Languages
 S IEN="B",VAL="",LGIEN=""
 S IEN=$O(^AUPNPAT(DFN,86,IEN),-1)
 I +IEN'=0 D
 . S LGIEN=$P($G(^AUPNPAT(DFN,86,IEN,0)),U,4)
 . S PGIEN=$P($G(^AUPNPAT(DFN,86,IEN,0)),U,2)
 . I LGIEN'="" S BQIL(LGIEN)=""
 . I PGIEN'="" S BQIL(PGIEN)=""
 . S OIEN=0
 . F  S OIEN=$O(^AUPNPAT(DFN,86,IEN,5,OIEN)) Q:'OIEN  D
 .. I $G(^AUTTLANG(OIEN,0))="" Q
 .. S BQIL(OIEN)=""
 ;
 S LGN=""
 F  S LGN=$O(BQIL(LGN)) Q:LGN=""  S VAL=VAL_LGN_$C(29)_$P(^AUTTLANG(LGN,0),U,1)_$C(28)
 S VAL=$$TKO^BQIUL1(VAL,$C(28))
 S $P(VALUE,U,1)="PFLANG",$P(VALUE,U,6)="Y",$P(VALUE,U,4)="Select one of the user's languages",$P(VALUE,U,2)="T"
 S $P(VALUE,U,3)=VAL,II=II+1,@DATA@(II)=VALUE_$C(30)
 ;
 S VAL=""
 I LGIEN'="" S VAL=LGIEN_$C(28)_$P(^AUTTLANG(LGIEN,0),U,1)
 S $P(VALUE,U,1)="PFLANG",$P(VALUE,U,6)="Y",$P(VALUE,U,4)="",$P(VALUE,U,2)="T"
 S $P(VALUE,U,3)=VAL,II=II+1,@DATA@(II)=VALUE_$C(30)
 Q