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

PSSUNMSI.m

Go to the documentation of this file.
  1. PSSUNMSI ;BHAM ISC/MRR - Unmark Supply Items as Non-VA Med Flag ;06/25/03
  1. ;;7.0;OUTPATIENT PHARMACY;**69**;DEC 1997
  1. ;
  1. ; This makes the Environment Check run only at Install (no at Load)
  1. I '$G(XPDENV) Q
  1. ;
  1. ASK W ! S DIR("A")="Unmark Supply Items as Non-VA Meds? "
  1. S DIR(0)="SA^Y:YES;N:NO",DIR("B")="YES" D ^DIR W !
  1. ;
  1. I $D(DTOUT)!$D(DUOUT) S XPDQUIT=1 Q
  1. I Y'="N",Y'="Y" G ASK
  1. W !," Supply items will "_$S(Y="N":"NOT",1:"")_" be unmarked as Non-VA Med"
  1. W !," with the installation of this patch.",!!
  1. S ^XTMP("PSS*1*69")=Y
  1. Q
  1. ;
  1. EN N OI,APPUSE,DGIEN,X,PSSCROSS,PSSTEST
  1. I $G(^XTMP("PSS*1*69"))'="Y" K ^XTMP("PSS*1*69") Q
  1. K ^XTMP("PSS*1*69"),^TMP("PSSOI",$J)
  1. ;
  1. ; - Updating APPL PCKGS' USE (File #50) and NON-VA MED (File #50.7)
  1. D BMES^XPDUTL("Unmarking supply items as Non-VA Meds...")
  1. S APPUSE=""
  1. F S APPUSE=$O(^PSDRUG("IU",APPUSE)) Q:APPUSE="" D
  1. . I APPUSE'["X" Q ; Not marked for Non-VA
  1. . S DGIEN=""
  1. . F S DGIEN=$O(^PSDRUG("IU",APPUSE,DGIEN)) Q:DGIEN="" D
  1. . . I $G(^PSDRUG(DGIEN,"I")),($P(^("I"),"^")<DT) Q ; Drug is Inactive
  1. . . ;
  1. . . S OI=$P($G(^PSDRUG(DGIEN,2)),"^") Q:'OI ; Get Orderable Item
  1. . . I '$P($G(^PS(50.7,OI,0)),"^",9) Q ; OI is not Supply Item
  1. . . S OINAM=$P($G(^PS(50.7,OI,0)),"^")
  1. . . S $P(^PS(50.7,OI,0),"^",10)=0 ; Unmark as Non-VA Med
  1. . . D XREFS(DGIEN,APPUSE) ; Update x-references
  1. . . S ^TMP("PSSOI",$J,OI)=""
  1. D BMES^XPDUTL("Done!")
  1. ;
  1. ; Sends Master File Updates to CPRS
  1. D BMES^XPDUTL("Updating CPRS Orderable Item File...")
  1. S OI=0,PSSCROSS=1
  1. F S OI=$O(^TMP("PSSOI",$J,OI)) Q:'OI D
  1. . S PSSTEST=OI D EN1^PSSPOIDT
  1. D BMES^XPDUTL("Done!")
  1. ;
  1. END K ^TMP("PSSOI",$J) Q
  1. ;
  1. XREFS(DGIEN,APPUSE) ; - Updating existing x-references for the Application
  1. ; Use field (#63) - DRUG File
  1. N DGNAME,NEWAPP
  1. I $G(^PSDRUG(DGIEN,0))="" Q
  1. S DGNAME=$P(^PSDRUG(DGIEN,0),"^") ; Retrive the Drug Name
  1. S NEWAPP=$TR(APPUSE,"X") ; Build the New App Use
  1. S $P(^PSDRUG(DGIEN,2),"^",3)=NEWAPP ; Update the DRUG file
  1. K ^PSDRUG("AIUX",DGNAME,DGIEN) ; Kill "AIU" x-reference
  1. K:APPUSE]"" ^PSDRUG("IU",APPUSE,DGIEN) ; Kill "IU" x-reference
  1. S:NEWAPP]"" ^PSDRUG("IU",NEWAPP,DGIEN)="" ; Set "IU" x-reference
  1. Q