ORCXPND ; SLC/MKB - Expanded Display ;6/3/97 11:04
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
RESULTS ; -- Results Display
N ORESULTS S ORESULTS=1
EN ; -- main entry point for OR DETAILED DISPLAY
I '$G(ORNMBR) S ORNMBR=$$ORDERS^ORCHART("display") I 'ORNMBR S VALMBCK="" Q
D EN^VALM("OR DETAILED DISPLAY") S VALMBCK="R"
Q
;
EN1(DFN,ID,ORTAB) ; -- entry point for independent display
Q:'DFN Q:'$D(ID) S:'$D(ORTAB) ORTAB="ORDERS"
N ORNMBR,ORVP,ORPNM,ORSSN,ORDOB,ORAGE,ORSEX,ORTS,ORWARD,ORATTEND,ORL,OREBUILD
S ORNMBR=-1,^TMP("OR",$J,ORTAB,"IDX",ORNMBR)=ID D SLCT1^ORQPT
D EN^VALM("OR DETAILED DISPLAY")
Q
;
INIT ; -- init variables and list array
; ORNMBR=#[,#,...,#] of selection[s]
N LCNT,ORPIECE,NUM,ID S LCNT=0
F ORPIECE=1:1:$L(ORNMBR,",") S NUM=$P(ORNMBR,",",ORPIECE) I NUM D:LCNT BORDER S ID=$P($G(^TMP("OR",$J,ORTAB,"IDX",NUM)),U) D @(ORTAB_"^ORCXPND1") ; create ^TMP("ORXPND",$J)
S VALMCNT=LCNT,VALM("TITLE")=$$TITLE(ORTAB)
M ^TMP("VALM VIDEO",$J,VALMEVL)=^TMP("ORXPND",$J,"VIDEO")
Q
;
BORDER ; -- Insert border between items
S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=" "
S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=$$REPEAT^XLFSTR("*",79)
S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=" "
Q
;
MSG ; -- set msg line, XQORM("KEY")
N ACTION S ACTION=$P($G(^TMP("ORXPND",$J,0)),U,2)
I '$L(ACTION) S VALMSG="Enter ? for more help." Q
I ACTION="NEW" S VALMSG="Enter NW to place another order.",XQORM("KEY","NW")=$O(^ORD(101,"B","ORCB NEW ORDER",0))_"^1"
I ACTION="RENEW" S VALMSG="Enter RN to renew this order.",XQORM("KEY","RN")=$O(^ORD(101,"B","ORCB RENEW ORDER",0))_"^1"
I ACTION="REPLACE" S VALMSG="Enter RP to replace this order.",XQORM("KEY","RP")=$O(^ORD(101,"B","ORCB REPLACE ORDER",0))_"^1"
Q
;
MARGIN ; -- Reset bottom margin if menu display off
N BM S BM=$S(VALMMENU:17,1:21) Q:BM=VALM("BM") ; no change
S VALM("BM")=BM,VALM("LINES")=VALM("BM")-VALM("TM")+1,VALMBCK="R"
Q
;
HELP ; -- help code
N X S VALMBCK="" I 'VALMMENU D FULL^VALM1 S VALMBCK="R"
W !!,"Use the actions listed to scroll up and down, to view the data; if you want",!,"to search the data for a particular string, enter SL. You may print the"
W !,"data, either the entire list or just the current screen, by entering PL or PS",!,"respectively. Enter Q when finished to return to the chart."
W !!,"Press <return> to continue ..." R X:DTIME
Q
;
EXIT ; -- exit code
K ^TMP("ORXPND",$J)
Q
;
SETVIDEO(LINE,COL,WIDTH,ON,OFF) ; -- set video attributes
S ^TMP("ORXPND",$J,"VIDEO",LINE,COL,WIDTH)=ON
S ^TMP("ORXPND",$J,"VIDEO",LINE,COL+WIDTH,0)=OFF
Q
;
BLANK ; -- blank line
S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=" "
Q
;
ITEM(X) ; -- set name of item into display
S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X
I $D(IORVON),$D(IORVOFF) D SETVIDEO(LCNT,1,$L(X),IORVON,IORVOFF)
Q
;
TITLE(TAB) ; -- Screen title
N Y S Y=""
S:TAB="COVER" Y="Allergies/Alerts"
S:TAB="NOTES" Y="Progress Note"
S:TAB="PROBLEMS" Y="Problem"
S:TAB="MEDS" Y="Medication"
S:TAB="LABS" Y="Laboratory"
S:TAB="ORDERS" Y=$S($G(ORESULTS):"Results",1:"Order")
S:TAB="REPORTS" Y="Report"
S:TAB="CONSULTS" Y="Consult/Procedure"
S:TAB="XRAYS" Y="Radiology"
S:TAB="SUMMRIES" Y="Discharge Summary"
S:TAB="PTINQ" Y="Patient Inquiry"
S:(TAB="NEW")!(TAB="DELAY") Y="Order"
Q Y_" Display"
ORCXPND ; SLC/MKB - Expanded Display ;6/3/97 11:04
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
RESULTS ; -- Results Display
+1 NEW ORESULTS
SET ORESULTS=1
EN ; -- main entry point for OR DETAILED DISPLAY
+1 IF '$GET(ORNMBR)
SET ORNMBR=$$ORDERS^ORCHART("display")
IF 'ORNMBR
SET VALMBCK=""
QUIT
+2 DO EN^VALM("OR DETAILED DISPLAY")
SET VALMBCK="R"
+3 QUIT
+4 ;
EN1(DFN,ID,ORTAB) ; -- entry point for independent display
+1 IF 'DFN
QUIT
IF '$DATA(ID)
QUIT
IF '$DATA(ORTAB)
SET ORTAB="ORDERS"
+2 NEW ORNMBR,ORVP,ORPNM,ORSSN,ORDOB,ORAGE,ORSEX,ORTS,ORWARD,ORATTEND,ORL,OREBUILD
+3 SET ORNMBR=-1
SET ^TMP("OR",$JOB,ORTAB,"IDX",ORNMBR)=ID
DO SLCT1^ORQPT
+4 DO EN^VALM("OR DETAILED DISPLAY")
+5 QUIT
+6 ;
INIT ; -- init variables and list array
+1 ; ORNMBR=#[,#,...,#] of selection[s]
+2 NEW LCNT,ORPIECE,NUM,ID
SET LCNT=0
+3 ; create ^TMP("ORXPND",$J)
FOR ORPIECE=1:1:$LENGTH(ORNMBR,",")
SET NUM=$PIECE(ORNMBR,",",ORPIECE)
IF NUM
IF LCNT
DO BORDER
SET ID=$PIECE($GET(^TMP("OR",$JOB,ORTAB,"IDX",NUM)),U)
DO @(ORTAB_"^ORCXPND1")
+4 SET VALMCNT=LCNT
SET VALM("TITLE")=$$TITLE(ORTAB)
+5 MERGE ^TMP("VALM VIDEO",$JOB,VALMEVL)=^TMP("ORXPND",$JOB,"VIDEO")
+6 QUIT
+7 ;
BORDER ; -- Insert border between items
+1 SET LCNT=LCNT+1
SET ^TMP("ORXPND",$JOB,LCNT,0)=" "
+2 SET LCNT=LCNT+1
SET ^TMP("ORXPND",$JOB,LCNT,0)=$$REPEAT^XLFSTR("*",79)
+3 SET LCNT=LCNT+1
SET ^TMP("ORXPND",$JOB,LCNT,0)=" "
+4 QUIT
+5 ;
MSG ; -- set msg line, XQORM("KEY")
+1 NEW ACTION
SET ACTION=$PIECE($GET(^TMP("ORXPND",$JOB,0)),U,2)
+2 IF '$LENGTH(ACTION)
SET VALMSG="Enter ? for more help."
QUIT
+3 IF ACTION="NEW"
SET VALMSG="Enter NW to place another order."
SET XQORM("KEY","NW")=$ORDER(^ORD(101,"B","ORCB NEW ORDER",0))_"^1"
+4 IF ACTION="RENEW"
SET VALMSG="Enter RN to renew this order."
SET XQORM("KEY","RN")=$ORDER(^ORD(101,"B","ORCB RENEW ORDER",0))_"^1"
+5 IF ACTION="REPLACE"
SET VALMSG="Enter RP to replace this order."
SET XQORM("KEY","RP")=$ORDER(^ORD(101,"B","ORCB REPLACE ORDER",0))_"^1"
+6 QUIT
+7 ;
MARGIN ; -- Reset bottom margin if menu display off
+1 ; no change
NEW BM
SET BM=$SELECT(VALMMENU:17,1:21)
IF BM=VALM("BM")
QUIT
+2 SET VALM("BM")=BM
SET VALM("LINES")=VALM("BM")-VALM("TM")+1
SET VALMBCK="R"
+3 QUIT
+4 ;
HELP ; -- help code
+1 NEW X
SET VALMBCK=""
IF 'VALMMENU
DO FULL^VALM1
SET VALMBCK="R"
+2 WRITE !!,"Use the actions listed to scroll up and down, to view the data; if you want",!,"to search the data for a particular string, enter SL. You may print the"
+3 WRITE !,"data, either the entire list or just the current screen, by entering PL or PS",!,"respectively. Enter Q when finished to return to the chart."
+4 WRITE !!,"Press <return> to continue ..."
READ X:DTIME
+5 QUIT
+6 ;
EXIT ; -- exit code
+1 KILL ^TMP("ORXPND",$JOB)
+2 QUIT
+3 ;
SETVIDEO(LINE,COL,WIDTH,ON,OFF) ; -- set video attributes
+1 SET ^TMP("ORXPND",$JOB,"VIDEO",LINE,COL,WIDTH)=ON
+2 SET ^TMP("ORXPND",$JOB,"VIDEO",LINE,COL+WIDTH,0)=OFF
+3 QUIT
+4 ;
BLANK ; -- blank line
+1 SET LCNT=LCNT+1
SET ^TMP("ORXPND",$JOB,LCNT,0)=" "
+2 QUIT
+3 ;
ITEM(X) ; -- set name of item into display
+1 SET LCNT=LCNT+1
SET ^TMP("ORXPND",$JOB,LCNT,0)=X
+2 IF $DATA(IORVON)
IF $DATA(IORVOFF)
DO SETVIDEO(LCNT,1,$LENGTH(X),IORVON,IORVOFF)
+3 QUIT
+4 ;
TITLE(TAB) ; -- Screen title
+1 NEW Y
SET Y=""
+2 IF TAB="COVER"
SET Y="Allergies/Alerts"
+3 IF TAB="NOTES"
SET Y="Progress Note"
+4 IF TAB="PROBLEMS"
SET Y="Problem"
+5 IF TAB="MEDS"
SET Y="Medication"
+6 IF TAB="LABS"
SET Y="Laboratory"
+7 IF TAB="ORDERS"
SET Y=$SELECT($GET(ORESULTS):"Results",1:"Order")
+8 IF TAB="REPORTS"
SET Y="Report"
+9 IF TAB="CONSULTS"
SET Y="Consult/Procedure"
+10 IF TAB="XRAYS"
SET Y="Radiology"
+11 IF TAB="SUMMRIES"
SET Y="Discharge Summary"
+12 IF TAB="PTINQ"
SET Y="Patient Inquiry"
+13 IF (TAB="NEW")!(TAB="DELAY")
SET Y="Order"
+14 QUIT Y_" Display"