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

ORWPFSS.m

Go to the documentation of this file.
  1. ORWPFSS ; SLC/REV/GSS - CPRS PFSS Calls; 11/15/04 [11/15/04 11:43am]
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,228**;Dec 17, 1997
  1. ; Sub-routines for phase II of the CPRS PFSS project except for
  1. ; tag PFSSACTV which (with different code) is in CPRS v26 or phase I
  1. ;
  1. Q
  1. ;
  1. PFSSACTV(ORY) ; Is PFSS active for this system/user/etc?
  1. ; RPC called by Delphi to determine if passing visit string
  1. ;
  1. ; 1 = PFSS active - pass visit string with order
  1. ; 0 = PFSS not active - do not pass visit string
  1. ;
  1. ;$$SWSTAT^IBBAPI() WILL BE RELEASED IN IB*2*286, as per E.Zeigler
  1. ;
  1. ;Check for IB patch
  1. S ORY=+$$PATCH^XPDUTL("IB*2.0*286") Q:ORY=0
  1. ;Check PFSS master switch status (1=On, 0=Off)
  1. S ORY=+$$SWSTAT^IBBAPI() ;IA #4663
  1. Q
  1. ;
  1. ORACTREF(ORACTREF,ORIEN) ;Return PFSS Account Reference Number (ARN)
  1. ; PFSS ARN in order file (#100) as field #97, i.e., ^OR(100,ORIEN,5.5)
  1. ; This API is covered under IA #4673
  1. ;
  1. ; Access as D ORACTREF^ORWPFSS(.ORACTREF,ORIEN), where
  1. ; ORIEN Order IEN
  1. ; ORACTREF returned in internal format, i.e., pointer to file #375
  1. ;
  1. ; Input:
  1. ; ORIEN Order internal reference number related to PFSS ARN
  1. ; Output:
  1. ; ORACTREF PFSS Account Reference Number
  1. ;
  1. ; new variables
  1. N ORERCK,ORPKG,OIREC,OIV,OIVN
  1. ; initialize PCE Account Reference Number variable
  1. S ORACTREF=""
  1. ; check for a valid ORIEN
  1. S ORERCK=$$ORDERCK(ORIEN) Q:+ORERCK>1
  1. ; get PFSS ARN from Order File (#100)
  1. S ORACTREF=$$GET1^DIQ(100,ORIEN_",",97,"I","","")
  1. Q
  1. ;
  1. ORDERCK(ORIEN) ; check validity of Order IEN (ORIEN)
  1. ; used by ORWPFSS & ORWPFSS1, access as $$ORDERCK^ORWPFSS(ORIEN)
  1. ;
  1. ; Input:
  1. ; ORIEN Order internal reference number related to PFSS ARN
  1. ; Output:
  1. ; if error, returns #^reason, where #>1
  1. ; if valid, returns 1
  1. ;
  1. ; quit if ORIEN is null
  1. I $G(ORIEN)="" Q 90_U_"ORIEN IS NULL"
  1. ; quit if order is a document/note, i.e., not an order
  1. I ORIEN=0 Q 91_U_"ORIEN IS A DOCUMENT/NOTE"
  1. ; quit if ORIEN value is invalid, e.g., no such order
  1. I $D(^OR(100,ORIEN,0))'=1 Q 92_U_"ORIEN IS AN INVALID ORDER NUMBER"
  1. ; determine if package type supported
  1. I '$$PKGTYP(ORIEN) Q 93_U_"PACKAGE TYPE NOT SUPPORTED"
  1. ; ORIEN is valid
  1. Q 1
  1. ;
  1. PKGTYP(ORIEN) ; Build CPRS PFSS supported packages array
  1. ; returns 1 if order package type supported, otherwise returns 0
  1. ; LR=Lab, RA=Radiology
  1. ; to add a package, include it above (documentation) & in For stmt below
  1. ;
  1. N I,ORPKG,ORPKGARY
  1. F I=1:1 S ORPKG=$P("LR;RA",";",I) Q:ORPKG="" D
  1. . ; create ORPKGARY array of supported package types
  1. . S ORPKGARY(+$O(^DIC(9.4,"C",ORPKG,0)))=ORPKG ; ^DIC(9.4) is pkg file
  1. ; yes, order passed is of a package type that is supported
  1. I $D(ORPKGARY($P(^OR(100,ORIEN,0),U,14))) Q 1
  1. Q 0 ; package type not supported