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

PSSTXT.m

Go to the documentation of this file.
  1. PSSTXT ;BIR/WRT-Edit DRUG TEXT file routine ; 11/15/01 8:11
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**29,55,194**;9/30/97;Build 9
  1. BEGIN S PSSNFI=1,PSSFG=0 W !,"This option enables you to edit entries in the DRUG TEXT file.",!! F PSSQQ=1:1 K DA D ASK Q:PSSFG
  1. DONE K DA,PSSFG,PSSQQ,PSSNFI,NAME,PSSENT,PSSBEG,PSSEND,PSSSRT,PSSXX
  1. K %,D,D0,DI,DIE,DLAYGO,DQ,DR,X,Y
  1. Q
  1. ;
  1. ASK W ! S DIC="^PS(51.7,",DIC(0)="QEALMN",DLAYGO=51.7 D ^DIC K DIC I Y<0 S PSSFG=1 Q
  1. S PSSENT=+Y D WRIT,REVW W ! S DA=PSSENT S DIE="^PS(51.7,"
  1. D NAME I PSSFG Q
  1. D TEXT I PSSFG Q
  1. W !
  1. S DR="1;2" D ^DIE,CHECKI
  1. Q
  1. CHECK I '$O(^PS(51.7,DA,2,0)),'$D(^PS(50.7,"DTXT",DA)),'$D(^PSDRUG("DTXT",DA)) S DIK="^PS(51.7," D ^DIK K DIK
  1. Q
  1. ;
  1. WRIT W !!,"There may be entries in your DRUG file and PHARMACY ORDERABLE ITEM file linked",!,"to this Drug Text Name. Editing information related to this Drug Text entry",!
  1. W "will affect the display of information related to these.",!
  1. Q
  1. ;
  1. REVW K DIR S DIR("A")="Do you want to review the list of drugs and orderable items linked to this Drug Text entry? ",DIR(0)="Y",DIR("B")="YES"
  1. S DIR("?",1)="Answering 'Yes' will list all entries in the Drug file or Orderable Item file",DIR("?",2)="that are linked to this drug text entry. The list could be long, so a "
  1. S DIR("?")="device can be entered to print a hard copy, if desired."
  1. D ^DIR K DIR
  1. I Y=1 D D RPT^PSSDTR
  1. . S PSSSRT="S"
  1. . S (PSSXX,PSSBEG,PSSEND)=$P($G(^PS(51.7,PSSENT,0)),"^",1)
  1. Q
  1. ;
  1. OUTMSG W !!,"IMPORTANT!! After editing the Drug Text Name OR Text, review the drugs and",!?12,"orderable items linked to this entry for accuracy."
  1. Q
  1. ;
  1. CHECKI I $P($G(^PS(51.7,DA,0)),"^",2) D MSG
  1. Q
  1. ;
  1. MSG W !!,"Because this entry was inactivated, drugs and orderable items that are linked",!,"to this entry will no longer display the text associated with this entry."
  1. W !,"You should review all drugs and orderable items associated with this Drug Text",!,"entry and update appropriately.",!
  1. Q
  1. ;
  1. NAME ;
  1. N PSSNAME
  1. W ! K DIR S DIR(0)="Y",DIR("A")="Do you want to edit the Drug Text Name",DIR("B")="NO" D ^DIR K DIR
  1. I X["^" S PSSFG=1 Q
  1. D OUTMSG
  1. I '$G(Y) Q
  1. S PSSNAME=$P($G(^PS(51.7,DA,0)),"^",1)
  1. W ! K DIR S DIR(0)="FO^1:75",DIR("A")="Drug Text Name: ",DIR("B")=PSSNAME D ^DIR K DIR
  1. I $G(X)["^" S PSSFG=1 Q
  1. I X'="",X'=PSSNAME D
  1. . I X["@" W " **DELETIONS ARE NOT ALLOWED!" Q
  1. . S ^PS(51.7,"B",$E(X,1,30),DA)=""
  1. . K ^PS(51.7,"B",$E(PSSNAME,1,30),DA)
  1. . S $P(^PS(51.7,DA,0),"^",1)=X
  1. Q
  1. ;
  1. TEXT ;
  1. W ! K DIR S DIR(0)="Y",DIR("A")="Do you want to edit the text for this entry",DIR("B")="YES" D ^DIR K DIR
  1. I $G(X)["^" S PSSFG=1 Q
  1. I '+($G(Y)) Q
  1. W !!,"WARNING: The absence of text lines will cause this Drug Text entry"
  1. W !," to be completely deleted."
  1. W ! S DIR(0)="E",DIR("A")="Press Return to continue" D ^DIR K DIR
  1. W ! S DR="3" D ^DIE,CHECK
  1. ;set flag if all text was deleted which deleted this entry
  1. I '$O(^PS(51.7,DA,2,0)) D
  1. . S PSSFG=1
  1. . W !!," **** **** **** **** **** **** **** **** **** **** ****"
  1. . W !!," The absence of text lines caused this Drug Text entry"
  1. . W !," to be completely deleted."
  1. . W !!," Therefore, Synonym and Inactivation Date"
  1. . W !," will not be asked."
  1. . W !!," **** **** **** **** **** **** **** **** **** **** ****",!!
  1. . S DIR(0)="E",DIR("A")=" Press Return to continue" D ^DIR K DIR
  1. . W !
  1. Q
  1. ;