- BQIPLMF ;PRXM/HC/DB-BQI Manual Patients Exist by Panel ; 23 Aug 2006 3:52 PM
- ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
- ;
- Q
- ;
- EN(DATA,OWNR,PLIEN) ; EP -- BQI MANUAL PATS EXIST BY PANEL
- ;
- ;Description
- ; Does panel have manually added or removed patients?
- ;
- ;Input
- ; OWNR - owner of the panel
- ; PLIEN - panel internal entry number
- ;Output
- ; DATA - name of global (passed by reference) in which the data
- ; is stored: 0=no manuals; 1=manual(s) included
- ;
- NEW UID,II,DFN,X,STAT,MAN
- S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
- S DATA=$NA(^TMP("BQIPLMF",UID))
- K @DATA
- ;
- S II=0,MAN=0
- NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLMF D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
- ;
- S DFN=0
- F S DFN=$O(^BQICARE(OWNR,1,PLIEN,40,DFN)) Q:'DFN D Q:MAN
- . NEW DA,IENS
- . S DA(2)=OWNR,DA(1)=PLIEN,DA=DFN,IENS=$$IENS^DILF(.DA)
- . S STAT=$$GET1^DIQ(90505.04,IENS,.02,"I"),MAN=STAT]""
- ;
- DONE ;
- S II=II+1,@DATA@(II)="I00001RESULT"_$C(30)
- S II=II+1,@DATA@(II)=MAN_$C(30)
- 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
- BQIPLMF ;PRXM/HC/DB-BQI Manual Patients Exist by Panel ; 23 Aug 2006 3:52 PM
- +1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
- +2 ;
- +3 QUIT
- +4 ;
- EN(DATA,OWNR,PLIEN) ; EP -- BQI MANUAL PATS EXIST BY PANEL
- +1 ;
- +2 ;Description
- +3 ; Does panel have manually added or removed patients?
- +4 ;
- +5 ;Input
- +6 ; OWNR - owner of the panel
- +7 ; PLIEN - panel internal entry number
- +8 ;Output
- +9 ; DATA - name of global (passed by reference) in which the data
- +10 ; is stored: 0=no manuals; 1=manual(s) included
- +11 ;
- +12 NEW UID,II,DFN,X,STAT,MAN
- +13 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
- +14 SET DATA=$NAME(^TMP("BQIPLMF",UID))
- +15 KILL @DATA
- +16 ;
- +17 SET II=0
- SET MAN=0
- +18 ; SAC 2006 2.2.3.3.2
- NEW $ESTACK,$ETRAP
- SET $ETRAP="D ERR^BQIPLMF D UNWIND^%ZTER"
- +19 ;
- +20 SET DFN=0
- +21 FOR
- SET DFN=$ORDER(^BQICARE(OWNR,1,PLIEN,40,DFN))
- IF 'DFN
- QUIT
- Begin DoDot:1
- +22 NEW DA,IENS
- +23 SET DA(2)=OWNR
- SET DA(1)=PLIEN
- SET DA=DFN
- SET IENS=$$IENS^DILF(.DA)
- +24 SET STAT=$$GET1^DIQ(90505.04,IENS,.02,"I")
- SET MAN=STAT]""
- End DoDot:1
- IF MAN
- QUIT
- +25 ;
- DONE ;
- +1 SET II=II+1
- SET @DATA@(II)="I00001RESULT"_$CHAR(30)
- +2 SET II=II+1
- SET @DATA@(II)=MAN_$CHAR(30)
- +3 SET II=II+1
- SET @DATA@(II)=$CHAR(31)
- +4 QUIT
- +5 ;
- ERR ;
- +1 DO ^%ZTER
- +2 NEW Y,ERRDTM
- +3 SET Y=$$NOW^XLFDT()
- XECUTE ^DD("DD")
- SET ERRDTM=Y
- +4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
- +5 IF $DATA(II)
- IF $DATA(DATA)
- SET II=II+1
- SET @DATA@(II)=$CHAR(31)
- +6 QUIT