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

VAFEOHL2.m

Go to the documentation of this file.
VAFEOHL2 ;ALB/JLU/CAW;generates the HL7 message to be sent(con't);6/29/93
 ;;5.3;Registration;**38**;Aug 13, 1993
 ;
ORC ;sets up the ORC segment and the fields 1 to indicate if new or canceled
 N VAFEDHL
 S VAFEDLCT=VAFEDLCT+1
 S $P(VAFEDHL,HLFS,1)="ORC"
 S $P(VAFEDHL,HLFS,2)=$S($P(VAFEDST1,"^",3)="C":"CA",1:"NW")
 D LOG^VAFEDOHL
 Q
 ;
OBR ;sets up the OBR segment and the fields 4,7,8,9,14,22
 N VAFEDHL
 S VAFEDLCT=VAFEDLCT+1
 S $P(VAFEDHL,HLFS,1)="OBR"
 S $P(VAFEDHL,HLFS,5)=VAFEDDA_$E(HLECH)_"391.51"_$E(HLECH)_"L"
 S $P(VAFEDHL,HLFS,8)=$$HLDATE^HLFNC($P(VAFEDST1,U,1))
 S $P(VAFEDHL,HLFS,9)=HLQ
 S $P(VAFEDHL,HLFS,10)=HLQ
 S $P(VAFEDHL,HLFS,15)=HLQ
 S $P(VAFEDHL,HLFS,23)=$$HLDATE^HLFNC(VAFEDLP)
 D LOG^VAFEDOHL
 Q
 ;
OBX ;this subroutine set up the OBX segments and the fields 3,5
 N X,VAFEDOBX
 S VAFEDOBX=0
 I +$P($G(VAFEDDX(1)),U) D DIAG
 I VAFEDST2]"" D CPT
 Q
 ;
DIAG ;this subroutine will set up the diagnosics in the OBX.
 N VAFEDN,X,VAFEDD,I
 S VAFEDN=+$P(VAFEDDX(1),U)
 F X=2:1 S VAFEDC=$P(VAFEDDX(1),U,X) Q:'VAFEDC  DO
 .S Y=$O(^ICD9("BA",VAFEDC,0))
 .Q:'Y  I '$D(^ICD9(Y,0)) Q
 .S VAFEDD=$P(^ICD9(Y,0),U,3)
 .S VAFEDOBX=VAFEDOBX+1,VAF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