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

PSOHLDS6.m

Go to the documentation of this file.
PSOHLDS6 ;BIR/MV - Update Host site for a OneVA fill ; 8/30/21 3:21pm
 ;;7.0;OUTPATIENT PHARMACY;**643,736**;DEC 1997;Build 19
 ;
HOST ;Update dispensing information at the host site for a OneVa OPAI fill, p736 - handle possible HLNODE overflow nodes
 N PSOHAIL,PSOHSUB,PSOHORC,PSOHRXD,PSOMSG,J,PSOHIEN,PSOHIENR,PSOHFILL,PSOHCHEK,PSOS5209,PSOHTPE,PSOHFLOT,PSOHSEXP,PSOHSMAN,PSOHSNDC,PSOHNTE,PSOHSUBR
 N ORC K PSOMSG F PSOHAIL=1:1 X HLNEXT Q:HLQUIT'>0  S PSOMSG(PSOHAIL)=HLNODE,J=0 S:$D(HLNODE(PSOHAIL)) HLNODE=HLNODE_HLNODE(PSOHAIL) D
 .I $P(PSOMSG(PSOHAIL),"|")="MSA"!($P(PSOMSG(PSOHAIL),"|")="RXR") Q
 .I $P(PSOMSG(PSOHAIL),"|")="ORC"  S PSOHORC=PSOMSG(PSOHAIL) Q
 .I $P(PSOMSG(PSOHAIL),"|")="RXD" S PSOHRXD=PSOMSG(PSOHAIL) Q
 .I $P(PSOMSG(PSOHAIL),"|")="NTE" S PSOHNTE=PSOMSG(PSOHAIL)
 S PSOHIEN=$P($P($G(PSOHORC),"|",3),"~") I PSOHIEN'="" S PSOHIENR=$O(^PSRX("B",PSOHIEN,0)) Q:'PSOHIENR
 S PSOHFILL=$P($G(PSOHORC),"|",11),PSOHCHEK=$P($G(PSOHORC),"|",12),PSOHTPE=$P($G(PSOHORC),"|",2)
 S PSOHSUB=$P($G(PSOHRXD),"|",2),PSOS5209=$P($G(PSOHRXD),"|",14),PSOHFLOT=$P($G(PSOHRXD),"|",19)
 S PSOHSEXP=$P($G(PSOHRXD),"|",20),PSOHSMAN=$P($G(PSOHRXD),"|",21)
 S PSOHSNDC=$P($G(PSOHRXD),"|",10)
 S PSOHSEXP=$$FMDATE^HLFNC(PSOHSEXP)
 I PSOS5209 D
 .S $P(^PSRXR(52.09,PSOS5209,0),"^",11)=$G(PSOHFILL)
 .S $P(^PSRXR(52.09,PSOS5209,0),"^",12)=$G(PSOHCHEK)
 .I $G(PSOHNTE)'="" D
 ..S $P(^PSRXR(52.09,PSOS5209,4),"^")=$P(PSOHNTE,"|",4)
 ..I $P(PSOHNTE,"|",4)'="" S ^PSRXR(52.09,"F",$P(PSOHNTE,"|",4),PSOS5209)=""
 ..S $P(^PSRXR(52.09,PSOS5209,4),"^",3)=$P(PSOHNTE,"|",5)
 ..S $P(^PSRXR(52.09,PSOS5209,4),"^",4)=$P(PSOHNTE,"|",6)
 ..S $P(^PSRXR(52.09,PSOS5209,4),"^",5)=$P(PSOHNTE,"|",7)
 Q:'PSOHSUB
 ;
 S:PSOHTPE="RF" $P(^PSRXR(52.09,PSOS5209,0),"^",13)=PSOHSUB
 S:PSOHTPE="PR" $P(^PSRXR(52.09,PSOS5209,0),"^",14)=PSOHSUB
 ;
 I PSOHSUB,PSOHIENR D
 .S PSOHSUBR=$S(PSOHTPE="PR":6,1:$S(PSOHSUB>5:PSOHSUB+1,1:PSOHSUB))
 .D ACT^PSORREF($S(PSOHTPE="RF":"R",1:"P"),PSOHIENR,PSOHSUBR)
 .I $P(^PSRXR(52.09,PSOS5209,4),"^",5) D ACTD^PSORREF("X","HL7 ID "_$P(PSOHNTE,"|",4)_" MESSAGE TRANSMITTED TO "_$P(PSOHNTE,"|",5)_" ("_$P(PSOHNTE,"|",6)_")")
 .D ACTD^PSORREF("N","External Interface Dispensing is Complete.")
 D UPDH^PSORREF
 Q