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

BIDUPLT1.m

Go to the documentation of this file.
  1. BIDUPLT1 ;IHS/CMI/MWR - BI PRINT LETTERS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; PRINT LETTERS FROM ^TMP LIST OF PATIENTS.
  1. ;
  1. ;
  1. ;----------
  1. PRINT(BILET,BIDLOC,BIIOP,BIFDT) ;EP
  1. ;---> Print Due Letters for patients stored in ^TMP("BIDUL".
  1. ;---> Called by PRINTALL above; error checking done above.
  1. ;---> Parameters:
  1. ; 1 - BILET (req) Due Letter IEN.
  1. ; 2 - BIDLOC (req) Date-Location Line of letter.
  1. ; 3 - BIIOP (req) Output Device Name (Should be equal to ION.)
  1. ; 4 - BIFDT (req) Forecast date.
  1. ;
  1. D FULL^VALM1
  1. I '$G(BILET) D ERROR(609) Q
  1. I '$D(^BILET(BILET,0)) D ERROR(610) Q
  1. S:'$D(BIIOP) BIIOP="HOME"
  1. I '$G(BIFDT) D ERROR(616) Q
  1. S BICRT=$S(($E(IOST)="C")!(IOST["BROWSER"):1,1:0)
  1. ;
  1. ;---> Quit if no patients retrieved. (Next line was v8.0 patch 1.)
  1. I $O(^TMP("BIDUL",$J,0))="" D Q
  1. .U IO
  1. .W !!?3,"NOTE: Based on the criteria you selected, no Immunization Due"
  1. .W !?9,"letters were printed."
  1. .D:BICRT DIRZ^BIUTL3() W:'BICRT @IOF
  1. ;
  1. ;---> Loop through ^TMP("BIDUL",$J,...,BIDFN) printing Due Letters.
  1. N BIDFN,BILCNT,BIPOP,N,M,P
  1. S BILCNT=0,BIPOP=0
  1. ;
  1. S N=0
  1. F S N=$O(^TMP("BIDUL",$J,N)) Q:N="" D Q:BIPOP
  1. .S M=0
  1. .F S M=$O(^TMP("BIDUL",$J,N,M)) Q:M="" D Q:BIPOP
  1. ..S P=0
  1. ..F S P=$O(^TMP("BIDUL",$J,N,M,P)) Q:P="" D Q:BIPOP
  1. ...S BIDFN=0
  1. ...F S BIDFN=$O(^TMP("BIDUL",$J,N,M,P,BIDFN)) Q:'BIDFN D Q:BIPOP
  1. ....N N,M,P
  1. ....S IOP=BIIOP D ^%ZIS
  1. ....D PRINT^BILETPR(BIDFN,BILET,BIDLOC,BIIOP,BIFDT,.BIPOP)
  1. ....S BILCNT=BILCNT+1
  1. ;
  1. S IOP=BIIOP D ^%ZIS
  1. U IO
  1. W !!?10,"Immunization Due Letters printed: ",BILCNT
  1. W !?10,$$NOW^BIUTL5()
  1. D:BICRT DIRZ^BIUTL3() W:'BICRT @IOF
  1. D ^%ZISC
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. ERROR(BIERR) ;EP
  1. ;---> Report error, either to screen or print.
  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)
  1. S BIPOP=1
  1. Q