source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSHLSCH.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1PSSHLSCH ;BIR/RLW/MV-BUILD HL7 MESSAGE TO POPULATE ADMIN. SCHEDULE FILE ; 09/02/97 8:38
2 ;;1.0;PHARMACY DATA MANAGEMENT;;9/30/97
3 ; PSJEC=event code from HL7 table 8.4.2.1
4 ; PSJIEN=ien to Administration Schedule file (#51.1)
5 ; SPDNAME=.01 field (name) of super-primary drug
6 ; DDIEN=ien to drug file (#50)
7 ; LIMIT=number of fields in HL7 segment being built
8 ;
9EN1 ; start here for pre-install auto load
10 Q
11 ;We no longer send schedules to OERR
12 N APPL,CODE,FIELD,LIMIT,MFE,PSJI,SEGMENT,SPDNAME,SYN,SYNONYM,USAGE,X
13 S PSJEC="MAD",CODE="REP"
14 D INIT
15 D LOOP
16 D SCH^PSSHLU(PSJI)
17 K PSJEC,PSJIEN,PSJCLEAR
18 Q
19 ;
20EN2 ; start here for "manual" update
21 Q
22 ;We no longer send schedules to OERR
23 K ^TMP("HLS",$J)
24 N APPL,CODE,FIELD,PSJI,LIMIT,MFE,SEGMENT,SPDNAME,SYN,SYNONYM,USAGE,X,Y,DA,DS
25 S CODE="UPD"
26 D INIT
27 S PSJIEN=0 F S PSJIEN=$O(PSJHLDA(PSJIEN)) Q:'PSJIEN D
28 . S PSJEC=PSJHLDA(PSJIEN)
29 . D MFE,CALL^PSSHLU(PSJI)
30 K PSJEC,PSJIEN,PSJHLDA
31 Q
32 ;
33 ;
34INIT ; initialize HL7 variables, set master file identification segment fields
35 S PSJI=0,LIMIT=6,HLMTN="MFN"
36 D INIT^PSSHLU X PSJCLEAR
37 S FIELD(0)="MFI"
38 S FIELD(1)="^^^51.1^ADMINSTRATION SCHEDULE FILE"
39 S FIELD(3)=CODE
40 S FIELD(6)="NE"
41 D SEGMENT^PSSHLU(LIMIT)
42 Q
43 ;
44LOOP ; loop through SCHEDULE file
45 S PSJIEN=0 F S PSJIEN=$O(^PS(51.1,PSJIEN)) Q:'PSJIEN D MFE
46 Q
47 ;
48MFE ; set master file entry segment fields
49 S LIMIT=4 X PSJCLEAR
50 S X=$G(^PS(51.1,PSJIEN,0))
51 S FIELD(0)="MFE"
52 S FIELD(1)=PSJEC
53 S FIELD(4)="^^^"_PSJIEN_"^"_$P(X,"^")_"~"_$P(X,"^",4)_"^99PSS"
54 D SEGMENT^PSSHLU(LIMIT)
55 Q
56 ;
Note: See TracBrowser for help on using the repository browser.