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

BLRAG05G.m

Go to the documentation of this file.
  1. BLRAG05G ; IHS/MSC/SAT - LABORATORY ACCESSION GUI RPCS ;03 MAY 2013 1200;SAT
  1. ;;5.2;IHS LABORATORY;**1031**;NOV 01, 1997;Build 185
  1. ;
  1. Q
  1. ;
  1. ;RPC to return Ask at Order Entry questions for the lab tests that go with the passed in Lab Order Entry file pointers.
  1. ; BLRAG05G AOE
  1. ;Input:
  1. ; BLRTSTL = (required) The "TEST POINTERS" portion of this data comes
  1. ; element 39 in the return from BLR ALL NON-ACCESSIONED.
  1. ; List of test pointers for each
  1. ; test/procedure being accessioned separated by ^.
  1. ; Each ^ piece is made up of these pipe pieces:
  1. ; TEST POINTERS | [ICD9_LIST_(not_used)] ^ ...
  1. ; Test pointers = pointers to the LAB ORDER ENTRY
  1. ; file 69 - DATE:SPECIMEN:TEST
  1. ; Note that these are the same pointers that are passed into BLR ACCESSION
  1. ;Output: BLRAOE=Count of items in array
  1. ; BLRAOE(<test ien>,<counter>)=Question prompt^Result Code^Lab Name
  1. AOE(BLRAOE,BLRTSTL) ;EP-
  1. N BLRDT,BLRJ,BLRSP,BLRTST
  1. N CNT,IEN,X
  1. D ^XBKVAR ;setup minimum KERNEL variables
  1. S X="ERROR^BLRAG05G",@^%ZOSF("TRAP") ;setup error trap
  1. S BLRAOE=0
  1. S CNT=0
  1. I $G(BLRTSTL)'="" D
  1. .F BLRJ=1:1:$L(BLRTSTL,U) D
  1. ..S BLRDT=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",1)
  1. ..S BLRSP=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",2)
  1. ..S BLRTST=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",3)
  1. ..S BLRTST60=$P($G(^LRO(69,+$G(BLRDT),1,+$G(BLRSP),2,+$G(BLRTST),0)),U,1) ;get test
  1. ..D GETPMT(BLRTST60)
  1. S BLRAOE=CNT
  1. Q
  1. ;
  1. ; Add prompts to return array for a given test
  1. GETPMT(TST) ;EP-
  1. N RL,RC,RI,N0,PC,TI,SC,LN
  1. S RL=$P($G(^BLRSITE(DUZ(2),"RL")),U)
  1. Q:'RL
  1. S RI=$O(^BLRRL("ALP",TST,RL,0))
  1. Q:'RI
  1. S LN=$P($G(^LAB(60,+$G(TST),0)),U,1)
  1. S RC=0 F S RC=$O(^BLRRL(RL,1,RI,1,RC)) Q:'RC D
  1. .S PC=$G(^BLRRL(RL,1,RI,1,RC,0))
  1. .S TP=$O(^BLRRL("BRES",PC,RL,0))
  1. .Q:'TP
  1. .S N0=^BLRRL(RL,1,TP,0)
  1. .S TI=$P(N0,U,7)
  1. .S SC=$P(N0,U,4)
  1. .S CNT=CNT+1
  1. .S BLRAOE(TST,CNT)=TI_U_SC_U_LN
  1. Q
  1. ;
  1. ERROR ;
  1. D ENTRYAUD^BLRUTIL("ERROR^BLRAG05G 0.0") ; Store Error data
  1. NEW ERRORMSG
  1. S ERRORMSG="$"_"Z"_"E=""ERROR^BLRAG05G""" ; BYPASS SAC Checker
  1. S @ERRORMSG D ^%ZTER
  1. D ERR("RPMS Error")
  1. Q
  1. ;
  1. ERR(BLRERR) ;Error processing
  1. ; BLRERR = Error text OR error code
  1. ; BLRAGI = pointer into return global array
  1. I +BLRERR S BLRERR=BLRERR+134234112 ;vbObjectError
  1. S BLRAOE=-1
  1. Q