Z Programs image

Z Programs

Our Z program listing offers utilities a quick reference to available utilities in NPR.

Access our Z Programs Listing

Click on any Z.program below to view it.
Click on the "Close" link to return to the full listing.

Age Related Z Programs
Z.age
Z.age

Arguments: A = birthdate YYYYMMDD
B = base date YYYYMMDD Optional, uses @.today otherwise

Returns: Age in years, months days, according to the following scheme:
Under 1 year
nM dD
Under 5 years
nY mM
5 or over
nn

Example call: %Z.age(@birthdate,@.today) returns age
%Z.age(19560315,20000421) returns 44

Notes:
MEDITECH age fields are stored in this format. @ADM.PAT.age for example. Do not compare ages stored in the format with > and < because the ASCII value does not always correspond to the age. Reformat the age with %Z.age.with.years, Z.age.format.strip or Z.age.in.years if you need to do comparisons.

Z.age.ck

Z.age.ck

Arguments: A = age in Z.age format
B = not nil if "weeks gestational age" allowed

Returns: Users input if valid, nil if not valid.

Example call: %Z.age.ck(@age) returns @age
%Z.age.ck(“4Y 11M”) returns “4Y 11M”
%Z.age.ck(“6Y 11M”) returns “” (bad format)

Z.age.format

Z.age.format

Arguments: A = age in standard MEDITECH age format

