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

BQIRGTHM.m

Go to the documentation of this file.
BQIRGTHM ;PRXM/HC/ALA-Proposed Value Trigger RPC for HMS ; 30 Nov 2007  5:55 PM
 ;;2.3;ICARE MANAGEMENT SYSTEM;;Apr 18, 2012;Build 59
 ;
EN(DATA,BQDFN,DCAT) ;EP - BQI REGISTER TRIGGER HMS
 ;
 ; Input
 ;   BQDFN - Patient internal entry number
 ;   DCAT  - Diagnosis category
 ;
 NEW UID,II,PARMS,DA,IENS,NM,VALUE,TEXT,ABLE,PPARMS,BKMIEN,BKMREG,BKMIENS
 NEW BI,BN,HELP,BCPTR,CPT,BDATA,LM
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIRGTHM",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIRGTHM 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)
 ;
 ; Build internal
 S BKMIEN=$$BKMIEN^BKMIXX3(BQDFN)
 S BKMREG=$$BKMREG^BKMIXX3(BKMIEN)
 S DA(1)=BKMIEN,DA=BKMREG
 S BKMIENS=$$IENS^DILF(.DA)
 ;
 S PARMS("BKMDCAT")=$$GET1^DIQ(90451.01,BKMIENS,2.3,"E")
 S PARMS("BKMDXDT")=$$FMTE^BQIUL1($$GET1^DIQ(90451.01,BKMIENS,5,"I"))
 S PARMS("BKMAIDT")=$$FMTE^BQIUL1($$GET1^DIQ(90451.01,BKMIENS,5.5,"I"))
 ;
 I BKMIENS=",," D FND
 I $G(PARMS("BKMDCAT"))=""!($G(PARMS("BKMDXDT"))="") D FND
 ;
 ;S PARMS("BKMDCAT")=$$STC^BQIUL2(90451.01,2.3,$$DIAG^BKMVA1B(BQDFN))
 ;S PARMS("BKMDXDT")=$$FMTE^BQIUL1($$GET1^DIQ(90451.01,BKMIENS,5,"I"))
 ;S PARMS("BKMAIDT")=$$FMTE^BQIUL1($$GET1^DIQ(90451.01,BKMIENS,5.5,"I"))
 ;S PARMS("BKMDCAT")=$$DIAG^BKMVA1B(BQDFN)
 ;S PARMS("BKMDXDT")=$$GET1^DIQ(90451.01,BKMIENS,5,"I")
 ;S PARMS("BKMAIDT")=$$GET1^DIQ(90451.01,BKMIENS,5.5,"I")
 ;
 S NM=""
 F  S NM=$O(PARMS(NM)) Q:NM=""  I $G(PARMS(NM))'="" S PPARMS(NM)=""
 ;
 I $G(DCAT)="" D
 . F BI=1:1 S LM=$T(LST+BI) Q:LM=" Q"  D
 .. S TEXT=$P(LM,";;",2)
 .. S ABLE(TEXT)="N",PARMS(TEXT)=""
 ;
 I $G(DCAT)'="" S PARMS("BKMDCAT")=DCAT,PPARMS("BKMDCAT")=""
 I $G(PARMS("BKMDCAT"))'="" D
 . D EN^BQIRGTH1(.BDATA,PARMS("BKMDCAT"))
 . S BN=0
 . F  S BN=$O(@BDATA@(BN)) Q:BN=""  D
 .. S TEXT=$P(@BDATA@(BN),U,1)
 .. S ABLE(TEXT)=$P(@BDATA@(BN),U,2)
 . K @BDATA
 ;F TXT="BKMDCOM","BKMETIO","BKMCLCLS","BKMPTSTA","BKMLOC" S ABLE(TXT)="Y"
 ;
 ; Figure out the fields that are enabled or disabled
 ;I $G(PPARMS("BKMDCAT"))="A"!($G(PARMS("BKMDCAT"))="A") D
 ;. F TXT="BKMAIDT","BKMDXDT","BKMHPROV","BKMHCSMR","BKMSHRST","BKMSARST" S ABLE(TXT)="Y"
 ;I $G(PPARMS("BKMDCAT"))="H"!($G(PARMS("BKMDCAT"))="H") D
 ;. F TXT="BKMHPROV","BKMDXDT","BKMHCSMR","BKMSHRST" S ABLE(TXT)="Y"
 ;. F TXT="BKMAIDT","BKMSARST" S ABLE(TXT)="N"
 ;
 S NM="",VALUE="",HELP=""
 F  S NM=$O(PARMS(NM)) Q:NM=""  D
 . S VALUE=NM_U
 . S $P(VALUE,U,3)=$S($G(PARMS(NM))'="":$G(PARMS(NM)),1:"")
 . S $P(VALUE,U,4)=HELP
 . S $P(VALUE,U,5)=$S($G(PARMS(NM))=""&$G(PPARMS(NM))'="":$G(PPARMS(NM)),1:"")
 . S $P(VALUE,U,6)=$S($G(ABLE(NM))'="":$G(ABLE(NM)),1:"Y")
 . S II=II+1,@DATA@(II)=VALUE_$C(30)
 ;
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
 ;
FND ; Find initial data
 K DIAGCAT,IAIDSDT,HAIDSDT
 D LDREC^BKMVA1B(BQDFN,1)
 S PPARMS("BKMAIDT")=$$FMTE^BQIUL1(IAIDSDT)
 S PPARMS("BKMDXDT")=$$FMTE^BQIUL1(HAIDSDT)
 S PPARMS("BKMDCAT")=$$STC^BQIUL2(90451.01,2.3,DIAGCAT)
 K DIAGCAT,IAIDSDT,HAIDSDT
 Q
 ;
LST ;
 ;;BKMCLCLS
 ;;BKMDCOM
 ;;BKMETIO
 ;;BKMETIOC
 ;;BKMETIOD
 ;;BKMHCCOM
 ;;BKMHCDT
 ;;BKMHCSMR
 ;;BKMHCST
 ;;BKMHCWHN
 ;;BKMHCWHO
 ;;BKMHPROV
 ;;BKMHTACM
 ;;BKMHTADT
 ;;BKMHTAST
 ;;BKMHTAWD
 ;;BKMHTAWH
 ;;BKMHTNAR
 ;;BKMIENS
 ;;BKMLOC
 ;;BKMPTDT
 ;;BKMPTLUP
 ;;BKMPTSTA
 ;;BKMRCOM
 ;;BKMSAADT
 ;;BKMSAAST
 ;;BKMSARDT
 ;;BKMSARST
 ;;BKMSHADT
 ;;BKMSHAST
 ;;BKMSHRDT
 ;;BKMSHRST
 ;;BKMWHOM
 Q