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

PSSP138.m

Go to the documentation of this file.
  1. PSSP138 ;BIR/RJS-DOSAGE FORM NOUN & LOCAL POSSIBLE DOSAGE "&" CLEANUP
  1. ;;1.0; PHARMACY DATA MANAGEMENT;**138**;9/30/97;Build 5
  1. ;;Reference to $$SETSTR^VALM1 is covered by DBIA #10116
  1. ;;Reference to $$TRIM^XLFSTR is covered by DBIA #10104
  1. ;;Reference to ^XMD is covered by DBIA #10070
  1. ;;
  1. NOUN ;CONVERY & TO AND
  1. N X
  1. S PSSIEN=0 F S PSSIEN=$O(^PS(50.606,PSSIEN)) Q:'PSSIEN D
  1. .S PSSNN=0 F S PSSNN=$O(^PS(50.606,PSSIEN,"NOUN",PSSNN)) Q:'PSSNN D
  1. ..S PSSNNN=$G(^PS(50.606,PSSIEN,"NOUN",PSSNN,0))
  1. ..I PSSNNN["&" S PSLOCV=$P(PSSNNN,"^",1) D
  1. ...D AMP^PSSORPH1
  1. ...S PSSNNN=$$TRIM^XLFSTR(PSLOCV,"LR"," ") K PSLOCV
  1. ...S ^TMP($J,"PSSP138-1",PSSIEN,PSSNN)=PSSNNN
  1. S XMSUB="PSS*1*138 Dosage Form Repair Report",PSSRPT="PSSP138-N"
  1. S ^TMP($J,PSSRPT,1)="PSS*1*138 Dosage Form Repair"
  1. S ^TMP($J,PSSRPT,2)="The following Dosage Form NOUNS have been converted"
  1. S ^TMP($J,PSSRPT,3)=""
  1. I '$D(^TMP($J,"PSSP138-1")) S ^TMP($J,"PSSP138",4)="No NOUNS found containing &.",^TMP($J,PSSRPT,5)="",PSSCNT=5 D MAIL G DOS2
  1. S X="" D TXT("DOSAGE FORM",1),TXT("IEN",40),TXT("NOUN",48)
  1. S ^TMP($J,PSSRPT,4)=X,^TMP($J,PSSRPT,5)="",PSSCNT=5
  1. S PSSIEN=0 F S PSSIEN=$O(^TMP($J,"PSSP138-1",PSSIEN)) Q:'PSSIEN D
  1. .S PSSNN=0 F S PSSNN=$O(^TMP($J,"PSSP138-1",PSSIEN,PSSNN)) Q:'PSSNN D
  1. ..N DIE,DA,DR
  1. ..S PSSNM=$G(^TMP($J,"PSSP138-1",PSSIEN,PSSNN)),DA(1)=PSSIEN,DA=PSSNN
  1. ..S DIE="^PS(50.606,"_DA(1)_","_"""NOUN"""_",",DR=".01////^S X=PSSNM" D ^DIE
  1. ..S X="" D TXT($P(^PS(50.606,PSSIEN,0),"^"),1),TXT(PSSIEN,40),TXT(PSSNM,48)
  1. ..S PSSCNT=PSSCNT+1,^TMP($J,PSSRPT,PSSCNT)=X
  1. S PSSCNT=PSSCNT+1,^TMP($J,PSSRPT,PSSCNT)=""
  1. D MAIL
  1. ;
  1. DOS2 ; Check and replace the "&" with "AND".
  1. N X
  1. S PSSDRG=0 F S PSSDRG=$O(^PSDRUG(PSSDRG)) Q:'PSSDRG!(PSSDRG>999999999) D
  1. .S PSSDOS=0 F S PSSDOS=$O(^PSDRUG(PSSDRG,"DOS2",PSSDOS)) Q:'PSSDOS!(PSSDOS>9999) D
  1. ..S PSSDOS2=$G(^PSDRUG(PSSDRG,"DOS2",PSSDOS,0))
  1. ..I PSSDOS2["&" S PSLOCV=$P(PSSDOS2,"^",1) D
  1. ...D AMP^PSSORPH1
  1. ...S PSSDOS2=$$TRIM^XLFSTR(PSLOCV,"LR"," ")
  1. ...S ^TMP($J,"PSSP138-2",PSSDRG,PSSDOS)=PSSDOS2
  1. S XMSUB="PSS*1*138 Local Possible Dosage Repair Report",PSSRPT="PSSP138-D"
  1. S ^TMP($J,PSSRPT,1)="PSS*1*138 Local Possible Dosage Repair"
  1. S ^TMP($J,PSSRPT,2)="The following Local Possible Dosages have been fixed"
  1. S ^TMP($J,PSSRPT,3)=""
  1. I '$D(^TMP($J,"PSSP138-2")) S ^TMP($J,PSSRPT,4)="No Local Possible Dosages found containing &.",^TMP($J,PSSRPT,5)="",PSSCNT=5 D MAIL G EXIT
  1. S X="" D TXT("Drug",1),TXT("IEN",40),TXT("Local Possible Dosage",48)
  1. S ^TMP($J,PSSRPT,4)=X,^TMP($J,PSSRPT,5)="",PSSCNT=5
  1. S PSSDRG=0 F S PSSDRG=$O(^TMP($J,"PSSP138-2",PSSDRG)) Q:'PSSDRG D
  1. .S PSSIEN=0 F S PSSIEN=$O(^TMP($J,"PSSP138-2",PSSDRG,PSSIEN)) Q:'PSSIEN D
  1. ..N DIE,DA,DR
  1. ..S PSSNM=$G(^TMP($J,"PSSP138-2",PSSDRG,PSSIEN)),DA(1)=PSSDRG,DA=PSSIEN
  1. ..S DIE="^PSDRUG("_DA(1)_","_"""DOS2"",",DR=".01////^S X=PSSNM" D ^DIE
  1. ..S X="" D TXT($P(^PSDRUG(PSSDRG,0),"^"),1),TXT(PSSIEN,40),TXT(PSSNM,48)
  1. ..S PSSCNT=PSSCNT+1,^TMP($J,PSSRPT,PSSCNT)=X
  1. S PSSCNT=PSSCNT+1,^TMP($J,PSSRPT,PSSCNT)=""
  1. MAIL N DIFROM
  1. S PSSCNT=PSSCNT+1,^TMP($J,PSSRPT,PSSCNT)="***** End Of Report *****"
  1. S XMTEXT="^TMP($J,PSSRPT,",XMDUZ="PSS*1*138 Post Install"
  1. S XMY(DUZ)=""
  1. D ^XMD
  1. EXIT ; CLEAN UP
  1. K ^TMP($J),PSSCNT,PSSIEN,PSSDRG,PSSDOS,PSSDOS2,XMDUZ,XMSUB,XMTEXT,XMY,PSSNN,PSSNM,PSSNNN,PSSRPT
  1. Q
  1. TXT(VAL,COL) S:'$D(X) X="" S X=$$SETSTR^VALM1(VAL,X,COL,$L(VAL))
  1. Q