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

ORWDPS5.m

Go to the documentation of this file.
  1. ORWDPS5 ;SLC/JLI - CPRS Orders Utility ; 8/15/2002 11AM
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**149,190**;Dec 17, 1997
  1. LESGRP(ORY,ORLES) ;Return all of the orders' display groups LES checked
  1. ;LES will check the orders belonging to the following display group
  1. ; 1. LAB/LABORATORY ORDERS
  1. ; 2. BLOOD BANK ORDERS
  1. ; 3. CHEMISTRY ORDERS
  1. N LABID,BLDBKID,CHMID
  1. S (LABID,BLDBKID,CHMID,ORY)=0
  1. S:$D(^ORD(100.98,"B","LAB")) LABID=$O(^ORD(100.98,"B","LAB",0))
  1. I 'LABID S:$D(^ORD(100.98,"B","LABORATORY")) LABID=$O(^ORD(100.98,"B","LABORATORY",0))
  1. S:$D(^ORD(100.98,"B","BLOOD BANK")) BLDBKID=$O(^ORD(100.98,"B","BLOOD BANK",0))
  1. S:$D(^ORD(100.98,"B","CHEMISTRY")) CHMID=$O(^ORD(100.98,"B","CHEMISTRY",0))
  1. I ('LABID)!('BLDBKID!('CHMID)) Q
  1. S ORY=LABID_U_BLDBKID_U_CHMID
  1. Q
  1. ;
  1. LESAPI(ORY,FLDS) ;Call LES Api from inside CPRS for validating changed lab order
  1. ; FLDS = DFN^TEST^ORL^ORNP^ORDT
  1. ; DFN: Patient DFN (pointer to #2)
  1. ; TEST: Lab Test IFN (pointer to #101.43)
  1. ; ORL: Patient Location (pointer to #44)
  1. ; ORNP: Provider IEN (pointer to #200)
  1. ; ORDT: Collection date/time (fileman format)
  1. N DFNL,TESTL,ORLOCL,ORNPL,ORDTL,HAVELES
  1. S (DFNL,TESTL,ORLOCL,ORNPL,ORDTL,HAVELES)=""
  1. S DFNL=$P(FLDS,U,1)
  1. S TESTL=$P(FLDS,U,2)
  1. S ORLOCL=$P(FLDS,U,3)
  1. S ORNPL=$P(FLDS,U,4)
  1. S ORDTL=$P(FLDS,U,5)
  1. S HAVELES=$TEXT(COM^AVJLES)
  1. I $L(HAVELES) D COM^AVJLES(.ORY,DFNL,TESTL,ORLOCL,ORNPL,ORDTL)
  1. S ORY(1)=""
  1. Q
  1. ;
  1. ISVTP(ORY,ODIEN) ;True: is verbal or telephoned or policy order
  1. S ORY=0
  1. Q:'$D(^OR(100,+ODIEN,0))
  1. N VERB,TEL,POL,LSTACT,NATR
  1. S (VERB,TEL,POL,LSTACT)=0,NATR=""
  1. S VERB=$O(^ORD(100.02,"B","VERBAL",0))
  1. S TEL=$O(^ORD(100.02,"B","TELEPHONED",0))
  1. S POL=$O(^ORD(100.02,"B","POLICY",0))
  1. S LSTACT=$O(^OR(100,+ODIEN,8,"?"),-1)
  1. S NATR=$P(^OR(100,+ODIEN,8,LSTACT,0),U,12)
  1. I (NATR=VERB)!(NATR=TEL)!(NATR=POL) S ORY=1
  1. Q