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

LROR6.m

Go to the documentation of this file.
  1. LROR6 ;SLC/DCM - EDIT LAB ORDERS FOR OE/RR ;8/11/97
  1. ;;5.2;LAB SERVICE;**100,121,202**;Sep 27, 1994
  1. DC(REQ,STAT) ;DC reason
  1. ;REQ=1 to require a response
  1. ;STAT=1 to set the variable LRMSTATI for sending status back to OE/RR.
  1. I $$VER^LR7OU1<3 Q ;OE/RR 2.5 Check
  1. N DEF,R,PKG,X,OK
  1. S PKG=$O(^DIC(9.4,"B","LAB SERVICE",0))
  1. S DEF=$P($G(^LAB(69.9,1,"OR")),"^",2)
  1. AGAIN S X=$$DC^ORX1(DEF,+$G(REQ),PKG,"Cancellation Reason"),LRNATURE=$S(X:"^^^"_$P(X,"^",1,2)_"^99ORR",1:-1)
  1. I $G(STAT)=1 S OK=1,LRMSTATI=$P(X,"^",9) I LRMSTATI,LRMSTATI'=1 D G:'OK AGAIN
  1. . W !,"This Cancellation Reason will ONLY remove the accession.",!,"The Doctor's original order will NOT be canceled, so that it may be"
  1. . W !,"re-accessioned at a later time. OK"
  1. . ;"To later cancel the order, use the option: ",!," Delete entire order or individual tests",!
  1. . S %=1 D YN^DICN I %'=1 S OK=0
  1. . I %=0 W !!,"You may enter a different Cancellation Reason, if you wish.",!
  1. Q
  1. DC1(REASON,TEXT) ;Set HL7 String for DC Reason
  1. ;REASON=ptr to DC Reason (100.03)
  1. ;TEXT=free text reason to be associated with order (optional)
  1. I $$VER^LR7OU1<3 Q "" ;OE/RR 2.5 Check
  1. Q:'$G(REASON) ""
  1. N X S X=$G(^ORD(100.03,REASON,0)),X="^^^"_REASON_"^"_$S($L($G(TEXT)):TEXT,1:$P(X,"^"))_"^99ORR"
  1. Q X
  1. NEW(REQ) ;Get Nature of order
  1. ;REQ=1 to require a response
  1. I $$VER^LR7OU1<3 Q ;OE/RR 2.5 Check
  1. N DEF,X
  1. S DEF=$P($G(^LAB(69.9,1,"OR")),"^"),X=$$NA^ORX1(DEF,+$G(REQ),"B","Nature of Order/Change"),LRNATURE=$S(X:$P(X,"^",1,2)_"^99ORN",1:-1)
  1. Q
  1. NEW1(NATURE) ;Set HL7 String for Nature of Order
  1. ;NATURE=ptr to Nature of Order (100.02)
  1. I $$VER^LR7OU1<3 Q "" ;OE/RR 2.5 Check
  1. Q:'$G(NATURE)
  1. N X S X=$G(^ORD(100.02,NATURE,0)),X="^^^"_NATURE_"^"_$P(X,"^")_"^99ORN"
  1. Q X
  1. EN ;OE/RR 2.5 Nature of Order processes
  1. I ORSTS=""!(+ORSTS=11) D EDITUR^LROR6A Q
  1. I ORGY'=0 S OREND=0 D C^LROR3 Q
  1. EDIT ;Edit orders for OE/RR 2.5
  1. S LRODT=$P(ORPK,"^"),LRSN=$P(ORPK,"^",2),I=$P(ORPK,"^",3)
  1. S X="" W !!,"Released laboratory orders are UNEDITABLE." Q:+ORSTS=6 W !,"You may use this action to ADD a test to the existing lab order number."
  1. N ORACTION,ORPARAM S ORNDO=1 D EN^LROR9
  1. K LRODT,LRSN,LRSX
  1. Q
  1. OT ;OE/RR 2.5 Natuer of Order processing
  1. S DIR("?",1)="This order/change will be recorded in the patient's electronic record."
  1. S DIR("?",2)="A notification will be sent to the requesting clinician to electronically"
  1. S DIR("?",3)="sign this action, and a copy of this action will be printed in the"
  1. S DIR("?",4)="ward/clinic to be placed in the chart, unless specified as a 'CORRECTION'"
  1. S DIR("?",5)="(not affecting the original order), or 'WRITTEN REQUEST' (Signed on chart)."
  1. S DIR("?",6)=""
  1. S DIR("?")="Enter reason: (C)ORRECTION, (W)RITTEN, (V)ERBAL, (P)HONED"
  1. S DIR("A")="NATURE OF ORDER/CHANGE: "
  1. S DIR("B")=$S($D(^XUSEC("LRLAB",DUZ)):"CORRECTION",1:"WRITTEN")
  1. S DIR(0)="SA^C:CORRECTION (internal to lab);W:WRITTEN REQUEST (Signed on chart);P:TELEPHONED REQUEST;V:VERBAL REQUEST"
  1. D ^DIR K DIR S ORNATR=$S($L(Y)&(Y="P"!(Y="V")):Y,1:"C") ;Correction=""
  1. I "VPWC"'[Y W !,"NATURE OF ORDER/CHANGE must be entered",$C(7),! G OT
  1. Q