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

MCORMN01.m

Go to the documentation of this file.
MCORMN01 ;WISC/DCB-HL7 MESSAGE BUILDER PART 2 ;5/2/96  13:30
 ;;2.3;Medicine;;09/13/1996
 W !,"This is not a valid entry point" Q
MSH(PROC,SAP,SNF,RAP,RNF,MST,PCI,VID) ;MSH Messaging Line
 N MSH,Y,%,%I
 D NOW^%DTC
 S $P(MSH,ST(1),8)=$$CONVERT("D",%)
 S MSH="MSH"_MSTR,$P(MSH,ST(1),3)=PROC_ST(2)_SAP,$P(MSH,ST(1),4)=SNF
 S $P(MSH,ST(1),5)=RAP,$P(MSH,ST(1),6)=RNF,$P(MSH,ST(1),9)=MST
 S $P(MSH,ST(1),10)=PCI,$P(MSH,ST(1),11)=VID
 Q MSH
PID(DFN) ;PID Messaging Line
 N PID,VADM,SSN,PTN,DOB,SEX,LOOP
 D ^VADPT
 S SSN=$$M11^HLFNC($P(VADM(2),U,1)),PTN=$$CONVERT("P200",VADM(1))
 S DOB=$$CONVERT("D",$P(VADM(3),U))
 S SEX=$P(VADM(5),U)
 S PID="PID",$P(PID,ST(1),4)=SSN
 S $P(PID,ST(1),7)=PTN,$P(PID,ST(1),8)=DOB,$P(PID,ST(1),9)=SEX
 Q PID
OBX1(FILETYPE,VTI,OBI,OSI,OBR) ; ODX Messaging Line
 N OBX
 S OBR=$$CONVERT(FILETYPE,OBR)
 S OBX="OBX",$P(OBX,ST(1),3)=VTI
 S $P(OBX,ST(1),4)=OBI,$P(OBX,ST(1),5)=OSI,$P(OBX,ST(1),6)=OBR
 Q OBX
OBX2(UNT,RNG) ; ODX Messaging Line
 N OBX
 S OBX=""
 S $P(OBX,ST(1),2)=UNT,$P(OBX,ST(1),3)=RNG
 Q OBX
OBR1(SDATE,MCPROC,REC,FILE) ; OBX Messaging Line
 N LOOP,TEMP,TMP,STAT,STR
 S TMP=+$O(^MCAR(697.2,"B",MCPROC,""))
 S:'TMP TMP=$P($G(^MCAR(697.2,TMP,0)),U,4)
 S TMP=$S(TMP="C":"EC",TMP="H":"HM",TMP["P":"PF",1:"OTH")
 S STAT=$P($G(^MCAR(MCFILE,REC,"ES")),U,7)
 S STAT=$S(STAT="RNV":"R",STAT="RV":"F",STAT="ROV":"F",STAT["D":"P",1:"")
 S TEMP=$$CONVERT("D",SDATE),STR="OBR",$P(STR,ST(1),8)=TEMP
 S $P(STR,ST(1),16)=TMP,$P(STR,ST(1),26)=STAT
 Q STR
CONVERT(FILETYPE,RST) ;Convert Fileman to HL7
 N TEMP
 S TEMP=RST
 I FILETYPE["D" D
 .S TEMP=$$HLDATE^HLFNC(RST,"TS")
 S:(FILETYPE["P200")!(FILETYPE["P690") TEMP=$$HLNAME^HLFNC(RST)
 Q TEMP