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

PSJOCDC.m

Go to the documentation of this file.
  1. PSJOCDC ;BIR/MV - NEW ORDER CHECKS MISC. ;6 Jun 07 / 3:37 PM
  1. ;;5.0;INPATIENT MEDICATIONS ;**181,260**;16 DEC 97;Build 94
  1. ;
  1. ; Reference to ^PS(55 is supported by DBIA 2191.
  1. ;
  1. DC(PSGP,PSJORD,PSJCLINF) ;DC orders during Duplicate Therapy order checks
  1. ;PSGP - Patient DFN
  1. ;PSJORD - Order #_u/v/p
  1. ;Save local arrays and variables to be restored after DC order(s)
  1. Q:'$D(PSJORD)
  1. S PSJDCDTF=1
  1. D ^PSJOCVAR
  1. NEW ON S ON=PSJORD
  1. I $$DSPORD(PSJORD,.PSJCLINF) D DCORD
  1. D RESTORE^PSJOCVAR
  1. K PSJDCDTF
  1. Q
  1. DCORD ;DC order according to order type
  1. ;PSJOCFLG is used in DC^PSJLIACT so the newly DC order during DT will not redisplay.
  1. NEW PSJOCFLG S PSJOCFLG=1
  1. I PSJORD["U" D DCUD Q
  1. ; DC pending, active IV and complex orders
  1. D DC^PSJLIACT
  1. Q
  1. DSPORD(PSJORD,PSJCLINF) ;Display the order about to DC and check if the user wish to DC to order
  1. ;Returns 1 if continuing with DC the duplicate order.
  1. ;Returns 0 if not to DC.
  1. ;
  1. NEW %
  1. D DSPORD^PSJOC(PSJORD,,.PSJCLINF)
  1. ;DC^PSJOE does the DC prompt
  1. I PSJORD["U" Q 1
  1. ASKDC W !!,"Enter DC to discontinue the above order or press <RETURN> to continue:" S %=2 D TST4DC^PSGOEC W:%=2 !,"No action taken!"
  1. W !
  1. I %="" D ENDC^PSGOEM W ! G ASKDC
  1. I %=1 Q 1
  1. Q 0
  1. DCUD ;DC a U/D order
  1. ;Setup necessary variables needed by DC^PSJOE
  1. NEW PSGOEEWF,PSGSTAT,DIR,PSJDCFLG
  1. S PSJDCFLG=1
  1. S PSGSTAT=$P($G(^PS(55,PSGP,5,+PSJORD,0)),U,9)
  1. S PSGOEEWF="^PS(55,"_PSGP_",5,"_+PSJORD_","
  1. D SYSL^PSGSETU
  1. D DC^PSJOE(PSGP,PSJORD)
  1. K PSJDCFLG
  1. Q