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

FHOMRC2.m

Go to the documentation of this file.
  1. FHOMRC2 ;Hines OIFO/RTK BACKDOOR CANCEL OUTPATIENT MEALS ;4/27/05 10:05
  1. ;;5.5;DIETETICS;**2,5**;Jan 28, 2005;Build 53
  1. ;
  1. CNRM100 ;Backdoor message to update file #100 with RM cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,12)
  1. S FHMPNUM=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,6)
  1. S FHDT=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,1)
  1. S FILL="R;"_FHMPNUM_";"_FHDT_";"_FHDT_";;"
  1. D CHECK
  1. I FHACTV=0 D CAN
  1. I FHACTV=1 D CANOCC
  1. ASSOC I $D(^FHPT(FHDFN,"OP",FHRNUM,1)) D CNAO100,CANAO^FHOMRC1
  1. I $D(^FHPT(FHDFN,"OP",FHRNUM,2)) D CNEL100,CANEL^FHOMRC1
  1. I $D(^FHPT(FHDFN,"OP",FHRNUM,3)) D CNTF100,CANTF^FHOMRC1
  1. Q
  1. CNAO100 ;Backdoor message to update file #100 with AO cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,"OP",FHRNUM,1)),U,4),FILL="A;"_FHRNUM D CAN Q
  1. CNEL100 ;Backdoor message to update file #100 with EL cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,"OP",FHRNUM,2)),U,5),FILL="E;"_FHRNUM D CAN Q
  1. CNTF100 ;Backdoor message to update file #100 with TF cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,"OP",FHRNUM,3)),U,4),FILL="T;"_FHRNUM D CAN Q
  1. CNIP100 ;Backdoor message to update file #100 with IP cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,0)),U,6),FILL="I;CANCEL" D CAN Q
  1. CNSM100 ;Backdoor message to update file #100 with SM cancel order
  1. S FHORN=$P($G(^FHPT(FHDFN,"SM",FHDA,0)),U,12),FILL="S;"_FHDA D CAN
  1. ;if an SM E/L Tray exists cancel that too:
  1. CNSMEL S FHORN=$P($G(^FHPT(FHDFN,"SM",FHDA,1)),U,4) I FHORN="" Q
  1. S FILL="G;"_FHDA D CAN Q
  1. CAN ;
  1. Q:'$$PATCH^XPDUTL("OR*3.0*215") ;must have CPRSv26 for O.M. backdoor
  1. Q:'DFN D MSHCA^FHOMUTL,EVSEND^FHWOR
  1. Q
  1. CANOCC ; If cancelling occurences of RM (not ALL) then send "XX" message
  1. ; instead of "OC" which will cancel the entire order in CPRS.
  1. Q:'$$PATCH^XPDUTL("OR*3.0*215") ;must have CPRSv26 for O.M. backdoor
  1. Q:'DFN K MSG D MSHOM^FHOMUTL ;Sets MSG(1), MSG(2) & MSG(3) for OM
  1. S FHOSTDT=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,1)
  1. S FHOSTDT=$$FMTHL7^XLFDT(FHOSTDT)
  1. S MSG(4)="ORC|XX|"_FHORN_"^OR|"_FILL_"^FH||||^^^"_FHOSTDT_"^"_FHOSTDT
  1. S MSG(5)="ODS|||^^^FH-X^Meal Canceled^99OTH|"
  1. D EVSEND^FHWOR
  1. Q
  1. CHECK ; Check if there are other "active" RM's to determine if entire order
  1. ; should be cancelled
  1. S FHACTV=0,FHMPNUM=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,6)
  1. F FHINDX=0:0 S FHINDX=$O(^FHPT(FHDFN,"OP","C",FHMPNUM,FHINDX)) Q:FHINDX'>0!(FHACTV=1) D
  1. .I $P($G(^FHPT(FHDFN,"OP",FHINDX,0)),U,1)<DT Q
  1. .I $P($G(^FHPT(FHDFN,"OP",FHINDX,0)),U,15)'="C" S FHACTV=1
  1. .Q
  1. Q