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

BQIPLPT.m

Go to the documentation of this file.
  1. BQIPLPT ;PRXM/HC/ALA-Get Patient List by Panel ; 27 Oct 2005 2:14 PM
  1. ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
  1. ;
  1. Q
  1. ;
  1. EN(DATA,OWNR,PLIEN) ; EP -- BQI GET PATIENT LIST BY PANEL
  1. ;
  1. ;Description
  1. ; Gets a list of patients by owner and panel in the designated
  1. ; display order
  1. ;Input
  1. ; OWNR - owner of the panel
  1. ; PLIEN - panel internal entry number
  1. ;Output
  1. ; DATA - name of global (passed by reference) in which the data
  1. ; is stored
  1. ;
  1. NEW UID,II,PDFN,X
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP("BQIPLPT",UID))
  1. K @DATA
  1. ;
  1. S II=0
  1. NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLPT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
  1. ;
  1. ; if no patients in panel, get header and return empty values
  1. I $O(^BQICARE(OWNR,1,PLIEN,40,0))="" D HDR G DONE
  1. ;
  1. ; for every patient in the panel, get the patient list data in display order
  1. S PDFN=0
  1. F S PDFN=$O(^BQICARE(OWNR,1,PLIEN,40,PDFN)) Q:'PDFN D
  1. . D EN^BQIPLVWP(.DATA,OWNR,PLIEN,PDFN)
  1. ;
  1. DONE ;
  1. S II=II+1,@DATA@(II)=$C(31)
  1. Q
  1. ;
  1. ERR ;
  1. D ^%ZTER
  1. NEW Y,ERRDTM
  1. S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
  1. S BMXSEC="Recording that an error occurred at "_ERRDTM
  1. I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
  1. Q
  1. ;
  1. HDR ;EP - Get the header if no patients are in the file
  1. NEW LIEN,NIEN
  1. D EN^BQIPLVWP(.DATA,OWNR,PLIEN,"")
  1. S LIEN=""
  1. S LIEN=$O(@DATA@(LIEN),-1) Q:'LIEN
  1. I LIEN=1,$P(@DATA@(LIEN),$C(30),1)?1."^" K @DATA@(LIEN) S II=II-1
  1. Q