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

ORIMO.m

Go to the documentation of this file.
ORIMO ;SLC/JDL - Inpatient medication on outpatient. ;02/23/16  10:15
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**187,190,195,215,243,350,424,377**;Dec 17, 1997;Build 582
IMOLOC(ORY,ORLOC,ORDFN,ORDLL) ;ORY>=0: LOC is an IMO authorized location
 S ORY=-1
 N PACH,A
 K ^TMP($J,"ORIMO")
 S PACH=$$PATCH^XPDUTL("PSJ*5.0*111")
 Q:'PACH
 I $L($TEXT(SDIMO^SDAMA203)) D
 . ;#DBIA 4133
 . S ORY=$$SDIMO^SDAMA203(ORLOC,ORDFN)
 . ;if RSA returns an error then check against Clinic Loc.
 . I ORY=-3 D
 . .I $P($G(^SC(ORLOC,0)),U,3)'="C" Q
 . .I $D(^SC("AE",1,ORLOC))=1 S ORY=1
 . K SDIMO(1)
 I $G(ORDLL) D ALL^PSJ53P46(+ORLOC,"ORIMO") S A=$G(^TMP($J,"ORIMO",0)) I A'>0!(+$G(^TMP($J,"ORIMO",A,3))=0) S ORY=-1
 Q
 ;
IMOOD(ORY,ORDERID) ;Is it an IMO order?
 Q:'$D(^OR(100,+ORDERID,0))
 N PIMO,DGRP,CMGRP,CIGRP
 S (DGRP,CMGRP,CIGRP,ORY)=0
 S DGRP=$P($G(^OR(100,+ORDERID,0)),U,11)
 S CMGRP=$O(^ORD(100.98,"B","CLINIC MEDICATIONS",""))
 S CIGRP=$O(^ORD(100.98,"B","CLINIC INFUSIONS",""))
 I DGRP=CMGRP S ORY=1
 I DGRP=CIGRP S ORY=1
 Q
 ;
ISCLOC(ORY,ALOC) ;Is it a clinical location
 S ORY=0
 Q:'$D(^SC(+ALOC,0))
 I $P(^SC(+ALOC,0),U,3)="C" S ORY=1
 Q
ISIVQO(ORY,DLGID) ;Is it an IV quick order
 S ORY=0
 Q:'$D(^ORD(101.41,DLGID,0))
 N IVGRP,DLGTYP,DLGGRP
 S IVGRP=$O(^ORD(100.98,"B","IV RX",0))
 S DLGTYP=$P($G(^ORD(101.41,DLGID,0)),U,4)
 S DLGGRP=$P($G(^ORD(101.41,DLGID,0)),U,5)
 I (DLGTYP="Q"),(DLGGRP=IVGRP) S ORY=1
 Q