BILETVW ;IHS/CMI/MWR - VIEW/EDIT FORM LETTERS; MAY 10, 2010
;;8.5;IMMUNIZATION;;SEP 01,2011
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; VIEW/EDIT FORM LETTERS.
;
;----------
START ;EP
;---> Lookup and edit Form Letters in the file BI LETTER.
D SETVARS^BIUTL5 N BIY
F D Q:$G(BIY)<1
.D TITLE^BIUTL5("VIEW/EDIT FORM LETTERS"),TEXT3
.N BIIEN
.D DIC^BIFMAN(9002084.4,"QEMAL",.BIY," Select Form Letter: ")
.Q:$G(BIY)<1
.S BIIEN=+BIY
.;---> If this is a new letter, select and copy Sample Form Letter.
.D:$P(BIY,U,3) ADDNEW^BILETVW2(.BIIEN)
.;---> Quit if Sample Form Letter not selected (new IEN deleted).
.Q:'$G(BIIEN)
.D EN(+BIIEN)
D EXIT
Q
;
;
;----------
HAVELET(BIIEN) ;EP
;---> NOT CALLED AT THIS TIME? 8/9/99
;---> Entry point when letter is already known.
D SETVARS^BIUTL5
K ^TMP("BILMLT",$J)
D EN(BIIEN),EXIT
Q
;
;
;----------
EN(BIIEN) ;EP
;---> Main entry point for BI LETTER VIEW/EDIT.
;---> If BIIEN not supplied, set Error Code and quit.
I '$G(BIIEN) D ERRCD^BIUTL2(609,,1) Q
D EN^VALM("BI LETTER FORM")
Q
;
;
;----------
HDR ;EP
;---> Header code.
N X S X="Form Letter: "_$P(^BILET(BIIEN,0),U)
D CENTERT^BIUTL5(.X)
S VALMHDR(1)=""
S VALMHDR(2)=X
Q
;
;
;----------
INIT ;EP
;---> Initialize variables and list array.
D INIT^BILETVW1
Q
;
;
;----------
RESET ;EP
;---> Update partition for return to Listmanager.
I $D(VALMQUIT) S VALMBCK="Q" Q
D TERM^VALM0 S VALMBCK="R"
D INIT,HDR Q
;
;
;----------
RESET2 ;EP
;---> Update partition without recreating display array.
I $D(VALMQUIT) S VALMBCK="Q" Q
D TERM^VALM0 S VALMBCK="R" D HDR Q
Q
;
;
;----------
HELP ;EP
;---> Help code.
N BIX S BIX=X
D FULL^VALM1 N BIPOP
D TITLE^BIUTL5("FORM LETTER EDIT - HELP, page 1 of 2")
D TEXT1,DIRZ^BIUTL3(.BIPOP)
I $G(BIPOP) D RE^VALM4 Q
D TITLE^BIUTL5("FORM LETTER EDIT - HELP, page 2 of 2")
D TEXT2,DIRZ^BIUTL3()
D:BIX'="??" RE^VALM4
Q
;
;
;----------
TEXT1 ;EP
;;The Form Letter Edit Screen allows you to customize Form Letters.
;;
;;The TOP section of the screen displays the name of the Form Letter.
;;
;;The MIDDLE section of the letter displays the body of the letter
;;in a scrollable region. Use the up and down arrow keys to view
;;all parts of the letter.
;;
;;The BOTTOM section of the screen lists actions you can take to
;;edit secions of the letter or to print or delete the letter.
;;
;;Fields in the letter are signified by uppercase text within vertical
;;bars, such as |PATIENT NAME|. These Fields may be moved within the
;;letter or they may be deleted. However, the text within the
;;vertical bars must NOT be altered.
;;
D PRINTX("TEXT1")
Q
;
;
;----------
TEXT2 ;EP
;;A Form Letter may contain up to 7 Sections. Each section is
;;represented by an Action at the bottom of the screen: Top, History,
;;Middle, Forecast, Bottom, Date/Loc, and Closing.
;;
;;When selected, some Sections take you to the word processor in order
;;to allow you to edit the section. (Your Preferred Editor should be
;;"Full Screen" for this; if not, contact your Site Manager.)
;;
;;Other Sections provide helpful information when they are selected.
;;
;;In order to add a NEW Form Letter, simply enter a name for the
;;new letter at the very first prompt, "Select Form Letter: ".
;;A generic sample letter will then appear under the newly named Form
;;Letter, which you can then edit to suit the intended purposes.
;;
D PRINTX("TEXT2")
Q
;
;
;----------
TEXT3 ;EP
;;This screen will allow you to add and edit Form Letters.
;;
;;Please select a Form Letter, or enter the name of a new Form Letter
;;you wish to add. (Enter "?" to see a list of existing Form Letters.)
;;
D PRINTX("TEXT3")
Q
;
;
;----------
PRINTX(BILINL,BITAB) ;EP
Q:$G(BILINL)=""
N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
F I=1:1 S X=$T(@BILINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
Q
;
;
;----------
EXIT ;EP
;---> End of job cleanup.
D KILLALL^BIUTL8(1)
K ^TMP("BILMLT",$J)
D CLEAR^VALM1
D FULL^VALM1
Q
BILETVW ;IHS/CMI/MWR - VIEW/EDIT FORM LETTERS; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;;SEP 01,2011
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; VIEW/EDIT FORM LETTERS.
+4 ;
+5 ;----------
START ;EP
+1 ;---> Lookup and edit Form Letters in the file BI LETTER.
+2 DO SETVARS^BIUTL5
NEW BIY
+3 FOR
Begin DoDot:1
+4 DO TITLE^BIUTL5("VIEW/EDIT FORM LETTERS")
DO TEXT3
+5 NEW BIIEN
+6 DO DIC^BIFMAN(9002084.4,"QEMAL",.BIY," Select Form Letter: ")
+7 IF $GET(BIY)<1
QUIT
+8 SET BIIEN=+BIY
+9 ;---> If this is a new letter, select and copy Sample Form Letter.
+10 IF $PIECE(BIY,U,3)
DO ADDNEW^BILETVW2(.BIIEN)
+11 ;---> Quit if Sample Form Letter not selected (new IEN deleted).
+12 IF '$GET(BIIEN)
QUIT
+13 DO EN(+BIIEN)
End DoDot:1
IF $GET(BIY)<1
QUIT
+14 DO EXIT
+15 QUIT
+16 ;
+17 ;
+18 ;----------
HAVELET(BIIEN) ;EP
+1 ;---> NOT CALLED AT THIS TIME? 8/9/99
+2 ;---> Entry point when letter is already known.
+3 DO SETVARS^BIUTL5
+4 KILL ^TMP("BILMLT",$JOB)
+5 DO EN(BIIEN)
DO EXIT
+6 QUIT
+7 ;
+8 ;
+9 ;----------
EN(BIIEN) ;EP
+1 ;---> Main entry point for BI LETTER VIEW/EDIT.
+2 ;---> If BIIEN not supplied, set Error Code and quit.
+3 IF '$GET(BIIEN)
DO ERRCD^BIUTL2(609,,1)
QUIT
+4 DO EN^VALM("BI LETTER FORM")
+5 QUIT
+6 ;
+7 ;
+8 ;----------
HDR ;EP
+1 ;---> Header code.
+2 NEW X
SET X="Form Letter: "_$PIECE(^BILET(BIIEN,0),U)
+3 DO CENTERT^BIUTL5(.X)
+4 SET VALMHDR(1)=""
+5 SET VALMHDR(2)=X
+6 QUIT
+7 ;
+8 ;
+9 ;----------
INIT ;EP
+1 ;---> Initialize variables and list array.
+2 DO INIT^BILETVW1
+3 QUIT
+4 ;
+5 ;
+6 ;----------
RESET ;EP
+1 ;---> Update partition for return to Listmanager.
+2 IF $DATA(VALMQUIT)
SET VALMBCK="Q"
QUIT
+3 DO TERM^VALM0
SET VALMBCK="R"
+4 DO INIT
DO HDR
QUIT
+5 ;
+6 ;
+7 ;----------
RESET2 ;EP
+1 ;---> Update partition without recreating display array.
+2 IF $DATA(VALMQUIT)
SET VALMBCK="Q"
QUIT
+3 DO TERM^VALM0
SET VALMBCK="R"
DO HDR
QUIT
+4 QUIT
+5 ;
+6 ;
+7 ;----------
HELP ;EP
+1 ;---> Help code.
+2 NEW BIX
SET BIX=X
+3 DO FULL^VALM1
NEW BIPOP
+4 DO TITLE^BIUTL5("FORM LETTER EDIT - HELP, page 1 of 2")
+5 DO TEXT1
DO DIRZ^BIUTL3(.BIPOP)
+6 IF $GET(BIPOP)
DO RE^VALM4
QUIT
+7 DO TITLE^BIUTL5("FORM LETTER EDIT - HELP, page 2 of 2")
+8 DO TEXT2
DO DIRZ^BIUTL3()
+9 IF BIX'="??"
DO RE^VALM4
+10 QUIT
+11 ;
+12 ;
+13 ;----------
TEXT1 ;EP
+1 ;;The Form Letter Edit Screen allows you to customize Form Letters.
+2 ;;
+3 ;;The TOP section of the screen displays the name of the Form Letter.
+4 ;;
+5 ;;The MIDDLE section of the letter displays the body of the letter
+6 ;;in a scrollable region. Use the up and down arrow keys to view
+7 ;;all parts of the letter.
+8 ;;
+9 ;;The BOTTOM section of the screen lists actions you can take to
+10 ;;edit secions of the letter or to print or delete the letter.
+11 ;;
+12 ;;Fields in the letter are signified by uppercase text within vertical
+13 ;;bars, such as |PATIENT NAME|. These Fields may be moved within the
+14 ;;letter or they may be deleted. However, the text within the
+15 ;;vertical bars must NOT be altered.
+16 ;;
+17 DO PRINTX("TEXT1")
+18 QUIT
+19 ;
+20 ;
+21 ;----------
TEXT2 ;EP
+1 ;;A Form Letter may contain up to 7 Sections. Each section is
+2 ;;represented by an Action at the bottom of the screen: Top, History,
+3 ;;Middle, Forecast, Bottom, Date/Loc, and Closing.
+4 ;;
+5 ;;When selected, some Sections take you to the word processor in order
+6 ;;to allow you to edit the section. (Your Preferred Editor should be
+7 ;;"Full Screen" for this; if not, contact your Site Manager.)
+8 ;;
+9 ;;Other Sections provide helpful information when they are selected.
+10 ;;
+11 ;;In order to add a NEW Form Letter, simply enter a name for the
+12 ;;new letter at the very first prompt, "Select Form Letter: ".
+13 ;;A generic sample letter will then appear under the newly named Form
+14 ;;Letter, which you can then edit to suit the intended purposes.
+15 ;;
+16 DO PRINTX("TEXT2")
+17 QUIT
+18 ;
+19 ;
+20 ;----------
TEXT3 ;EP
+1 ;;This screen will allow you to add and edit Form Letters.
+2 ;;
+3 ;;Please select a Form Letter, or enter the name of a new Form Letter
+4 ;;you wish to add. (Enter "?" to see a list of existing Form Letters.)
+5 ;;
+6 DO PRINTX("TEXT3")
+7 QUIT
+8 ;
+9 ;
+10 ;----------
PRINTX(BILINL,BITAB) ;EP
+1 IF $GET(BILINL)=""
QUIT
+2 NEW I,T,X
SET T=""
IF '$DATA(BITAB)
SET BITAB=5
FOR I=1:1:BITAB
SET T=T_" "
+3 FOR I=1:1
SET X=$TEXT(@BILINL+I)
IF X'[";;"
QUIT
WRITE !,T,$PIECE(X,";;",2)
+4 QUIT
+5 ;
+6 ;
+7 ;----------
EXIT ;EP
+1 ;---> End of job cleanup.
+2 DO KILLALL^BIUTL8(1)
+3 KILL ^TMP("BILMLT",$JOB)
+4 DO CLEAR^VALM1
+5 DO FULL^VALM1
+6 QUIT