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

ORY405NV.m

Go to the documentation of this file.
  1. ORY405NV ;ALB/BKG/gsn - POST-INIT ORDER DIALOG UPDATE ;Apr 29, 2022@10:02:04
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**405**;Dec 17, 1997;Build 211
  1. ;This routine will update the Order Dialog File (#101.41)
  1. ;Non-Va entry with new sequences
  1. ;
  1. Q
  1. ;
  1. EN ;entry point for post install
  1. N ORIEN,ORITEM,ORPARENT
  1. S ORIEN=$O(^ORD(101.41,"B","PSH OERR",0))
  1. S ORPARENT=$O(^ORD(101.41,"B","OR GTX INSTRUCTIONS",0))
  1. I 'ORIEN D Q
  1. . D BMES^XPDUTL
  1. . D MES^XPDUTL("******************************************************************")
  1. . D MES^XPDUTL("* ERROR Dialog PSH OERR was not found in the ORDER DIALOG file!! *")
  1. . D MES^XPDUTL("* *")
  1. . D MES^XPDUTL("* This is required for patch OR*3*405 to function properly. *")
  1. . D MES^XPDUTL("* Post Install Aborting... *")
  1. . D MES^XPDUTL("******************************************************************")
  1. . D BMES^XPDUTL
  1. . D MAILERR
  1. . H 5
  1. ;continue and update Dialog
  1. D BMES^XPDUTL
  1. D MES^XPDUTL("Updtating PSH OERR order dialog...")
  1. D SETDATA
  1. D MES^XPDUTL("Completed")
  1. D BMES^XPDUTL
  1. Q
  1. ;
  1. SETDATA ;
  1. N I,OREC,OREC1
  1. F I=1:1 S OREC=$P($T(TEXT1+I),";;",2) Q:OREC="QUIT" D
  1. .S OREC1=$P($T(TEXT+I),";;",2)
  1. .S:$P(OREC,"^")=2.4 OREC1=OREC1_"~"_$P($T(TEXT2+I),";;",2),ORITEM=$O(^ORD(101.41,"B","OR GTX AND/THEN",0))
  1. .S:$P(OREC,"^")=2.3 ORITEM=$O(^ORD(101.41,"B","OR GTX DURATION",0))
  1. .S:$P(OREC,"^")=2.8 ORITEM=$O(^ORD(101.41,"B","OR GTX SCHEDULE TYPE",0))
  1. .D UPDATE
  1. Q
  1. ;
  1. UPDATE ;setup die call
  1. K DR,DIC,DD,DA,DO,DINUM,FDA
  1. S DIC="^ORD(101.41,"
  1. S DA(1)=ORIEN
  1. S FDA(101.412,"?+1,"_DA(1)_",",.01)=$P((OREC),"^")
  1. S FDA(101.412,"?+1,"_DA(1)_",",.1)=$P((OREC1),"~")
  1. S FDA(101.412,"?+1,"_DA(1)_",",1)=ORPARENT
  1. S FDA(101.412,"?+1,"_DA(1)_",",2)=ORITEM
  1. S FDA(101.412,"?+1,"_DA(1)_",",4)=$P((OREC),"^",4)
  1. S FDA(101.412,"?+1,"_DA(1)_",",9)=$P((OREC),"^",9)
  1. S FDA(101.412,"?+1,"_DA(1)_",",13)=$P((OREC1),"~",3)
  1. S FDA(101.412,"?+1,"_DA(1)_",",11)=$P((OREC1),"~",2)
  1. S FDA(101.412,"?+1,"_DA(1)_",",15)=$P((OREC1),"~",4)
  1. S FDA(101.412,"?+1,"_DA(1)_",",19)=$P((OREC1),"~",5)
  1. S FDA(101.412,"?+1,"_DA(1)_",",20)=$P((OREC1),"~",6)
  1. S FDA(101.412,"?+1,"_DA(1)_",",17)=$P((OREC1),"~",7)
  1. D UPDATE^DIE("","FDA")
  1. K FDA
  1. Q
  1. ;
  1. MAILERR ;Send err message to insatller mailman
  1. N ORTEXT
  1. S XMY(DUZ)=DUZ
  1. S XMSUB="OR*3*405 ** INSTALL ERROR ** NON-VA MEDICATIONS"
  1. S ORTEXT(1)="ERROR Dialog PSH OERR was not found in the ORDER DIALOG file!!"
  1. S ORTEXT(2)=""
  1. S ORTEXT(3)="This is required for patch OR*3*405 to function properly."
  1. S ORTEXT(4)="Post Install Aborted Prematurely."
  1. S ORTEXT(5)=""
  1. S XMTEXT="ORTEXT(" N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
  1. Q
  1. ;
  1. TEXT ;dialog text
  1. ;;D INPCONJ^ORCDPS1~Enter AND if the next dose is to be administered concurrently with this one, or THEN if it is to follow after~I $G(ORCOMPLX)~I $G(ORESET)'=$P(Y,U) D CHANGED^ORCDPS1("QUANTITY")~D ENCONJ^ORCDPS1
  1. ;;~Enter the length of time over which this Non-VA Medication is being taken~I $$ASKDUR^ORCDPS3~D DUR^ORCDPS3~~~Q I $G(ORTYPE)'="Z",$G(ORCAT)="I",$G(ORCOMPLX),$P($G(ORSD),U,3) S Y=+$P(ORSD,U,3)_" DAYS"
  1. ;;~~I 0
  1. ;;QUIT
  1. TEXT1 ;dialog text
  1. ;;2.4^^^^^^^^^^
  1. ;;2.3^^^How Long:^^^^^C^^
  1. ;;2.8^^^^^^^^*^^
  1. ;;QUIT
  1. TEXT2 ;ONLY FOR SEQUENCE 2.4
  1. ;;I $G(ORCOMPLX),'$L($G(ORDIALOG(PROMPT,INST))),FIRST S MAX=1
  1. Q
  1. ;
  1. INDPR ;adding OR GTX INDICATION entry to ORDER DIALOG file ;*405-IND
  1. N ORIND,ORITEM,FDA,DA,ORSTA
  1. S ORIND="OR GTX INDICATION"
  1. S ORITEM=$O(^ORD(101.41,"B",ORIND,0))
  1. D BMES^XPDUTL
  1. I ORITEM D Q
  1. . D MES^XPDUTL("******************************************************************")
  1. . D MES^XPDUTL("* OR GTX INDICATION already exists in ORDER DIALOG (#101.41) file*")
  1. . D MES^XPDUTL("* Quitting from here.... *")
  1. . D MES^XPDUTL("******************************************************************")
  1. . D BMES^XPDUTL
  1. D MES^XPDUTL("*******************************************************************")
  1. D MES^XPDUTL("*Adding OR GTX INDICATION entry to the ORDER DIALOG (#101.41) file*")
  1. D MES^XPDUTL("*******************************************************************")
  1. D BMES^XPDUTL
  1. S FDA(101.41,"?+1,",.01)=ORIND
  1. S FDA(101.41,"?+1,",2)="Indication:"
  1. S FDA(101.41,"?+1,",4)="P"
  1. S FDA(101.41,"?+1,",11)="F"
  1. S FDA(101.41,"?+1,",12)="3:40"
  1. S FDA(101.41,"?+1,",13)="INDICATION"
  1. D UPDATE^DIE("","FDA","ORSTA")
  1. I $G(ORSTA)'=""!('$G(ORSTA(1))) D Q
  1. . D MES^XPDUTL("*******************************************************************")
  1. . D MES^XPDUTL("*OR GTX INDICATION addition failed. Quitting from here.... *")
  1. . D MES^XPDUTL("*******************************************************************")
  1. . D BMES^XPDUTL
  1. Q
  1. ;
  1. INDPT ;adding OR GTX INDICATION to the order dialog listed in OPT
  1. N ORIND,ORITEM,FDA,DA,ORSTA,ORIEN,I,OPTX,REQ,ZZ,ORD
  1. S ORIND="OR GTX INDICATION"
  1. S ORITEM=$O(^ORD(101.41,"B",ORIND,0))
  1. I 'ORITEM D Q
  1. . D MES^XPDUTL("******************************************************************")
  1. . D MES^XPDUTL("* OR GTX INDICATION does not exist in ORDER DIALOG (#101.41) file*")
  1. . D MES^XPDUTL("* Quitting order dialog updates..................................*")
  1. . D MES^XPDUTL("******************************************************************")
  1. . D BMES^XPDUTL
  1. F I=1:1 S OPTX=$P($T(OPT+I),";;",2) Q:OPTX="" D
  1. . S REQ=1 S:OPTX="PSH OERR"!(OPTX="PSO SUPPLY") REQ=0
  1. . S ORIEN=$O(^ORD(101.41,"B",OPTX,0)) I 'ORIEN D Q
  1. .. D BMES^XPDUTL
  1. .. D MES^XPDUTL("******************************************************************")
  1. .. D MES^XPDUTL("* "_OPTX_" was not found in the *")
  1. .. D MES^XPDUTL("* ORDER DIALOG (#101.41) file!! *")
  1. .. D MES^XPDUTL("******************************************************************")
  1. . D ADDITEM
  1. ;allow Park or Clinic for Pick Up in quick order dialog
  1. F ZZ="PSO OERR","PSO SUPPLY" S ORD=$O(^ORD(101.41,"B",ZZ,0)) Q:'ORD D
  1. . S I=0 F S I=$O(^ORD(101.41,ORD,10,I)) Q:'I I ^(I,0)["Pick Up:" D Q
  1. .. S ^ORD(101.41,ORD,10,I,.1)="D PARKCK^ORCDPS3",^ORD(101.41,ORD,10,I,5)=""
  1. .. S ^ORD(101.41,ORD,10,I,1)="Enter if the patient is to receive this medication by mail, at the window, or to be parked."
  1. D BMES^XPDUTL
  1. D MES^XPDUTL("****..Completed..****")
  1. D BMES^XPDUTL
  1. Q
  1. ;
  1. ADDITEM ;
  1. K FDA,DA
  1. S DA(1)=ORIEN
  1. S FDA(101.412,"?+1,"_DA(1)_",",.01)=8.5
  1. S FDA(101.412,"?+1,"_DA(1)_",",.1)="D INDIT^ORCDPS3"
  1. S FDA(101.412,"?+1,"_DA(1)_",",2)=ORITEM
  1. S FDA(101.412,"?+1,"_DA(1)_",",4)="Indication: "
  1. S:REQ FDA(101.412,"?+1,"_DA(1)_",",6)=1
  1. S FDA(101.412,"?+1,"_DA(1)_",",11)="You can choose a common indication from the list or free text an indication between 3-40 characters. "
  1. S FDA(101.412,"?+1,"_DA(1)_",",11)=FDA(101.412,"?+1,"_DA(1)_",",11)_"This field is not required in a quick order. If left blank the provider will have to fill it during order entry."
  1. S FDA(101.412,"?+1,"_DA(1)_",",16)="D XHELP^ORCDPS3:$G(ORDIALOG(PROMPT,""LIST""))"
  1. S FDA(101.412,"?+1,"_DA(1)_",",17)="D DFIND^ORCDPS3"
  1. S FDA(101.412,"?+1,"_DA(1)_",",19)="D IND^ORCDPS3"
  1. S FDA(101.412,"?+1,"_DA(1)_",",20)="I $L(Y) W "" ""_Y"
  1. S FDA(101.412,"?+1,"_DA(1)_",",21)=20
  1. S FDA(101.412,"?+1,"_DA(1)_",",24)="Indication:"
  1. S FDA(101.412,"?+1,"_DA(1)_",",26)=1
  1. I $D(^ORD(101.41,DA(1),10,"B",8.5)) D MES^XPDUTL("...updating "_OPTX_" with "_ORIND)
  1. I '$D(^ORD(101.41,DA(1),10,"B",8.5)) D MES^XPDUTL("...adding "_OPTX_" with "_ORIND)
  1. D UPDATE^DIE("","FDA")
  1. Q
  1. ;
  1. OPT ;
  1. ;;PSO OERR
  1. ;;PSJ OR PAT OE
  1. ;;PSJI OR PAT FLUID OE
  1. ;;PSO SUPPLY
  1. ;;PSH OERR
  1. ;;PS MEDS
  1. ;;PSJ OR CLINIC OE
  1. ;;CLINIC OR PAT FLUID OE
  1. Q
  1. ;
  1. CLINMED ;
  1. ;
  1. ; Remove the Route and Days supply prompts from PSJ OR CLINIC OE since
  1. ; they are not needed for Clin Meds and prevent QOs from being Auto Accepted
  1. ;
  1. N DA,DIK,ORDAYDLGIEN,ORDLG,ORIMODLGIEN,ORRTNGDLGIEN,ORX
  1. ;
  1. D BMES^XPDUTL("Updating 'PSJ OR CLINIC OE'... removing Route and Days Supply prompts.")
  1. ;
  1. S ORIMODLGIEN=$O(^ORD(101.41,"B","PSJ OR CLINIC OE",0))
  1. S ORDAYDLGIEN=$O(^ORD(101.41,"B","OR GTX DAYS SUPPLY",0))
  1. S ORRTNGDLGIEN=$O(^ORD(101.41,"B","OR GTX ROUTING",0))
  1. I 'ORIMODLGIEN!('ORDAYDLGIEN)!('ORRTNGDLGIEN) D Q
  1. . S ORX=$S('ORIMODLGIEN:"PSJ OR CLINIC OE",'ORDAYDLGIEN:"OR GTX DAYS SUPPLY",1:"OR GTX ROUTING")
  1. . D MES^XPDUTL("**************************************************************************")
  1. . D MES^XPDUTL("* ERROR Dialog "_ORX_" was not found in the ORDER DIALOG file!! *")
  1. . D MES^XPDUTL("* *")
  1. . D MES^XPDUTL("* This is required for patch OR*3*405 to function properly. *")
  1. . D MES^XPDUTL("**************************************************************************")
  1. ;
  1. F ORDLG=ORDAYDLGIEN,ORRTNGDLGIEN D
  1. . S DA=$O(^ORD(101.41,ORIMODLGIEN,10,"D",ORDLG,0))
  1. . I 'DA D Q
  1. . . D MES^XPDUTL($S(ORDLG=ORDAYDLGIEN:"OR GTX DAYS SUPPLY",1:"OR GTX ROUTING")_" already removed from PSJ OR CLINIC OE.")
  1. . S DA(1)=ORIMODLGIEN
  1. . S DIK="^ORD(101.41,"_DA(1)_",10,"
  1. . D ^DIK
  1. . D MES^XPDUTL("Removing "_$S(ORDLG=ORDAYDLGIEN:"OR GTX DAYS SUPPLY",1:"OR GTX ROUTING")_" from PSJ OR CLINIC OE.")
  1. ;
  1. D BMES^XPDUTL
  1. ;
  1. Q
  1. ;