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

BIW.m

Go to the documentation of this file.
  1. BIW ;IHS/CMI/MWR - WRITE LINES TO ^TMP.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; WRITE LINES TO ^TMP AND VALMHDR FOR LISTMAN DISPLAYS & REPORTS.
  1. ;
  1. ;
  1. ;----------
  1. WH(BILINE,BIVAL,BIBLNK) ;EP
  1. ;---> Write a Header line to the VALMHDR array (Listman Header).
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Last line# in the Header array.
  1. ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
  1. ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
  1. ;
  1. Q:'$D(BILINE)
  1. S:$G(BIVAL)="" BIVAL=" "
  1. S BILINE=BILINE+1,VALMHDR(BILINE)=BIVAL
  1. ;
  1. ;---> Write as many blank line after as specified by parameter 3.
  1. N I F I=1:1:+$G(BIBLNK) S BILINE=BILINE+1,VALMHDR(BILINE)=" "
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. WL(BILINE,BINOD,BIVAL,BIBLNK,BIENT) ;EP
  1. ;---> Write a line to the ^TMP global for WP or Listman.
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Last line# in the WP ^TMP global.
  1. ; 2 - BINOD (req) Node in ^TMP to store lines under.
  1. ; 3 - BIVAL (opt) Value/text of line (Null=blank line).
  1. ; 4 - BIBLNK (opt) Number of blank lines to add after line sent.
  1. ; 5 - BIENT (opt) Entry Number for LM selection in VALMY
  1. ;
  1. Q:$G(BINOD)=""
  1. S:'$G(BILINE) BILINE=0
  1. S:$G(BIVAL)="" BIVAL=" "
  1. ;
  1. S BILINE=BILINE+1
  1. S ^TMP(BINOD,$J,BILINE,0)=BIVAL
  1. S:$G(BIENT) ^TMP(BINOD,$J,"IDX",BILINE,BIENT)=""
  1. ;
  1. ;---> Write as many blank lines after as specified by parameter 4.
  1. N I F I=1:1:+$G(BIBLNK) D
  1. .S BILINE=BILINE+1,^TMP(BINOD,$J,BILINE,0)=" "
  1. .S:$G(BIENT) ^TMP(BINOD,$J,"IDX",BILINE,BIENT)=""
  1. Q
  1. ;
  1. ;
  1. ;;*** BELOW IS A STANDARD "WRITE" CALL THAT CAN BE PASTED INTO
  1. ;;*** A ROUTINE FOR MULTIPLE CALLS FROM THAT ROUTINE TO THE ABOVE
  1. ;;*** SUBROUTINE. NOTE: THE NODE PASSED MUST BE EDITED AS APPROPRIATE.
  1. ;----------
  1. WRITE(BILINE,BIVAL,BIBLNK,BIENT) ;EP
  1. ;---> Write lines to ^TMP (see documentation in ^BIW).
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Last line# written.
  1. ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
  1. ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
  1. ; 4 - BIENT (opt) Entry Number for LM selection in VALMY
  1. ;
  1. Q:'$D(BILINE)
  1. D WL^BIW(.BILINE,"BIREPA1",$G(BIVAL),$G(BIBLNK),$G(BIENT))
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. MARK(BILINE,BILNS,BINODE) ;EP
  1. ;---> Mark the top line of a record (or node in a Listman TMP global
  1. ;---> with the number of lines in that record.
  1. ;---> This utility enables one to avoid splitting records with
  1. ;---> formfeeds when printing.
  1. ;---> The number of lines in a record is stored by appending a number
  1. ;---> of $C(30)'s equal to the number of lines, delimited by $C(31).
  1. ;---> Note that $(30) and $C(31) are not visible characters on screen.
  1. ;---> This code is picked up by line label PRTLST, just below,
  1. ;---> when printing a Listman TMP global.
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Top line of the record to be marked.
  1. ; 2 - BILNS (req) Number of lines in the record.
  1. ; 3 - BINODE (req) The node in ^TMP storing the text,
  1. ; e.g., "BIDULV" in ^TMP("BIDULV",$J,BILINE,0).
  1. ;
  1. Q:'$G(BILINE) Q:'$G(BILNS) Q:$G(BINODE)=""
  1. N BI31 S BI31=$C(31)_$C(31)
  1. N BILNS1,I S BILNS1=""
  1. F I=1:1:BILNS S BILNS1=BILNS1_$C(30)
  1. S $P(^TMP(BINODE,$J,BILINE,0),BI31,2)=BILNS1
  1. Q