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

APCLSIH1.m

Go to the documentation of this file.
APCLSIH1 ;cmi/flag/maw - APCL ILI CDC HL7 Export 5/12/2010 9:26:17 AM
 ;;3.0;IHS PCC REPORTS;**29,30**;FEB 05, 1997;Build 27
 ;
 ;
 ;
 ; Create PID segment
PIDLAB(R) ;EP
 N PID,PID3,PID8,PID7
 S PID=$G(^APCLDATA($J,R,"PID"))
 S PID3=$P(PID,U)
 S PID8=$P(PID,U,2)
 S PID7=$P(PID,U,3)
 S HLQ=HL1("Q")
 D SET(.ARY,"PID",0)
 D SET(.ARY,1,1)
 D SET(.ARY,PID3,3)
 D SET(.ARY,PID8,8)
 D SET(.ARY,PID7,7)
 S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
ZIDLAB(R) ;EP -- create the ZID segment
 N ZID,ZID1
 S ZID=$G(^APCLDATA($J,R,"ZID"))
 S ZID1=$P(ZID,U)
 D SET(.ARY,"ZID",0)
 D SET(.ARY,1,1)
 D SET(.ARY,ZID1,2)
 S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
PV1LAB(R) ;EP -- setup the PV1 LAB segment
 N PV1,PV13,PV132,PV115,PV144,PV145
 S PV1=$G(^APCLDATA($J,R,"PV1"))
 S PV13=$P(PV1,U,1)
 S PV132=$P(PV1,U,2)
 S PV115=$P(PV1,U,3)
 S PV144=$P(PV1,U,4)
 S PV145=$P(PV1,U,5)
 D SET(.ARY,"PV1",0)
 D SET(.ARY,1,1)
 D SET(.ARY,PV13,3,1)
 D SET(.ARY,PV132,3,2)
 D SET(.ARY,PV115,15)
 D SET(.ARY,PV144,44)
 D SET(.ARY,PV145,45)
 S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
DG1LAB(R) ;EP -- set the repeating DG1
 N BDA,DG1,DG13
 S BDA=0 F  S BDA=$O(^APCLDATA($J,R,"DG1",BDA)) Q:'BDA  D
 . S DG1=$G(^APCLDATA($J,R,"DG1",BDA))
 . S DG13=$P(DG1,U)
 . S APCLFCNT=APCLFCNT+1
 . D SET(.ARY,"FT1",0)
 . D SET(.ARY,APCLFCNT,1)
 . D SET(.ARY,DG13,19)
 . S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
PR1LAB(R) ;EP -- set the repeating DG1
 N BDA,PR1,PR13
 S BDA=0 F  S BDA=$O(^APCLDATA($J,R,"PR1",BDA)) Q:'BDA  D
 . S PR1=$G(^APCLDATA($J,R,"PR1",BDA))
 . S PR13=$P(PR1,U)
 . S APCLFCNT=APCLFCNT+1
 . D SET(.ARY,"FT1",0)
 . D SET(.ARY,+$G(APCLFCNT),1)
 . D SET(.ARY,PR13,25)
 . S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
OBXLAB(R) ;EP -- setup the ILI OBX segment
 N BDA,OBX,OBX1,OBX2,OBX31,OBX32,OBX5
 S BDA=0 F  S BDA=$O(^APCLDATA($J,R,"OBX",BDA)) Q:'BDA  D
 . S OBX=$G(^APCLDATA($J,R,"OBX",BDA))
 . S OBX1=$P(OBX,U)
 . S OBX2=$P(OBX,U,2)
 . S OBX3=$P(OBX,U,3)
 . I OBX3'="TMP" D
 .. S OBX31=$P(OBX3,"~")
 .. S OBX32=$P(OBX3,"~",2)
 . S OBX5=$P(OBX,U,4)
 . D SET(.ARY,"OBX",0)
 . D SET(.ARY,OBX1,1)
 . D SET(.ARY,OBX2,2)
 . I '$G(OBX31) D SET(.ARY,OBX3,3)
 . I $G(OBX31) D
 .. I $G(OBX31)]"" D SET(.ARY,OBX31,3,1)
 .. D SET(.ARY,OBX32,3,2)
 . D SET(.ARY,OBX5,5)
 . S X=$$ADDSEG^HLOAPI(.HLST,.ARY,.ERR)
 Q
 ;
SET(ARY,V,F,C,S,R) ;EP
 D SET^HLOAPI(.ARY,.V,.F,.C,.S,.R)
 Q
 ;