Returns: Age formatted as below, allowing comparisons
returns either nn (years if nn>5)
; nY mmM (if n'=0)
; 0Y mmM ddD
; 0Y 00M 000D ggWG (weeks gestational)
Example call %Z.age.format(@age) returns nY mmM
%Z.age.format(“1M 22D”) returns “0Y 01M 22D”

Z.age.format.strip

Z.age.format.strip

ARGUMENT: A = a formatted age (e.g., 0Y 04M 11D)

RETURNS: Stripped age (e.g., 4M 11D)
Example Call: %Z.age.format.strip(“1Y 01M”) returns “1Y 1M”

Z.age.group

Z.age.group

Arguments: A = birth date
B = admit date

Returns Age Group (Canadian)
NB = NEWBORN
UM = UNDER 1 MONTH
00 = UNDER 1 YEAR
99 = 100 YRS or MORE
AU = AGE UNKNOWN
= Others (no age group returned)

Note: Canadian hospitals only.

Z.age.in.years

Z.age.in.years

Arguments: A = birthdate YYYYMMDD
B = date as of YYYYMMDD

Returns: Age in Years

Example Call: %Z.age.in.years(19580101,20000101) Returns 42

Z.age.to.birthdate

Z.age.to.birthdate

Converts an age to a computed birthdate.

Arguments: A = age (for example: 32, 3Y 6M, 2M 15D)
B = base date (age A was recorded on this date; generally
today or admission date) YYYYMMDD format.

Returns: Computed birthdate in YYYYMMDD format.
Example Call: %Z.age.to.birthdate(42,20000422) returns 19580422

Z.age.with.years

Z.age.with.years

Allows compiled reports to compare ages.

Arguments: A = birthdate

B = OPTIONAL base date (e.g., admission date) - program uses IF{B;@.today}

Returns: Age in years, months, days. If the age is less than one year, "0Y "

is returned in front of the number of months and days.

Examples: 32, 3Y 10M, 0Y 0M 21D

Example Call: %Z.age.with.years(20000101,20000421) returns 0Y 03M 20D

Date and Time Related Z Programs

Z.bdate.in

Z.b.date.in

Arguments        A = External Date (MM/DD/YY US  DD/MM/YY Canada)

Returns            Internal Date based on system century = current year - 99

Example Call:   %Z.date.in(“04/02/00”) Returns 20000402

Z.date.add2

Z.date.add

Argument:         A = internal date YYYYMMDD

                        B = integer, days to add to A (for negative use 0-N or “-N”

Returns”            Internal date N days from A

Example Call:    %Z.date.add(20000101,90) returns 20000331

Z.date.clin.to.out

Z.date.clin.to.out

Arguments:         A = clinical date or S(0) (Seconds since 3/1/1980)

Returns:             External Date (MM/DD/YY US, DD/MM/YY Canada).

This yields the same results as:  %Z.date.out(%Z.date.in.magic(input))

Example Call:    %Z.date.clin.to.out(S(0)) (on 04/21/00) returns “04/21/00”

                        %Z.date.clin.to.out(7356) returns “04/21/00”

Z.date.clin.to.text

Z.date.clin.to.text

This program takes a clinical date and returns a 'text' form of it.

Arguments:       A = date  (days since 3/1/1980 or S(0))

B = format indicator:   Use M, m, N, n, D, d, Y, y.

(Capital letter means long form; Small letter means abbreviated form)

(All other characters are taken literally.)

Examples:

September 03, 1990    "M D, Y"

September 3, 90         "M d, y"

Sep 03, 1990              "m D, Y"

03Sep90                   "Dmy"

3 Sep 90                   "d m y"

3-Sep-90                   "d-m-y"

09/03/90                   "N/D/Y"

[For text month only:]

C = "I"  to print month with inital capital only, for example, September or Sep.

="A"  to print month with all capitals, e.g., SEPTEMBER or SEP

DEFAULTS:

B = "m d,Y"  \_____  Sep 3, 1990

C ="I"       /

Example Call     %Z.date.clin.to.text(7356,”M D, Y”) returns “April 21, 2000

Z.date.clinical

Z.date.clinical

Arguments:       A = Internal Date YYYYMMDD

Returns:            Clinical Date (Number of days since 3/1/1980

                        If the A is not eight characters, A is returned.

Example Call:    %Z.date.clinical(7356) returns 20000421

Z.date.in

Z.date.in

 

Arguments:       A = mm/dd/yy or T or T+n or T-n

Returns:            YYYYMMDD

Example Call:    %Z.date.in(“03/01/00”) with system century = 1900 returns "19000301”
                        %Z.date.in(“03/01/00”) with system century = 1930 returns “20000301”

 

Z.date.in.magic

Z.date.in.magic

 

Arguments:     A = S(0) or @.sd or clinical date

Returns:         YYYYMMDD 
Example Call: %Z.date.in.magic(7356) Returns 20000421

 

Z.date.julian

Z.date.julian

 

Arguments:       A = YYYYMMDD

Returns:            YYJJJ – The Julian date.

Example call:    %Z.date.julian(20000421) returns 00112

Z.date.julian.to.in

Z.date.julian.to.in

Arguments:       A = YYJJJ

Returns:            YYYYMMDD

Example call:    %Z.date.julian.to.in(“00112”) returns 20000421

Z.date.out

Z.date.out

Arguments:       A = internal date YYYYMMDD
                        B = if non-nil, return A if format checks fail
                        C = 5 return MM/DD or DD/MM
                        C = 10 return MM/DD/YYYY or DD/MM/YYYY

Returns:            MM/DD/YY or MMDDYYYY depending on system century or argument C 
Example Call:    %Z.date.out(20000421) returns 04/21/00
                      %Z.date.out(20000421,””,5) returns 04/21
                      %Z.date.out(20000421,””,10) returns 04/21/2000”

Z.date.out.long

Z.date.out.long

Argument:         A = YYYYMMDD 

Returns:            MM/DD/YYYY
                        (US format only)
Example Call     %Z.date.out.long(20000421) Returns 04/21/2000

Z.date.sub

Z.date.sub

Arguments:       A = more recent date
                        B = older date

Returns:            Number of days between B and A
                        If A or B are nil, returns nil
Example Call:    %Z.date.sub(20000415,20000101) returns 105

Z.date.text

Z.date.text

Arguments:       A date in (YYYYMMDD or MM/DD/YY or MM/DD/YYYY)< /p> B = format indicator:   Use M, m, N, n, D, d, Y, y.
Capital letter means long form; Small letter means abbreviated form)
(All other characters are taken literally.)
Examples:

September 03, 1990    "M D, Y"< /p> September 3, 90         "M d, y"
Sep 03, 1990              "m D, Y"
03Sep90                    "Dmy"
3 Sep 90                    "d m y"
3-Sep-90                   "d-m-y"
09/03/90                    "N/D/Y"
[For text month only:]
C = "I"  to print month with inital capital only, e.g, September or Sep.
C = "A"  to print month with all capitals, e.g., SEPTEMBER or SEP
               DEFAULTS:
                 B = "m d, Y"  \_____  Sep 3, 1990
                 C = "I"       /

Z.day.from.date

Z.day.from.date

Arguments:        A = YYYYMMDD 

Returns:             Day of the week (integer) 

Example Call:    %Z.day.from.date(20000421) Returns 6

Z.day.in

Z.day.in

Converts a three-letter mnemonic (ex. "MON") for a day into a number (ex. 2). 

Arguments:       Three letter day mnemonic ex: SUN, MON, TUE, WED. 

Returns:            Day of the week (SUN = 1) 

Example Call:    %Z.day.in(“FRI”) returns 6

Z.day.out

Z.day.out

Converts number 1 – 7 to corresponding mnemonic for day of the week 

Arguments:       Integer 1 – 7 

Returns:           SUN – SAT 
Example Call:   %Z.day.out(6) Returns “FRI”

Z.month.in

Z.month.in

Arguments:       A = Three letter mnemonic for Month

Returns:            Number of month
Example Call:   %Z.month.in(“APR”) returns

Z.month.out

Z.month.out

Converts an internal month (1-12) into an external mnemonic (ex. "FEB").
Example Call:    %Z.month.out(1) returns “JAN”

Z.time.add

Z.time.add

Arguments:       A = internal date YYMMDD
B = time HHMM
C = number of minutes to add  (may be a negative number)

Returns:           Q(new.date,new.time)     new.date = YYMMDD     new.time = HHMM

Example:          A = 19910103
                        B = 0700
                        C = "-600"  (i.e., subtract 10 hours) 
                       
Returns: Q(19910102,2100)
Example Call:    Z.time.add(20000421,1200,60*24*3) returns 20000424 1200

Z.time.in

Z.time.in

Arguments:       A HHMM time

Returns:            S(0) time
Example Call     %Z.time.in(1300) returns 46800

Z.time.lapse

Z.time.lapse

Arguments:       S(0) time or HH:MM:SS time

Returns:            the alternative format
Example call     %Z.time.lapse(46800) returns 13:00:00
                        %Z.time.lapse(“13:00:00”) returns 46800

Note:  Do not use S(0) or @sd directly, convert to internal time first as follows:
          %Z.time.lapse(%Z.time.in(HHMM)) or %Z.time.lapse(S(0)\86400)
          The internal time is the remainder on division (\) of S(0) and 86400 because
          there are 86400 seconds in a day.

Z.time.out

Z.time.out

Argument:         Time in S(0) format or HHMM or HH:MM

Returns:            HHMM unless already HH:MM, then HH:MM returned

Example call:    %Z.time.out(S(0)) returns the current time in HHMM format

Z.time.sub

Z.time.sub

Argument:         A = end time     HHMM
                        B.= start time    HHMM

Returns:           minutes between B and A

Example call:   %Z.time.sub(2400,1200) returns 720

Z.time.text

Z.time.text

Arguments:       A = time (HHMM or NNNNN*)
B = format indicator:  Use H, h, M, m, A, a, N
(Capital letter means keep lead zero; Small letter means don't)
(Use 'A' or 'a' for AM/PM.  'A' means use 'AM' or 'PM'; 'a' = 'A' or 'P')
(N means to return military time)
(All other characters are taken literally)

Examples:
                        09:10am  "H:MA"
                        9:10 a     "h:M a"
                        9:10 am   "h:M A"
                        0910 am  "HM A"
                        0910a      "HMa"
                        1530        "N"   (with input as 1530)

                 C = "C" to capitalize AM and PM
                    = "S" to use small letters for am and pm
                 D = 1 to indicate that argument A is internal time in seconds.

If A is NNNNN (seconds), it will be converted to HHMM *UNLESS* it looks
like HHMM already.  It is best to pass in HHMM time.  If you cannot,
pass in D=1 so that the program knows that the time is in internal form.
(i.e., 0000-2359 seconds is indistinguishable from 0000-2359 HHMM, except
where X%1>59;  however, note that 2359 seconds is only = 0039 HHMM, a small
time window).
DEFAULTS:
                  B = "h:MA"   \___  e.g., 9:10am
                  C = "S"      /

Example call: %Z.time.text(1300,"h:mmA","C") Returns “1:00PM”

Z.elapsed.time

Z.elapsed.time

Computes the elapsed time between two combinations of date/time
               

Arguments:       A =End date
B - End time
C - Start date
D - Start Time
E - format of output

The dates must be in the internal NPR format: YYYYMMDD
The times must be in the HHMM format.  If they are in TIME format, call %Z.time.out to convert them to HHMM.

Argument E is used to determine the output format.  It is entered as a quoted
string, eg, "hh HRS".  The string will be interpreted for three keywords, and
will make substitutions for those keywords.  All other text in the string will
be outputted as entered.  The keywords are:
“hh"   - number of hours
"mm"   - number of minutes
"hh.hh" - number of hours to two decimal points

Example list of the formats and the results given a stay of 11 hours and 35 minutes:
Format                          Output
"hh Hrs mm Mins"          11 Hrs 35 Mins
"hh.hh Hours"                11.6 Hours                
"hh/mm"                        11/35
"hh hours"                     12 hours
"hh.mm"                        11:35

Notes:
1) if "hh.hh" is entered, do not also enter "hh" or "mm"
2) if "hh" is used without "mm", "hh" will be rounded to the nearest hour.
3) if "hh.mm" is found in the format string, "hh:mm" is substituted.

