Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (15 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORIMO.m

    r613 r623  
    1 ORIMO   ;SLC/JDL - Inpatient medication on outpatient. ; 02/12/2007
    2         ;;3.0;ORDER ENTRY/RESULTS REPORTING;**187,190,195,215,243**;Dec 17, 1997;Build 242
    3 IMOLOC(ORY,ORLOC,ORDFN) ;ORY>=0: LOC is an IMO authorized location
    4         S ORY=-1
    5         N PACH
    6         S PACH=$$PATCH^XPDUTL("PSJ*5.0*111")
    7         Q:'PACH
    8         I $L($TEXT(SDIMO^SDAMA203)) D
    9         . ;#DBIA 4133
    10         . S ORY=$$SDIMO^SDAMA203(ORLOC,ORDFN)
    11         . ;if RSA returns an error then check against Clinic Loc.
    12         . I ORY=-3 D
    13         . .I $P($G(^SC(ORLOC,0)),U,3)'="C" Q
    14         . .I $D(^SC("AE",1,ORLOC))=1 S ORY=1
    15         . K SDIMO(1)
    16         Q
    17         ;
    18 IMOOD(ORY,ORDERID)      ;Is it an IMO order?
    19         Q:'$D(^OR(100,+ORDERID,0))
    20         N PIMO,DGRP,IMOGRP,ISIMO
    21         S (PIMO,DGRP,ISIMO)=0
    22         I $P($G(^OR(100,+ORDERID,0)),U,18)>0 S PIMO=1
    23         S DGRP=$P($G(^OR(100,+ORDERID,0)),U,11)
    24         S IMOGRP=$O(^ORD(100.98,"B","CLINIC ORDERS",""))
    25         I DGRP=IMOGRP S ISIMO=1
    26         I PIMO,ISIMO S ORY=1
    27         Q
    28         ;
    29 ISCLOC(ORY,ALOC)        ;Is it a clinical location
    30         S ORY=0
    31         Q:'$D(^SC(+ALOC,0))
    32         I $P(^SC(+ALOC,0),U,3)="C" S ORY=1
    33         Q
    34 ISIVQO(ORY,DLGID)       ;Is it an IV quick order
    35         S ORY=0
    36         Q:'$D(^ORD(101.41,DLGID,0))
    37         N IVGRP,DLGTYP,DLGGRP
    38         S IVGRP=$O(^ORD(100.98,"B","IV RX",0))
    39         S DLGTYP=$P($G(^ORD(101.41,DLGID,0)),U,4)
    40         S DLGGRP=$P($G(^ORD(101.41,DLGID,0)),U,5)
    41         I (DLGTYP="Q"),(DLGGRP=IVGRP) S ORY=1
    42         Q
     1ORIMO ;SLC/JDL - Inpatient medication on outpatient. ; 07/07/2005
     2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**187,190,195,215**;Dec 17, 1997
     3IMOLOC(ORY,ORLOC,ORDFN) ;ORY>=0: LOC is an IMO authorized location
     4 S ORY=-1
     5 N PACH
     6 S PACH=$$PATCH^XPDUTL("PSJ*5.0*111")
     7 Q:'PACH
     8 I $L($TEXT(SDIMO^SDAMA203)) D
     9 . ;I $P($G(^SC(ORLOC,0)),U,3)'="C" Q
     10 . ;I $D(^SC("AE",1,ORLOC))=1 S ORY=1
     11 . ;#DBIA 4133
     12 . S ORY=$$SDIMO^SDAMA203(ORLOC,ORDFN)
     13 . K SDIMO(1)
     14 Q
     15 ;
     16IMOOD(ORY,ORDERID) ;Is it an IMO order?
     17 Q:'$D(^OR(100,+ORDERID,0))
     18 N PIMO,DGRP,IMOGRP,ISIMO
     19 S (PIMO,DGRP,ISIMO)=0
     20 I $P($G(^OR(100,+ORDERID,0)),U,18)>0 S PIMO=1
     21 S DGRP=$P($G(^OR(100,+ORDERID,0)),U,11)
     22 S IMOGRP=$O(^ORD(100.98,"B","CLINIC ORDERS",""))
     23 I DGRP=IMOGRP S ISIMO=1
     24 I PIMO,ISIMO S ORY=1
     25 Q
     26 ;
     27ISCLOC(ORY,ALOC) ;Is it a clinical location
     28 S ORY=0
     29 Q:'$D(^SC(+ALOC,0))
     30 I $P(^SC(+ALOC,0),U,3)="C" S ORY=1
     31 Q
     32ISIVQO(ORY,DLGID) ;Is it an IV quick order
     33 S ORY=0
     34 Q:'$D(^ORD(101.41,DLGID,0))
     35 N IVGRP,DLGTYP,DLGGRP
     36 S IVGRP=$O(^ORD(100.98,"B","IV RX",0))
     37 S DLGTYP=$P($G(^ORD(101.41,DLGID,0)),U,4)
     38 S DLGGRP=$P($G(^ORD(101.41,DLGID,0)),U,5)
     39 I (DLGTYP="Q"),(DLGGRP=IVGRP) S ORY=1
     40 Q
Note: See TracChangeset for help on using the changeset viewer.