source: FOIAVistA/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDADT.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 1.0 KB
Line 
1PSDADT ;BIR/LTL- ADT Message builder for HL7 ; 13 Feb 95
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3 Q:("123"'[$P(DGPMA,U,2))
4 N HLERR,HLEVN,HLNDAP,HLMTN,HLFS,HLECH,HLSDATA,HLSDT,HLSEC,HLCHAR,HLDA,HLDAN,HLDAP,HLDT,HLDT1,HLNDAP0,HLPID,HLQ,HLVER
5 S HLNDAP="PSD-NDES" D INIT^HLTRANS I $D(HLERR) D KILL^HLTRANS Q
6 D EVN($P(DGPMA,U,2),$P(DGPMA,U))
7 S HLMTN="ADT",HLEVN=1
8PID S HLSDATA(2)=$$EN^VAFHLPID(DFN,"1,2,3,5")
9PV1 N VAROOT,VAINDT S VAROOT="PSD",VAINDT=$P(DGPMA,U) D INP^VADPT
10 S $P(HLSDATA(3),HLFS,8)=""
11 S $P(HLSDATA(3),HLFS)="PV1"
12 S $P(HLSDATA(3),HLFS,4)=$P(PSD(4),U,2)_$E(HLECH)_$P(PSD(5),"-")_$E(HLECH)_$P(PSD(5),"-",2)
13 S $P(HLSDATA(3),HLFS,7)=$E(HLECH)_$E(HLECH)
14 S $P(HLSDATA(3),HLFS,8)=$P(PSD(2),U)_$E(HLECH)_$$HLNAME^HLFNC($P(PSD(2),U,2))
15 D:$P(DGPMA,U,2)=2
16 .N VAROOT,VAINDT S VAROOT="PSD",VAINDT=$P(DGPMA,U) D IN5^VADPT
17 .S $P(HLSDATA(3),HLFS,7)=$P(PSD(15,4),U,2)_$E(HLECH)_$E(HLECH)
18SEND D EN^HLTRANS K PSD Q
19EVN(EVENT,DATE) ;EVN Segment builder
20 S HLSDATA(1)="EVN"_HLFS_"A0"_EVENT_HLFS_$$HLDATE^HLFNC(DATE) Q
Note: See TracBrowser for help on using the repository browser.