Example call: %Z.elapsed.time(20000101,1300,19991231,1200,”hh.hh”) returns 25.00
                     %Z.elapsed.time(20000101,1300,19991231,1230,”hh.mm”) returns 24:30
                     %Z.elapsed.time(20000101,1300,19991231,1230,”hh.hh”) returns 24.50

When adding elapsed times to compute averages, use “hh.hh”, adding hours and minutes as if they were decimals will produce inaccurate results.

Graphics and Printer Z programs

Z.bar.code

Z.bar.code

Arguments        A = string to be printed in barcode
B = number of columns the cursor should have moved to the right when the program returns
C = not used
D = type of bar code:  nil Code 3 of 9 “POSTNET” – Postnet
Returns             Nil
Barcodes should be printed one line high.  User can print the same data on two successive lines if a taller barcode is desired.
The following programs are called from Z.bar.code to handle specific printers:
%Z.bar.code.eltron
%Z.bar.code.fargo
%Z.bar.code.hp
%Z.bar.code.genicom

Z.on.device

Z.on.device

Selects an output device, opens ! to it.
Arguments        A = "N" - submerged spooling will not be allowed;
                       else allow it unless @Z.spool.bj.no non-nil
                        B - prompt, default is "Print on: "
                        C - default response, . implies
                        MIS.USER.default.device[@.logical.device]

