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

PSSP110.m

Go to the documentation of this file.
  1. PSSP110 ; Post init routine for patch PSS*1*110 03/30/2006 4:57P
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**110**;9/30/97
  1. Q
  1. EN ; Entry point
  1. ; Convert the NAME field in files #51 & 51.1 to all CAPS
  1. ;
  1. N DD,D0,DA,DIE,DR,PSSI,PSSJ,PSSCNT,PSSTXT,PSSLN,PSSAST
  1. N XMDUZ,XMSUB,XMTEXT,XMY,DIFROM,PSSFLG
  1. I $G(U)="" S U="^"
  1. S XMDUZ="PSS*1*110 Post Init",XMY(DUZ)=""
  1. ;
  1. ; File 51 (Medication Instruction)
  1. S DIE="^PS(51,"
  1. D CON
  1. S XMSUB="File #51 modified records"
  1. D MSG1
  1. ;
  1. ; File 51.1 (Administration Schedule)
  1. S DIE="^PS(51.1,"
  1. D CON
  1. S XMSUB="File #51.1 modified records"
  1. D MSG1
  1. ;
  1. ; File 51.2 (Medication Routes)
  1. ;S XMSUB="File #51.2 'to be' modified records"
  1. ;D COM
  1. G ENQ
  1. ;
  1. CON ; Convert ONLY lowercase alphabet to uppercase. All other characters
  1. ; in the NAME field are left alone.
  1. S PSSI="",PSSCNT=0,PSSLN=2,PSSFLG=""
  1. F S PSSI=$O(@(DIE_"""B"""_",PSSI)")) Q:PSSI="" D
  1. . I PSSI'?.E1L.E Q ; No lowercase in the NAME, no need to convert
  1. . S PSSJ=$$UP^XLFSTR(PSSI),PSSAST="*"
  1. . I '$O(@(DIE_"""B"""_",PSSJ,0)")) D
  1. . . S DA=$O(@(DIE_"""B"""_",PSSI,0)")),DR=".01///"_PSSJ
  1. . . D ^DIE
  1. . . S PSSAST=""
  1. . E S PSSFLG=1
  1. . S PSSCNT=PSSCNT+1
  1. . S PSSLN=PSSLN+1,PSSTXT(PSSLN)=PSSAST_PSSI
  1. Q
  1. COM ; Compile a list of all medication routes that do NOT
  1. ; have an abbreviation and send it to DUZ.
  1. S PSSI="",PSSCNT=0,PSSLN=2
  1. F S PSSI=$O(^PS(51.2,PSSI)) Q:PSSI']"" D
  1. . I '$D(^PS(51.2,PSSI,0)) Q
  1. . S PSSJ=$G(^PS(51.2,PSSI,0))
  1. . I $P(PSSJ,U,3)']"" D
  1. . . S PSSCNT=PSSCNT+1,PSSLN=PSSLN+1
  1. . . S PSSTXT(PSSLN)=$P(PSSJ,U,1)
  1. I PSSCNT<1 D Q
  1. . S PSSTXT(1)="All medication routes have abbreviations!"
  1. . D SEND
  1. S PSSTXT(1)="The following medication route/s does/do not"
  1. S PSSTXT(2)="have a corresponding abbreviation:"
  1. D SEND
  1. Q
  1. MSG1 ; Send message to user DUZ for files 51 & 51.1
  1. I PSSCNT<1 D Q
  1. . S PSSTXT(1)="No NAME conversion was neccessary!"
  1. . D SEND
  1. S PSSTXT(1)="The following NAME/s was/were converted"
  1. S PSSTXT(2)="from lowercase to uppercase:"
  1. I PSSFLG=1 D
  1. . S PSSLN=PSSLN+1
  1. . S PSSTXT(PSSLN)="Record/s marked with an '*' was/were skipped."
  1. . S PSSLN=PSSLN+1
  1. . S PSSTXT(PSSLN)="Conversion to uppercase would have created a"
  1. . S PSSLN=PSSLN+1
  1. . S PSSTXT(PSSLN)="duplicate NAME. Please check!!"
  1. D SEND
  1. Q
  1. SEND ;
  1. S XMTEXT="PSSTXT(",XMDUZ="PSS*1*110 Post Init",XMY(DUZ)=""
  1. D ^XMD
  1. K PSSTXT
  1. ENQ Q