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