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

PSSPRICE.m

Go to the documentation of this file.
  1. PSSPRICE ;EPIP/WC - PHARMACY PRICE TRACKER FILE 50;1/13/20 3:31pm
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**227,236,241**;2/28/17;Build 2
  1. Q ; call by line tag
  1. ; UDPATE^DIE supported by ICR #2053
  1. ; ^XMD supported by ICR #10113
  1. ST(PSSIEN,PSSDUZ,PSSFLD) ;
  1. ; PSSIEN=DRUG IEN
  1. ; PSSNEW=NEW PRICE
  1. ; PSSDUZ=USER CHANGING PRICE
  1. ; PSSFLD=13-PRICE PER ORDER UNIT, 15-DISPENSE UNITS PER ORDER UNIT ;p236
  1. ; CLASS 3 CROSS REFER ON FILE 50 FIELD #16
  1. N DA,DIE,X,Y,DIC
  1. N PSSNEW
  1. ;LEAST GET THE TIME THE CHANGE WAS MADE
  1. D NOW^%DTC S PSSTIME=%
  1. S PSSNEW=$P($G(^PSDRUG(PSSIEN,660)),"^",6)
  1. ;
  1. QUE ;ENTER THE DATA IN FILE 50 MULTIPLE FIELD 950
  1. S ZTRTN="HIS^PSSPRICE"
  1. S ZTDESC="PHARMACY PRICE TRACKER "
  1. S ZTSAVE("PSSIEN")=""
  1. S ZTSAVE("PSSNEW")=""
  1. S ZTSAVE("PSSDUZ")=""
  1. S ZTSAVE("PSSTIME")=""
  1. S ZTSAVE("PSSFLD")=""
  1. S ZTIO=""
  1. D NOW^%DTC S ZTDTH=%
  1. D ^%ZTLOAD
  1. D HOME^%ZIS
  1. Q
  1. HIS ;LOGS CHANGES IN FILE 50 HISTORY PRICE DISPENSE #950
  1. ; first delete any price updates prior to the retention limit set up in the paramater PSS DRUG AUDIT RETENTION MOS
  1. N DEFDT,PSIEN2 S DEFDT=+$$GET^XPAR("ALL","PSS DRUG AUDIT RETENTION MOS")
  1. S DEFMOS=$S(DEFDT>0:DEFDT,1:999999999)
  1. S X1=$$NOW^XLFDT,X2=DEFMOS*30 D C^%DTC S ENDDT=X
  1. S X1=$P($$NOW^XLFDT,".",1)
  1. S ENDDT=$$FMADD^XLFDT(DT,"-"_(DEFMOS*30))
  1. I $O(^PSDRUG(PSSIEN,950,0)) D
  1. . F S PSIEN2=$O(^PSDRUG(PSSIEN,950,0)) Q:'PSIEN2 Q:^(PSIEN2,0)>ENDDT D ;p236
  1. . . N DIK,DA
  1. . . S DIK="^PSDRUG(PSSIEN,950,",DA(1)=PSSIEN,DA=PSIEN2 D ^DIK ; Delete old data
  1. N PSSPDU S PSSPDU=99999,PSSPDU=$O(^PSDRUG(PSSIEN,950,PSSPDU),-1) ; p236
  1. I PSSPDU>0,PSSNEW=$P($G(^PSDRUG(PSSIEN,950,PSSPDU,0)),"^",3) Q ; p236 Quit if no changes to PRICE PER DISPENSE UNIT
  1. N FDA
  1. S FDA(50.095,"?+1,"_PSSIEN_",",.01)=PSSTIME
  1. S FDA(50.095,"?+1,"_PSSIEN_",",1)=PSSDUZ
  1. S FDA(50.095,"?+1,"_PSSIEN_",",3)=PSSNEW
  1. D UPDATE^DIE("","FDA")
  1. S PSSNAME=$$GET1^DIQ(200,PSSDUZ_",",.01)
  1. BULL ;Generate the bulletin.
  1. S XMY("G.PSS DEE AUDIT")=""
  1. S XMSUB="Pharmacy Price Tracker",XMDUZ=.5
  1. S ^UTILITY($J,"PHARM TRACK",1)=PSSNAME_" has changed the "_$S(PSSFLD=13:"PRICE PER ORDER UNIT",1:"DISPENSE UNITS PER ORDER UNIT") ;p236
  1. S ^UTILITY($J,"PHARM TRACK",2)="The PRICE PER DISPENSE UNIT of:"
  1. S ^UTILITY($J,"PHARM TRACK",3)=$P($G(^PSDRUG(PSSIEN,0)),"^",1)_" is: "_PSSNEW
  1. S ^UTILITY($J,"PHARM TRACK",4)="" ;p236
  1. S ^UTILITY($J,"PHARM TRACK",5)="Date/Time changed: "_$$FMTE^XLFDT(PSSTIME) ;p236
  1. S XMTEXT="^UTILITY($J,""PHARM TRACK""," D ^XMD
  1. K %,PSSTIME,PSSIEN,PSSNAME,PSSOLD,PSSNEW,PSSDUZ,PSSFLD,^UTILITY($J),XMSUB,XMTEXT,XMDUZ
  1. Q
  1. ;