Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSDADT

PSDADT.m

Go to the documentation of this file.
PSDADT ;BIR/LTL- ADT Message builder for HL7 ; 13 Feb 95
 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
 Q:("123"'[$P(DGPMA,U,2))
 N HLERR,HLEVN,HLNDAP,HLMTN,HLFS,HLECH,HLSDATA,HLSDT,HLSEC,HLCHAR,HLDA,HLDAN,HLDAP,HLDT,HLDT1,HLNDAP0,HLPID,HLQ,HLVER
 S HLNDAP="PSD-NDES" D INIT^HLTRANS I $D(HLERR) D KILL^HLTRANS Q
 D EVN($P(DGPMA,U,2),$P(DGPMA,U))
 S HLMTN="ADT",HLEVN=1
PID S HLSDATA(2)=$$EN^VAFHLPID(DFN,"1,2,3,5")
PV1 N VAROOT,VAINDT S VAROOT="PSD",VAINDT=$P(DGPMA,U) D INP^VADPT
 S $P(HLSDATA(3),HLFS,8)=""
 S $P(HLSDATA(3),HLFS)="PV1"
 S $P(HLSDATA(3),HLFS,4)=$P(PSD(4),U,2)_$E(HLECH)_$P(PSD(5),"-")_$E(HLECH)_$P(PSD(5),"-",2)
 S $P(HLSDATA(3),HLFS,7)=$E(HLECH)_$E(HLECH)
 S $P(HLSDATA(3),HLFS,8)=$P(PSD(2),U)_$E(HLECH)_$$HLNAME^HLFNC($P(PSD(2),U,2))
 D:$P(DGPMA,U,2)=2
 .N VAROOT,VAINDT S VAROOT="PSD",VAINDT=$P(DGPMA,U) D IN5^VADPT
 .S $P(HLSDATA(3),HLFS,7)=$P(PSD(15,4),U,2)_$E(HLECH)_$E(HLECH)
SEND D EN^HLTRANS K PSD Q
EVN(EVENT,DATE) ;EVN Segment builder
 S HLSDATA(1)="EVN"_HLFS_"A0"_EVENT_HLFS_$$HLDATE^HLFNC(DATE) Q