LA7UCFG1 ;DALOI/JMC - Configure Lab Universal Interface ;3/15/16 15:42
;;5.2;AUTOMATED LAB INSTRUMENTS;**88**;Sep 27, 1994;Build 10
;
; ZEXCEPT is used to identify variables which are external to a specific TAG
; used in conjunction with Eclipse M-editor.
;
Q
;
ENACK ;entry point to enable enhanced ack mode prompts
;
N DIR,LA7UPDATE,LANODE,LAHLVERSION,LAHLACKCODE,LA101,LAIEN,LAX,X,Y
;
;I '$$GET^XPAR("SYS^PKG","LA UI AUTO RELEASE MASTER",1,"Q") W !!,"Auto Release of Results is NOT Enabled." Q
;
S LAHLVERSION=$$FIND1^DIC(771.5,"","OX","2.5.1")
I LAHLVERSION<1 D Q
. W !,"Unable to check/update Lab UI protocols"
. W !," - could not identify HL7 v2.5.1 version entry in file #771.5"
;
S LAHLACKCODE=$$FIND1^DIC(779.003,"","OX","AL")
I LAHLACKCODE<1 D Q
. W !,"Unable to check/update Lab UI protocols"
. W !," - could not identify HL7 'AL' ACK condition in file #779.003"
;
S LA7UPDATE=0
S LANODE="^ORD(101,""B"",""LA7UI"")"
F S LANODE=$Q(@LANODE) Q:LANODE="" Q:$QS(LANODE,2)'="B" Q:$QS(LANODE,3)'?1"LA7UI"1.E D
. S LAX=$QS(LANODE,3),LA101=$QS(LANODE,4)
. I LAX["2.2" S LA7UPDATE=1 ;not updated to 2.5.1
. S LAIEN=LA101_","
. I $$GET1^DIQ(101,LAIEN,4,"I")="E",($$GET1^DIQ(101,LAIEN,770.8,"I")'=LAHLACKCODE) S LA7UPDATE=2 ;not updated to enhanced acknowledgement mode
;
I 'LA7UPDATE D Q
. W !!,"All Lab UI protocols in file #101 already updated to HL7 version 2.5.1."
. W !,"All Lab UI protocols already updated to HL7 Enhanced Mode Acknowledgments."
;
W ! S DIR(0)="YO",DIR("B")="No",DIR("A")="Has the Lab UI COTS driver been upgraded to send HL7 v2.5.1 messages"
S DIR("?",1)=" Enter either 'Y' or 'N'."
S DIR("?",2)=" "
S DIR("?",3)=" This normally involves a driver update on the COTS system"
S DIR("?",4)=" to allow the COTS system to send HL7 messages indicating"
S DIR("?",5)=" either HL7 v2.2 or v2.5.1. Contact your Laboratory Information"
S DIR("?")=" Manager to confirm the status of the driver update."
D ^DIR K DIR I $D(DIRUT)!'Y Q
;
W ! S DIR(0)="YO",DIR("B")="No",DIR("A")="Implement enhanced acknowledgement mode transmission" D ^DIR K DIR I $D(DIRUT)!'Y Q
S LA7UPDATE=2
;
D FILE101(LA7UPDATE)
;
Q
;
;
FILE101(LA7UPDATE) ; Update Lab UI protocols to HL7 v2.5.1
;
; Call with LA7UPDATE = 1 (update HL7 version on protocols)
; 2 (update HL7 version and ACK codes to use enhance mode)
;
N DIERR,I,LA101,LAFDA,LAHLACKCODE,LAHLVERSION,LAIEN,LAMSG,LANODE,LATXT,LAX
;
; Reference to file #771.5 supported by ICR DBIA1169-A
; Check LA7UI protocols and set to HL v2.5.1
;
D BMES("Starting checking and updating related Lab UI protocols in file #101")
;
S LAHLVERSION=$$FIND1^DIC(771.5,"","OX","2.5.1")
I LAHLVERSION<1 D Q
. D BMES("Unable to check/update Lab UI protocols")
. D BMES(" - could not identify HL7 v2.5.1 version entry in file #771.5")
. D BMES("Aborted checking and updating related Lab UI protocols in file #101")
;
I LA7UPDATE=2 D Q:LAHLACKCODE<1
. S LAHLACKCODE=$$FIND1^DIC(779.003,"","OX","AL")
. I LAHLACKCODE<1 D Q
. . D BMES("Unable to check/update Lab UI protocols")
. . D BMES(" - could not identify HL7 'AL' ACK condition in file #779.003")
. . D BMES("Aborted checking and updating related Lab UI protocols in file #101")
;
S LANODE="^ORD(101,""B"",""LA7UI"")"
F S LANODE=$Q(@LANODE) Q:LANODE="" Q:$QS(LANODE,2)'="B" Q:$QS(LANODE,3)'?1"LA7UI"1.E D
. S LAX=$QS(LANODE,3),LA101=$QS(LANODE,4)
. I LAX'["2.2" D BMES("Protocol "_LAX_" already updated to HL7 version 2.5.1")
. I 'LA101 Q
. K LAFDA,LAIEN,DIERR,LAMSG,LATXT
. S LAIEN=LA101_","
. I LAX["2.2" S LAFDA(1,101,LAIEN,.01)=$P(LAX," 2.2")
. I $$GET1^DIQ(101,LAIEN,770.95)="2.2" S LAFDA(1,101,LAIEN,770.95)=LAHLVERSION
. I LA7UPDATE=2,$$GET1^DIQ(101,LAIEN,4,"I")="E" D
. . S LAFDA(1,101,LAIEN,770.8)=LAHLACKCODE
. . S LAFDA(1,101,LAIEN,770.9)=LAHLACKCODE
. I '$D(LAFDA) Q
. D FILE^DIE("S","LAFDA(1)","LAMSG")
. I $G(LAMSG("DIERR")) D Q
. . D BMES("Protocol "_LAX_"could not be updated.")
. . D MSG^DIALOG("AEST",.LATXT,80,0,"LAMSG")
. . F I=1:1:LATXT D BMES("FileMan error: "_LATXT(I))
. I $D(LAFDA(1,101,LAIEN,.01)) D BMES("Protocol "_LAX_" name changed to "_$$GET1^DIQ(101,LAIEN,.01)_".")
. I $D(LAFDA(1,101,LAIEN,770.95)) D BMES("Protocol "_LAX_" updated to HL7 version 2.5.1.")
. I $D(LAFDA(1,101,LAIEN,770.8)) D BMES("Protocol "_LAX_" updated to HL7 Enhanced Mode Acknowledgments.")
. D CHECKWP(LAIEN)
;
D BMES("Finished checking and updating related Lab UI protocols in file #101")
Q
;
;
CHECKWP(LAIEN) ; Check description (WP) field on protocol and update text.
; Change reference to v2.2 to v2.5.1 in description.
; Call with LAIEN = IENS of entry in file #101
;
N FR,I,LAMSG,LATXT,LAX,WP,X
;
S LAX=$$GET1^DIQ(101,LAIEN,.01)
S X=$$GET1^DIQ(101,LAIEN,3.5,"","WP")
;
S I=0,FR("v2.2")="v2.5.1"
F S I=$O(WP(I)) Q:'I S WP(I)=$$REPLACE^XLFSTR(WP(I),.FR)
;
D WP^DIE(101,LAIEN,3.5,"","WP","LAMSG")
I $G(LAMSG("DIERR")) D
. D BMES("Protocol "_LAX_" description field (#3.5) could not be updated.")
. D MSG^DIALOG("AEST",.LATXT,80,0,"LAMSG")
. F I=1:1:LATXT D BMES("FileMan error: "_LATXT(I))
;
Q
;
;
BMES(STR) ;
; Write string
D BMES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$G(IOM,80)),"R"," "))
Q
;
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLA7UCFG1 5393 printed Oct 16, 2024@17:40:38 Page 2
LA7UCFG1 ;DALOI/JMC - Configure Lab Universal Interface ;3/15/16 15:42
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**88**;Sep 27, 1994;Build 10
+2 ;
+3 ; ZEXCEPT is used to identify variables which are external to a specific TAG
+4 ; used in conjunction with Eclipse M-editor.
+5 ;
+6 QUIT
+7 ;
ENACK ;entry point to enable enhanced ack mode prompts
+1 ;
+2 NEW DIR,LA7UPDATE,LANODE,LAHLVERSION,LAHLACKCODE,LA101,LAIEN,LAX,X,Y
+3 ;
+4 ;I '$$GET^XPAR("SYS^PKG","LA UI AUTO RELEASE MASTER",1,"Q") W !!,"Auto Release of Results is NOT Enabled." Q
+5 ;
+6 SET LAHLVERSION=$$FIND1^DIC(771.5,"","OX","2.5.1")
+7 IF LAHLVERSION<1
Begin DoDot:1
+8 WRITE !,"Unable to check/update Lab UI protocols"
+9 WRITE !," - could not identify HL7 v2.5.1 version entry in file #771.5"
End DoDot:1
QUIT
+10 ;
+11 SET LAHLACKCODE=$$FIND1^DIC(779.003,"","OX","AL")
+12 IF LAHLACKCODE<1
Begin DoDot:1
+13 WRITE !,"Unable to check/update Lab UI protocols"
+14 WRITE !," - could not identify HL7 'AL' ACK condition in file #779.003"
End DoDot:1
QUIT
+15 ;
+16 SET LA7UPDATE=0
+17 SET LANODE="^ORD(101,""B"",""LA7UI"")"
+18 FOR
SET LANODE=$QUERY(@LANODE)
if LANODE=""
QUIT
if $QSUBSCRIPT(LANODE,2)'="B"
QUIT
if $QSUBSCRIPT(LANODE,3)'?1"LA7UI"1.E
QUIT
Begin DoDot:1
+19 SET LAX=$QSUBSCRIPT(LANODE,3)
SET LA101=$QSUBSCRIPT(LANODE,4)
+20 ;not updated to 2.5.1
IF LAX["2.2"
SET LA7UPDATE=1
+21 SET LAIEN=LA101_","
+22 ;not updated to enhanced acknowledgement mode
IF $$GET1^DIQ(101,LAIEN,4,"I")="E"
IF ($$GET1^DIQ(101,LAIEN,770.8,"I")'=LAHLACKCODE)
SET LA7UPDATE=2
End DoDot:1
+23 ;
+24 IF 'LA7UPDATE
Begin DoDot:1
+25 WRITE !!,"All Lab UI protocols in file #101 already updated to HL7 version 2.5.1."
+26 WRITE !,"All Lab UI protocols already updated to HL7 Enhanced Mode Acknowledgments."
End DoDot:1
QUIT
+27 ;
+28 WRITE !
SET DIR(0)="YO"
SET DIR("B")="No"
SET DIR("A")="Has the Lab UI COTS driver been upgraded to send HL7 v2.5.1 messages"
+29 SET DIR("?",1)=" Enter either 'Y' or 'N'."
+30 SET DIR("?",2)=" "
+31 SET DIR("?",3)=" This normally involves a driver update on the COTS system"
+32 SET DIR("?",4)=" to allow the COTS system to send HL7 messages indicating"
+33 SET DIR("?",5)=" either HL7 v2.2 or v2.5.1. Contact your Laboratory Information"
+34 SET DIR("?")=" Manager to confirm the status of the driver update."
+35 DO ^DIR
KILL DIR
IF $DATA(DIRUT)!'Y
QUIT
+36 ;
+37 WRITE !
SET DIR(0)="YO"
SET DIR("B")="No"
SET DIR("A")="Implement enhanced acknowledgement mode transmission"
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!'Y
QUIT
+38 SET LA7UPDATE=2
+39 ;
+40 DO FILE101(LA7UPDATE)
+41 ;
+42 QUIT
+43 ;
+44 ;
FILE101(LA7UPDATE) ; Update Lab UI protocols to HL7 v2.5.1
+1 ;
+2 ; Call with LA7UPDATE = 1 (update HL7 version on protocols)
+3 ; 2 (update HL7 version and ACK codes to use enhance mode)
+4 ;
+5 NEW DIERR,I,LA101,LAFDA,LAHLACKCODE,LAHLVERSION,LAIEN,LAMSG,LANODE,LATXT,LAX
+6 ;
+7 ; Reference to file #771.5 supported by ICR DBIA1169-A
+8 ; Check LA7UI protocols and set to HL v2.5.1
+9 ;
+10 DO BMES("Starting checking and updating related Lab UI protocols in file #101")
+11 ;
+12 SET LAHLVERSION=$$FIND1^DIC(771.5,"","OX","2.5.1")
+13 IF LAHLVERSION<1
Begin DoDot:1
+14 DO BMES("Unable to check/update Lab UI protocols")
+15 DO BMES(" - could not identify HL7 v2.5.1 version entry in file #771.5")
+16 DO BMES("Aborted checking and updating related Lab UI protocols in file #101")
End DoDot:1
QUIT
+17 ;
+18 IF LA7UPDATE=2
Begin DoDot:1
+19 SET LAHLACKCODE=$$FIND1^DIC(779.003,"","OX","AL")
+20 IF LAHLACKCODE<1
Begin DoDot:2
+21 DO BMES("Unable to check/update Lab UI protocols")
+22 DO BMES(" - could not identify HL7 'AL' ACK condition in file #779.003")
+23 DO BMES("Aborted checking and updating related Lab UI protocols in file #101")
End DoDot:2
QUIT
End DoDot:1
if LAHLACKCODE<1
QUIT
+24 ;
+25 SET LANODE="^ORD(101,""B"",""LA7UI"")"
+26 FOR
SET LANODE=$QUERY(@LANODE)
if LANODE=""
QUIT
if $QSUBSCRIPT(LANODE,2)'="B"
QUIT
if $QSUBSCRIPT(LANODE,3)'?1"LA7UI"1.E
QUIT
Begin DoDot:1
+27 SET LAX=$QSUBSCRIPT(LANODE,3)
SET LA101=$QSUBSCRIPT(LANODE,4)
+28 IF LAX'["2.2"
DO BMES("Protocol "_LAX_" already updated to HL7 version 2.5.1")
+29 IF 'LA101
QUIT
+30 KILL LAFDA,LAIEN,DIERR,LAMSG,LATXT
+31 SET LAIEN=LA101_","
+32 IF LAX["2.2"
SET LAFDA(1,101,LAIEN,.01)=$PIECE(LAX," 2.2")
+33 IF $$GET1^DIQ(101,LAIEN,770.95)="2.2"
SET LAFDA(1,101,LAIEN,770.95)=LAHLVERSION
+34 IF LA7UPDATE=2
IF $$GET1^DIQ(101,LAIEN,4,"I")="E"
Begin DoDot:2
+35 SET LAFDA(1,101,LAIEN,770.8)=LAHLACKCODE
+36 SET LAFDA(1,101,LAIEN,770.9)=LAHLACKCODE
End DoDot:2
+37 IF '$DATA(LAFDA)
QUIT
+38 DO FILE^DIE("S","LAFDA(1)","LAMSG")
+39 IF $GET(LAMSG("DIERR"))
Begin DoDot:2
+40 DO BMES("Protocol "_LAX_"could not be updated.")
+41 DO MSG^DIALOG("AEST",.LATXT,80,0,"LAMSG")
+42 FOR I=1:1:LATXT
DO BMES("FileMan error: "_LATXT(I))
End DoDot:2
QUIT
+43 IF $DATA(LAFDA(1,101,LAIEN,.01))
DO BMES("Protocol "_LAX_" name changed to "_$$GET1^DIQ(101,LAIEN,.01)_".")
+44 IF $DATA(LAFDA(1,101,LAIEN,770.95))
DO BMES("Protocol "_LAX_" updated to HL7 version 2.5.1.")
+45 IF $DATA(LAFDA(1,101,LAIEN,770.8))
DO BMES("Protocol "_LAX_" updated to HL7 Enhanced Mode Acknowledgments.")
+46 DO CHECKWP(LAIEN)
End DoDot:1
+47 ;
+48 DO BMES("Finished checking and updating related Lab UI protocols in file #101")
+49 QUIT
+50 ;
+51 ;
CHECKWP(LAIEN) ; Check description (WP) field on protocol and update text.
+1 ; Change reference to v2.2 to v2.5.1 in description.
+2 ; Call with LAIEN = IENS of entry in file #101
+3 ;
+4 NEW FR,I,LAMSG,LATXT,LAX,WP,X
+5 ;
+6 SET LAX=$$GET1^DIQ(101,LAIEN,.01)
+7 SET X=$$GET1^DIQ(101,LAIEN,3.5,"","WP")
+8 ;
+9 SET I=0
SET FR("v2.2")="v2.5.1"
+10 FOR
SET I=$ORDER(WP(I))
if 'I
QUIT
SET WP(I)=$$REPLACE^XLFSTR(WP(I),.FR)
+11 ;
+12 DO WP^DIE(101,LAIEN,3.5,"","WP","LAMSG")
+13 IF $GET(LAMSG("DIERR"))
Begin DoDot:1
+14 DO BMES("Protocol "_LAX_" description field (#3.5) could not be updated.")
+15 DO MSG^DIALOG("AEST",.LATXT,80,0,"LAMSG")
+16 FOR I=1:1:LATXT
DO BMES("FileMan error: "_LATXT(I))
End DoDot:1
+17 ;
+18 QUIT
+19 ;
+20 ;
BMES(STR) ;
+1 ; Write string
+2 DO BMES^XPDUTL($$TRIM^XLFSTR($$CJ^XLFSTR(STR,$GET(IOM,80)),"R"," "))
+3 QUIT
+4 ;
+5 ;