source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LREPIRP4.m@ 1250

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1LREPIRP4 ;DALOI/CKA-EMERGING PATHOGENS HL7 REPORT CONVERSION ;5/13/03
2 ;;5.2;LAB SERVICE;**281**;Sep 27, 1994
3 ; Reference to ^DIC(21 supported by IA #2504
4 ;This routine builds the ^XTMP global for REF #s 2,15,16,17
5 ;^XTMP("LREPIREP"_LRDATE,LRTYPE,DFN,#)
6 Q
7OBX ;RESULTS
8 I $P(LRTMP,HLFS,3)="ST" D
9 .S TST=$P(LRTMP,HLFS,4),TSTNM=$P(TST,LRCS,5)
10 .;S:TSTNM="" TSTNM=$P(TST,LRCS,5)
11 .S OV=$P(LRTMP,HLFS,6)
12 I $P(LRTMP,HLFS,3)="CE" D
13 .S TSTNM=""
14 .S OV=$P($P(LRTMP,HLFS,6),LRCS,2)
15 S ENTRY=$P(LRTMP,HLFS,5)
16 S FD=$$CDT($P(LRTMP,HLFS,15)),RR=$P(LRTMP,HLFS,8)
17 S UN=$P(LRTMP,HLFS,7),AF=""
18 S ^XTMP("LREPIREP"_LRDATE,LRTYPE,DFN,LRCNT)=LRNAME_$E(LRSP,1,25-$L(LRNAME))_SSN_" "_LRACCDT_$E(LRSP,1,16-$L(LRACCDT))_TSTNM_" "_OV
19 S LRCNT=LRCNT+1
20 Q
21PV1 ;
22 S TYPE=$P(LRTMP,HLFS,3)
23 S ENC=$S(TYPE="O":"Accession ",1:"Admission ")_"Date "
24 S TYPE=$S(TYPE="U":"Update",TYPE="I":"Inpatient ",1:"Outpatient")
25 S MSG=TYPE_" "_ENC_$$CDT($P(LRTMP,HLFS,45))
26 Q:$P(LRTMP,HLFS,46)=""
27 S MSG=" Discharge Date "_$$CDT($P(LRTMP,HLFS,46))
28 S MSG=MSG_" Discharge Disposition "_$P($P(LRTMP,HLFS,37),LRCS,2)
29 S ^TMP($J,"RPT",LRTYPE,DFN,"PV1",LRPV1)=MSG
30 K TYPE
31 Q
32CDT(DATE) ;CONVERTS THE DATE AND TIME
33 S X=$E(DATE,5,6)_"-"_$E(DATE,7,8)_"-"_$E(DATE,1,4)
34 S:$E(DATE,9,12)'="" X=X_"@"_$E(DATE,9,12)
35 S:X="--" X=""
36 Q X
Note: See TracBrowser for help on using the repository browser.