CDS General Information image

CDS General Information

Disclaimer: Use of the following attributes is done at the sole discretion of the user. Iatric Systems is not responsible for any problems arising from the use of this code. All code should be implemented and tested thoroughly in a TEST environment before moving LIVE.

CDS Basics

  1. Position the cursor........................P(R,S)^#
  2. When to default in information:
    Always .....................................Data^/[ANS%0,CD]|0
    If Blank.....................................IF{/[ANS%0,CD];Data}^/[ANS%0,CD]|0
  3. Update the screen......................../[ANS%0,CD]|0^#
  4. Allow data entry using IFE...............1 or ""
  5. @t.fields...................................Temporary fields, pulls from / file
  6. @p.fields...................................Permanent fields, pulls from disk

Creating default answers

Example #1 -

Default Y/N if attending doctor is same as primary care doctor.

Admitting Screens

Admitting Screens

MIS Attribute

MIS Attribute

Example #2

Default reason for visit into OE reason for procedure.

In this case, via the short form registration, the comments are the reason for visit.

Comments

In OE, the test is ordered and the ADM comments default into the reason for procedure.

ADM comments

The attribute checks first for a reason for visit, and if not available, the comments are taken to ensure this works with all types of registrations, short and full.

Registrations

Example #3

Setup default answer via a fragment call to another module

In this example we set up a query to appear on the CBC ordering screen in OE that will show the total patient charges (so far) that have passed to B/AR. Obviously, this would work better with inpatients that have more than a one day los.

CBC ordering

The BAR fragment can quickly find the patient’s file via the acct number index.

BAR fragment

BAR

On page 3, we pull the total charges in an AL D footnote.

Page 3

Charges are pulled into field for display mostly. With the value of the IFE set to nil, users won’t be allowed to edit the field.

charges

Calling An NPR Report From An Attribute

In this example, we added a query to our CBC screen to allow the ordering user to generate a re-print of the Admitting form.

CBC

CBC

The output was sent to VIEW, like an ordinary NPR report run from a menu.

View

To print the report, we pass control to a macro residing in our macro library.

Print

;------------------------------------------------------------------------------------
;Macro loads appropriate / variables and calls Admissions form
;------------------------------------------------------------------------------------
@SETUP.PATIENT,
@SETUP.PROGRAM,
@GET.ADM.DATABASE,
@OPEN.TO.ADM.AND.KEEP.SLASH,
@CALL.PROGRAM,
@RESTORE.PREFIXES,
@SEG.BACK,
END;
;-------------------------------------------------------------------------------------

SETUP.PATIENT
A^/["urn"]

SETUP.PROGRAM
"ADM.PAT.zcus.adm.form4"^/PR,
"%"_/PR_".S("_D(34)_/PR_".R"_D(34)_","_D(34)_0_D(34)_")"^/PR

GET.ADM.DATABASE
/.FAC^MIS.FACILITY.mnemonic,
"ADM"^MIS.FACILITY.database,
@Next(MIS.FACILITY.database),
MIS.FACILITY.database^/ADM.DB

OPEN.TO.ADM.AND.KEEP.SLASH
"SEGS"^MEW
$[MEW](@MIS.APPL.database.segment[/ADM.DB],@MIS.APPL.database.directory[/ADM.DB]),
CL(\S,*S,?S,:S,&S),
ZZ%OP(!S,"P"),MOVE(/,!),ZZ%OP(/S,"P"),MOVE(!,/),CL(!U)

CALL.PROGRAM
%Z.sign.on.direct(/.MIS,/ADM.DB,"",/.USR,/PR,.,1)X

RESTORE.PREFIXES
CL(\U,*U,?U,:U,&U,/U)

SEG.BACK
CL($U,%U)

"Pop up" Messages via Attributes

First for the attribute:

image

Again, we call a macro in our library:
;------------------------------------------------------------------------------------
;Macro checks to see if any messages need to be 'popped' up to the ordering user
;based on the patient's blood pressure
;------------------------------------------------------------------------------------
@INITIALIZE,
IF{SP<90 @SYSTOLIC.TOO.LOW},
IF{DP>90 @DIASTOLIC.TOO.HIGH},
END;
;-------------------------------------------------------------------------------------

INITIALIZE
A#"0/"^SP,
A#"1/"^DP

SYSTOLIC.TOO.LOW
@INITIALIZE.MSG,
"Systolic Pressure is Low"^/BP.MSG[1],
"Check With Patient for History"^/BP.MSG[2],
@DISPLAY.MSG

DIASTOLIC.TOO.HIGH
@INITIALIZE.MSG,
"Diastolic Pressure is Elevated"^/BP.MSG[1],
"Check With Patient for History"^/BP.MSG[2],
@DISPLAY.MSG

INITIALIZE.MSG
""^MSG,
DO{+/BP.MSG[MSG]^MSG ""^/BP.MSG[MSG]}

DISPLAY.MSG
@Bell("")^#,
@Window.centered(8,50,3)^#,
"!! WARNING !!":50C^#,
N(D(4,0))^#,
N("")^#,
DO{+/BP.MSG[MSG]^MSG N(/BP.MSG[MSG]:50C)^#},
NN(D(4,0))^#,
N("Press << ENTER >>":50C)^#,
#0,
@Window.close("")^#


Message #1:

Message 1

Message #2:

Message 2

Adding field level security

Example #1 -

Control Enter/Edit access to a particular field.

In this example, we set up an attribute to determine whether or not a user has access to edit a particular field. We set up a custom field in MIS pertaining to allergies.

Allergies

In the attribute, we check the custom field:

Check custom field

If the user has access, the cursor will stop at that query, otherwise, it will simply skip over it.

Example #2 -

Control viewing of response to a customer-defined field.

For this example, we will use the same MIS query to control the access as in the previous example. In this example, we need to erase the query IAT.CONF, if the user doesn’t have access, when the screen displays (in the first query on the screen ADMDRSTR).

image

The macro being called is again stored in our macro library:
;--------------------------------------------------------------------------------
;Macro will nill out a particular query based on the row, col, and field length
;Query is passed in as argument A
;--------------------------------------------------------------------------------
@INITIALIZE,
@GET.ROW.COL.LEN,
@ADJUST.VALS,
@ZAP.QUERY,
END;
;--------------------------------------------------------------------------------

INITIALIZE
A^MIS.QUERY.mnemonic,
/CDS^MIS.SCREEN.mnemonic,
""^/ROW^/COL^/LEN

GET.ROW.COL.LEN
IF{@MIS.SCREEN.resp.row'="SAME";
    @MIS.SCREEN.query.row}^/ROW,
@MIS.SCREEN.resp.col^/COL,
IF{@MIS.SCREEN.resp.len;
    @MIS.QUERY.length}^/LEN

ADJUST.VALS
/ROW+3^/ROW,
/COL-1^/COL

ZAP.QUERY
P(/ROW,/COL," ":/LEN)^#

Obviously, control from example 1 should be added so that in addition to not viewing a field, we don’t give restricted users access to Enter/Edit the field as well.

With restricted user (Frank) the field confidential information is not viewable.

Restricted user

With non-restricted user (Joel) the field is viewable.

non-restricted

One Extra Trick: Double Click Hot Key

What to enter on the menu:

Enter on menu

Macro:

Macro