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

TIUCP.m

Go to the documentation of this file.
  1. TIUCP ;SLC/RMO - Clinical Procedures API(s) and RPC(s) ;5/12/04
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**109,182**;Jun 20, 1997
  1. ;
  1. CLASS() ;Get the CLINICAL PROCEDURES Class TIU Document Definition
  1. ;file (#8925.1) IEN
  1. ; Input -- None
  1. ; Output -- TIU Document Definition file (#8925.1) IEN
  1. N Y,TIUI,TYPE
  1. S (Y,TIUI)=0
  1. ; -- Make sure type is CLASS (P182):
  1. F S TIUI=+$O(^TIU(8925.1,"B","CLINICAL PROCEDURES",TIUI)) Q:'TIUI D Q:Y
  1. . S TYPE=$P($G(^TIU(8925.1,TIUI,0)),U,4)
  1. . I TYPE="CL" S Y=TIUI
  1. Q Y
  1. ;
  1. HISTDC() ;Get Historical Procedures Document Class IEN (under Class CLINICAL PROCEDURES) in TIU DDEF file (#8925.1)
  1. ; -- P182
  1. ; Input -- None
  1. ; Output -- TIU Document Definition file (#8925.1) IEN
  1. N Y,TIUI,TYPE,TIUISCP
  1. S (Y,TIUI)=0
  1. F S TIUI=+$O(^TIU(8925.1,"B","HISTORICAL PROCEDURES",TIUI)) Q:'TIUI D Q:Y
  1. . S TYPE=$P($G(^TIU(8925.1,TIUI,0)),U,4)
  1. . I TYPE="DC" D ISCP(.TIUISCP,TIUI) S:TIUISCP Y=TIUI
  1. Q Y
  1. ;
  1. ISHISTCP(TITLE) ; Function evaluates whether a Title is under the
  1. ;Historical Procedures Document Class under Class CP
  1. ; -- P182
  1. ; Input -- TITLE TIU Document Definition file (#8925.1) IEN
  1. ; Output -- 1=True and 0=False
  1. N TIUDCLAS,Y
  1. ; -- Exit if Title is not defined:
  1. I $G(TITLE)'>0 S Y=0 G ISHISTX
  1. ; -- Get HISTORICAL PROCEDURES Document Class IEN in 8925.1:
  1. S TIUDCLAS=$$HISTDC
  1. ; -- Exit if Document Class is not found:
  1. I TIUDCLAS'>0 S Y=0 G ISHISTX
  1. ; -- Check if Title is under HISTORICAL PROCEDURES Document Class:
  1. S Y=+$$ISA^TIULX(TITLE,TIUDCLAS)
  1. ISHISTX Q Y
  1. ;
  1. HPCAN(TIUACT) ; Is action allowed (not prohibited outright) for HP docmts
  1. ; Returns 1 if action allowed (not prohibited outright)
  1. ; 0^WHYNOT if action not allowed (prohibited outright)
  1. ; Requires TIUACT=IEN in USR ACTION file
  1. N ALLOWED S ALLOWED=1
  1. I TIUACT=19 S ALLOWED="0^ Historical Procedures may not be addended."
  1. I TIUACT=20 S ALLOWED="0^ Historical Procedures may not have signers identified."
  1. I TIUACT=21 S ALLOWED="0^ Historical Procedures may not be reassigned."
  1. I TIUACT=22 S ALLOWED="0^ Historical Procedures may not have their titles changed."
  1. I TIUACT=23 S ALLOWED="0^ Historical Procedures may not be linked with requests."
  1. Q ALLOWED
  1. ;
  1. ISCP(TIUY,TITLE) ;RPC that evaluates whether or not a Title is under
  1. ;the CLINICAL PROCEDURES Class
  1. ; Input -- TITLE TIU Document Definition file (#8925.1) IEN
  1. ; (May be Document Class instead of Title.)
  1. ; Output -- TIUY 1=True and 0=False
  1. N TIUCLASS
  1. ;
  1. ;Exit if a Title is not defined
  1. I +$G(TITLE)'>0 S TIUY=0 G ISCPQ
  1. ;
  1. ;Get CLINICAL PROCEDURES TIU Document Definition file (#8925.1) IEN
  1. S TIUCLASS=+$$CLASS
  1. ;
  1. ;Exit if the CLINICAL PROCEDURES Class is not found
  1. I +TIUCLASS'>0 S TIUY=0 G ISCPQ
  1. ;
  1. ;Check if the Title is under the CLINICAL PROCEDURES Class
  1. S TIUY=+$$ISA^TIULX(TITLE,TIUCLASS)
  1. ISCPQ Q
  1. ;
  1. CPCLASS(Y) ;RPC that gets the CLINICAL PROCEDURES TIU Document
  1. ;Definition file (#8925.1) IEN
  1. ; Input -- None
  1. ; Output -- Y TIU Document Definition file (#8925.1) IEN
  1. S Y=$$CLASS
  1. Q
  1. ;
  1. LNGCP(Y,FROM,DIR) ;RPC that serves data to a longlist of selectable Titles
  1. ; Input -- FROM Reference Title from which the longlist is
  1. ; scrolling
  1. ; DIR Direction from which the longlist is scrolling
  1. ; from the reference Title (Optional- default 1)
  1. ; Output -- Y An array of the 44 nearest Titles to that indicated
  1. ; by the user in the direction passed by the longlist
  1. ; component
  1. N TIUCLASS
  1. ;
  1. ;Exit if a reference Title is not defined
  1. I '$D(FROM) G LNGCPQ
  1. ;
  1. ;Get CLINICAL PROCEDURES TIU Document Definition file (#8925.1) IEN
  1. S TIUCLASS=+$$CLASS
  1. ;
  1. ;Exit if the CLINICAL PROCEDURES Class is not found
  1. I +TIUCLASS'>0 G LNGCPQ
  1. ;
  1. ;Get the longlist of Titles for the CLINICAL PROCEDURES Class
  1. D LONGLIST^TIUSRVD(.Y,TIUCLASS,FROM,$G(DIR,1))
  1. LNGCPQ Q