source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSP110.m@ 1611

Last change on this file since 1611 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1PSSP110 ; Post init routine for patch PSS*1*110 03/30/2006 4:57P
2 ;;1.0;PHARMACY DATA MANAGEMENT;**110**;9/30/97
3 Q
4EN ; Entry point
5 ; Convert the NAME field in files #51 & 51.1 to all CAPS
6 ;
7 N DD,D0,DA,DIE,DR,PSSI,PSSJ,PSSCNT,PSSTXT,PSSLN,PSSAST
8 N XMDUZ,XMSUB,XMTEXT,XMY,DIFROM,PSSFLG
9 I $G(U)="" S U="^"
10 S XMDUZ="PSS*1*110 Post Init",XMY(DUZ)=""
11 ;
12 ; File 51 (Medication Instruction)
13 S DIE="^PS(51,"
14 D CON
15 S XMSUB="File #51 modified records"
16 D MSG1
17 ;
18 ; File 51.1 (Administration Schedule)
19 S DIE="^PS(51.1,"
20 D CON
21 S XMSUB="File #51.1 modified records"
22 D MSG1
23 ;
24 ; File 51.2 (Medication Routes)
25 ;S XMSUB="File #51.2 'to be' modified records"
26 ;D COM
27 G ENQ
28 ;
29CON ; Convert ONLY lowercase alphabet to uppercase. All other characters
30 ; in the NAME field are left alone.
31 S PSSI="",PSSCNT=0,PSSLN=2,PSSFLG=""
32 F S PSSI=$O(@(DIE_"""B"""_",PSSI)")) Q:PSSI="" D
33 . I PSSI'?.E1L.E Q ; No lowercase in the NAME, no need to convert
34 . S PSSJ=$$UP^XLFSTR(PSSI),PSSAST="*"
35 . I '$O(@(DIE_"""B"""_",PSSJ,0)")) D
36 . . S DA=$O(@(DIE_"""B"""_",PSSI,0)")),DR=".01///"_PSSJ
37 . . D ^DIE
38 . . S PSSAST=""
39 . E S PSSFLG=1
40 . S PSSCNT=PSSCNT+1
41 . S PSSLN=PSSLN+1,PSSTXT(PSSLN)=PSSAST_PSSI
42 Q
43COM ; Compile a list of all medication routes that do NOT
44 ; have an abbreviation and send it to DUZ.
45 S PSSI="",PSSCNT=0,PSSLN=2
46 F S PSSI=$O(^PS(51.2,PSSI)) Q:PSSI']"" D
47 . I '$D(^PS(51.2,PSSI,0)) Q
48 . S PSSJ=$G(^PS(51.2,PSSI,0))
49 . I $P(PSSJ,U,3)']"" D
50 . . S PSSCNT=PSSCNT+1,PSSLN=PSSLN+1
51 . . S PSSTXT(PSSLN)=$P(PSSJ,U,1)
52 I PSSCNT<1 D Q
53 . S PSSTXT(1)="All medication routes have abbreviations!"
54 . D SEND
55 S PSSTXT(1)="The following medication route/s does/do not"
56 S PSSTXT(2)="have a corresponding abbreviation:"
57 D SEND
58 Q
59MSG1 ; Send message to user DUZ for files 51 & 51.1
60 I PSSCNT<1 D Q
61 . S PSSTXT(1)="No NAME conversion was neccessary!"
62 . D SEND
63 S PSSTXT(1)="The following NAME/s was/were converted"
64 S PSSTXT(2)="from lowercase to uppercase:"
65 I PSSFLG=1 D
66 . S PSSLN=PSSLN+1
67 . S PSSTXT(PSSLN)="Record/s marked with an '*' was/were skipped."
68 . S PSSLN=PSSLN+1
69 . S PSSTXT(PSSLN)="Conversion to uppercase would have created a"
70 . S PSSLN=PSSLN+1
71 . S PSSTXT(PSSLN)="duplicate NAME. Please check!!"
72 D SEND
73 Q
74SEND ;
75 S XMTEXT="PSSTXT(",XMDUZ="PSS*1*110 Post Init",XMY(DUZ)=""
76 D ^XMD
77 K PSSTXT
78ENQ Q
Note: See TracBrowser for help on using the repository browser.