Z.printer.open.px

Z.printer.open.px

Use this program to open a prefix to a particular printer via a program.
Argument:         A - mnemonic of the output device
                        B - If present open port in that mode, eg, "I" for instrument buffer.

Z.printer.close.px

Z.printer.close.px

When printing from a program, you should use this program to close ! when printing is complete. Otherwise, depending on how a remote printer is managed, you will lose all the output, or not get the last page.

Arguments:       None

Z.graphics

Z.graphics

Arguments:       A = Box type   0 - black border
                                                1 - grey box
                                                2 - grey box and black border 
                        B = length of box 
                        C = ht of box (DFT=1)  (can be 0 for just a horizontal line) 
                        D = number of chars to move right (+) or left (-) before starting box 
                        E = number of chars to move down (+) or (-) before starting box. 
                        F = gray scale (default = 10%) 
                        G = width of lines (DFT=5)

Z.directory.name

Z.directory.name

Arguments:       None

Returns:            Name of current (MAGIC) directory

Z.directory.type

Z.directory.type

Arguments:       None

Returns:            Current directory type (“LIVE” or “TEST”)

MEDITECH Workstation DOS commands

Z.dos.check

Z.dos.check

Arguments:       A = source file

Returns:            nil – file not found
1                      file opened
99                    error

