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

ORQO441P.m

Go to the documentation of this file.
ORQO441P ;EPIP/RTW - QUICK ORDER POST INSTALL ; 12/29/17 10:03am
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**441**;Dec 17, 1997;Build 52
 ;ICR#   Type  Description
 ;-----  ----  -------------------------------------
 ;1472   Sup   RESCH^XUTMOPT [allows creation of new record in 19.2]
 ;1157   Sup   $$LKOPT^XPDMENU
 ;2053   Sup   FILE^DIE
 ;10103  Sup   $$FMTE^XLFDT
 ;10141  Sup   MES^XPDUTL
 ;5033   CS    Lookup name in file 8925.1 [OR not a subscriber]
 ;10013  Sup   ^DIk Multiple entry points to support entry deletion and file reindexing.  
 ;
 I $D(^TIU(8925.1,"B","OR QUICK ORDER AUDIT")) D OBJECT1
 I $D(^TIU(8925.1,"B","OR QUICK ORDER AUDIT(ALT)")) D OBJECT2
 D TASK,OBJECT3,ORFUMPS
 Q
TASK ;
 N ORQAOPTB,ORQAOPTN,DA,DIE,DR,X,ORQWHEN
 S ORQWHEN=DT_"@2301" ;ORQWHEN IS THE QUICK ORDER NIGHTLY TASK Date Time
 W !,"The 'QUICK ORDER NIGHTLY BG' option is scheduled to run at: "
 D RESCH^XUTMOPT("OR QUICK ORDER NIGHTLY BG",ORQWHEN,"","1D","L",".ORQA_ERROR")
 S ORQAOPTN=$$FIND1^DIC(19,"","X","OR QUICK ORDER NIGHTLY BG","B")
 S ORQAOPTB=0,ORQAOPTB=+$P($Q(^DIC(19.2,"B",ORQAOPTN,ORQAOPTB)),",",4) W ORQAOPTB
 S DIE="^DIC(19.2,",DR="11///.5",DA=ORQAOPTB D ^DIE
 Q
 ;
OBJECT1 ;
 N ORBIEN,DIK,DA
 I $D(^TIU(8925.1,"B","OR QUICK ORDER AUDIT")) S ORBIEN=0,ORBIEN=$O(^TIU(8925.1,"B","OR QUICK ORDER AUDIT",ORBIEN)) D
 . S DIK="^TIU(8925.1,"
 . S DA=ORBIEN
 . D ^DIK
 Q
OBJECT2 ;
 N ORBIEN,DIK,DA
 I $D(^TIU(8925.1,"B","OR QUICK ORDER AUDIT(ALT)")) S ORBIEN=0,ORBIEN=$O(^TIU(8925.1,"B","OR QUICK ORDER AUDIT(ALT)",ORBIEN)) D
 . S DIK="^TIU(8925.1,"
 . S DA=ORBIEN
 . D ^DIK
 Q 
OBJECT3 ;
 N OROBJECT,ORTYPE,ORMETHOD,ORPEROWN,ORCLOWN,ORSTATUS,OBOBFDA,ORUSRCL
 S ORUSRCL=0,ORUSRCL=$O(^USR(8930,"B","CLINICAL COORDINATOR",ORUSRCL))
 S OROBJECT="" F OROBJECT="OR QUICK ORDER AUDIT","OR QUICK ORDER AUDIT(ALT)" Q:OROBJECT=""  D
 .Q:$D(^TIU(8925.1,"B",OROBJECT))
 .S ORTYPE="OBJECT",ORPEROWN="POSTMASTER",ORCLOWN="CLINICAL COORDINATOR"
 .S:OROBJECT'["ALT" ORMETHOD="S X=$$AUD^ORQOAUIC(DFN,""P"",$P($G(X0),U,1))"
 .S:OROBJECT["ALT" ORMETHOD="S X=$$AUD^ORQOAUIC(DFN,""A"",$P($G(X0),U,1))"
 .S FDA(8925.1,"+1,",.01)=OROBJECT
 .S FDA(8925.1,"+1,",.03)=OROBJECT
 .S FDA(8925.1,"+1,",.04)="O"
 .S FDA(8925.1,"+1,",.05)=.5
 .S FDA(8925.1,"+1,",.06)=ORUSRCL
 .S FDA(8925.1,"+1,",.07)="11"
 .S FDA(8925.1,"+1,",9)=ORMETHOD
 .S FDA(8925.1,"+1,",99)=$H
 .;
 .D UPDATE^DIE("","FDA","FDAIEN","MSG")
 .K FDA,FDAIEN
 I $D(MSG) D  Q
 . S ORX="TIU Object creation failed.  The following error message was returned:"
 . W !
 . D MES^XPDUTL(ORX)
 S ORX="TIU Object created successfully."
 D MES^XPDUTL(ORX)
 Q
ORFUMPS ;
 N ORDATA,ORDNAME,ORDNUM,ORLINE,ORNEW
 S ORDNAME="" F  S ORDNAME=$O(^ORD(101.41,"B",ORDNAME)) Q:ORDNAME=""  D
 . S ORDNUM=0 F  S ORDNUM=$O(^ORD(101.41,"B",ORDNAME,ORDNUM)) Q:'ORDNUM  D
 . . Q:'$D(^ORD(101.41,ORDNUM,6,3,2,1))
 . . S ORLINE=0 F  S ORLINE=$O(^ORD(101.41,ORDNUM,6,3,2,ORLINE)) Q:'ORLINE  D
 . . . S ORDATA=$G(^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)) Q:ORDATA=""
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT","OR QUICK ORDER AUDIT")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT (ALT)|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT (ALT)","OR QUICK ORDER AUDIT(ALT)")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT (CI)|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT (CI)","OR QUICK ORDER AUDIT")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT (CI-ALT)|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT (CI-ALT)","OR QUICK ORDER AUDIT(ALT)")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT (NE)|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT (NE)","OR QUICK ORDER AUDIT")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 . . . I ORDATA["|ZZ QUICK ORDER AUDIT (NE-ALT)|" D  Q
 . . . . S ORNEW=$$STUFF(ORDATA,"ZZ QUICK ORDER AUDIT (NE-ALT)","OR QUICK ORDER AUDIT(ALT)")
 . . . . S ^ORD(101.41,ORDNUM,6,3,2,ORLINE,0)=ORNEW
 ;
 Q
 ;
STUFF(ORSTR,ORFROM,ORTO) ;
 ;
 N ORA,ORB,ORC
 ;
 S ORA=$P(ORSTR,"|"),ORB=$P(ORSTR,"|",2),ORC=$P(ORSTR,"|",3)
 ;
 I ORA=ORFROM Q ORTO_"|"_ORB_"|"_ORC
 I ORB=ORFROM Q ORA_"|"_ORTO_"|"_ORC
 I ORC=ORFROM Q ORA_"|"_ORB_"|"_ORTO
 ;
 Q ORSTR