TIUP323 ;BIZ/WPB - POST ROUTINE TO SET UP THE LINK FOR TIUCCRA; 02/01/2019
;;1.0;TEXT INTEGRATION UTILITIES;**323**;Feb 1, 2019;Build 33
;
;Reference to $$KSP^XUPARAM("INST") Supported by DBIA2541
;Reference to IA#3550
;Reference to IA#3335
Q
POST ;
D LINK,SENDAPP,RECAPP
Q
LINK ; update the TIUCCRA Link
N LIEN,OPSITE,DOMAIN,VAL,TIUERR
I $G(XPDQUES("POST1"))'?.3N1".".3N1".".3N1".".3N W !,"IP Address is in the wrong format!" Q ; check for correct ip format
S VAL="TIUCCRA"
S LIEN=$$FIND1^DIC(870,,"B",.VAL) Q:'LIEN
S FDA(870,LIEN_",",.02)=$$KSP^XUPARAM("INST") ; site station number
S FDA(870,LIEN_",",4.5)=1 ; auto start
S FDA(870,LIEN_",",400.01)=$G(XPDQUES("POST1")) ; ip address
S FDA(870,LIEN_",",400.02)=$G(XPDQUES("POST2")) ; hl7 port
D FILE^DIE(,"FDA","TIUERR") K FDA
D MES^XPDUTL("")
I $D(TIUERR) D Q ; something went wrong
.D MES^XPDUTL("FileMan error when editing the TIUCCRA Link.")
D MES^XPDUTL("TIUCCRA Link has been updated.")
Q
SENDAPP ; update the HL7 Application Parameter file to add Facility Name
N AIEN,VAL,TIUCERR
S VAL="TIU CCRA SEND"
S AIEN=$$FIND1^DIC(771,,"B",.VAL) Q:'AIEN
S FDA(771,AIEN_",",3)=$$KSP^XUPARAM("INST") ; update facility
D FILE^DIE(,"FDA","TIUCERR") K FDA
D MES^XPDUTL("")
I $D(TIUCERR) D Q ; something went wrong
.D MES^XPDUTL("FileMan error when editing the TIU CCRA SEND Application Parameter.")
D MES^XPDUTL("The TIU CCRA SEND Application Parameter has been updated.")
Q
RECAPP ; update the HL7 Application Parameter file to add Facility Name
N AIEN,VAL,TIUERR
S VAL="TIU CCRA RECEIVE"
S AIEN=$$FIND1^DIC(771,,"B",.VAL) Q:'AIEN
S FDA(771,AIEN_",",3)=200 ; update facility
D FILE^DIE(,"FDA","TIUERR") K FDA
D MES^XPDUTL("")
I $D(TIUERR) D Q ; something went wrong
.D MES^XPDUTL("FileMan error when editing the GMRC CCRA RECEIVE Application Parameter.")
D MES^XPDUTL("The TIU CCRA RECEIVE Application Parameter has been updated.")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUP323 1975 printed Dec 13, 2024@02:43 Page 2
TIUP323 ;BIZ/WPB - POST ROUTINE TO SET UP THE LINK FOR TIUCCRA; 02/01/2019
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**323**;Feb 1, 2019;Build 33
+2 ;
+3 ;Reference to $$KSP^XUPARAM("INST") Supported by DBIA2541
+4 ;Reference to IA#3550
+5 ;Reference to IA#3335
+6 QUIT
POST ;
+1 DO LINK
DO SENDAPP
DO RECAPP
+2 QUIT
LINK ; update the TIUCCRA Link
+1 NEW LIEN,OPSITE,DOMAIN,VAL,TIUERR
+2 ; check for correct ip format
IF $GET(XPDQUES("POST1"))'?.3N1".".3N1".".3N1".".3N
WRITE !,"IP Address is in the wrong format!"
QUIT
+3 SET VAL="TIUCCRA"
+4 SET LIEN=$$FIND1^DIC(870,,"B",.VAL)
if 'LIEN
QUIT
+5 ; site station number
SET FDA(870,LIEN_",",.02)=$$KSP^XUPARAM("INST")
+6 ; auto start
SET FDA(870,LIEN_",",4.5)=1
+7 ; ip address
SET FDA(870,LIEN_",",400.01)=$GET(XPDQUES("POST1"))
+8 ; hl7 port
SET FDA(870,LIEN_",",400.02)=$GET(XPDQUES("POST2"))
+9 DO FILE^DIE(,"FDA","TIUERR")
KILL FDA
+10 DO MES^XPDUTL("")
+11 ; something went wrong
IF $DATA(TIUERR)
Begin DoDot:1
+12 DO MES^XPDUTL("FileMan error when editing the TIUCCRA Link.")
End DoDot:1
QUIT
+13 DO MES^XPDUTL("TIUCCRA Link has been updated.")
+14 QUIT
SENDAPP ; update the HL7 Application Parameter file to add Facility Name
+1 NEW AIEN,VAL,TIUCERR
+2 SET VAL="TIU CCRA SEND"
+3 SET AIEN=$$FIND1^DIC(771,,"B",.VAL)
if 'AIEN
QUIT
+4 ; update facility
SET FDA(771,AIEN_",",3)=$$KSP^XUPARAM("INST")
+5 DO FILE^DIE(,"FDA","TIUCERR")
KILL FDA
+6 DO MES^XPDUTL("")
+7 ; something went wrong
IF $DATA(TIUCERR)
Begin DoDot:1
+8 DO MES^XPDUTL("FileMan error when editing the TIU CCRA SEND Application Parameter.")
End DoDot:1
QUIT
+9 DO MES^XPDUTL("The TIU CCRA SEND Application Parameter has been updated.")
+10 QUIT
RECAPP ; update the HL7 Application Parameter file to add Facility Name
+1 NEW AIEN,VAL,TIUERR
+2 SET VAL="TIU CCRA RECEIVE"
+3 SET AIEN=$$FIND1^DIC(771,,"B",.VAL)
if 'AIEN
QUIT
+4 ; update facility
SET FDA(771,AIEN_",",3)=200
+5 DO FILE^DIE(,"FDA","TIUERR")
KILL FDA
+6 DO MES^XPDUTL("")
+7 ; something went wrong
IF $DATA(TIUERR)
Begin DoDot:1
+8 DO MES^XPDUTL("FileMan error when editing the GMRC CCRA RECEIVE Application Parameter.")
End DoDot:1
QUIT
+9 DO MES^XPDUTL("The TIU CCRA RECEIVE Application Parameter has been updated.")
+10 QUIT