MHV7B1N ;KUM/LB - HL7 message builder RSP^K11 Patient Porblems List ; 10/30/14 3:06pm
;;1.0;My HealtheVet;**11,22**;Mar 05, 2014;Build 19
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
DG1(MSGROOT,DATAROOT,CNT,LEN,HL) ; Build DG1 segments for Patient Problems List data
;
; Walks data in DATAROOT to populate MSGROOT with RDT segments
; sequentially numbered starting at CNT
;
; Integration Agreements:
; 10103 : FMTHL7^XLFDT
;
; Input:
; MSGROOT - Root of array holding the message
; DATAROOT - Root of array to hold extract data
; CNT - Current message line counter
; LEN - Current message length
; HL - HL7 package array variable
;
; Output:
; - Populated message array
; - Updated LEN and CNT
;
; POPULATE SEQUENCE NUMBER
N I,APP,DG1
D LOG^MHVUL2("MHV7B1N","BEGIN DG1","S","TRACE")
F I=1:1 Q:'$D(@DATAROOT@(I)) D
. M ^KUMDG3=@DATAROOT
. I $P(@DATAROOT@(I),"^",2)=0 Q
. S APP=@DATAROOT@(I)
. S DG1(0)="DG1"
. S DG1(1,1)=I
. S DG1(3,1,4)=$$ESCAPE^MHV7U($P(APP,"^"),.HL) ;Diagnosis Code IEN
. S DG1(3,1,1)=$$ESCAPE^MHV7U($P(APP,"^",2),.HL) ;Diagnosis Code
. S DG1(3,1,2)=$$ESCAPE^MHV7U($P(APP,"^",3),.HL) ;Diagnosis Code Description
. ;S DG1(3,1,3)=$$ESCAPE^MHV7U("I9",.HL) ;ICD-9 Coding System
. ;Fix for ICD 10 PRODUCTION ISSUE on Oct 1,2015 date switch
. ;Item#2.Story 223914: SM WLC - ICD10 - SNOMED CT Problem List and Encounter Completion and Workload
. S DG1(3,1,3)=$$ESCAPE^MHV7U($P(APP,"^",4),.HL) ;ICD-9 or ICD-10 Coding System
. S CNT=CNT+1
. S @MSGROOT@(CNT)=$$BLDSEG^MHV7U(.DG1,.HL)
. S LEN=LEN+$L(@MSGROOT@(CNT))
. Q
D LOG^MHVUL2("MHV7B1N","END DG1","S","TRACE")
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHV7B1N 1775 printed Dec 13, 2024@02:15:43 Page 2
MHV7B1N ;KUM/LB - HL7 message builder RSP^K11 Patient Porblems List ; 10/30/14 3:06pm
+1 ;;1.0;My HealtheVet;**11,22**;Mar 05, 2014;Build 19
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
DG1(MSGROOT,DATAROOT,CNT,LEN,HL) ; Build DG1 segments for Patient Problems List data
+1 ;
+2 ; Walks data in DATAROOT to populate MSGROOT with RDT segments
+3 ; sequentially numbered starting at CNT
+4 ;
+5 ; Integration Agreements:
+6 ; 10103 : FMTHL7^XLFDT
+7 ;
+8 ; Input:
+9 ; MSGROOT - Root of array holding the message
+10 ; DATAROOT - Root of array to hold extract data
+11 ; CNT - Current message line counter
+12 ; LEN - Current message length
+13 ; HL - HL7 package array variable
+14 ;
+15 ; Output:
+16 ; - Populated message array
+17 ; - Updated LEN and CNT
+18 ;
+19 ; POPULATE SEQUENCE NUMBER
+20 NEW I,APP,DG1
+21 DO LOG^MHVUL2("MHV7B1N","BEGIN DG1","S","TRACE")
+22 FOR I=1:1
if '$DATA(@DATAROOT@(I))
QUIT
Begin DoDot:1
+23 MERGE ^KUMDG3=@DATAROOT
+24 IF $PIECE(@DATAROOT@(I),"^",2)=0
QUIT
+25 SET APP=@DATAROOT@(I)
+26 SET DG1(0)="DG1"
+27 SET DG1(1,1)=I
+28 ;Diagnosis Code IEN
SET DG1(3,1,4)=$$ESCAPE^MHV7U($PIECE(APP,"^"),.HL)
+29 ;Diagnosis Code
SET DG1(3,1,1)=$$ESCAPE^MHV7U($PIECE(APP,"^",2),.HL)
+30 ;Diagnosis Code Description
SET DG1(3,1,2)=$$ESCAPE^MHV7U($PIECE(APP,"^",3),.HL)
+31 ;S DG1(3,1,3)=$$ESCAPE^MHV7U("I9",.HL) ;ICD-9 Coding System
+32 ;Fix for ICD 10 PRODUCTION ISSUE on Oct 1,2015 date switch
+33 ;Item#2.Story 223914: SM WLC - ICD10 - SNOMED CT Problem List and Encounter Completion and Workload
+34 ;ICD-9 or ICD-10 Coding System
SET DG1(3,1,3)=$$ESCAPE^MHV7U($PIECE(APP,"^",4),.HL)
+35 SET CNT=CNT+1
+36 SET @MSGROOT@(CNT)=$$BLDSEG^MHV7U(.DG1,.HL)
+37 SET LEN=LEN+$LENGTH(@MSGROOT@(CNT))
+38 QUIT
End DoDot:1
+39 DO LOG^MHVUL2("MHV7B1N","END DG1","S","TRACE")
+40 QUIT
+41 ;