Z.dos.create

Z.dos.create

Arguments:       A = path and file name 

Z.dos.delete

Z.dos.delete

Arguments:       A = path and file name

Z.dos.filename.valid

Z.dos.filename.valid

Arguments:       A = complete path

Returns:            {@error,@exists,@path}
where @exists is a flag, and @path is a valid dos path to the file, and @error
is a short message indicating why the filename is not valid
if wildcards are used, returns the first file that matches
if no matches, filename is considered valid, but no path returned
possible return value combinations and their interpretations:
@error         @exists @path      interpretation
------             -------   -----      --------------
  ""                ""      ""            valid name, file doesn't exist, wildcard used in arg
; ""                ""      defined    valid name, path to file returned
; ""                1       ""            valid name, wildcard used, >1 file matches pattern
; ""                1       defined    valid name, file exists
;(""                2       defined    valid name, wildcard used, only this file matches ptrn)
; defined        ""      ""            invalid name (invalid path, other error, or "error")
; defined        ""      defined    this case isn't used
; defined        1       ""           this case isn't used
; defined        1       defined    reserved file name, invalid for use (usually)
;
; from empirical results, this assumes that if DOS (i.e. $DOS.DIR) returns a "File not Found"
; error, that the filename is otherwise valid.

Z.dos.link

Z.dos.link

Arguments:       A = executable
                        Prompts for a filename

Z.dos.link.no.file

Z.dos.link.no.file

Arguments        A = executable
                        B = command line/ file name 

Z.dos.rename

Z.dos.rename

Arguments:       A = source file path on PC
                        B = new file name

Returns:            nil = file not found or denied 
                        1 = file renamed 
                        99 = error encountered

Valid dos name should be no longer than 8 characters extension no longer than 3.

Z.dos.read

Z.dos.read

Arguments:       A = source file path on PC
                        B = name of structure containing text.  [B][1]..[B][n] 
                        C = 1 to delete temp file 
                        D = 1 read as an ASCII file 
                        else as a "flat" file 
                        E = longest line to allow, if TEXT type transfer, dft = 202 (i.e. 200 char of text.)}

Z.dos.write

Z.dos.write

Arguments:       A = name of structure containing text.  [A][1]..[A][n]
                        B = name of temp file to be used 
                       C = 1 write as an ASCII file 
                       else as a "flat" file

Misc String Functions

Z.amount.in.words

Z.amount.in.words

Arguments:       A =  Money value between 0.00 and 999999.99
                        B =  Optional maximum length, if exceeded, message printed instead of amount

Returns:            String indicating amount in words, cents are returned as digits.
                        C\100^C},

Z.convert.name

Z.convert.name

Uses $NM.STRIP translate string to UPPER CASE names and strip punctuation and
numbers.  It discards any middle name.  Translated names are used in some ID
programs to find possible matches for the name entered.
Arguments        A = name

Returns:           Q(last name,first name)
Example call    %Z.convert.name(Berman,Joel F”) returns |0 = BERMAN |1 = JOEL

Z.convert.to.mixed.case

Z.convert.to.mixed.case

