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

RMPRPF3.m

Go to the documentation of this file.
  1. RMPRPF3 ;HOIFO/TH,DDA - PFSS Charge Cancel (credit) ;8/18/05
  1. ;;3.0;PROSTHETICS;**98**;Feb 09, 1996
  1. ;
  1. ; This routine sends "Credit" Charge Message to IBB if .01 field got deleted in file 660
  1. ; or if the PSAS HCPCS code is deleted (equals null after user edit).
  1. ;
  1. ; DBIA # 4663 for SWSTAT^IBBAPI
  1. ; DBIA # 4665 for CHARGE^IBBAPI
  1. Q
  1. ;
  1. CHRGTASK ; FILE #660, ENTRY DATE AND PSAS HCPCS FIELDS MUMPS XREF
  1. ;KILL LOGIC.
  1. ; TASKMAN LOAD A ONE TIME TASKMAN TASK.
  1. ; QUIT IF PFSS SWITCH IS OFF OR IF THERE IS NO CHARGE TO REVERSE
  1. Q:'+$$SWSTAT^IBBAPI()
  1. S RMPRPFSS=$G(^RMPR(660,DA,"PFSS"))
  1. Q:$P(RMPRPFSS,"^",2)=""
  1. S RMPRZERO=^RMPR(660,DA,0)
  1. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC
  1. S ZTIO="",ZTRTN="CHRGCRED^RMPRPF3",ZTDESC="Prosthetics file #660 PFSS Charge Credit",ZTDTH=$H
  1. S ZTSAVE("RMPRIEN")=DA
  1. S ZTSAVE("RMPRZERO")=RMPRZERO
  1. S ZTSAVE("RMPRONE")=$G(^RMPR(660,DA,1))
  1. S ZTSAVE("RMPRTEN")=$G(^RMPR(660,DA,10))
  1. S ZTSAVE("RMPRPFSS")=RMPRPFSS
  1. D ^%ZTLOAD
  1. Q
  1. ;
  1. CHRGCRED ; Process account deletion/cancellation
  1. ;
  1. ; Check if already processing this record.
  1. Q:$G(^TMP("RMPRPF3",RMPRIEN))=RMPRIEN
  1. S ^TMP("RMPRPF3",RMPRIEN)=RMPRIEN
  1. ; Check if this is just a Date edit or a PSAS HCPCS edit, set x-ref AND QUIT.
  1. S RMPRCDFL=0
  1. S:'$D(^RMPR(660,RMPRIEN,0)) RMPRCDFL=1
  1. S:$P($G(RMPRONE),"^",4)="" RMPRCDFL=1
  1. I RMPRCDFL=0 D SETAPD G EXIT
  1. ; RECORD HAS EITHER BEEN DELETED OR PSAS HCPCS HAS BEEN DELETED. SEND A CREDIT (CD).
  1. S RMPRUCID=$P(RMPRPFSS,U,2)
  1. S RMPRTYPE="CD"
  1. S RMPRDFN=$P(RMPRZERO,"^",2)
  1. S RMPRARFN=$P(RMPRPFSS,"^")
  1. ;
  1. ; FT1
  1. S RMPRFT1(4)=$P(RMPRZERO,"^",12) ; Delivery Date
  1. S RMPRFT1(10)=$P(RMPRZERO,"^",7) ; Transaction Quantity
  1. S RMPRFT1(13)=423 ; Department Code
  1. S RMPRFT1(21)=$P($G(RMPRTEN),"^",6) ; Ordering Provider/Ordered by Code
  1. S RMPRTC=$P(RMPRZERO,"^",16)
  1. S RMPRFT1(22)=RMPRTC/RMPRFT1(10) ; Unit Cost = Total Cost/QTY
  1. ; PR1
  1. S RMPRHCPC=$P(RMPRONE,"^",4)
  1. S RMPRHCDT=$P(RMPRONE,"^")
  1. D PSASHCPC^RMPOPF
  1. S RMPRPR1(3)=RMPRVHC ; Procedure Code
  1. S RMPRPR1(4)=RMPRTHC ; PSAS HCPCS text
  1. ; Procedure Functional Type - I:Stock Issue;P:Purchasing
  1. S RMPRPR1(6)=$S($P(RMPRZERO,"^",13)=11:"I",1:"P")
  1. ;
  1. SENDDATA ; Send charge data
  1. S RMPRCHRG=$$CHARGE^IBBAPI(RMPRDFN,RMPRARFN,RMPRTYPE,RMPRUCID,.RMPRFT1,.RMPRPR1,"","","","","")
  1. Q
  1. ;
  1. SETAPD ; Set the APD cross-reference because the activity was only an edit, not a delete.
  1. S DIE="^RMPR(660,"
  1. S DA=RMPRIEN
  1. S DR="107///^S X=1"
  1. D ^DIE
  1. K DIE,DA,DR
  1. Q
  1. EXIT ; Common exit point
  1. K ^TMP("RMPRPF3",RMPRIEN)
  1. K RMPRQTY,RMPRTC,RMPRCHRG,RMPRUCID,RMPRDFN,RMRICPP,RMPRCPT
  1. K RMPRARFN,RMPRTYPE,RMPRFT1,RMPRPR1,RMPRCPT,RMPRRICP
  1. K RMPRDG1,RMPRDIAG,RMPRZCL,RMPRNODE,RMPRPROS,RMPRHCPC,RMPRHCDT,RMPRVHC,RMPRTHC
  1. K ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC
  1. Q