source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRHL7U.m@ 1704

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1RMPRHL7U ;HINES CIOFO/HNC - Utilities for HL7 messages ;3/14/00
2 ;;3.0;PROSTHETICS;**45,78**;Feb 09, 1996
3 ;
4 ;Patch #78 09/26/03 TH - Add field desc for PV1 & ZCL segments.
5 ; - Clean up DG1 related variables.
6 Q
7 ;
8PID(RMPRPID) ;Get fields from PID segment and set into RMPR variables.
9 S DFN=$P(RMPRPID,"|",4),RMPRPNM=$P(RMPRPID,"|",6)
10 Q
11 ;
12PV1(RMPRPV1) ;
13 ;Get fields from PV1 segment of HL-7 message and set into RMPR variables
14 N X
15 ; RMPRSBR = service basis to be rendered (Inpatient or Outpatient)
16 S X=$P(RMPRPV1,"|",3),RMPRSBR=$S(X]"":X,1:"")
17 ;
18 ; Patient Location
19 ; Inpatient: Hospital Location IEN^Room-Bed
20 ; Outpatinet: Hospital Location IEN
21 ; RMPRWARD=patients ward
22 S X=$P(RMPRPV1,"|",4),RMPRWARD=$S($P(X,"^",1)]"":$P(X,"^",1),1:"")
23 ; RMPRRB = patients room/bed
24 S RMPRRB=$S($P(X,"^",2)]"":$P(X,"^",2),1:"")
25 ;
26 ; Outpatient: VISIT=Pointer for the Visit file (#9000010)
27 S VISIT=$S($P(RMPRPV1,"|",20)]"":$P(RMPRPV1,"|",20),1:"")
28 N RMPRVSIT S:VISIT]"" RMPRVSIT=$$FMDATE^RMPRHL7(VISIT)
29 Q
30 ;
31REJECT(RMPRMSG) ;can't be filed send reject message
32 ;
33 ;send message to mail group RMPR SUSP
34 N XMDUZ
35 S XMDUZ=.5
36 S XMTEXT="RMPRMSG("
37 S XMSUB="Request Failed to Suspense"
38 S XMY("RMPR SUSP")=""
39 D ^XMD
40 Q
41 ;
42FILE(RMPRO,DR) ;File data "^"RMPR(668,IEN,4 using "^"DIE
43 N DIE,DA
44 ;RMPRO = IEN
45 L +^RMPR(668,+RMPRO,4) S:'$D(^RMPR(668,+RMPRO,4,0)) ^(0)="^668.02DA^^"
46 S DA=$S($P(^RMPR(668,+RMPRO,4,0),"^",3):$P(^(0),"^",3)+1,1:1),DA(1)=+RMPRO
47 S DIE="^RMPR(668,"_RMPRO_",4,"
48 S $P(^RMPR(668,+RMPRO,4,0),"^",3,4)=DA_"^"_DA
49 D ^DIE
50 L -^RMPR(668,+RMPRO,4)
51 Q
52 ;
53EXIT ;Kill variables and exit
54 K HLQ,J,LN,ND,ND1,ND2
55 K RMPRA,RMPRACT,RMPRAD,RMPRAP,RMPRAPP,RMPRATN,RMPRDA,RMPRDEV,RMPRFAC
56 K RMPRFF,RMPRINTR,RMPRMTP,RMPRMSG,RMPRMSH,RMPRNOD,RMPRNTC,RMPRODT
57 K RMPROID,RMPRORFN,RMPRPA,RMPRPLCR,RMPRPLI,RMPRPNM,RMPRPR,RMPRPRI,RMPRFQ
58 K RMPRPRDG,RMPRSEND,RMPRSTDT,RMPRSTS,RMPRURGI,RMPRVAL,RMPRVTYP,RMPRWARD
59 K RMPRPRV,RMPRTYPE,RMPRND,RMPRND1,VISIT
60 K RMPRRB,RMPRPRA,RMPRRFQ,MSH,OBXND,PID,RMPRORPV,RMPROTXT
61 K RMPRTRLC,RMPRSS,RMPRO,RMPRORNP
62 K RMPRGMRC,RMPRCD,RMPRNATO,RMPRQT,RMPRS38,RMPRS668
63 K DA,DIC
64 K RMPRMSG,RMPRCI,RMPRSID,RMPRDIAG,RMPRDG1
65 Q
66 ;END
Note: See TracBrowser for help on using the repository browser.