source: WorldVistAEHR/trunk/r/SURGERY-SR/SRHLVU.m@ 1211

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

initial load of WorldVistAEHR

File size: 875 bytes
Line 
1SRHLVU ;B'HAM ISC/DLR - Surgery HL7 Utility routine ; [ 05/06/98 7:14 AM ]
2 ;;3.0; Surgery ;**41**;24 Jun 93
3 ; Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
4DNAME(NAME) ;identifies an incoming CN data type to a record in file 200
5 N X,CNT
6 I '$D(NAME)!(($P(NAME,HLCOMP)="")&($P(NAME,HLCOMP,2="")!$P(NAME,HLCOMP,3=""))) Q ""
7 I NAME="" Q ""
8 I $P(NAME,HLCOMP)'="" S NAME=$O(^VA(200,"SSN",$P(NAME,HLCOMP),0)) I NAME'="" S NAME=$P(^VA(200,NAME,0),U)
9 E S X="",CNT=0 S NAME=$$FMNAME^HLFNC($P(NAME,HLCOMP,2,3)) F S X=$O(^VA(200,"B",NAME,X)) Q:'X S CNT=CNT+1 S NAME=$S(CNT=1:X,CNT>1:"")
10 Q NAME
11HNAME(IEN) ;converts an file 200 internal entry number into an HL7 CN data type
12 I IEN="" Q ""
13 I '$D(^VA(200,IEN,0)) W !,"Not a valid entry in file 200." Q ""
14 Q $P(^VA(200,IEN,1),U,9)_HLCOMP_$P($P(^VA(200,IEN,0),U),",")_HLCOMP_$P($P(^VA(200,IEN,0),U),",",2)
Note: See TracBrowser for help on using the repository browser.