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

IBDF1B1B.m

Go to the documentation of this file.
  1. IBDF1B1B ;ALB/CJM - ENCOUNTER FORM PRINT (IBDF1B continued - user options for printing- continuation of IBDF1B1); 3/1/93
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
  1. ;
  1. ENDV ;entire divisions were choosen, find all clinics (with encounter forms defined)
  1. N IBCLN,IBDIV,NODE,DIVISION,ALL
  1. ;
  1. ;if ^TMP("IBDF",$J,"D","ALL") exists then all divisions were chosen
  1. S ALL=$S($D(^TMP("IBDF",$J,"D","ALL")):1,1:0)
  1. ;
  1. ;user did not select ALL, so make a list of the divisions he did choose
  1. I 'ALL S IBDIV=0 F S IBDIV=$O(^TMP("IBDF",$J,"D",IBDIV)) Q:'IBDIV S DIVISION(IBDIV)=""
  1. ;
  1. ;loop through all the clinics finding ones in selected divisions
  1. S IBCLN="" F S IBCLN=$O(^SC(IBCLN)) Q:IBCLN="" D
  1. .S NODE=$G(^SC(IBCLN,0))
  1. .;
  1. .;make sure it's in one of the selected divisions
  1. .S IBDIV=$P(NODE,"^",15)
  1. .I IBDIV,'ALL Q:'$D(DIVISION(IBDIV))
  1. .;
  1. .;check that location is a clinic
  1. .Q:$P(NODE,"^",3)'="C"
  1. .;
  1. .;if it's a restart make sure the IBDIV does not precede the starting division
  1. .I IBSTRTDV]" ",IBDIV S DIVISION=$P($G(^DG(40.8,IBDIV,0)),"^") I DIVISION'=IBSTRTDV,DIVISION']IBSTRTDV Q
  1. .;
  1. .;don't put it on the list if there is nothing to print
  1. .I '$$DIVHAS^IBDF1B1A(IBDIV),'$$CLNCHAS^IBDF1B1A(IBCLN) Q
  1. .;
  1. .;it passed all the tests, put it on the list
  1. .S ^TMP("IBDF",$J,"C",IBCLN)=""
  1. ;
  1. ;don't need list of divisions anymore
  1. K ^TMP("IBDF",$J,"D")
  1. Q