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

RMPRPIYS.m

Go to the documentation of this file.
  1. RMPRPIYS ;HINCIO/ODJ - RC - PIP Receive Stock ;10/8/02 13:11
  1. ;;3.0;PROSTHETICS;**61,108,128,161**;Feb 09, 1996;Build 2
  1. Q
  1. ;
  1. ;***** PB - Print Bar Code labels
  1. ; RMPR INV BAR CODE
  1. ; Callable from VISTA menu, no vars required other than
  1. ; global VISTA vars (DUZ, etc)
  1. ;
  1. PB N RMPRERR,RMPRSTN,RMPRLCN,RMPREXC,RMPR1,RMPR11,RMPROVAL,RMPRNLAB
  1. N RMPR6,RMPR7,RMPR7I,RMPRBARC,RMPRITXT,RMPRBCP,RMPRQ,RMPRIOP
  1. ;
  1. ;***** STN - prompt for Site/Station
  1. STN S RMPROVAL=$G(RMPRSTN("IEN"))
  1. W @IOF S RMPRERR=$$STN^RMPRPIY1(.RMPRSTN,.RMPREXC)
  1. I RMPRERR G PBX
  1. I RMPREXC'="" G PBX
  1. I RMPROVAL'=RMPRSTN("IEN") K RMPR1,RMPR11
  1. ;
  1. ;***** HCPCS - prompt for HCPCS and Item
  1. HCPCS W !!,"Print Bar code Labels for current inventory...",!
  1. HCPCS2 D HCPCS^RMPRPIY7(RMPRSTN("IEN"),$G(RMPR1("HCPCS")),.RMPR1,.RMPR11,.RMPREXC)
  1. I RMPREXC="T" G PBX
  1. I RMPREXC="P" G STN
  1. I RMPREXC="^" D G PBX
  1. . W !,"** No HCPCS selected..." H 1
  1. . Q
  1. I $G(RMPR11("IEN"))'="" G HCPCS3A
  1. HCPCS3 D ITEM^RMPRPIYP(RMPRSTN("IEN"),RMPR1("HCPCS"),.RMPR11,.RMPREXC)
  1. I RMPREXC="T" G PBX
  1. I RMPREXC="P"!(RMPREXC="^") G HCPCS
  1. HCPCS3A S RMPR11("STATION")=RMPRSTN("IEN")
  1. S RMPR11("STATION IEN")=RMPRSTN("IEN")
  1. ;
  1. ; display selected HCPCS and item and continue
  1. HCPCS4 W !!,"HCPCS: "_RMPR1("HCPCS")_" "_RMPR1("SHORT DESC")
  1. W !!,"IFCAP Item: ",RMPR11("ITEM MASTER")
  1. W !!,"PIP Item desc.: ",RMPR11("DESCRIPTION")
  1. ;
  1. ;***** CURST - call prompt for current stock record
  1. CURST S RMPRLCN=""
  1. D PVEN^RMPRPIYR(RMPRSTN("IEN"),.RMPRLCN,RMPR11("HCPCS"),RMPR11("ITEM"),.RMPR6,.RMPR7,.RMPREXC)
  1. I RMPREXC="T" G PBX
  1. I RMPREXC="P" G HCPCS3
  1. I RMPREXC="^" G HCPCS
  1. I '+$G(RMPR7("QUANTITY")) D G HCPCS2
  1. . W !,"This item is not currently in stock.",!!
  1. . Q
  1. K RMPR7I
  1. S RMPRERR=$$ETOI^RMPRPIX7(.RMPR7,.RMPR7I)
  1. S RMPRBARC=RMPR11("HCPCS")_"-"_$P(RMPR7I("DATE&TIME"),".",1)_$P(RMPR7I("DATE&TIME"),".",2)
  1. S RMPRITXT("DATE")=$E(RMPR7I("DATE&TIME"),4,5)_"/"_$E(RMPR7I("DATE&TIME"),6,7)_"/"_(1700+$E(RMPR7I("DATE&TIME"),1,3))
  1. S RMPRITXT("ITEM")=RMPR11("HCPCS-ITEM")
  1. S RMPRITXT("MASTER DESC")=RMPR11("ITEM MASTER")
  1. S RMPRITXT("ITEM DESC")=RMPR11("DESCRIPTION")
  1. S RMPRITXT("UNIT PRICE")=+$J(RMPR7("VALUE")/RMPR7("QUANTITY"),0,2)
  1. S RMPRITXT("VENDOR")=RMPR6("VENDOR")
  1. S RMPRITXT("LOCATION")=RMPR7("LOCATION")
  1. ;
  1. ;***** NLAB - call prompt for number of labels to print
  1. NLAB S RMPRNLAB=RMPR7("QUANTITY")
  1. W ! D NLABP(.RMPRNLAB,RMPR7("QUANTITY"),.RMPREXC)
  1. I RMPREXC="T" G PBX
  1. I RMPREXC="P" G HCPCS
  1. I RMPREXC="^" G HCPCS
  1. ;
  1. ;***** SELP - call prompt for bar code print device
  1. SELP D PRINT G HCPCS
  1. G HCPCS
  1. PBX D KILL^XUSCLEAN
  1. Q
  1. ;
  1. ;***** PRINT - print bar code labels
  1. ; requires RMPRNLAB (number of labels) and
  1. ; RMPRBCP (bar code printer name) to be set
  1. ; RMPRBARC (bar code to print)
  1. ; RMPRIOP (the device to open)
  1. PRINT I '$D(RMPRNLAB) S RMPRNLAB=1
  1. ;allows queing of bar code labels
  1. SELD S %ZIS("A")="Select Bar Code Printer: "
  1. S %ZIS="QM" K IOP W ! D ^%ZIS G:POP PRINTX
  1. I $G(IOST)'["P-ZEBRA" D
  1. . W !!,"** WARNING - This is NOT a Zebra Bar Code Printer!!",!!
  1. I '$D(IO("Q")) U IO G PNOW
  1. K IO("Q") S ZTDESC="PRINT BAR CODE LABELS",ZTRTN="PNOW^RMPRPIYS"
  1. S ZTIO=ION,ZTSAVE("RMPRBARC")="",ZTSAVE("RMPRITXT(")=""
  1. S ZTSAVE("RMPRNLAB")="",ZTSAVE("RMPR(")="",ZTSAVE("RMPRSTN(")=""
  1. D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!" H 2 G PRINTC
  1. ;
  1. PNOW ;jump here if not queued.
  1. D ZPLII^RMPRPI11(RMPRBARC,.RMPRITXT,RMPRNLAB)
  1. S IONOFF=1
  1. PRINTC D ^%ZISC K IONOFF
  1. PRINTX Q
  1. ;
  1. ;***** NLABP - Number of labels prompt
  1. NLABP(RMPRNLAB,RMPRMAX,RMPREXC) ;
  1. N RMPRERR,DIR,X,Y,DUOUT,DTOUT,DIROUT,DIRUT,DA
  1. S RMPRNLAB=$G(RMPRNLAB)
  1. S RMPRERR=0
  1. S DIR(0)="NAO^1:"_RMPRMAX_":0"
  1. S DIR("A")="Number of Labels to print: "
  1. S:RMPRNLAB'="" DIR("B")=RMPRNLAB
  1. S DIR("??")="^D NLABPH2^RMPRPIYS"
  1. D ^DIR
  1. I $D(DTOUT) S RMPREXC="T" G NLABPX
  1. I $D(DIROUT) S RMPREXC="P" G NLABPX
  1. I X=""!(X["^")!($D(DUOUT)) S RMPREXC="^" G NLABPX
  1. S RMPREXC=""
  1. S RMPRNLAB=+Y
  1. NLABPX Q
  1. NLABPH2 W "Type in the number of bar code labels you want to print for the",!
  1. W "inventory item you have selected.",!
  1. Q
  1. ;
  1. ;***** BARC - bar code prompt
  1. BARC(RMPRBARC,RMPREXC) ;
  1. N RMPRERR,DIR,X,Y,DUOUT,DTOUT,DIROUT,DIRUT,DA
  1. S RMPRBARC=""
  1. S RMPREXC=""
  1. S RMPRERR=0
  1. S DIR(0)="FAO"
  1. S DIR("A")="Scan in item bar code: "
  1. S DIR("?")="^D BARCH^RMPRPIYS"
  1. BARC1 D ^DIR
  1. I $D(DTOUT) S RMPREXC="T" G BARCX
  1. I $D(DIROUT) S RMPREXC="P" G BARCX
  1. I X["^"!($D(DUOUT)) S RMPREXC="^" G BARCX
  1. I X="",$G(REDIT) G BARCX
  1. I X="" G BARC1
  1. S RMPRBARC=X
  1. BARCX Q
  1. BARCH W "If you have access to a bar code scanner, use it to scan the item bar code now.",!
  1. W "Don't press the [Enter] key as the scanner should do this automatically.",!
  1. W "If the scanner cannot read the bar code, type in the character sequence",!
  1. W "immediately below the bar code.",!
  1. ;W "If there is no bar code or you prefer to enter the transaction manually",!
  1. ;W "leave this prompt blank.",!
  1. Q
  1. ;
  1. ;***** SCAN - scan bar code and set up stock issue vars.
  1. ; (to be called by RMPRPIYI (too big))
  1. SCAN K RMPR7,RMPR7I,RMPR1,RMPR1I,RMPR11,RMPR11I,RMPR6,RMDAHC,RMITQTY
  1. SCAN1 D BARC(.RMPRBARC,.RMPREXC)
  1. I RMPREXC'="" S RMPRBARC="" G SCANX
  1. I RMPRBARC="" G SCANX
  1. ;*161 added check to insure barcode scan or manual entry was valid HCPCS item entry
  1. I $P(RMPRBARC,"-")="" W !,"** No HCPCS Selected due to null HCPCS entered..." G SCAN
  1. S RMPRBARC=$$UPCASE(RMPRBARC)
  1. ;
  1. ; If we get a good bar code then populate all the fields and go
  1. ; straight to the Post/Edit prompt
  1. K RMPR7
  1. S (RMPR7("STATION"),RMPRSTN)=RMPR("STA")
  1. S RMPR7("HCPCS")=$P(RMPRBARC,"-",1)
  1. S RMDAHC=$O(^RMPR(661.1,"B",RMPR7("HCPCS"),0))
  1. I $G(RMDAHC),$D(^RMPR(661.1,RMDAHC,0)),($P(^RMPR(661.1,RMDAHC,0),U,5)'=1) S RMDAHC=$P(^RMPR(661.1,RMDAHC,0),U,3)
  1. I '$G(RMDAHC) W !,"** No HCPCS Selected or Unable to Select Inactive HCPCS..." G SCAN
  1. S RMPR7("DATE&TIME")=$E($P(RMPRBARC,"-",2),1,7)_"."_$E($P(RMPRBARC,"-",2),8,$L(RMPRBARC))
  1. ;
  1. ; look up current stock record with bar coded key fields
  1. S RMPRERR=$$SCAN^RMPRPIUA(.RMPR7,.RMPREXC)
  1. I $G(RMPR7("IEN"))="" W !,"*** The Item scanned is not available, please update your inventory !!!" G SCAN1
  1. I RMPRERR D SCANE G SCAN1
  1. S RMPRERR=$$ETOI^RMPRPIX7(.RMPR7,.RMPR7I)
  1. I RMPRERR D SCANE G SCAN1
  1. S R1("DATE&TIME")=$G(RMPR7I("DATE&TIME"))
  1. S $P(R1(0),U,8)=$G(RMPR7I("UNIT"))
  1. ;
  1. ; set vars. for HCPCS
  1. K RMPR1,RMPR1I
  1. S RMPR1("HCPCS")=RMPR7("HCPCS")
  1. S RMPRERR=$$HPACT^RMPRPIX1(.RMPR1)
  1. I RMPRERR D SCANE G SCAN1
  1. S RMPRERR=$$HPETOI^RMPRPIX1(.RMPR1,.RMPR1I)
  1. I RMPRERR D SCANE G SCAN1
  1. ;
  1. ; set vars. for Item
  1. K RMPR11,RMPR11I
  1. S RMPR11("STATION")=RMPR("STA")
  1. S RMPR11("HCPCS")=RMPR7("HCPCS")
  1. S RMPR11("ITEM")=RMPR7("ITEM")
  1. S RMPRERR=$$GET^RMPRPIX1(.RMPR11)
  1. I RMPRERR D SCANE G SCAN1
  1. S RMPRERR=$$ETOI^RMPRPIX1(.RMPR11,.RMPR11I)
  1. I RMPRERR D SCANE G SCAN1
  1. I RMPR11I("ITEM MASTER IEN")="" D G SCAN1
  1. . W !,"This item is not associated with an IFCAP Item.",!
  1. . W "Please use the Edit Inventory option before trying to issue this item."
  1. . W !
  1. . Q
  1. ;S RMDAHC=RMPR1("IEN")
  1. D CPT(RMDAHC_"^"_$P(R1(0),U,4)_"^"_RMPR11I("SOURCE")_"^660")
  1. I RMPREXC="T" G SCANX
  1. I RMPREXC'="" G SCAN1
  1. ;
  1. ; get Vendor
  1. S RMPR6("DATE&TIME")=RMPR7I("DATE&TIME")
  1. S RMPR6("HCPCS")=RMPR7("HCPCS")
  1. S RMPR6("SEQUENCE")=RMPR7("SEQUENCE")
  1. S RMPRERR=$$GET^RMPRPIX6(.RMPR6)
  1. I RMPRERR D SCANE G SCAN1
  1. S RMPRERR=$$VNDIEN^RMPRPIX6(.RMPR6)
  1. I RMPRERR D SCANE G SCAN1
  1. S $P(R1(0),U,9)=RMPR6("VENDOR IEN")
  1. S $P(R3("D"),U,9)=RMPR6("VENDOR")
  1. ;
  1. ; set vars for issue
  1. S RMCPTC=""
  1. I $G(RMDAHC),$D(^RMPR(661.1,RMDAHC,0)) S RMCPTC=$P(^RMPR(661.1,RMDAHC,0),U,4)
  1. S $P(R1(1),U,4)=RMDAHC
  1. S $P(R1(0),U,22)=$G(RMCPTC)
  1. S $P(R1(0),U,6)=RMPR11I("ITEM MASTER IEN")
  1. S (RMHCNEW,RMHCDA)=RMDAHC
  1. S RMITDA=RMPR11("IEN")
  1. S RMHCPC=RMPR11("HCPCS")
  1. S RMIT=RMPR11("HCPCS-ITEM")
  1. S RDESC=RMPR1("SHORT DESC")
  1. S $P(R3("D"),U,14)=RMPR11("SOURCE")
  1. S RMSO=RMPR11I("SOURCE")
  1. S $P(R1(0),U,14)=RMSO
  1. S $P(R3("D"),U,6)=RMPR11("ITEM MASTER")
  1. S $P(R1(0),U,6)=RMPR11I("ITEM MASTER IEN")
  1. S $P(R1(2),U,1)=RMIT
  1. S $P(R1(2),U,2)=RMPR11("DESCRIPTION")
  1. S RMLOC=RMPR7I("LOCATION"),RMUBA=0,RMPR11("ITEM")=$P(RMIT,"-",2)
  1. S RMPR11("LOCATION")=RMLOC,RMPR11("STATION")=RMPRSTN
  1. I '$G(RMPR11("LOCATION")) S RMUBA=RMPR7("QUANTITY")
  1. S:'$G(RMUBA) RMUBA=$$BAL^RMPRPIX7(.RMPR11)
  1. S RMITQTY=RMPR7("QUANTITY")
  1. K RMPR5
  1. S RMPR5("IEN")=RMLOC
  1. S RMPRUCST=RMPR7("VALUE")/RMPR7("QUANTITY")
  1. S $P(R1(0),U,16)=$J(RMPRUCST,0,2)
  1. S $P(R3("D"),U,16)=$J(RMPRUCST,0,2)
  1. S $P(R1(0),U,7)=1 ;qty.
  1. S $P(R1(0),U,11)="" ;serial num
  1. S $P(R1(0),U,24)="" ;lot num
  1. S $P(R1(0),U,18)="" ;remarks
  1. SCANX Q
  1. SCANE W !,"A problem has occurred with the scan, please try again.",!
  1. Q
  1. ;
  1. ;***** CPT - prompt for CPT modifier
  1. ; (extension of RMPRPIYI and to be used only by that routine)
  1. CPT(RDA) ;
  1. N DIC,Y,RQUIT,X,DA,DIR,DUOUT,DTOUT
  1. N RMPR1,RMPR11,RMPR11I,RMPR7,RMPR7I
  1. S RMPREXC=""
  1. D:$D(RMCPT) CHK^RMPRED5
  1. W:$G(REDIT) !,"OLD CPT MODIFIER: ",$P(R1(1),U,6)
  1. I RMHCOLD'=RMDAHC D CPT^RMPRCPTU(RDA)
  1. I $D(DUOUT) S RMPREXC="^" G CPTX
  1. I $D(DTOUT) S RMPREXC="T" G CPTX
  1. S $P(R1(1),U,6)=$G(RMCPT)
  1. W:$G(REDIT) !,"NEW CPT MODIFIER: ",$G(RMCPT)
  1. I RMHCOLD'="",(RMHCOLD=RMDAHC),$G(REDIT) D
  1. .S DIR(0)="Y",DIR("A")="Would you like to Edit CPT MODIFIER Entry ",DIR("B")="N" D ^DIR Q:$D(DTOUT)!$D(DUOUT)
  1. .I $G(Y) D
  1. ..D CPT^RMPRCPTU(RDA)
  1. ..I $D(DUOUT) S RMPREXC="^"
  1. ..I $D(DTOUT) S RMPREXC="T"
  1. ..W:RMCPT=$P(R1(1),U,6) !!,"***Based on the information given above, CPT modifier string has not changed!!!",!
  1. ..W:RMCPT'=$P(R1(1),U,6) !,"NEW CPT MODIFIER: ",$G(RMCPT)
  1. ..S $P(R1(1),U,6)=$G(RMCPT)
  1. CPTX Q
  1. UPCASE(RMPRSTR) ;
  1. Q $TR(RMPRSTR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")