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

BSDB0.m

Go to the documentation of this file.
  1. BSDB0 ; IHS/ANMC/LJF - SCHEDULING TEMPLATES ;
  1. ;;5.3;PIMS;;APR 26, 2002
  1. ;
  1. ASK ;EP; ask user for template when setting up clinic
  1. ; Called by ^SDB0
  1. S Y=$$READ^BDGF("FO^1:30","TIME","","^D HELP^BSDB0")
  1. Q:Y=U Q:Y=""
  1. I Y="[?" D HELP2,ASK Q
  1. I $E(Y)="[" D GETTIMES($P(Y,"[",2)),ASK Q
  1. I Y'?4N1"-"4N D MSG^BDGF("Enter time like 0800-1200",1,0),ASK Q
  1. S BSDTIME=$G(BSDTIME)_Y_U D SLOTS,ASK Q
  1. Q
  1. ;
  1. GETTIMES(TNAMES) ; find times and slots based on sched template TNAMES
  1. NEW ONE,IEN,IEN1
  1. ; separate template names by ;
  1. F S ONE=$P(TNAMES,";"),TNAMES=$P(TNAMES,";",2,99) Q:ONE="" D
  1. . ;
  1. . ; find template in file 9009017.3
  1. . S IEN=$O(^BSDST("B",ONE,0)) I 'IEN W $C(7),"??" Q
  1. . ;
  1. . ; loop thru time multiples to set times and slots
  1. . S IEN1=0 F S IEN1=$O(^BSDST(IEN,1,IEN1)) Q:'IEN1 D
  1. .. S BSDTIME=$G(BSDTIME)_$P(^BSDST(IEN,1,IEN1,0),U)_U
  1. .. S BSDSLOT=$G(BSDSLOT)_$P(^BSDST(IEN,1,IEN1,0),U,2)_U
  1. Q
  1. ;
  1. SLOTS ; ask user for # of slots
  1. ;PROG NOTE: using Read command to mimic VA user interface where
  1. ; this question is on same line as TIME prompt
  1. R " NO. SLOTS: 1// ",Y:DTIME S:Y="" Y=1
  1. I Y>0 S BSDSLOT=$G(BSDSLOT)_Y_U
  1. Q
  1. ;
  1. HELP ;EP; user help on TIME question
  1. D MSG^BDGF($$SP(5)_"Enter times using this example: 0800-1200 or enter a",2,0)
  1. D MSG^BDGF($$SP(5)_"scheduling template name(s): [FMS C1 or [PEDS B3AM;PEDS D1PM.",1,0)
  1. D MSG^BDGF($$SP(5)_"A template name must be preceeded by a bracket [. If you need",1,0)
  1. D MSG^BDGF($$SP(5)_"to enter more than one template per day (am and pm), separate",1,0)
  1. D MSG^BDGF($$SP(5)_"them by a semicolon.",1,0)
  1. D MSG^BDGF($$SP(5)_"To see a list of current templates, type [? at TIME prompt.",1,0)
  1. Q
  1. ;
  1. HELP2 ; list scheduling templates in file
  1. NEW DIC,D,DZ,X,Y
  1. S DIC="^BSDST(",DIC(0)="AMQE",D="B",DZ="??" D DQ^DICQ
  1. Q
  1. ;
  1. PAD(D,L) ;EP -- SUBRTN to pad length of data
  1. ; -- D=data L=length
  1. Q $E(D_$$REPEAT^XLFSTR(" ",L),1,L)
  1. ;
  1. SP(N) ; -- SUBRTN to pad N number of spaces
  1. Q $$PAD(" ",N)