Not available prior to release 4.7
Arguments        A = string to be converted
                      B = if true, treat as a name, convert to last<comma>first
                      C= if true, convert strings less than 6 characters to mixed case.   If C is nil, 1-5 character strings are left unchanged.

%Z.convert.to.mixed.case(“GRAND RAPIDS”)
Grand Rapids
%Z.convert.to.mixed.case(“TOM SAWYER”,1,1)
Sawyer,Tom
%Z.convert.to.mixed.case(“TOM SAWYER,””,1)
Tom Sawyer
%Z.convert.to.mixed.case(“THE RAIN IN SPAIN FALLS MAINLY IN THE PLAIN”,””,1)
The Rain In Spain Falls Mainly In The Plain

Z.money.ck

Z.money.ck

Checks validity of MONEY, SMONEY & PMONEY data types, and adds decimals on if appropriate.   
Returns 2 decimal number if OK, else nil

Z.name.inversion

Z.name.inversion

Arguments:      A = name in lastname,first<space>rest of name format

Returns:          Title First Last Etc 
                       eg. SMITH,DR WILLIAM III becomes DR WILLIAM SMITH III
Example Call:  %Z.name.inversion("Berman,Joel F III MD") returns
                      Joel F Berman, III, MD
I believe 4.7 has an MIS title dictionary to allow a site to tweak this program.

Z.phone.ck

Z.phone.ck

Formats phone numbers according to MIS parameter.

Arguments:       A is input
                        B is # of max columns in field
                        C suppresses messages to screen

Z.phone.format

Z.phone.format

Formats phone numbers according to MIS parameter.  This is identical to phone.ck except it does not prompt the user to accept a non standard format.  Instead it uses argument C to decide whether to accept it.

This program checks for legal zip codes and postal codes.  A legal zip code is either:   nnnnn  or  nnnnn-nnnn      A legal postal code is:  ana nan (02141  or  02141-1234) (A1B 2K3)

Arguments:       A = user's entry
B = Y or N (allow user to override a bad entry, after a warning)
C = Z, P, or nil   Z=only allow zip code form,
P=only allow postal code form,
nil=allow both)
                    RETURNS: TRUE if there is an error.

Z.split.text

Z.split.text"

decide whether to accept it.

 

Arguments:       A is input
                        B is # of max columns in field
                        C if true accept a format which does not match the standard format

Z.zero.fill

Z.zero.fill

Formats phone numbers according to MIS parameter.  This is identical to phone.ck except it does not prompt the user to accept a non standard format.  Instead it uses argument C to decide whether to accept it.

Arguments:       A is input
                        B is # of max columns in field
                        C if true accept a format which does not match the standard format

Z.zip.code.ck

Z.zip.code.ck

Formats phone numbers according to MIS parameter.  This is identical to phone.ck except it does not prompt the user to accept a non standard format.  Instead it uses argument C to decide whether to accept it.

Arguments:       A is input
                        B is # of max columns in field
                        C if true accept a format which does not match the standard format

MISC Z programs

Z.link.to.other

Z.link.to.other

Call from an NPR Menu as follows;
Z.link.to.other(Q(“EXT.XXX”,PROGRAM,A,B,C…))

Z.link.to.shell

Z.link.to.shell

Arguments:       A = url or filename with path or unc filename

Expects a single 'A' argument

Returns:
;               D(0) ok
;               D(128) There is not enough memory to perform the specified action.
;               D(130) The specified file was not found.
;               D(131) The specified path was not found.
;               D(154) There was a sharing violation
;               D(157) The DDE transaction failed.
;               D(159) There is no application associated with the given file name extension.

Note: Return codes are handled by the Workstation, and are only captured here with the
%Z.cmd.read(1) syntax (following the shell invocation) in order to clear the input buffer.

Uses the new Workstation SHELL command: D(30)_"sh_"_{\path\filename}^#
to invoke the PC program that is associated with the FILE TYPE of the
'A' argument. Valid arguments would be of the format:

