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

ORSMART.m

Go to the documentation of this file.
ORSMART ;SLC/JMH - SMART UTILITY FUNCTIONS ; 4/15/21 1:06pm
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**377,498**;Dec 17, 1997;Build 38
 ;
SMRADPR(ORRAD,ORIEN) ;RETURN 1 IF ORRAD IS A RADIOLOGY PROCEDURE SMART IS INTERESTED IN
 N CODE,DATE,EXDATE,IMGORD,ORARR,ORERR,ORRET,PAT S ORRET=0
 ; GET REMINDER TERM LIST FOR RADIOLOGY PROCEDURES
 S CODE=$$GET1^DIQ(71,ORRAD_",",9,"")
 I CODE'="" S ORARR("CODESYS")="CPT",ORARR("CODE")=CODE
 S ORARR("ITEMTYPE")="RAMIS(71,",ORARR("ITEM")=ORRAD
 S IMGORD=$P($G(^OR(100,ORIEN,4)),U)
 I IMGORD="" Q ORRET
 S PAT=+$P($G(^OR(100,ORIEN,0)),U,2) I PAT=0 Q ORRET
 S EXDATE="",DATE=0
 F  S EXDATE=$O(^RADPT("AO",IMGORD,PAT,EXDATE)) Q:EXDATE=""  D
 .S ORARR("DATE")=9999999-$P(EXDATE,".")
 S ORRET=+$$CHCKPROC^PXRMPRAD(.ORARR,.ORERR)
 Q ORRET
 ;
SMRFIRE(ORIEN,ORMSG,ORORIG,ORNEW) ;INPUT IS FILE 100 IEN FROM ALERT.  OUTPUT IS ORFIRE
 S ORFIRE=0
 I $$SMRADPR(+$$OR2PKG(+ORIEN),ORIEN) D
 .I ORORIG'=53 S ORFIRE=1 Q
 .I ORORIG=53,ORNEW=84,ORMSG["Abnormal" S ORFIRE=1 Q
 .I ORORIG=53,ORNEW=85,ORMSG'["Abnormal" S ORFIRE=1 Q
 I ORFIRE S ORNEWMSG="SMART: "_ORMSG
 Q
 ;
OR2PKG(ORIEN) ;TURN FILE 100 IEN INTO PACKAGE REFERENCE
 N ORRET S ORRET=""
 N ORI S ORI=$O(^OR(100,ORIEN,4.5,"ID","ORDERABLE",0)) I ORI D
 .N ORJ S ORJ=$G(^OR(100,ORIEN,4.5,ORI,1),0) I ORJ D
 ..S ORRET=$P($G(^ORD(101.43,ORJ,0)),U,2)
 Q ORRET
 ;
OR2OI(ORIEN) ;TURN FILE 100 IEN INTO ORDERABLE ITEM
 N ORRET S ORRET=""
 N ORI S ORI=$O(^OR(100,ORIEN,4.5,"ID","ORDERABLE",0)) I ORI D
 .N ORJ S ORJ=$G(^OR(100,ORIEN,4.5,ORI,1),0) I ORJ S ORRET=ORJ
 Q ORRET
 ;