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

CRHDDR.m

Go to the documentation of this file.
  1. CRHDDR ; CAIRO/CLC - RETRIEVE DNR ORDERS USING ORDER DIALOG ;4/23/08 13:06
  1. ;;1.0;CRHD;****;Jan 28, 2008;Build 19
  1. ;=================================================================
  1. ENT(CRHDRTN,DFN,CRHDNRTT,CRHDDIV,CRHDMULT) ;
  1. N CRHDSDAT,CRHDFND,CRHDRN,CRHDEXDT,CRHDEXN,X,Y
  1. N CRHDSTS,CRHDDL,CRHDCT,CRHDFLG,CRHDIEN1,CRHDOI
  1. K CRHDRTN
  1. ;CRHDMULT = 1,if multi active orders displayed
  1. S CRHDMULT=+$G(CRHDMULT)
  1. I '$G(CRHDRN) S CRHDRN=1
  1. D DNRPARM(.CRHDNRTT,DUZ,.CRHDDIV)
  1. S CRHDFLG=0
  1. S CRHDSDAT=$$NOW^XLFDT
  1. S CRHDEXDT=0,CRHDCT=0
  1. F S CRHDEXDT=$O(^OR(100,"AC",DFN_";DPT(",CRHDEXDT)) Q:'CRHDEXDT!(CRHDFLG) D
  1. .S CRHDEXN="" F S CRHDEXN=$O(^OR(100,"AC",DFN_";DPT(",CRHDEXDT,CRHDEXN)) Q:CRHDEXN=""!(CRHDFLG) D
  1. ..S CRHDOI=0
  1. ..F S CRHDOI=$O(^OR(100,CRHDEXN,.1,"B",CRHDOI)) Q:'CRHDOI!(CRHDFLG) D
  1. ...I $D(CRHDNRTT(+CRHDOI)) D DETAIL("CRHDRTN",CRHDEXN,.CRHDFLG,.CRHDCT,.CRHDMULT)
  1. Q
  1. ;
  1. DETAIL(CRHDY,CRHDIFN,CRHDFND,CRHDCNT,CRHDMDNR) ; -- Returns details of order CRHDIFN in CRHDY(#)
  1. N CRHDMCNT,X,CRHDX2,CRHDI,CRHDILOG,CRHD0,CRHD3,CRHD6,CRHDSEQ,CRHDITEM,CRHDPRMT
  1. N CRHDFIRT,CRHDTITL,CRHDINST,CRHDN,ORIGVIEW,ORFLG,CRHDII
  1. N DIWL,DIWR,DIWF,CRHDACTI,VAIN,CRHDOVW,ORNMSP,CRHDYT,CRHDDNR,CRHDXX,CRHDNX
  1. S CRHDIFN=+CRHDIFN,CRHD0=$G(^OR(100,CRHDIFN,0)),CRHD3=$G(^(3)),CRHD6=$G(^(6))
  1. Q:$P(CRHD3,"^",3)'=6
  1. K CRHDYT S CRHDOVW=1 D TEXT^CRHD8(.CRHDYT,+CRHDIFN_";"_+$P(CRHD3,U,7),254)
  1. ;CurrTx
  1. I $D(CRHDYT) D
  1. .I 'CRHDMDNR S CRHDFND=1
  1. .S CRHDN=0
  1. .;USE CRHDEXDT IN THE DATA NODE TO
  1. .I $D(@CRHDY) S CRHDCNT=CRHDCNT+1,@CRHDY@(CRHDCNT)=""
  1. .F CRHDII=1:1 S CRHDN=$O(CRHDYT(CRHDN)) Q:'CRHDN D
  1. ..S CRHDCNT=CRHDCNT+1
  1. ..I CRHDII=1 S @CRHDY@(CRHDCNT)=CRHDEXDT_"~"_CRHDIFN_"~"_CRHDYT(CRHDN)
  1. ..E S @CRHDY@(CRHDCNT)=CRHDYT(CRHDN)
  1. Q
  1. DNRPARM(CRHDNRTT,DUZ,CRHDDIV) ;GET DNR TITLES
  1. N CRHDPAR,CRHDDIVI,CRHDDNRT
  1. K CRHDNRTT
  1. S CRHDDNRT=0
  1. I '+$G(CRHDDIV) S CRHDDIV=+$$SITE^VASITE
  1. S CRHDPAR="DIV.`"_+CRHDDIV D GETLST^XPAR(.CRHDDNRT,CRHDPAR,"CRHD DNR ORDERABLE ITEMS")
  1. I 'CRHDDNRT D
  1. .S CRHDDIVI=$O(^DIC(4,"D",CRHDDIV,0))
  1. .I CRHDDIVI S CRHDPAR="DIV.`"_CRHDDIVI D GETLST^XPAR(.CRHDDNRT,CRHDPAR,"CRHD DNR ORDERABLE ITEMS")
  1. I CRHDDNRT D
  1. .S CRHDN=0 F S CRHDN=$O(CRHDDNRT(CRHDN)) Q:'CRHDN D
  1. ..S:$P($G(CRHDDNRT(CRHDN)),"^",2)'="" CRHDNRTT($P(CRHDDNRT(CRHDN),"^",2))=""
  1. Q
  1. LORDITM(CRHDY,CRHDFROM,CRHDDIR) ; Return a set of names from the ORDERABLE ITEMS file.
  1. ; copied from ORWU1
  1. ; .CRHDY=returned list.
  1. ; CRHDDIR=Direction to move through the x-ref with $O.
  1. ; CRHDFROM=Starting name for this set.
  1. K CRHDRTN
  1. N CRHDNAME,CRHDNUMB,CRHDIEN1,CRHDMAX
  1. S CRHDI=0,CRHDMAX=44
  1. F Q:CRHDI'<CRHDMAX S CRHDFROM=$O(^ORD(101.43,"B",CRHDFROM),CRHDDIR) Q:CRHDFROM="" D
  1. .S CRHDIEN1=""
  1. .F S CRHDIEN1=$O(^ORD(101.43,"B",CRHDFROM,CRHDIEN1),CRHDDIR) Q:'CRHDIEN1 D
  1. ..I $D(^ORD(101.43,CRHDIEN1,.1)),+$G(^ORD(101.43,CRHDIEN1,.1)) I +^ORD(101.43,CRHDIEN1,.1)<$$DT^XLFDT Q
  1. ..S CRHDI=CRHDI+1,CRHDY(CRHDI)=CRHDIEN1_"^"_CRHDFROM
  1. Q