;               "C:\Documents\Important Information.doc"
;               "\\server\shared files\group docum.xls"
;               "http://www.microsoft.com"

Note: It is not necessary to test for return codes.

Z.square.root

Z.square.root

Returns:            SQR(A)
iterative program to find square root
It averages out the divisor and the result until they're within .0001
Thus, it cannot do square roots on numbers < .0001*.0001=.0000001
There is an extra check that the number of iterations won't exceed 15,
though the number of iterations is usually under 6.

Window and Message Z programs, General Text Editor

Z.choice.list

Z.choice.list

Arguments        A = ^file of choices, consisting of choice text and 1-2 letter mnemonics.
subscript is the display.order
See arg E for file structure of text and mnemonics
B = default mnemonics

; optional arguments:
C = Q(R,C,@center) = where to put window (dft is "field-based")
IF{C|2 @CENTERED.WINDOW;@WINDOW.AT.R.C}
D = title (default is "CHOICES")
E - address of mnemonic and text:
E|0 = Address of mnemonic:
If "" - use subscript of file as the mnemonic
else E|0 is the packed piece where the mnemonic is stored.
E|1 = Address of text:
If "" - use value of file, ie, [A,sub]
else E|1 is the packed piece where the name is stored.
Thus if E = Q("",""), file structure is [A,mnemonic]=text
if E = Q(0,1),   file structure is [A,display.order]=Q(mnemonic,text)
Returns option.letter or nil

 

Example call:    %Z.choice.list(^/CH,2,Q("","",1),"Title",Q("",1))
Given structure: /CH[1]=Q(5,”Five”)
                        /CH[2]=Q(4,”Four”)
                        /CH[3]=Q(3,”Three”)
                        /CH[4]=Q(2,”Two”)
                        /CH[5]=Q(1,”One”)
                        /CH[6]=Q(0,”Blastoff”)

Z.console.message

Z.console.message

Sends a message to the system caretaker print file.

Arguments:       A = message text

B = message group (DEFAULTS to /.APPL)
C = OPTIONAL end of message text, e.g., sign-on errors

Z.scroll.date

Z.scroll.date

; select a date
; A = relative window row
; B = optional title
; C = if TRUE, leave cursor OFF when done
Pops up a date and time selection scrolling window.  Returns Z.date.clinical and time when a date and time are selected in |0 and |1.

 

Example call: %Z.scroll.date(“”)

Z.scroll.menu

Z.scroll.menu

