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

BIDUVLS.m

Go to the documentation of this file.
  1. BIDUVLS ;IHS/CMI/MWR - VIEW DUE LIST.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; VIEW LIST OF PATIENTS (DUE LIST OR MASTER LIST).
  1. ;; CALLED BY PROTOCOL: BI DUE LIST OF PATIENTS ("List of Patients")`
  1. ;
  1. ;
  1. ;----------
  1. VIEWDUE ;EP
  1. ;---> View Immunization Due list.
  1. ;---> Called by Protocol BI DUE LIST OF PATIENTS.
  1. ;---> Variables:
  1. ; 1 - BIAG (req) Age Range in months.
  1. ; 2 - BIPG (req) Patient Group Data; see PGRPOUP1^BIOUTPT4 for details.
  1. ; 3 - BIFDT (req) Forecast date.
  1. ; 4 - BICC (req) Current Community array.
  1. ; 5 - BICM (req) Case Manager array.
  1. ; 6 - BIDPRV (req) Designated Provider array.
  1. ; 7 - BIMMR (req) Immunizations Received array.
  1. ; 8 - BIMMD (req) Immunizations Due array.
  1. ; 9 - BIHCF (req) Health Care Facility array.
  1. ; 10 - BILOT (req) Lot Number array.
  1. ; 11 - BIORD (req) Order of listing.
  1. ; 12 - BINFO (opt) Array of Additional Information elements (may be null).
  1. ; 13 - BIRDT (opt) Date Range for Received Imms (form BEGDATE:ENDDATE).
  1. ; 14 - BIDED (opt) Include Deceased Patients (0=no, 1=yes).
  1. ; 15 - BIMMRF (opt) Imms Received Filter array (subscript=CVX's included).
  1. ; 16 - BIBEN (req) Beneficiary Type array: either BIBEN(1) or BIBEN("ALL").
  1. ;
  1. ;---> Check for required Variables.
  1. I '$D(BIAG) D ERROR(613) Q
  1. I '$D(BIPG) D ERROR(620) Q
  1. I '$G(BIFDT) D ERROR(616) Q
  1. I '$D(BICC) D ERROR(614) Q
  1. I '$D(BICM) D ERROR(615) Q
  1. I '$D(BIDPRV) D ERROR(680) Q
  1. I '$D(BIMMR) D ERROR(652) Q
  1. I '$D(BIMMD) D ERROR(638) Q
  1. I '$D(BIHCF) D ERROR(625) Q
  1. I '$D(BILOT) D ERROR(630) Q
  1. I '$G(BIORD) D ERROR(618) Q
  1. ;I '$D(BINFO) D ERROR(629) Q ;Additional Info not required (may be null).
  1. ; ;BIMMRF not required (may be null).
  1. ;
  1. I '$D(BIRDT) S BIRDT=""
  1. I '$D(BIDED) S BIDED=0
  1. I '$D(BIBEN) S BIBEN(1)=""
  1. ;
  1. D FULL^VALM1 N BIERR
  1. D TITLE^BIUTL5("PRINT OR VIEW LIST"),TEXT1
  1. N DIR
  1. S DIR("A")=" Select Print or View: ",DIR("B")="View"
  1. S DIR(0)="SAM^p:Print;v:View;q:Quit"
  1. D ^DIR K DIR
  1. I Y=-1!($D(DIRUT)) D RESET^BIDU Q
  1. ;
  1. ;---> User chose to Quit.
  1. I Y="q" D RESET^BIDU Q
  1. ;
  1. VIEW ;---> User chose to VIEW Due List.
  1. I Y="v" D Q
  1. .W !!?10,"This may take some time. Please hold on...",!
  1. .;
  1. .;---> Retrieve patients for this listing.
  1. .;---> (Patient's forecast gets updated at CHKSET+60^BIDUR.)
  1. .;---> Since this is List (not Letter), send 0 days since last letter
  1. .;---> as 10th parameter. BIT=Total Patients retrieved.
  1. .;
  1. .;D NOW1^BIUTL3
  1. .D RETRIEVE(.BIT,.BIERR)
  1. .I $G(BIERR) D ERROR(BIERR),EXIT,RESET^BIDU Q
  1. .;D NOW2^BIUTL3
  1. .;
  1. .;---> Display list of patients retrieved.
  1. .K ^TMP("BIDULV",$J)
  1. .D START^BIDUVLS1(BIFDT,.BINFO,BIPG,BIAG,BIT,,,,,.BIBEN)
  1. .D EXIT,RESET^BIDU
  1. ;
  1. ;
  1. PRINT ;EP
  1. ;---> User chose to PRINT Due List.
  1. N BIPOP
  1. D DEVICE(.BIPOP)
  1. I $G(BIPOP) D RESET^BIDU Q
  1. ;
  1. D:$G(IO)'=$G(IO(0))
  1. .W !!?10,"This may take some time. Please hold on...",!
  1. ;
  1. ;---> Retrieve patients for this listing.
  1. D RETRIEVE(.BIT,.BIERR)
  1. I $G(BIERR) D ERROR(BIERR),EXIT,RESET^BIDU Q
  1. ;
  1. ;---> Print list of patients retrieved.
  1. ;---> Cannot pass params to INIT, but should have BIFDTDT,
  1. ;---> BINFO, and BIT defined.
  1. K ^TMP("BIDULV",$J)
  1. N VALM,VALMHDR
  1. D HDR^BIDUVLS1,INIT^BIDUVLS1
  1. D PRTLST^BIUTL8("BIDULV")
  1. D EXIT,RESET^BIDU
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. RETRIEVE(BIT,BIERR) ;EP
  1. ;---> Retrieve patients according to parameters set.
  1. ;---> Parameters:
  1. ; 1 - BIT (ret) Total Patients retrieved.
  1. ; 2 - BIERR (ret) Error Code.
  1. ;
  1. D R^BIDUR(BIAG,BIPG,BIFDT,.BICC,.BICM,.BIMMR,.BIMMD,.BILOT,0,BIORD,BIRDT,BIDED,.BIT,.BIHCF,.BIDPRV,.BIERR,.BIBEN)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. DEVICE(BIPOP) ;EP
  1. ;---> Get Device and possibly queue to Taskman.
  1. ;---> Parameters:
  1. ; 1 - BIPOP (ret) If error or Queue, BIPOP=1
  1. ;
  1. K %ZIS,IOP S BIPOP=0
  1. S ZTRTN="DEQUEUE^BIDUVLS"
  1. D ZSAVES^BIUTL3
  1. D ZIS^BIUTL2(.BIPOP,1)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. DEQUEUE ;EP
  1. ;---> Print list of patients retrieved.
  1. ;
  1. D RETRIEVE(.BIT,.BIERR)
  1. I $G(BIERR) D EXIT Q
  1. K VALMHDR,^TMP("BIDULV",$J)
  1. D HDR^BIDUVLS1,INIT^BIDUVLS1
  1. D PRTLST^BIUTL8("BIDULV")
  1. D EXIT
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. ERROR(BIERR) ;EP
  1. ;---> Report error, reset Listman screen and quit.
  1. ;---> Parameters:
  1. ; 1 - BIERR (ret) Text of Error Code if any, otherwise null.
  1. ;
  1. S:'$G(BIERR) BIERR=999
  1. D ERRCD^BIUTL2(BIERR,,1) D RESET^BIDU Q
  1. Q
  1. ;
  1. ;
  1. TEXT1 ;
  1. ;;You may either PRINT the List or VIEW it on this screen.
  1. ;;
  1. ;;PRINT: If it customarily takes a long time for your computer
  1. ;;to produce a List of Patients, it may be more efficient for you
  1. ;;to QUEUE it to a printer. That way you can be free to do other
  1. ;;things until the printout is finished.
  1. ;;
  1. ;;VIEW: You will have to wait while the computer retrieves the
  1. ;;information. However, once the List of Patients comes up on
  1. ;;the screen, you will be able to browse the list on screen by
  1. ;;scrolling up and down using the arrow keys.
  1. ;;
  1. D PRINTX("TEXT1",5)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. PRINTX(BILINL,BITAB) ;EP
  1. Q:$G(BILINL)=""
  1. N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
  1. F I=1:1 S X=$T(@BILINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EXIT ;EP
  1. ;---> Cleanup and Quit.
  1. K ^TMP("BIDULV",$J)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EDITPAT ;EP
  1. ;---> Edit Patient from List.
  1. S:'$G(BIORD) BIORD=1
  1. D FULL^VALM1
  1. D
  1. .N BIAG,BIBEN,BICC,BICM,BICPT,BIDPRV,BIFDT,BIHCF,BILOT,BIMD
  1. .N BIMMD,BIMMR,BINFO,BIORD,BIPG,BIQDT,BIRPDT,BIT
  1. .D ONEPAT^BIPATVW
  1. ;
  1. S VALMBCK="R"
  1. Q