Arguments:       A Q(Choice1,Choice2,etc...)
B Q(top left row,top left column,# rows,#columns)
C title
Example Call: %Z.scroll.menu(Q("Happy Meal","Chicken Shapes","Hot Dogs","French Fries ","Mac & Cheese"),Q(10,10,5,20),"Title")
 
Returns |0 number of selection in queued list
            |1 key stroke used to select (13 is C/R  18 is Rt Arrow, 147 is file)
            Exit or Escape return nil in |0.

 

Example call: %Z.scroll.date(“”)

Z.scroll.time

Z.scroll.time

; select a time of day
; A = relative window row
; B = relative window column
; C = optional title
; D = default time if not current
Pops up a scrolling time selection window.  Selected time is returned

Example call: %Z.scroll.time(20,10)

Z.text.ed.shell

Z.text.ed.shell

This procedure is used to set up a text file for editing by the text editor
kernal (Z.text.ed.kern).

A text box of any size can be defined as long as it is no more than 79 characters wide, and it's bottom margin is less than 24.  Although the kernal will accept a larger edit area (92 by 28), this particular shell has been set up with these maximums. This procedure establishes the temporary RAF which is used by the kernal.  It also defines a special function program and data for this program in special nodes in the RAF.

Arguments:       A - Nameof (^) textfile
B - Top margin.  Defaults to 3.  (A screen-editor message displays)
C - Bottom margin.  Defaults to 23.
D - Line length.  Defaults to 79.  Text lines that exceed this
length are reformatted by; 1st - stripping trailing spaces,
2nd - stripping leading spaces, 3rd - breaking line into
two or more lines.
E - Left margin.  Defaults to 0.  When added to line length
cannnot exceed 79.
F - Has value "D" if display only, otherwise display and edit
is assumed.  If F="Q", then copy queue will be preserved from
last use of editor.
G,H - Name of DPM and element where additional on-line help
documentation is defined.
I - (optional) COLOR only; override special editor functions:
Q(special.func.pgm,D(key.ascii,key.ascii,...),argument)
I|2 is saved in !Z.ARG for use by program in I|0.
Defaults to Q(Z.text.ed.spec.fn.keys,D(148,149,164),"")
J - (optional). Indicates the maximum number of lines for that file

Returns:            1 if text has been edited, otherwise nil.

Z.w.macro

Z.w.macro

Message should be in /.WO
;If /.Z.MACRO.OUT is non-nil, # is closed, and ! is open, output goes to !
;
;If /Z.SCHED.LOG is non-nil (# will be closed), procedure is being called from a
;  background "scheduled report".  This variable contains the address of a structure
;  in which messages may be logged.  Any yes/no or @W.err messages are considered an
;  error condition and termination of job is indicated by setting /Z.SCHED.ERR to 1.
;
;A=0, field relative (centered, 2 lines below, highlight field)
; =1, centered and 2 rows below current window
; =2, centered and 2 rows below current window - nil response allowed
;B=1, ring bell
;  0, don't
;C=0 or nil, don't prompt for anything (@W.err, @W.return)
; =1 prompt for Y/N with no default (@W.yes.no)
; =2 prompt for Y/N with 'Y' default (@W.yes.no.y)
; =3 prompt for Y/N with 'N' default (@W.yes.no.n)
; =4 prompt for CHOICE (@W.choice)
; =5 @W.display

Z.wm.macro

Z.wm.macro

;  COLOR only.  Copied from %Z.w.macro, but for MULTI-LINE windows.
;  Expects lines of text in: /.WO[q] = text
;      /.WO = max line length of text.
;           = 0 or "" to close display-only window.
;           = . to have program calculate this.
;      /.WD = default if C=4 or C=6
;      /.WC = choice string if C=4, check code if C=6 [use F as user's response]
;
; EXAMPLES:
;   @W.err SCREEN = %Z.wm.macro(0,1)
;   @W.err PROCEDURE LOGIC = %Z.wm.macro(1,1)
;   @W.return = %Z.wm.macro(1,0,0)
;   @W.yes.no = %Z.wm.macro(1,0,1)  ,2)  or  ,3)
;   @W.choice = %Z.wm.macro(1,0,4)  [set up /.WD and /.WC as noted above]
;   @W.display = %Z.wm.macro(1,0,5) [call with /.WO=0 or nil to close]
;   Ask & check response (new) =  %Z.wm.macro(1,0,6)  [set up /.WD and /.WC as noted above]
;
; A=0, field relative (centered, 2 lines below, highlight field)
;  =1, centered and 2 rows below current window
;  =2, centered and 2 rows below current window - nil response allowed
; B=1, ring bell
;   0, don't
; C=nil or 0, don't prompt for anything (@W.err, @W.return)
;  =1 prompt for Y/N with no default (@W.yes.no)
;  =2 prompt for Y/N with 'Y' default (@W.yes.no.y)
;  =3 prompt for Y/N with 'N' default (@W.yes.no.n)
;  =4 prompt for CHOICE (@W.choice)
;  =5 @W.display;
;  =6 prompt and check response with V(/.WC)
; D=response length if C=6
; E=non-nil if nil response ok.

Z.ws.hd

Z.ws.hd

Note: The standard MEDITECH front ends (FE and FEC) will do a %Z.ws.hd(“”) at every prompt, so you cannot use this program from the standard MT front ends.

Resources

Product Information