diff --git a/Packages/Health Level Seven/Globals/771+HL7 APPLICATION PARAMETER.zwr b/Packages/Health Level Seven/Globals/771+HL7 APPLICATION PARAMETER.zwr index 4e14297e1f5..dba7613e26d 100644 --- a/Packages/Health Level Seven/Globals/771+HL7 APPLICATION PARAMETER.zwr +++ b/Packages/Health Level Seven/Globals/771+HL7 APPLICATION PARAMETER.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: HL7 APPLICATION PARAMETER -22-NOV-2019 11:51:15 ZWR -^HL(771,0)="HL7 APPLICATION PARAMETER^771I^250^244" +25-NOV-2019 16:11:10 ZWR +^HL(771,0)="HL7 APPLICATION PARAMETER^771I^252^246" ^HL(771,3,0)="RADIOLOGY^i" ^HL(771,3,"EC")="~|\&" ^HL(771,3,"FS")="^" @@ -1093,6 +1093,12 @@ OSEHRA ZGO Export: HL7 APPLICATION PARAMETER ^HL(771,250,0)="GMRC HSRM-CCRA SEND^a^200^337^^^1" ^HL(771,250,"EC")="^~\&" ^HL(771,250,"FS")="|" +^HL(771,251,0)="SD-CCRA-HSRM^a^200^^^^1" +^HL(771,251,"EC")="^~\&" +^HL(771,251,"FS")="|" +^HL(771,252,0)="SD-CCRA-VISTA^a^442^^^^1" +^HL(771,252,"EC")="^~\&" +^HL(771,252,"FS")="|" ^HL(771,"AF","AAC","a",105)="" ^HL(771,"AF","AAC_FPDS","a",163)="" ^HL(771,"AF","AITC_VTS","a",225)="" @@ -1282,6 +1288,8 @@ OSEHRA ZGO Export: HL7 APPLICATION PARAMETER ^HL(771,"AF","ROR SITE","a",63)="" ^HL(771,"AF","SD ENC PERF MON","a",104)="" ^HL(771,"AF","SD-AAC-PAIT","i",103)="" +^HL(771,"AF","SD-CCRA-HSRM","a",251)="" +^HL(771,"AF","SD-CCRA-VISTA","a",252)="" ^HL(771,"AF","SD-SITE-PAIT","i",102)="" ^HL(771,"AF","SR AAIS","i",19)="" ^HL(771,"AF","SR SURGERY","i",18)="" @@ -1526,6 +1534,8 @@ OSEHRA ZGO Export: HL7 APPLICATION PARAMETER ^HL(771,"B","ROR SITE",63)="" ^HL(771,"B","SD ENC PERF MON",104)="" ^HL(771,"B","SD-AAC-PAIT",103)="" +^HL(771,"B","SD-CCRA-HSRM",251)="" +^HL(771,"B","SD-CCRA-VISTA",252)="" ^HL(771,"B","SD-SITE-PAIT",102)="" ^HL(771,"B","SR AAIS",19)="" ^HL(771,"B","SR SURGERY",18)="" diff --git a/Packages/Kernel/Globals/101+PROTOCOL.zwr b/Packages/Kernel/Globals/101+PROTOCOL.zwr index 7ea7e68f9e9..15db91649e0 100644 --- a/Packages/Kernel/Globals/101+PROTOCOL.zwr +++ b/Packages/Kernel/Globals/101+PROTOCOL.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: PROTOCOL -22-NOV-2019 11:51:19 ZWR -^ORD(101,0)="PROTOCOL^101I^5256^4734" +25-NOV-2019 16:11:13 ZWR +^ORD(101,0)="PROTOCOL^101I^5262^4740" ^ORD(101,1,0)="ORU PATIENT MOVMT^Review Orders on Patient Movement^^A^1^^^^^^^" ^ORD(101,1,1,0)="^^2^2^2960720^^^^" ^ORD(101,1,1,1,0)="This is the option used to review orders when a patient is discharged or" @@ -42912,6 +42912,45 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,5256,775,0)="^101.0775PA^1^1" ^ORD(101,5256,775,1,0)=5254 ^ORD(101,5256,775,"B",5254,1)="" +^ORD(101,5257,0)="CCRA HSRM SIU-S12 SERVER^^^E^17^^^^^^^" +^ORD(101,5257,1,0)="^^1^1^3181001^" +^ORD(101,5257,1,1,0)="Receives HL7 SIU^S12 v2.5.1 messages from HSRM app." +^ORD(101,5257,770)="251^^61^59^^^^1^3^7^" +^ORD(101,5257,775,0)="^101.0775PA^1^1" +^ORD(101,5257,775,1,0)=5258 +^ORD(101,5257,775,"B",5258,1)="" +^ORD(101,5258,0)="CCRA HSRM SIU-S12 CLIENT^^^S^17^^^^^^^" +^ORD(101,5258,1,0)="^^1^1^3181001^" +^ORD(101,5258,1,1,0)="Sends ACK for HL7 SIU^S12 v2.5.1 messages received from HSRM app." +^ORD(101,5258,770)="^252^^59^^^80^^^^1" +^ORD(101,5258,771)="D EN^SDCCRSEN" +^ORD(101,5258,773)="1^1" +^ORD(101,5259,0)="CCRA HSRM SIU-S15 CLIENT^^^S^17^^^^^^^" +^ORD(101,5259,1,0)="^^1^1^3181001^" +^ORD(101,5259,1,1,0)="Sends ACK for HL7 SIU^S15 v2.5.1 messages received from HSRM Application." +^ORD(101,5259,770)="^252^^62^^^80^^^^1" +^ORD(101,5259,771)="D EN^SDCCRSEN" +^ORD(101,5259,773)="1^1" +^ORD(101,5260,0)="CCRA HSRM SIU-S26 CLIENT^^^S^17^^^^^^^" +^ORD(101,5260,1,0)="^^1^1^3181116^" +^ORD(101,5260,1,1,0)="Sends ACK for HL7 SIU^S26 v2.5.1 messages received from HSRM Application." +^ORD(101,5260,770)="^252^^173^^^80^^^^1" +^ORD(101,5260,771)="D EN^SDCCRSEN" +^ORD(101,5260,773)="1^1" +^ORD(101,5261,0)="CCRA HSRM SIU-S15 SERVER^^^E^17^^^^^^^" +^ORD(101,5261,1,0)="^^1^1^3181001^" +^ORD(101,5261,1,1,0)="Receives HL7 SIU^S15 v2.5.1 messages from HSRM application." +^ORD(101,5261,770)="251^^61^62^^^^1^3^7^" +^ORD(101,5261,775,0)="^101.0775PA^1^1" +^ORD(101,5261,775,1,0)=5259 +^ORD(101,5261,775,"B",5259,1)="" +^ORD(101,5262,0)="CCRA HSRM SIU-S26 SERVER^^^E^17^^^^^^^" +^ORD(101,5262,1,0)="^^1^1^3181001^" +^ORD(101,5262,1,1,0)="Receives HL7 SIU^S26 v2.5.1 messages from HSRM application." +^ORD(101,5262,770)="251^^61^173^^^^1^3^7^" +^ORD(101,5262,775,0)="^101.0775PA^1^1" +^ORD(101,5262,775,1,0)=5260 +^ORD(101,5262,775,"B",5260,1)="" ^ORD(101,"AB",1496,1495,1)="" ^ORD(101,"AB",1591,1590,1)="" ^ORD(101,"AB",1593,1469,1)="" @@ -43214,6 +43253,9 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,"AB",5227,5228,1)="" ^ORD(101,"AB",5253,5255,1)="" ^ORD(101,"AB",5254,5256,1)="" +^ORD(101,"AB",5258,5257,1)="" +^ORD(101,"AB",5259,5261,1)="" +^ORD(101,"AB",5260,5262,1)="" ^ORD(101,"AD",1,2,2)="" ^ORD(101,"AD",1,3,1)="" ^ORD(101,"AD",4,2,1)="" @@ -48675,6 +48717,9 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,"AHL1",247,39,133,7,5228)="" ^ORD(101,"AHL1",250,51,94,7,5255)="" ^ORD(101,"AHL1",250,51,95,7,5256)="" +^ORD(101,"AHL1",251,61,59,7,5257)="" +^ORD(101,"AHL1",251,61,62,7,5261)="" +^ORD(101,"AHL1",251,61,173,7,5262)="" ^ORD(101,"AHL2",9,1590)="" ^ORD(101,"AHL2",9,1591)="" ^ORD(101,"AHL2",10,2177)="" @@ -49009,6 +49054,9 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,"AHL2",248,5227)="" ^ORD(101,"AHL2",249,5253)="" ^ORD(101,"AHL2",249,5254)="" +^ORD(101,"AHL2",252,5258)="" +^ORD(101,"AHL2",252,5259)="" +^ORD(101,"AHL2",252,5260)="" ^ORD(101,"AHL2","MAGD-CLIENT",4669)="" ^ORD(101,"AHL2","MAGD-CLIENT",4670)="" ^ORD(101,"AHL2","MAGD-CLIENT",4671)="" @@ -49302,6 +49350,9 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,"AHL21",247,39,7,5228)="" ^ORD(101,"AHL21",250,51,7,5255)="" ^ORD(101,"AHL21",250,51,7,5256)="" +^ORD(101,"AHL21",251,61,7,5257)="" +^ORD(101,"AHL21",251,61,7,5261)="" +^ORD(101,"AHL21",251,61,7,5262)="" ^ORD(101,"B",513,487,1)=1 ^ORD(101,"B"," ",544,1)=1 ^ORD(101,"B","$",2229,1)=1 @@ -49454,6 +49505,12 @@ OSEHRA ZGO Export: PROTOCOL ^ORD(101,"B","CB",789,1)=1 ^ORD(101,"B","CC",728,1)=1 ^ORD(101,"B","CC",778,1)=1 +^ORD(101,"B","CCRA HSRM SIU-S12 CLIENT",5258)="" +^ORD(101,"B","CCRA HSRM SIU-S12 SERVER",5257)="" +^ORD(101,"B","CCRA HSRM SIU-S15 CLIENT",5259)="" +^ORD(101,"B","CCRA HSRM SIU-S15 SERVER",5261)="" +^ORD(101,"B","CCRA HSRM SIU-S26 CLIENT",5260)="" +^ORD(101,"B","CCRA HSRM SIU-S26 SERVER",5262)="" ^ORD(101,"B","CD",699,1)=1 ^ORD(101,"B","CD",3614,1)=1 ^ORD(101,"B","CE",3088,3)=1 diff --git a/Packages/Kernel/Globals/14.4+TASKS.zwr b/Packages/Kernel/Globals/14.4+TASKS.zwr index 3e08285d111..ec2299246fd 100644 --- a/Packages/Kernel/Globals/14.4+TASKS.zwr +++ b/Packages/Kernel/Globals/14.4+TASKS.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: TASKS -25-NOV-2019 15:22:39 ZWR -^%ZTSK(-1)=5479 +25-NOV-2019 16:11:09 ZWR +^%ZTSK(-1)=5482 ^%ZTSK(0)="TASKS^14.4^5277" ^%ZTSK(1001,0)="TASK^XMXBULL^16^^63957,36927^63957,36927^R^^^PATCH,USER^PLA^PLA^ZTDESC^^" ^%ZTSK(1001,.02)="^PLA^^" @@ -52782,6 +52782,39 @@ OSEHRA ZGO Export: TASKS ^%ZTSK(5479,.3,"DUZ(",0)="@" ^%ZTSK(5479,.3,"XQSCH")=8 ^%ZTSK(5479,.3,"XQY")=9891 +^%ZTSK(5480,0)="ZTSK^XQ1^.5^VISTA^65342,58037^65342,58037^O^8853^HL AUTOSTART LINK MANAGER^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^" +^%ZTSK(5480,.02)="^VISTA^^" +^%ZTSK(5480,.03)="No Description (%ZTLOAD)" +^%ZTSK(5480,.04)=5645606837 +^%ZTSK(5480,.1)="B^65342,58037^Task's volume set not listed in index.^^^^^^" +^%ZTSK(5480,.2)="" +^%ZTSK(5480,.21)="" +^%ZTSK(5480,.25)="" +^%ZTSK(5480,.3,"DUZ(",0)="@" +^%ZTSK(5480,.3,"XQSCH")=10 +^%ZTSK(5480,.3,"XQY")=8853 +^%ZTSK(5481,0)="ZTSK^XQ1^.5^VISTA^65342,58037^65342,58037^O^8412^HL TASK RESTART^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^" +^%ZTSK(5481,.02)="^VISTA^^" +^%ZTSK(5481,.03)="No Description (%ZTLOAD)" +^%ZTSK(5481,.04)=5645606837 +^%ZTSK(5481,.1)="B^65342,58039^Task's volume set not listed in index.^^^^^^" +^%ZTSK(5481,.2)="" +^%ZTSK(5481,.21)="" +^%ZTSK(5481,.25)="" +^%ZTSK(5481,.3,"DUZ(",0)="@" +^%ZTSK(5481,.3,"XQSCH")=11 +^%ZTSK(5481,.3,"XQY")=8412 +^%ZTSK(5482,0)="ZTSK^XQ1^.5^VISTA^65342,58037^65342,58037^O^9891^XOBV LISTENER STARTUP^POSTMASTER^VISTA^VISTA^ZTDESC^VISTA^" +^%ZTSK(5482,.02)="^VISTA^^" +^%ZTSK(5482,.03)="No Description (%ZTLOAD)" +^%ZTSK(5482,.04)=5645606837 +^%ZTSK(5482,.1)="B^65342,58041^Task's volume set not listed in index.^^^^^^" +^%ZTSK(5482,.2)="" +^%ZTSK(5482,.21)="" +^%ZTSK(5482,.25)="" +^%ZTSK(5482,.3,"DUZ(",0)="@" +^%ZTSK(5482,.3,"XQSCH")=8 +^%ZTSK(5482,.3,"XQY")=9891 ^%ZTSK(1082462,.1)="E^64013,39495^Interrupted While Running" ^%ZTSK(1082463,.1)="E^64013,39495^Interrupted While Running" ^%ZTSK(1082464,.1)="E^64013,39495^Interrupted While Running" diff --git a/Packages/Kernel/Globals/9.4+PACKAGE.zwr b/Packages/Kernel/Globals/9.4+PACKAGE.zwr index 9a683ecb4d7..b23befe8186 100644 --- a/Packages/Kernel/Globals/9.4+PACKAGE.zwr +++ b/Packages/Kernel/Globals/9.4+PACKAGE.zwr @@ -1,5 +1,5 @@ OSEHRA ZGO Export: PACKAGE -25-NOV-2019 15:22:51 ZWR +25-NOV-2019 16:11:21 ZWR ^DIC(9.4,-1,"INI")="^2960819.165753" ^DIC(9.4,0)="PACKAGE^9.4I^232^144" ^DIC(9.4,0,"DD")="#" @@ -100884,7 +100884,7 @@ OSEHRA ZGO Export: PACKAGE ^DIC(9.4,48,14,"B","SC",1)="" ^DIC(9.4,48,22,0)="^9.49I^5.28^1" ^DIC(9.4,48,22,5.28,0)="5.3^3051119^2960613" -^DIC(9.4,48,22,5.28,"PAH",0)="^9.4901^521^521" +^DIC(9.4,48,22,5.28,"PAH",0)="^9.4901^522^522" ^DIC(9.4,48,22,5.28,"PAH",1,0)="42 SEQ #39^2960626^1" ^DIC(9.4,48,22,5.28,"PAH",1,1,0)="^^2^2^2960626" ^DIC(9.4,48,22,5.28,"PAH",1,1,1,0)="See National Patch Module (NPM) for a description of the contents of this" @@ -104239,6 +104239,10 @@ OSEHRA ZGO Export: PACKAGE ^DIC(9.4,48,22,5.28,"PAH",521,1,2,0)=" " ^DIC(9.4,48,22,5.28,"PAH",521,1,3,0)="1. when queuing Recall Clinic Letter Report, an SORT+14^SDRRREP" ^DIC(9.4,48,22,5.28,"PAH",521,1,4,0)=" error occurred." +^DIC(9.4,48,22,5.28,"PAH",522,0)="707^3191125.160752^17" +^DIC(9.4,48,22,5.28,"PAH",522,1,0)="^^2^2^3191125" +^DIC(9.4,48,22,5.28,"PAH",522,1,1,0)="CCRA-HSRM Scheduling HL7 Interfaces for processing Make" +^DIC(9.4,48,22,5.28,"PAH",522,1,2,0)="Appointment: SIU-S12, CANCEL: SIU-S15, and NOSHOW: SIU-S26 messages." ^DIC(9.4,48,22,5.28,"PAH","B",27,7)="" ^DIC(9.4,48,22,5.28,"PAH","B",41,3)="" ^DIC(9.4,48,22,5.28,"PAH","B",44,8)="" @@ -104341,6 +104345,7 @@ OSEHRA ZGO Export: PACKAGE ^DIC(9.4,48,22,5.28,"PAH","B",696,512)="" ^DIC(9.4,48,22,5.28,"PAH","B",703,516)="" ^DIC(9.4,48,22,5.28,"PAH","B",705,515)="" +^DIC(9.4,48,22,5.28,"PAH","B",707,522)="" ^DIC(9.4,48,22,5.28,"PAH","B",713,519)="" ^DIC(9.4,48,22,5.28,"PAH","B",719,514)="" ^DIC(9.4,48,22,5.28,"PAH","B",721,518)="" diff --git a/Packages/Kernel/Globals/9.6+BUILD.zwr b/Packages/Kernel/Globals/9.6+BUILD.zwr index 59d87e39df9..df09ed89721 100644 --- a/Packages/Kernel/Globals/9.6+BUILD.zwr +++ b/Packages/Kernel/Globals/9.6+BUILD.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: BUILD -25-NOV-2019 15:22:49 ZWR -^XPD(9.6,0)="BUILD^9.6I^11412^11052" +25-NOV-2019 16:11:18 ZWR +^XPD(9.6,0)="BUILD^9.6I^11413^11053" ^XPD(9.6,1,0)="KERNEL - VIRGIN INSTALL 8.0^3^0^2950703^n" ^XPD(9.6,1,1,0)="^^3^3^2950703^" ^XPD(9.6,1,1,1,0)="Install files needed to support Kernel 8.0. This package is" @@ -1230020,6 +1230020,99 @@ OSEHRA ZGO Export: BUILD ^XPD(9.6,11412,"REQB","B","RA*5.0*106",4)="" ^XPD(9.6,11412,"REQB","B","RA*5.0*154",3)="" ^XPD(9.6,11412,"REQB","B","RA*5.0*77",2)="" +^XPD(9.6,11413,0)="SD*5.3*707^48^0^3190729^y" +^XPD(9.6,11413,1,0)="^^2^2^3190610^" +^XPD(9.6,11413,1,1,0)="CCRA-HSRM Scheduling HL7 Interfaces for processing Make" +^XPD(9.6,11413,1,2,0)="Appointment: SIU-S12, CANCEL: SIU-S15, and NOSHOW: SIU-S26 messages." +^XPD(9.6,11413,4,0)="^9.64PA^^" +^XPD(9.6,11413,6)="^586" +^XPD(9.6,11413,6.3)=57 +^XPD(9.6,11413,"ABPKG")="n" +^XPD(9.6,11413,"INI")="LINK^SDPRE707" +^XPD(9.6,11413,"INID")="^^n" +^XPD(9.6,11413,"INIT")=" " +^XPD(9.6,11413,"KRN",0)="^9.67PA^779.2^20" +^XPD(9.6,11413,"KRN",.4,0)=.4 +^XPD(9.6,11413,"KRN",.401,0)=.401 +^XPD(9.6,11413,"KRN",.402,0)=.402 +^XPD(9.6,11413,"KRN",.403,0)=.403 +^XPD(9.6,11413,"KRN",.5,0)=.5 +^XPD(9.6,11413,"KRN",.84,0)=.84 +^XPD(9.6,11413,"KRN",3.6,0)=3.6 +^XPD(9.6,11413,"KRN",3.8,0)=3.8 +^XPD(9.6,11413,"KRN",3.8,"NM",0)="^9.68A^1^1" +^XPD(9.6,11413,"KRN",3.8,"NM",1,0)="GMRC HSRM SIU HL7 MESSAGES^^0" +^XPD(9.6,11413,"KRN",3.8,"NM","B","GMRC HSRM SIU HL7 MESSAGES",1)=" " +^XPD(9.6,11413,"KRN",9.2,0)=9.2 +^XPD(9.6,11413,"KRN",9.8,0)=9.8 +^XPD(9.6,11413,"KRN",9.8,"NM",0)="^9.68A^12^5" +^XPD(9.6,11413,"KRN",9.8,"NM",3,0)="SDCCRCOR^^0^B91692691" +^XPD(9.6,11413,"KRN",9.8,"NM",5,0)="SDCCRGAP^^0^B27289606" +^XPD(9.6,11413,"KRN",9.8,"NM",10,0)="SDCCRSCU^^0^B91336223" +^XPD(9.6,11413,"KRN",9.8,"NM",11,0)="SDCCRSEN^^0^B147345634" +^XPD(9.6,11413,"KRN",9.8,"NM",12,0)="SDPRE707^^0^B12266652" +^XPD(9.6,11413,"KRN",9.8,"NM","B","SDCCRCOR",3)=" " +^XPD(9.6,11413,"KRN",9.8,"NM","B","SDCCRGAP",5)=" " +^XPD(9.6,11413,"KRN",9.8,"NM","B","SDCCRSCU",10)=" " +^XPD(9.6,11413,"KRN",9.8,"NM","B","SDCCRSEN",11)=" " +^XPD(9.6,11413,"KRN",9.8,"NM","B","SDPRE707",12)=" " +^XPD(9.6,11413,"KRN",19,0)=19 +^XPD(9.6,11413,"KRN",19,"NM",0)="^9.68A^^" +^XPD(9.6,11413,"KRN",19.1,0)=19.1 +^XPD(9.6,11413,"KRN",101,0)=101 +^XPD(9.6,11413,"KRN",101,"NM",0)="^9.68A^6^6" +^XPD(9.6,11413,"KRN",101,"NM",1,0)="CCRA HSRM SIU-S12 CLIENT^^0" +^XPD(9.6,11413,"KRN",101,"NM",2,0)="CCRA HSRM SIU-S12 SERVER^^0" +^XPD(9.6,11413,"KRN",101,"NM",3,0)="CCRA HSRM SIU-S15 CLIENT^^0" +^XPD(9.6,11413,"KRN",101,"NM",4,0)="CCRA HSRM SIU-S15 SERVER^^0" +^XPD(9.6,11413,"KRN",101,"NM",5,0)="CCRA HSRM SIU-S26 CLIENT^^0" +^XPD(9.6,11413,"KRN",101,"NM",6,0)="CCRA HSRM SIU-S26 SERVER^^0" +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S12 CLIENT",1)=" " +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S12 SERVER",2)=" " +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S15 CLIENT",3)=" " +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S15 SERVER",4)=" " +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S26 CLIENT",5)=" " +^XPD(9.6,11413,"KRN",101,"NM","B","CCRA HSRM SIU-S26 SERVER",6)=" " +^XPD(9.6,11413,"KRN",409.61,0)=409.61 +^XPD(9.6,11413,"KRN",409.61,"NM",0)="^9.68A^^" +^XPD(9.6,11413,"KRN",771,0)=771 +^XPD(9.6,11413,"KRN",771,"NM",0)="^9.68A^2^2" +^XPD(9.6,11413,"KRN",771,"NM",1,0)="SD-CCRA-HSRM^^0" +^XPD(9.6,11413,"KRN",771,"NM",2,0)="SD-CCRA-VISTA^^0" +^XPD(9.6,11413,"KRN",771,"NM","B","SD-CCRA-HSRM",1)=" " +^XPD(9.6,11413,"KRN",771,"NM","B","SD-CCRA-VISTA",2)=" " +^XPD(9.6,11413,"KRN",779.2,0)=779.2 +^XPD(9.6,11413,"KRN",870,0)=870 +^XPD(9.6,11413,"KRN",870,"NM",0)="^9.68A^^0" +^XPD(9.6,11413,"KRN",8989.51,0)=8989.51 +^XPD(9.6,11413,"KRN",8989.52,0)=8989.52 +^XPD(9.6,11413,"KRN",8994,0)=8994 +^XPD(9.6,11413,"KRN","B",.4,.4)=" " +^XPD(9.6,11413,"KRN","B",.401,.401)=" " +^XPD(9.6,11413,"KRN","B",.402,.402)=" " +^XPD(9.6,11413,"KRN","B",.403,.403)=" " +^XPD(9.6,11413,"KRN","B",.5,.5)=" " +^XPD(9.6,11413,"KRN","B",.84,.84)=" " +^XPD(9.6,11413,"KRN","B",3.6,3.6)=" " +^XPD(9.6,11413,"KRN","B",3.8,3.8)=" " +^XPD(9.6,11413,"KRN","B",9.2,9.2)=" " +^XPD(9.6,11413,"KRN","B",9.8,9.8)=" " +^XPD(9.6,11413,"KRN","B",19,19)=" " +^XPD(9.6,11413,"KRN","B",19.1,19.1)=" " +^XPD(9.6,11413,"KRN","B",101,101)=" " +^XPD(9.6,11413,"KRN","B",409.61,409.61)=" " +^XPD(9.6,11413,"KRN","B",771,771)=" " +^XPD(9.6,11413,"KRN","B",779.2,779.2)=" " +^XPD(9.6,11413,"KRN","B",870,870)=" " +^XPD(9.6,11413,"KRN","B",8989.51,8989.51)=" " +^XPD(9.6,11413,"KRN","B",8989.52,8989.52)=" " +^XPD(9.6,11413,"KRN","B",8994,8994)=" " +^XPD(9.6,11413,"QUES",0)="^9.62^^0" +^XPD(9.6,11413,"REQB",0)="^9.611^2^2" +^XPD(9.6,11413,"REQB",1,0)="GMRC*3.0*99^2" +^XPD(9.6,11413,"REQB",2,0)="GMRC*3.0*106^2" +^XPD(9.6,11413,"REQB","B","GMRC*3.0*106",2)=" " +^XPD(9.6,11413,"REQB","B","GMRC*3.0*99",1)=" " ^XPD(9.6,"B","A4A7*1.01*10",1312)="" ^XPD(9.6,"B","A4A7*1.01*11",1900)="" ^XPD(9.6,"B","A4A7*1.01*9",339)="" @@ -1239390,6 +1239483,7 @@ OSEHRA ZGO Export: BUILD ^XPD(9.6,"B","SD*5.3*70",324)="" ^XPD(9.6,"B","SD*5.3*703",11076)="" ^XPD(9.6,"B","SD*5.3*705",11075)="" +^XPD(9.6,"B","SD*5.3*707",11413)="" ^XPD(9.6,"B","SD*5.3*71",321)="" ^XPD(9.6,"B","SD*5.3*713",11321)="" ^XPD(9.6,"B","SD*5.3*719",11074)="" @@ -1244840,6 +1244934,7 @@ OSEHRA ZGO Export: BUILD ^XPD(9.6,"C",48,11321)="" ^XPD(9.6,"C",48,11337)="" ^XPD(9.6,"C",48,11338)="" +^XPD(9.6,"C",48,11413)="" ^XPD(9.6,"C",49,72)="" ^XPD(9.6,"C",49,131)="" ^XPD(9.6,"C",49,150)="" diff --git a/Packages/Kernel/Globals/9.7+INSTALL.zwr b/Packages/Kernel/Globals/9.7+INSTALL.zwr index b6d04353ac8..59d61f06e79 100644 --- a/Packages/Kernel/Globals/9.7+INSTALL.zwr +++ b/Packages/Kernel/Globals/9.7+INSTALL.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: INSTALL -25-NOV-2019 15:23:50 ZWR -^XPD(9.7,0)="INSTALL^9.7I^11131^10989" +25-NOV-2019 16:12:22 ZWR +^XPD(9.7,0)="INSTALL^9.7I^11132^10990" ^XPD(9.7,1,0)="KERNEL - VIRGIN INSTALL 8.0^^2960531.10393^1^1^^^^3^0^.5" ^XPD(9.7,1,1)="2960604.094043^2960604.094043^2960604.094047" ^XPD(9.7,1,2)="Kernel 8.0 from ISC-SF by RSD ;Created on Jul 10, 1995@09:28:18" @@ -854084,6 +854084,89 @@ OSEHRA ZGO Export: INSTALL ^XPD(9.7,11131,"RTN","B","RAO7PC4",5)="" ^XPD(9.7,11131,"RTN","B","RAPRINT1",6)="" ^XPD(9.7,11131,"RTN","B","RAREG3",7)="" +^XPD(9.7,11132,0)="SD*5.3*707^48^3191125.160717^11132^1^^0^0SD*5.3*707^3^0^17" +^XPD(9.7,11132,1)="3191125.160752^3191125.160752^3191125.160752^3190729" +^XPD(9.7,11132,2)="Extracted from mail message ;Created on " +^XPD(9.7,11132,6)="^586" +^XPD(9.7,11132,"INI",0)="^9.713^2^2" +^XPD(9.7,11132,"INI",1,0)="XPD PREINSTALL COMPLETED^3191125.160752" +^XPD(9.7,11132,"INI",2,0)="XPD PREINSTALL STARTED^3191125.160752" +^XPD(9.7,11132,"INI",2,1)="LINK^SDPRE707" +^XPD(9.7,11132,"INI","B","XPD PREINSTALL COMPLETED",1)="" +^XPD(9.7,11132,"INI","B","XPD PREINSTALL STARTED",2)="" +^XPD(9.7,11132,"INIT",0)="^9.716^1^1" +^XPD(9.7,11132,"INIT",1,0)="XPD POSTINSTALL COMPLETED^3191125.160752" +^XPD(9.7,11132,"INIT","B","XPD POSTINSTALL COMPLETED",1)="" +^XPD(9.7,11132,"KRN",0)="^9.715P^771^3" +^XPD(9.7,11132,"KRN",3.8,0)="3.8^3191125.160752^11" +^XPD(9.7,11132,"KRN",101,0)="101^3191125.160752^15" +^XPD(9.7,11132,"KRN",771,0)="771^3191125.160752^14" +^XPD(9.7,11132,"KRN","AC",11,3.8)="" +^XPD(9.7,11132,"KRN","AC",14,771)="" +^XPD(9.7,11132,"KRN","AC",15,101)="" +^XPD(9.7,11132,"KRN","B",3.8,3.8)="" +^XPD(9.7,11132,"KRN","B",101,101)="" +^XPD(9.7,11132,"KRN","B",771,771)="" +^XPD(9.7,11132,"MES",0)="^^32^32^3191125" +^XPD(9.7,11132,"MES",1,0)=" " +^XPD(9.7,11132,"MES",2,0)=" Install Started for SD*5.3*707 : " +^XPD(9.7,11132,"MES",3,0)=" Nov 25, 2019@16:07:52" +^XPD(9.7,11132,"MES",4,0)=" " +^XPD(9.7,11132,"MES",5,0)="Build Distribution Date: Jul 29, 2019" +^XPD(9.7,11132,"MES",6,0)=" " +^XPD(9.7,11132,"MES",7,0)=" Installing Routines:" +^XPD(9.7,11132,"MES",8,0)=" Nov 25, 2019@16:07:52" +^XPD(9.7,11132,"MES",9,0)=" " +^XPD(9.7,11132,"MES",10,0)=" Running Pre-Install Routine: LINK^SDPRE707" +^XPD(9.7,11132,"MES",11,0)="Checking VistA system for CCRA-NAK logical link setup..." +^XPD(9.7,11132,"MES",12,0)="Link already exists, no new setup needed" +^XPD(9.7,11132,"MES",13,0)=" " +^XPD(9.7,11132,"MES",14,0)=" Installing PACKAGE COMPONENTS: " +^XPD(9.7,11132,"MES",15,0)=" " +^XPD(9.7,11132,"MES",16,0)=" Installing MAIL GROUP" +^XPD(9.7,11132,"MES",17,0)=" " +^XPD(9.7,11132,"MES",18,0)=" Installing HL7 APPLICATION PARAMETER" +^XPD(9.7,11132,"MES",19,0)=" " +^XPD(9.7,11132,"MES",20,0)=" Installing PROTOCOL" +^XPD(9.7,11132,"MES",21,0)=" Nov 25, 2019@16:07:52" +^XPD(9.7,11132,"MES",22,0)=" " +^XPD(9.7,11132,"MES",23,0)=" Updating Routine file..." +^XPD(9.7,11132,"MES",24,0)=" " +^XPD(9.7,11132,"MES",25,0)=" Updating KIDS files..." +^XPD(9.7,11132,"MES",26,0)=" " +^XPD(9.7,11132,"MES",27,0)=" SD*5.3*707 Installed. " +^XPD(9.7,11132,"MES",28,0)=" Nov 25, 2019@16:07:52" +^XPD(9.7,11132,"MES",29,0)=" " +^XPD(9.7,11132,"MES",30,0)=" Not a production UCI" +^XPD(9.7,11132,"MES",31,0)=" " +^XPD(9.7,11132,"MES",32,0)=" NO Install Message sent " +^XPD(9.7,11132,"QUES",0)="^9.701^3^3" +^XPD(9.7,11132,"QUES",1,0)="XPM1498#1" +^XPD(9.7,11132,"QUES",1,1)=.5 +^XPD(9.7,11132,"QUES",1,"A")="Enter the Coordinator for Mail Group 'GMRC HSRM SIU HL7 MESSAGES'" +^XPD(9.7,11132,"QUES",1,"B")="POSTMASTER" +^XPD(9.7,11132,"QUES",2,0)="XPI1" +^XPD(9.7,11132,"QUES",2,1)=0 +^XPD(9.7,11132,"QUES",2,"A")="Want KIDS to INHIBIT LOGONs during the install" +^XPD(9.7,11132,"QUES",2,"B")="NO" +^XPD(9.7,11132,"QUES",3,0)="XPZ1" +^XPD(9.7,11132,"QUES",3,1)=0 +^XPD(9.7,11132,"QUES",3,"A")="Want to DISABLE Scheduled Options, Menu Options, and Protocols" +^XPD(9.7,11132,"QUES",3,"B")="NO" +^XPD(9.7,11132,"QUES","B","XPI1",2)="" +^XPD(9.7,11132,"QUES","B","XPM1498#1",1)="" +^XPD(9.7,11132,"QUES","B","XPZ1",3)="" +^XPD(9.7,11132,"RTN",0)="^9.704A^5^5" +^XPD(9.7,11132,"RTN",1,0)="SDCCRCOR" +^XPD(9.7,11132,"RTN",2,0)="SDCCRGAP" +^XPD(9.7,11132,"RTN",3,0)="SDCCRSCU" +^XPD(9.7,11132,"RTN",4,0)="SDCCRSEN" +^XPD(9.7,11132,"RTN",5,0)="SDPRE707" +^XPD(9.7,11132,"RTN","B","SDCCRCOR",1)="" +^XPD(9.7,11132,"RTN","B","SDCCRGAP",2)="" +^XPD(9.7,11132,"RTN","B","SDCCRSCU",3)="" +^XPD(9.7,11132,"RTN","B","SDCCRSEN",4)="" +^XPD(9.7,11132,"RTN","B","SDPRE707",5)="" ^XPD(9.7,"ASP",1,1,1)="" ^XPD(9.7,"ASP",1,2,2)="" ^XPD(9.7,"ASP",3,1,3)="" @@ -865073,6 +865156,7 @@ OSEHRA ZGO Export: INSTALL ^XPD(9.7,"ASP",11129,1,11129)="" ^XPD(9.7,"ASP",11130,1,11130)="" ^XPD(9.7,"ASP",11131,1,11131)="" +^XPD(9.7,"ASP",11132,1,11132)="" ^XPD(9.7,"B","A4A7*1.01*10",1037)="" ^XPD(9.7,"B","A4A7*1.01*11",1611)="" ^XPD(9.7,"B","A4A7*1.01*11",1631)="" @@ -874389,6 +874473,7 @@ OSEHRA ZGO Export: INSTALL ^XPD(9.7,"B","SD*5.3*70",337)="" ^XPD(9.7,"B","SD*5.3*703",10795)="" ^XPD(9.7,"B","SD*5.3*705",10794)="" +^XPD(9.7,"B","SD*5.3*707",11132)="" ^XPD(9.7,"B","SD*5.3*71",336)="" ^XPD(9.7,"B","SD*5.3*713",11040)="" ^XPD(9.7,"B","SD*5.3*719",10793)="" diff --git a/Packages/Kernel/Globals/9.8+ROUTINE.zwr b/Packages/Kernel/Globals/9.8+ROUTINE.zwr index 41c18e9b348..d6fcfcbfb32 100644 --- a/Packages/Kernel/Globals/9.8+ROUTINE.zwr +++ b/Packages/Kernel/Globals/9.8+ROUTINE.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: ROUTINE -25-NOV-2019 12:42:13 ZWR -^DIC(9.8,0)="ROUTINE^9.8^36221^29277" +25-NOV-2019 16:11:37 ZWR +^DIC(9.8,0)="ROUTINE^9.8^36226^29282" ^DIC(9.8,0,"DD")="#" ^DIC(9.8,0,"DEL")="#" ^DIC(9.8,0,"GL")="^DIC(9.8," @@ -6771,7 +6771,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,1580,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^16572164/38687252" ^DIC(9.8,1580,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" ^DIC(9.8,1581,0)="RAHLO1^R" -^DIC(9.8,1581,4.1)=3110823.121201 +^DIC(9.8,1581,4.1)=3191125.152019 ^DIC(9.8,1581,8,0)="^9.818^1^1" ^DIC(9.8,1581,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^19974108/42447286" ^DIC(9.8,1581,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -7104,7 +7104,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,1655,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^11613848/22198588" ^DIC(9.8,1655,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" ^DIC(9.8,1656,0)="RAPRINT1^R" -^DIC(9.8,1656,4.1)=3110823.121201 +^DIC(9.8,1656,4.1)=3191125.152019 ^DIC(9.8,1656,8,0)="^9.818^1^1" ^DIC(9.8,1656,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^8920500/25798821" ^DIC(9.8,1656,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -7170,7 +7170,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,1669,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^16469554/42484505" ^DIC(9.8,1669,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" ^DIC(9.8,1670,0)="RAREG3^R" -^DIC(9.8,1670,4.1)=3190826.215118 +^DIC(9.8,1670,4.1)=3191125.152019 ^DIC(9.8,1670,8,0)="^9.818^1^1" ^DIC(9.8,1670,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^8460388/17775791" ^DIC(9.8,1670,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -64518,7 +64518,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,16841,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^11868424/30271954" ^DIC(9.8,16841,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" ^DIC(9.8,16842,0)="RAHLO2^R" -^DIC(9.8,16842,4.1)=3181202.201609 +^DIC(9.8,16842,4.1)=3191125.152019 ^DIC(9.8,16842,8,0)="^9.818^1^1" ^DIC(9.8,16842,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^7948095/17806463" ^DIC(9.8,16842,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -74806,7 +74806,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,19559,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^3499755/13384367" ^DIC(9.8,19559,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" ^DIC(9.8,19560,0)="RAHLTCPB^R" -^DIC(9.8,19560,4.1)=3110309.102709 +^DIC(9.8,19560,4.1)=3191125.152019 ^DIC(9.8,19560,8,0)="^9.818^1^1" ^DIC(9.8,19560,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^15549193/56853424" ^DIC(9.8,19560,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -81132,7 +81132,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,21460,8,"B","COMPARE INTEGRATED PATIENT FUN",1)="" ^DIC(9.8,21461,0)="LEX2019^R" ^DIC(9.8,21464,0)="RAO7PC4^R" -^DIC(9.8,21464,4.1)=3070904.235404 +^DIC(9.8,21464,4.1)=3191125.152019 ^DIC(9.8,21464,8,0)="^9.818^1^1" ^DIC(9.8,21464,8,1,0)="COMPARE RADIOLOGY/NUCLEAR MEDICINE 5.0^13713291/39691653" ^DIC(9.8,21464,8,"B","COMPARE RADIOLOGY/NUCLEAR MEDI",1)="" @@ -106983,7 +106983,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,31356,0)="RAHLRU1^R" ^DIC(9.8,31356,4.1)=3130821.113914 ^DIC(9.8,31357,0)="RAHLTCPX^R" -^DIC(9.8,31357,4.1)=3181202.201609 +^DIC(9.8,31357,4.1)=3191125.152019 ^DIC(9.8,31359,0)="MAG7UCFG^R" ^DIC(9.8,31359,4.1)=3150916.120954 ^DIC(9.8,31360,0)="MAG7UD^R" @@ -115036,6 +115036,16 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,36220,4.1)=3191125.123828 ^DIC(9.8,36221,0)="LRWU9A^R" ^DIC(9.8,36221,4.1)=3191125.123828 +^DIC(9.8,36222,0)="SDCCRCOR^R" +^DIC(9.8,36222,4.1)=3191125.160752 +^DIC(9.8,36223,0)="SDCCRGAP^R" +^DIC(9.8,36223,4.1)=3191125.160752 +^DIC(9.8,36224,0)="SDCCRSCU^R" +^DIC(9.8,36224,4.1)=3191125.160752 +^DIC(9.8,36225,0)="SDCCRSEN^R" +^DIC(9.8,36225,4.1)=3191125.160752 +^DIC(9.8,36226,0)="SDPRE707^R" +^DIC(9.8,36226,4.1)=3191125.160752 ^DIC(9.8,"%",0)="^1.005^1^1" ^DIC(9.8,"%",1,0)="XU" ^DIC(9.8,"%","B","XU",1)="" @@ -139853,6 +139863,10 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,"B","SDC4",5611)="" ^DIC(9.8,"B","SDCAN",5612)="" ^DIC(9.8,"B","SDCCP",5613)="" +^DIC(9.8,"B","SDCCRCOR",36222)="" +^DIC(9.8,"B","SDCCRGAP",36223)="" +^DIC(9.8,"B","SDCCRSCU",36224)="" +^DIC(9.8,"B","SDCCRSEN",36225)="" ^DIC(9.8,"B","SDCD",774)="" ^DIC(9.8,"B","SDCED",34396)="" ^DIC(9.8,"B","SDCED1",34397)="" @@ -140174,6 +140188,7 @@ OSEHRA ZGO Export: ROUTINE ^DIC(9.8,"B","SDPPRT",781)="" ^DIC(9.8,"B","SDPPSEL",4093)="" ^DIC(9.8,"B","SDPPTEM",782)="" +^DIC(9.8,"B","SDPRE707",36226)="" ^DIC(9.8,"B","SDPURG",5706)="" ^DIC(9.8,"B","SDPURG1",5707)="" ^DIC(9.8,"B","SDPURG2",5708)="" diff --git a/Packages/MailMan/Globals/3.8+MAIL GROUP.zwr b/Packages/MailMan/Globals/3.8+MAIL GROUP.zwr index cd8abd3ea6f..28304f911c4 100644 --- a/Packages/MailMan/Globals/3.8+MAIL GROUP.zwr +++ b/Packages/MailMan/Globals/3.8+MAIL GROUP.zwr @@ -1,6 +1,6 @@ OSEHRA ZGO Export: MAIL GROUP -29-AUG-2019 23:37:52 ZWR -^XMB(3.8,0)="MAIL GROUP^3.8^339^325" +25-NOV-2019 16:11:19 ZWR +^XMB(3.8,0)="MAIL GROUP^3.8^340^326" ^XMB(3.8,1,0)="POSTMASTER^PU^y^3^2971212^" ^XMB(3.8,1,3)=1 ^XMB(3.8,2,0)="EN PROJECTS^PU^y^^^" @@ -1906,6 +1906,8 @@ OSEHRA ZGO Export: MAIL GROUP ^XMB(3.8,339,2,2,0)="XUSERDIS/XUSERDEAC bulletins for each user that has the DISUSER field " ^XMB(3.8,339,2,3,0)="set to ""YES"", or is deactivated at the sites." ^XMB(3.8,339,3)=17 +^XMB(3.8,340,0)="GMRC HSRM SIU HL7 MESSAGES^PU^^^^^.5" +^XMB(3.8,340,3)=17 ^XMB(3.8,"AB",.5,240,1)="" ^XMB(3.8,"AB",.5,319,1)="" ^XMB(3.8,"AB",1,3,1)="" @@ -1969,6 +1971,7 @@ OSEHRA ZGO Export: MAIL GROUP ^XMB(3.8,"AC",.5,33)="" ^XMB(3.8,"AC",.5,34)="" ^XMB(3.8,"AC",.5,336)="" +^XMB(3.8,"AC",.5,340)="" ^XMB(3.8,"AC",1,20)="" ^XMB(3.8,"AC",1,33)="" ^XMB(3.8,"AC",1,34)="" @@ -2243,6 +2246,7 @@ OSEHRA ZGO Export: MAIL GROUP ^XMB(3.8,"B","GMRA VERIFY FOOD ALLERGY",9)="" ^XMB(3.8,"B","GMRA VERIFY OTHER ALLERGY",10)="" ^XMB(3.8,"B","GMRC HCP HL7 MESSAGES",318)="" +^XMB(3.8,"B","GMRC HSRM SIU HL7 MESSAGES",340)="" ^XMB(3.8,"B","GMRCCCRA NOTIFICATIONS",337)="" ^XMB(3.8,"B","HBHC MEDICAL FOSTER HOME",259)="" ^XMB(3.8,"B","HDIS ERRORS",213)="" diff --git a/Packages/Scheduling/Routines/SDCCRCOR.m b/Packages/Scheduling/Routines/SDCCRCOR.m new file mode 100644 index 00000000000..86e35ebe059 --- /dev/null +++ b/Packages/Scheduling/Routines/SDCCRCOR.m @@ -0,0 +1,274 @@ +SDCCRCOR ;CCRA/LB,PB - Core Tags;APR 4, 2019 + ;;5.3;Scheduling;**707**;APR 4, 2019;Build 57 + ;;Per VA directive 6402, this routine should not be modified. + Q + ; +HL72VATS(HL7TS) ; Converts HL7 formatted timestamps to VA format + ; HL7TS - date/time stamp in 24H HL7 format (YYYYMMDDHHMMSS) + Q $$HL7TFM^XLFDT($G(HL7TS)) +VA2HL7TS(VATS) ; Converts VA formatted timestamps to HL7 format + ; VATS - date/time stamp in VA format (YYYMMDD.HHMMSS) + Q $$FMTHL7^XLFDT($G(VATS)) +GETPTIEN(PATNAME) ; Returns patient ID or null, name must be perfect match + ; PATNAME - Patient name - must be exact LAST,FIRST + N IEN + I $G(PATNAME)="" Q "" + I $D(^DPT("B",PATNAME)) D + . S IEN=$O(^DPT("B",PATNAME,"")) + Q $G(IEN) +GETPTNM(DFN) ; Returns patient name from ^DPT global, given a valid DFN + ; DFN - Patient ID to look for + N PATNAME + I $G(DFN)="" Q "" + I $D(^DPT(DFN,0)) D + . S PATNAME=$P(^DPT(DFN,0),"^",1) + Q $G(PATNAME) +GETLCIEN(LOCNAME) ; Returns Location ID or null, name must be perfect match + ; PATNAME - Location name - must be exact + N IEN + I $G(LOCNAME)="" Q "" + I $D(^SC("B",LOCNAME)) D + . S IEN=$O(^SC("B",LOCNAME,"")) + Q $G(IEN) +GETLCNM(LOCID) ; Returns location name from clinic file 44 given a valid clinic IEN + ; LOCID - Location ID to look for + Q $$GET1^DIQ(44,$G(LOCID),.01) +GETNMPRV(CLINIC) ; Returns the number of providers associated with a clinic + ; CLINIC - The Clinic IEN (first piece of DPT 0 node) + Q $P(^SC($G(CLINIC),"PR",0),"^",4) ;Piece 3 is most recently assigned number, piece 4 is total active. +GETCNGNM(CLINICGROUP) ; Returns the Name of a Clinic's group + ; CLINICGROUP - The Clinic Group IEN + Q $P(^SD(409.67,$G(CLINICGROUP),0),"^",1) +GETPRVNM(PROVIEN) ; Returns the provider name, given a provider ID + ; PROVIEN - The Provider IEN + Q $P(^VA(200,$G(PROVIEN),0),"^") +ICLNDPRV(CLINIC,PROVIEN) ; Determines if the provider is the default provider for the clinic + ; CLINIC - The Clinic IEN (first piece of DPT 0 node) + ; PROVIEN - The Provider IEN + Q $P(^SC($G(CLINIC),"PR",$$CLNPVIND($G(CLINIC),$G(PROVIEN)),0),"^",2) +CLNPVIND(CLINIC,PROVIEN) ; Determines the line number the provider is listed on for a clinic + ; CLINIC - The Clinic IEN (first piece of DPT 0 node) + ; PROVIEN - The Provider IEN + Q +$QS($Q(^SC($G(CLINIC),"PR","B",$G(PROVIEN))),5) +GTCANRSN(PATIENTIEN,APPTDT) ; Returns the discrete cancellation reason + ; PATIEN (I,REQ)- Patient ID as in DPT(PATIEN,"S",APPTDAT + ; APPTDAT (I,REQ) - Appointment date + Q $P(^SD(409.2,$$APTNODEP^SDCCRGAP($G(PATIENTIEN),$G(APPTDT),0,15),0),"^",1) +GTCNRNTP(PATIENTIEN,APPTDT) ; Gets the cancelation reason type. + ; PATIEN - Patient ID as in DPT(PATIEN,"S",APPTDAT + ; APPTDAT - Appointment date + N VAL,CANTYPE + S CANTYPE=$$APTNODEP^SDCCRGAP($G(PATIENTIEN),$G(APPTDT),0,15) + S VAL=$P($G(^SD(409.2,$G(CANTYPE),0)),"^",2) + Q $S($G(VAL)="B":"C",1:$G(VAL)) +ORD2CONS(ORDERID) ;Returns the consult ID linked to the given order + ; ORDERID - Order ID + N CNSLTLNK + I $G(ORDERID)="" Q "" + S CNSLTLNK=$G(^OR(100,ORDERID,4)) + I $P(CNSLTLNK,";",2)="GMRC" Q $P(CNSLTLNK,";",1) + Q "" +INSTRING(VALUE,LIST,DELIM) ; compare a string value to see if it is a list given a particular delimiter + ; VALUE - value to find in the list. + ; LIST - The list to check + ; DELIM - Delimiter that separates the data in the list. Default = "," + Q $S($G(DELIM)="":(","_$G(LIST)_",")[(","_$G(VALUE)_","),1:($G(DELIM)_$G(LIST)_$G(DELIM))[($G(DELIM)_$G(VALUE)_$G(DELIM))) +INITINC ; Sets temp global that indicates this process is filing an incoming message + S ^TMP($J,"CCRA-INCINTF")=1 + Q +DONEINC ; Clears temp global that indicates this process is filing an incoming message + K ^TMP($J,"CCRA-INCINTF") + Q +INCINTF() ; Checks temp global that indicates whether the process is filing an incoming message + Q +$G(^TMP($J,"CCRA-INCINTF")) +SETMSGET() ;SEND AN ERROR MESSAGE OUT AND LOG THE CACHE ERROR+STACK TO ^ERRORS + N $ETRAP + S $ETRAP="LOGSEND^SDCCRCOR" + Q +FMTPHONE(PHONE,EXT) ; Formats a VistA telephone number into an HL7-compliant format + ; Formats include: (nnn)nnn-nnnn and nnn-nnnn, depending on whether or not there is an area code. + ; If the number is not in an a valid format, does not attempt to do any formatting. + ; Returns 1 if the number was formatted, 0 otherwise. + ; + ; PHONE - Phone number to be formatted + ; EXT - Phone number extension (if specified) + ; + I $G(PHONE)="" Q 0 + N TEMP,LENGTH + ; + ; Extract phone number + S TEMP=$$STRIP^XLFSTR(PHONE,"-()") ; Strip certain delimiters + S TEMP=$TR(TEMP,"x","X") ; Standardize extension delimiter + S EXT=$P(TEMP,"X",2) ; Pull out the extension (if it exists) + S TEMP=$P(TEMP,"X",1) + ; + ; Format based on length + S LENGTH=$L(TEMP) + I '$$INSTRING^SDCCRCOR(LENGTH,"7,10",",") Q 0 ; Length not 7 or 10 + I LENGTH=7 S TEMP=$E(TEMP,1,3)_"-"_$E(TEMP,4,7) ; No area code: nnn-nnnn + I LENGTH=10 S TEMP="("_$E(TEMP,1,3)_")"_$E(TEMP,4,6)_"-"_$E(TEMP,7,10) ; Area code: (nnn)nnn-nnnn + ; + ; Save output + S PHONE=TEMP + Q 1 +GETLEN(SCH,AIP,AIG) ;Translates duration into Minutes. Assumes minutes unless set to S or SEC for the units + ; Only one parameter at a time should be passed-in, depending on what segment is calling this tag + ; SCH (I/OPT) - SCH message segment data + ; AIP (I/OPT) - AIP message segment data + ; AIG (I/OPT) - AIG message segment data + N DURATION,UNIT + I $D(SCH) D + . S DURATION=+$$GET^SDCCRSCU(.SCH,9,1) ;SCH-9 + . I DURATION=0 D ACK("CE",MID,"SCH",9,1,304,"NO APPOINTMENT DURATION RECIEVED IN SCH",1) S ABORT="1^NO APPOINTMENT DURATION RECIEVED IN SCH" Q + . S UNIT=$$GET^SDCCRSCU(.SCH,10,1) ;SCH-10 + E I $D(AIP) D + . S DURATION=+$$GET^SDCCRSCU(.AIP,9,1) ;AIP-9 + . I DURATION=0 D ACK("CE",MID,"AIP",9,1,304,"NO APPOINTMENT DURATION RECIEVED IN AIP",1) S ABORT="1^NO APPOINTMENT DURATION RECIEVED IN AIP" Q + . S UNIT=$$GET^SDCCRSCU(.AIP,10,1) ;AIP-10 + E I $D(AIG) D + . S DURATION=+$$GET^SDCCRSCU(.AIG,11,1) ;AIG-11 + . I DURATION=0 D ACK("CE",MID,"AIG",11,1,304,"NO APPOINTMENT DURATION RECIEVED IN AIG",1) S ABORT="1^NO APPOINTMENT DURATION RECIEVED IN AIG" Q + . ;S UNIT=$$GET^SDCCRSCU(.AIG,12,1) ;AIG-12 + ; Translate to minutes + I $$INSTRING^SDCCRCOR(UNIT,"S,SEC") S DURATION=DURATION/60 + Q $G(DURATION) +COPYMSG(Y) ; Copy HL7 Message to array Y (by reference) + ; Based on HL*1.6*56 VISTA HL7 Site Manager & Developer Manual + ; Paragraph 9.7, page 9-4 + I $L($G(HLNEXT)) ;HL7 context + E Q + N I,J + F I=1:1 X HLNEXT Q:HLQUIT'>0 D + .S Y(I)=HLNODE,J=0 + .F S J=$O(HLNODE(J)) Q:'J D + ..S Y(I)=Y(I)_HLNODE(J) + Q + ; +CHKMSG(Y) ; Check Message for all required segments + N QUIT,REQSEG,SEGFND,I,SEGTYP,ICN,DFN,ERRMSG,MSGEVN + S QUIT=0 + F REQSEG="MSH","SCH","PID","PV1","RGS","AIS","AIG","AIL","AIP" D Q:QUIT + .S (SEGFND,I)=0 + .F S I=$O(Y(I)) Q:'I!(SEGFND) D + ..S SEGTYP=$E(Y(I),1,3) + ..I SEGTYP=REQSEG S SEGFND=1 + ..I SEGTYP="MSH" D + ... I $P(Y(I),FS,10)="" D + .... S QUIT=1 + .... D ACK("CE",MID,"MSH","",10,101,"MESSAGE CONTROL ID MISSING") + .... S ABORT="1^MESSAGE CONTROL ID MISSING" + .... Q:QUIT + ... I $P($P(Y(I),FS,9),CS,1)'="SIU" D + .... S QUIT=1 + .... S ERRMSG="Scheduling Message TYPE not received on CCRA scheduling interface. Message type received:"_$P($P(Y(I),FS,9),CS,1) + .... S ERRMSG=ERRMSG_" for MESSAGE CONTROL ID:"_$P(Y(I),FS,10) + .... D ACK("CE",MID,"MSH","",9,200,ERRMSG) + .... S ABORT="1^"_$G(ERRMSG) + .... Q:QUIT + ... ;determine scheduling action event from message event + ... S MSGEVN=$P($P(Y(I),FS,9),CS,2) I $$SETEVENT^SDCCRSEN($G(MSGEVN),.MSGARY)=0 D + .... S QUIT=1 + .... S ERRMSG="Scheduling Message EVENT could not be determined. Message event received:"_$P($P(Y(I),FS,9),CS,2) + .... S ERRMSG=ERRMSG_" for MESSAGE CONTROL ID:"_$P(Y(I),FS,10) + .... D ACK("CE",MID,"MSH","",9,201,ERRMSG) + .... S ABORT="1^"_$G(ERRMSG) + .... Q:QUIT + ... S HDRTIME=$P(Y(I),FS,7) + .I 'SEGFND D + ..S QUIT=1 + ..D ACK("CE",MID,REQSEG,"","",100,REQSEG_" SEGMENT MISSING OR OUT OF ORDER") + .. S ABORT="1^"_$G(REQSEG)_" SEGMENT MISSING OR OUT OF ORDER" + Q QUIT +ACK(STAT,MID,SID,SEG,FLD,CD,TXT,ACKTYP) ; Creates ACKs for HL7 Message + ;STAT = Status (Acknowledgment Code) (REQUIRED) + ;MID = Message ID (REQUIRED) + ;SID = Segment ID (set if ERR occurred in segment) (OPTIONAL) + ;SEG = Segment location of error (OPTIONAL) + ;FLD = Field location of error (OPTIONAL) + ;CD = Error Code (OPTIONAL) + ;TXT = Text describing error (OPTIONAL) + ;ACKTYP = Acknowledgment Type (OPTIONAL) + ; + N HLA,EID,EIDS,RES,ERRI + ; + ;Make sure the parameters are defined + S STAT=$G(STAT),MID=$G(MID),SID=$G(SID),SEG=$G(SEG) + S FLD=$G(FLD),CD=$G(CD),TXT=$G(TXT) + ; + ;Create MSA Segment + S HLA("HLA",1)="MSA"_FS_STAT_FS_MID + S EID=$G(HL("EID")) + S EIDS=$G(HL("EIDS")) + Q:((EID="")!($G(HLMTIENS)="")!(EIDS="")) + ; + S RES="" + ;If Segment ID (SID) is set, create ERR segment + D:$L(SID)>0 + . K ERRARY + . S HLA("HLA",2)="ERR" + . S $P(HLA("HLA",2),FS,3)=SID_CS_SEG_CS_FLD + . S $P(HLA("HLA",2),FS,5)="E" + . ; + . ; Commit Error + . I '+$G(ACKTYP) D + .. S $P(HLA("HLA",2),FS,4)=CD_CS_TXT_CS_"0357" + . ; + . ; Application Error + . I +$G(ACKTYP)=1 D + .. S ERRI=0 + .. S $P(HLA("HLA",2),FS,6)=CS_CS_CS_CD_CS_TXT + .. ;Process Error + .. S ERRI=ERRI+1 + .. S ERRARY(ERRI,2)=$P($G(HLA("HLA",2)),"|",3) + .. I $P($G(HLA("HLA",2)),"|",6)'="" D ; + ... S ERRARY(ERRI,3)=$P($P($G(HLA("HLA",2)),"|",6),"^",4)_"^"_$P($P($G(HLA("HLA",2)),"|",6),"^",5) + .. I $P($G(HLA("HLA",2)),"|",6)="" S ERRARY(ERRI,3)=$P($G(HLA("HLA",2)),"|",4) + . ;I $D(ERRARY) D MESSAGE(MID,.ERRARY) + . ; build message for MailMan + D GENACK^HLMA1(EID,$G(HLMTIENS),EIDS,"LM",1,.RES) + Q + ; +APPMSG(MSGID,ABORT) ; Send a MailMan Message with the errors + N MSGTEXT,DUZ,XMDUZ,XMSUB,XMTEXT,XMY,XMMG,XMSTRIP,XMROU,DIFROM,XMYBLOB,XMZ,XMMG,DATE,J + S DATE=$$FMTE^XLFDT($$FMDATE^HLFNC($P(HL("DTM"),"-",1))) + S XMSUB="Consult: "_$G(CONSULTID)_" - GMRC CCRA Scheduling Issue from HSRM" + S MSGTEXT(1)=" " + S MSGTEXT(2)="An error in making a community care appointment for consult ID: "_$G(CONSULTID) + S MSGTEXT(3)="The consult title is: "_$G(CONTITLE) + S MSGTEXT(4)="A non-count clinic named "_$G(SRVNAME)_" could not be found." + S MSGTEXT(5)="The appointment was for "_$G(PROVIDER)_" on "_$$FMTE^XLFDT(SDECSTART,3) + S XMTEXT="MSGTEXT(" + S XMDUZ="GMRC-CCRA <-HSRM Transaction Error" + S XMDUZ=.5 + S XMY("G.GMRC HSRM SIU HL7 MESSAGES")="" ; ** CHECK THIS OUT ** + D ^XMD + Q +MESSAGE(MSGID,ABORT) ; Send a MailMan Message with the errors + N MSGTEXT,DUZ,XMDUZ,XMSUB,XMTEXT,XMY,XMMG,XMSTRIP,XMROU,DIFROM,XMYBLOB,XMZ,XMMG,DATE,J + S DATE=$$FMTE^XLFDT($$FMDATE^HLFNC($P(HL("DTM"),"-",1))) + S XMSUB="Consult: "_$G(CONID)_" GMRC CCRA Scheduling Issue from HSRM" + S MSGTEXT(1)=" " + S MSGTEXT(2)="Error in receiving HL7 message from HSRM" + S MSGTEXT(3)="Date: "_DATE + S MSGTEXT(4)="Message ID: "_MSGID + S MSGTEXT(5)="Error(s): "_$P(ABORT,"^",2) + S XMTEXT="MSGTEXT(" + S XMDUZ="GMRC-CCRA <-HSRM Transaction Error" + S XMDUZ=.5 + S XMY("G.GMRC HSRM SIU HL7 MESSAGES")="" + D ^XMD + Q +ANAK(NAKMSG,USERMAIL,ICN,DFN,APTTM,CONID) ; Application Error + N PATNAME,EID,EIDS,MSGN,SITE,CONPAT + Q:$G(NAKMSG)="" + Q:$G(APTTM)="" + Q:$G(CONID)="" + S CONPAT=$$GET1^DIQ(123,CONID_",",.02,"I"),PATNAME=$$GET1^DIQ(123,CONID_",",.02,"E") + S SITE=$$KSP^XUPARAM("INST") + S:$G(ICN)="" ICN=$P(^DPT(CONPAT,"MPI"),"^",10) + S EID=$G(HL("EID")) + S EIDS=$G(HL("EIDS")) + S MSGN=$G(HL("MID")) + S HLA("HLA",1)="MSA|AE|"_$G(MSGN)_"|"_$G(USERMAIL)_" "_$G(NAKMSG)_"|||"_$G(ICN)_"^"_$G(PATNAME)_"^"_SITE_"^"_CONID_"^"_APTTM + D GENACK^HLMA1(EID,$G(HLMTIENS),EIDS,"LM",1,.RES) + Q diff --git a/Packages/Scheduling/Routines/SDCCRGAP.m b/Packages/Scheduling/Routines/SDCCRGAP.m new file mode 100644 index 00000000000..1f609c23c88 --- /dev/null +++ b/Packages/Scheduling/Routines/SDCCRGAP.m @@ -0,0 +1,175 @@ +SDCCRGAP ;CCRA/LB,PB - Appointment retrieval API;APR 4, 2019 + ;;5.3;Scheduling;**707**;APR 4, 2019;Build 57 + ;;Per VA directive 6402, this routine should not be modified. + Q +GETAPPT(PATIEN,APPTDT,APPTARY) ;Gets the appointment details form the database and returns it in an array. + ; See parameter descriptions for details of the available nodes. + ; PATIEN(I,REQ) - The patient IEN + ; APPTDT(I,REQ) - the appointment date/time in vista format. + ; Found in the ^DPT(,"S", node. + ; APPTARY(O,REQ) - Array of appointment data. + ; + ; APPTARY("PATIENT IEN") - IEN + ; APPTARY("APPTDT") = date/time of the appointment in VistA format + ; APPTARY("APPTTYPE") - appointment type + ; APPTARY("CANCEL REASON") - Cancellation reason (discrete) + ; APPTARY("CANCEL REMARK") - Cancellation remark (freetext) + ; APPTARY("CHECKIN DT") - date/time of the check in action + ; APPTARY("CHECKIN USER") - check in user + ; APPTARY("CHECKOUT DT") - date/time of the check out action + ; APPTARY("CHECKOUT USER") - check out user + ; APPTARY("CLINIC") = the clinic of this appointment + ; APPTARY("CLINIC NAME") = Clinic name + ; APPTARY("CLINIC PROVIDER",0) - number of providers on the clinic + ; APPTARY("CLINIC PROVIDER",n,"IEN") - Provider IEN + ; APPTARY("CLINIC PROVIDER",n,"NAME") - Name of provider + ; APPTARY("CLINIC PURGED") - Flag to say the clinic has reached its + ; purge days so the data is no longer available. + ; APPTARY("CLINIC GROUP") - This is heavily covering our specialties. + ; APPTARY("COMMENT") - Appointment comment. + ; APPTARY("CONSULT") - linked consult ID + ; APPTARY("COV") - The COV. Looking into what this is. + ; APPTARY("DURATION") - appointment duration + ; APPTARY("ENCOUNTER IEN") - Encounter ID + ; APPTARY("ELIGIBILITY") - Appointment eligibility if different than primary + ; APPTARY("Next Available") - If the appt was scheduled as next available + ; APPTARY("PAT INDICATED DATE") - Date the start of search was performed on. + ; APPTARY("STATUS") - APPT status calculated to current state + ; (SCHEDULED/CHECKED IN/CHECKED OUT/CANCELLED/NO-SHOW) + ; APPTARY("USER") - Scheduling user + ; + N DELIM,CLNODE0,SNODE0,CLINIC,PROVARY,CLNODEC,CLNODECN + K APPTARY ;Force output only parameter + ; + I $G(PATIEN)="" Q + I $G(APPTDT)="" Q + ; + S DELIM="^" + S SNODE0=$$APPTNODE(PATIEN,APPTDT,0) + I $G(SNODE0)="" Q ;no appointment found + ; + ; Get clinic + S CLINIC=$P(SNODE0,DELIM,1) + S CLNODE0=$$CLINNODE(PATIEN,APPTDT,CLINIC,0) + S CLNODEC=$$CLINNODE(PATIEN,APPTDT,CLINIC,"C") + S CLNODECN=$$CLINNODE(PATIEN,APPTDT,CLINIC,"CONS") + ; + ; Get providers off of clinic + I $G(CLINIC)'="" D CLINPROV(CLINIC,.PROVARY) + ; + ; Build Array of patient information from the known nodes + S APPTARY("PATIENT IEN")=PATIEN ;IEN + S APPTARY("APPTDT")=APPTDT ;date/time of the appointment in VistA format + S APPTARY("APPTTYPE")=$P(SNODE0,DELIM,16) ;appointment type + S APPTARY("CLINIC")=$G(CLINIC) ;the clinic of this appointment ; + I $G(CLNODE0)="" S APPTARY("CLINIC PURGED")=1 + I $D(PROVARY) M APPTARY("CLINIC PROVIDER")=PROVARY + S APPTARY("CLINIC NAME")=$$GET1^DIQ(44,$G(CLINIC),.01) + S APPTARY("CLINIC GROUP")=$$CLINGRP($G(CLINIC)) + S APPTARY("CLINIC GROUP NAME")=$$GET1^DIQ(409.67,$G(APPTARY("CLINIC GROUP")),.01) + S APPTARY("CHECKIN DT")=$P($G(CLNODEC),DELIM,1) + S APPTARY("CHECKIN USER")=$P($G(CLNODEC),DELIM,2) + S APPTARY("CHECKOUT DT")=$P($G(CLNODEC),DELIM,3) + S APPTARY("CHECKOUT USER")=$P($G(CLNODEC),DELIM,4) + S APPTARY("COMMENT")=$P(CLNODE0,DELIM,4) + S APPTARY("CONSULT")=$$CLINNODE(PATIEN,APPTDT,CLINIC,"CONS") ;consult ID + S APPTARY("COV")=$P(SNODE0,DELIM,7) ;The COV if c&P/Scheduled/or walked in + S APPTARY("DURATION")=$P(CLNODE0,DELIM,2) + s APPTARY("ELIGIBILITY")=$P(CLNODE0,DELIM,10) + S APPTARY("PAT INDICATED DATE")=$$APTNODEP(PATIEN,APPTDT,1,1) + ; APPT status - Computed and translated + S APPTARY("STATUS")=$$APTSTAT(PATIEN,APPTDT,0) + S APPTARY("STATUS PIECE")=$P(SNODE0,DELIM,2) ;Status from the status node + S APPTARY("USER")=$P(SNODE0,DELIM,18) ;Scheduling user + S APPTARY("CANCEL REASON")=$P(SNODE0,DELIM,15) + S APPTARY("CANCEL REMARK")=$$APTNODEP(PATIEN,APPTDT,"R",1) + S APPTARY("ENCOUNTER IEN")=$P(SNODE0,DELIM,20) + Q +APPTNODE(PATIEN,APPTDT,NODE) ;For a given patient we will return their appointment node in the ^DPT file. + ; PATIEN(I,REQ) - The patient IEN + ; APPTDT(I,REQ) - the appointment date/time in vista format. Found in the ^DPT(,"S", node. + ; NODE(I,REQ) - node number to pull + ; + I ($G(APPTDT)="")!($G(PATIEN)="")!($G(NODE)="") Q + Q $G(^DPT(PATIEN,"S",APPTDT,NODE)) +APTNODEP(PATIEN,APPTDT,NODE,PIECE) ;For a given patient we will return a piece of their appointment node in the ^DPT file. + ; PATIEN(I,REQ) - The patient IEN + ; APPTDT(I,REQ) - the appointment date/time in vista format. Found in the ^DPT(,"S", node. + ; NODE(I,REQ) - node number to pull + ; PIECE(I,REQ) - piece in the node to return + ; DATA(I,OPT) - data node may be passed in to bypass extracting. + N DATA + S DATA=$$APPTNODE($G(PATIEN),$G(APPTDT),$G(NODE)) + Q $P($G(DATA),"^",$G(PIECE)) +CLINNODE(PATIEN,APPTDT,CLINICIEN,NODE,COUNT) ;For a given patient we will find their clinic node in the ^SC file. + ; May need to loop through the overbooks on that time. + ; PATIEN(I,REQ) - The patient IEN + ; APPTDT(I,REQ) - the appointment date/time in vista format. Found in the ^DPT(,"S", node. + ; CLINICIEN(I,REQ) - clinic record IEN to search through + ; NODE(I,REQ) - last node for the clinic. 0 node has appointment info. "C" node has check in/out info. + ; COUNT(O,OPT) - subscript # of appointment + N RET + ; Loop through the possibly multiple appointments scheduled into this clinic slot + S COUNT=$$FIND^SDAM2($G(PATIEN),$G(APPTDT),$G(CLINICIEN)) + I $G(COUNT)'="" S RET=$G(^SC($G(CLINICIEN),"S",$G(APPTDT),1,COUNT,$G(NODE))) ;Get the node from the SC global + Q $G(RET) +CLINPROV(CLINIC,ARRAY) ;Sets an array filled with clinic provider data + ; CLINIC (I,REQ) - The Clinic IEN (first piece of DPT 0 node) + ; ARRAY (O,REQ) - APPTARY("CLINIC PROVIDER",0) - number of providers on the clinic + ; APPTARY("CLINIC PROVIDER",N,"IEN") - Provider IEN + ; APPTARY("CLINIC PROVIDER",N,"NAME") - Name of provider + N NUM + K ARRAY + I $G(CLINIC)="" Q + S NUM=0 + S ARRAY(0)=0 + F S NUM=$O(^SC(CLINIC,"PR",NUM)) Q:'NUM D + . S ARRAY(NUM,"IEN")=$$PROVIEN(CLINIC,NUM) ;-Provider IEN File 200 + . I ARRAY(NUM,"IEN")="" Q + . S ARRAY(NUM,"NAME")=$$GET1^DIQ(200,(ARRAY(NUM,"IEN")),.01) ;- Name of provider File 200 + . S ARRAY(0)=ARRAY(0)+1 + Q +PROVIEN(CLINIC,NODE) ;Returns the Nth provider ID for a Clinic + ; CLINIC (I,REQ) - The Clinic IEN (first piece of DPT 0 node) + ; NODE (I,REQ) - The count of the node being examined + Q $P(^SC($G(CLINIC),"PR",$G(NODE),0),"^",1) +CLINGRP(CLINIC) ;Returns the ID of a Clinic's group + ; CLINIC (I,REQ) - The Clinic IEN (first piece of DPT 0 node) + Q $P(^SC($G(CLINIC),0),"^",31) + ;--------- + ; DESCRIPTION: + ; PARAMETERS: + ; + ; + ;--------- +APTSTAT(PATIEN,APPTDT,FULLSTAT) ;Returns current computed appointment status which + ; includes checked in/out which the "S"0;2 node does not. + ; PATIEN (I,REQ)- Patient ID as in DPT(PATIEN,"S",APPTDAT + ; APPTDT (I,REQ) - Appointment date + ; FULLSTAT (I,OPT,DEFAULT:"") - Set to 1 return full STATUS string + ; OUTPUT: Appointment current Status values: + ; SCHEDULED (Default) + ; CHECKED IN + ; CHECKED OUT + ; CANCELLED + ; NO-SHOW + ; "" if the appointment does not exist.\ + ; + N RET,DPT0,CLINICID + I $G(PATIEN)="" Q "" + I $G(APPTDT)="" Q "" + ; + ; + S DPT0=$$APPTNODE(PATIEN,APPTDT,0) + I $G(DPT0)="" Q "" + ; + ;CLINIC ID IS FIRST PART OF DPT "S" 0 NODE + S CLINICID=+$G(DPT0) + I $G(CLINICID)="" Q "" + ; + S RET=$$STATUS^SDAM1(PATIEN,APPTDT,CLINICID,DPT0) + I '$G(FULLSTAT) D + . S RET=$P(RET,";",3) ;PRINT STATUS- NOTE THAT THESE HAVE THE POSSIBILITY OF RETURNING MULTIPLE STATUSES + . S RET=$S(RET["CANCELLED":"CANCELLED",RET["NO-SHOW":"NO SHOW",RET["CHECKED OUT":"CHECKED OUT",RET["CHECKED IN":"CHECKED IN",1:"SCHEDULED") + Q RET + ; diff --git a/Packages/Scheduling/Routines/SDCCRSCU.m b/Packages/Scheduling/Routines/SDCCRSCU.m new file mode 100644 index 00000000000..be8452e1a6d --- /dev/null +++ b/Packages/Scheduling/Routines/SDCCRSCU.m @@ -0,0 +1,280 @@ +SDCCRSCU ;CCRA/LB,PB - Appointment Message Parsing Utilities;APR 4, 2019 + ;;5.3;Scheduling;**707**;APR 4, 2019;Build 57 + ;;Per VA directive 6402, this routine should not be modified. + Q +PARSE(FIELD,REP,COMP,SUBCOMP,ESCAPE,SEG,TO) ; + ;Parses the segment stored in SEG(1),SEG(2),... into TO() + ;Input: + ; FIELD - field separator + ; REP - field repetition separator + ; COMP - component separator + ; SUBCOMP - subcomponent separator + ; ESCAPE - escape character + ; SEG - (pass by reference) the array holding the unparsed segment. + ;Output: + ; Function returns 1 on success, 0 on failure + ; TO - (pass by reference) - the parsed values + ; SEG- This input variable is deleted during the processing. If it is needs to be retained, pass in a copy! + ; + N VALUE,CHAR,COUNTS + K TO + Q:$L($G(FIELD))'=1 0 + Q:$L($G(REP))'=1 0 + Q:$L($G(COMP))'=1 0 + Q:'$D(SUBCOMP) 0 + Q:'$D(SEG) 0 + S COUNTS("FIELD")=0 + S COUNTS("REP")=1 + S COUNTS("COMP")=1 + S COUNTS("SUBCOMP")=1 + S VALUE="" + S SEG("LINE")=$O(SEG(0)),SEG("CHAR")=0 + F S CHAR=$$NEXTCHAR(.SEG) D Q:'$L(CHAR) + .I '$L(CHAR) D Q + ..I $L(VALUE) S TO(COUNTS("FIELD"),COUNTS("REP"),COUNTS("COMP"),COUNTS("SUBCOMP"))=VALUE + .E I CHAR=FIELD D Q + ..I $L(VALUE) S TO(COUNTS("FIELD"),COUNTS("REP"),COUNTS("COMP"),COUNTS("SUBCOMP"))=$$DESCAPE(VALUE,.FIELD,.COMP,.SUBCOMP,.REP,.ESCAPE),VALUE="" + ..S COUNTS("FIELD")=COUNTS("FIELD")+1,COUNTS("REP")=1,COUNTS("COMP")=1,COUNTS("SUBCOMP")=1 + .E I CHAR=REP D Q + ..I $L(VALUE) S TO(COUNTS("FIELD"),COUNTS("REP"),COUNTS("COMP"),COUNTS("SUBCOMP"))=$$DESCAPE(VALUE,.FIELD,.COMP,.SUBCOMP,.REP,.ESCAPE),VALUE="" + ..S COUNTS("REP")=COUNTS("REP")+1,COUNTS("COMP")=1,COUNTS("SUBCOMP")=1 + .E I CHAR=COMP D Q + ..I $L(VALUE) S TO(COUNTS("FIELD"),COUNTS("REP"),COUNTS("COMP"),COUNTS("SUBCOMP"))=$$DESCAPE(VALUE,.FIELD,.COMP,.SUBCOMP,.REP,.ESCAPE),VALUE="" + ..S COUNTS("COMP")=COUNTS("COMP")+1,COUNTS("SUBCOMP")=1 + .E I CHAR=SUBCOMP D Q + ..I $L(VALUE) S TO(COUNTS("FIELD"),COUNTS("REP"),COUNTS("COMP"),COUNTS("SUBCOMP"))=$$DESCAPE(VALUE,.FIELD,.COMP,.SUBCOMP,.REP,.ESCAPE),VALUE="" + ..S COUNTS("SUBCOMP")=COUNTS("SUBCOMP")+1 + .E S VALUE=VALUE_CHAR + S TO("SEGMENT TYPE")=$G(TO(0,1,1,1)),TO(0)=TO("SEGMENT TYPE") + I (TO("SEGMENT TYPE")="BHS")!(TO("SEGMENT TYPE")="MSH") S TO("FIELD SEPARATOR")=FIELD + Q 1 + ; +NEXTCHAR(SEG) ; + ;returns the next character in the segment array + ; + Q:'SEG("LINE") "" + N RET + S SEG("CHAR")=SEG("CHAR")+1 + S RET=$E(SEG(SEG("LINE")),SEG("CHAR")) + Q:RET]"" RET + S SEG("LINE")=$O(SEG(SEG("LINE"))) + I SEG("LINE") S SEG("CHAR")=1 Q $E(SEG(SEG("LINE"))) + Q "" + ; +DESCAPE(VALUE,FIELD,COMP,SUBCOMP,REP,ESCAPE) ; + ;Replaces the escape sequences with the corresponding encoding character and returns the result as the function value + ; + Q:ESCAPE="" VALUE + N NEWSTRNG,SUBSTRNG,SET,LEN,I,SUBLEN,CHAR + S (NEWSTRNG,SUBSTRNG,SUBLEN)="" + S SET="FSTRE" + S LEN=$L(VALUE) + F I=1:1:LEN S SUBSTRNG=SUBSTRNG_$E(VALUE,I),SUBLEN=SUBLEN+1 D:SUBLEN=3 + .S CHAR=$E(SUBSTRNG,2) + .I $E(SUBSTRNG,1)=ESCAPE,$E(SUBSTRNG,3)=ESCAPE,SET[CHAR D + ..I CHAR="F" S NEWSTRNG=NEWSTRNG_FIELD,SUBSTRNG="",SUBLEN=0 Q + ..I CHAR="S" S NEWSTRNG=NEWSTRNG_COMP,SUBSTRNG="",SUBLEN=0 Q + ..I CHAR="T" S NEWSTRNG=NEWSTRNG_SUBCOMP,SUBSTRNG="",SUBLEN=0 Q + ..I CHAR="R" S NEWSTRNG=NEWSTRNG_REP,SUBSTRNG="",SUBLEN=0 Q + ..I CHAR="E" S NEWSTRNG=NEWSTRNG_ESCAPE,SUBSTRNG="",SUBLEN=0 Q + .E S NEWSTRNG=NEWSTRNG_$E(SUBSTRNG),SUBSTRNG=$E(SUBSTRNG,2,3),SUBLEN=2 + Q NEWSTRNG_SUBSTRNG + ; +GETCODE(SEG,VALUE,FIELD,COMP,REP) ; + ;Implements GETCNE and GETCWE + ; + N SUB,VAR + Q:'$G(FIELD) + I '$G(COMP) D + .S VAR="COMP",SUB=1 + E D + .S VAR="SUB" + S:'$G(REP) REP=1 + S @VAR=1,VALUE("ID")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=2,VALUE("TEXT")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=3,VALUE("SYSTEM")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=4,VALUE("ALTERNATE ID")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=5,VALUE("ALTERNATE TEXT")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=6,VALUE("ALTERNATE SYSTEM")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=7,VALUE("SYSTEM VERSION")=$$GET(.SEG,FIELD,COMP,SUB,REP) + S @VAR=8,VALUE("ALTERNATE SYSTEM VERSION")=$$GET(.SEG,FIELD,COMP) + S @VAR=9,VALUE("ORIGINAL TEXT")=$$GET(.SEG,FIELD,COMP,SUB,REP) + Q + ; +GET(SEG,FIELD,COMP,SUBCOMP,REP) ; + ;This function gets a specified value from a segment that was parsed by + ;$$NEXTSEG. The FIELD,COMP,SUBCOMP,REP parameters are optional - if not + ;specified, they default to 1. + ; Example: + ; $$GET(.SEG,1) will return the value of the first field, first + ; component, first subcomponent, in the first occurrence of field #1. + ;Input: + ;SEG - (required, pass by reference) - this is the array where the parsed segment was placed by $$NEXTSEG + ;FIELD - the sequence # of the field (optional, defaults to 1) + ;COMP - the # of the component (optional, defaults to 1) + ;SUBCOMP - the # of the subcomponent (optional, defaults to 1) + ;REP - the occurrence# (optional, defaults to 1) For a non-repeating field, the occurrence # need not be provided, because it would be 1. + ;Output: + ; Function returns the requested value on success, "" if not valued. + ; + ;allow the segment type to be obtained via field #0 (shorthand) + I $D(FIELD),$G(FIELD)=0 Q $G(SEG("SEGMENT TYPE")) + S:'$G(FIELD) FIELD=1 + ; + ;for MSH or BHS, SEQ#1 is the field separator + I FIELD=1,$G(SEG("SEGMENT TYPE"))="MSH"!($G(SEG("SEGMENT TYPE"))="BHS"),$G(REP)<2,$G(COMP)<2,$G(SUBCOMP)<2 Q SEG("FIELD SEPARATOR") + I FIELD=1,$G(SEG("SEGMENT TYPE"))="MSH"!($G(SEG("SEGMENT TYPE"))="BHS") Q "" + ; + S:'$G(COMP) COMP=1 + S:'$G(SUBCOMP) SUBCOMP=1 + S:'$G(REP) REP=1 + Q $G(SEG(FIELD,REP,COMP,SUBCOMP)) + ; +PARSEHDR(HDR) ; + ;Parses the segment (HDR, pass by reference) into the HDR() array using meaningful subscripts. + ;Input: + ; HDR (pass by reference, required) contains the segment in the format HDR(1),HDR(2), etc.. + ;Output: + ; HDR (pass by reference, required) This array will contain all the individual values. Also will contain HDR(1) with components 1-6 and HDR(2) with components 1-end + ; Function - returns 1 if the segment is indeed an MSH or BHS segment, 0 otherwise + ; +ZB25 ; + N VALUE,FS,CS,REP,SUBCOMP,ESCAPE + S VALUE=$E(HDR(1),1,3) + I VALUE'="MSH",VALUE'="BHS" Q 0 + S HDR("SEGMENT TYPE")=VALUE + S FS=$E(HDR(1),4) + Q:FS="" 0 + S HDR("ENCODING CHARACTERS")=$P(HDR(1),FS,2) + S CS=$E(HDR("ENCODING CHARACTERS"),1) + S REP=$E(HDR("ENCODING CHARACTERS"),2) + S ESCAPE=$E(HDR("ENCODING CHARACTERS"),3) + S SUBCOMP=$E(HDR("ENCODING CHARACTERS"),4) + Q:REP="" 0 + S HDR("FIELD SEPARATOR")=FS + S HDR("COMPONENT SEPARATOR")=CS + S HDR("REPETITION SEPARATOR")=REP + S HDR("ESCAPE CHARACTER")=ESCAPE + S HDR("SUBCOMPONENT SEPARATOR")=SUBCOMP + S HDR("SENDING APPLICATION")=$$DESCAPE($P($P(HDR(1),FS,3),CS)) + S VALUE=$P(HDR(1),FS,4) + S HDR("SENDING FACILITY",1)=$$DESCAPE($P(VALUE,CS)) + S HDR("SENDING FACILITY",2)=$$DESCAPE($P(VALUE,CS,2)) + S HDR("SENDING FACILITY",3)=$$DESCAPE($P(VALUE,CS,3)) + S HDR("RECEIVING APPLICATION")=$$DESCAPE($P($P(HDR(1),FS,5),CS)) + S VALUE=$P(HDR(1),FS,6) + S HDR("RECEIVING FACILITY",1)=$$DESCAPE($P(VALUE,CS)) + S HDR("RECEIVING FACILITY",2)=$$DESCAPE($P(VALUE,CS,2)) + S HDR("RECEIVING FACILITY",3)=$$DESCAPE($P(VALUE,CS,3)) + S HDR("DT/TM OF MESSAGE")=$$FMDATE^HLFNC($$DESCAPE($P($P(HDR(2),FS,2),CS))) + S HDR("SECURITY")=$$DESCAPE($P($P(HDR(2),FS,3),CS)) + ; + I HDR("SEGMENT TYPE")="MSH" D + .S VALUE=$P(HDR(2),FS,4) + .S HDR("MESSAGE TYPE")=$P(VALUE,CS) + .S HDR("EVENT")=$P(VALUE,CS,2) + .S HDR("MESSAGE STRUCTURE")=$$DESCAPE($P(VALUE,CS,3)) + .S HDR("MESSAGE CONTROL ID")=$$DESCAPE($P($P(HDR(2),FS,5),CS)) + .S VALUE=$P(HDR(2),FS,6) + .S HDR("PROCESSING ID")=$P(VALUE,CS) + .S HDR("PROCESSING MODE")=$$DESCAPE($P(VALUE,CS,2)) + .S HDR("VERSION")=$$DESCAPE($P($P(HDR(2),FS,7),CS)) + .S HDR("CONTINUATION POINTER")=$$DESCAPE($P($P(HDR(2),FS,9),CS)) + .S HDR("ACCEPT ACK TYPE")=$P($P(HDR(2),FS,10),CS) + .S HDR("APP ACK TYPE")=$P($P(HDR(2),FS,11),CS) + .S HDR("COUNTRY")=$$DESCAPE($P($P(HDR(2),FS,12),CS)) + ; + I HDR("SEGMENT TYPE")="BHS" D + .S VALUE=$P(HDR(2),FS,4) + .S HDR("BATCH NAME/ID/TYPE")=$$DESCAPE(VALUE) + .S HDR("PROCESSING ID")=$E($P(VALUE,"PROCESSING ID=",2),1) + .S HDR("ACCEPT ACK TYPE")=$E($P(VALUE,"ACCEPT ACK TYPE=",2),1,2) + .S HDR("APP ACK TYPE")=$E($P(VALUE,"APP ACK TYPE=",2),1,2) + .S HDR("BATCH COMMENT")=$$DESCAPE($P(HDR(2),FS,5)) + .S HDR("BATCH CONTROL ID")=$$DESCAPE($P($P(HDR(2),FS,6),CS)) + .S HDR("REFERENCE BATCH CONTROL ID")=$$DESCAPE($P($P(HDR(2),FS,7),CS)) + .; +ZB26 ; + Q 1 + ; +PARSESEG(SEG,DATA,HL) ;Generic segment parser + ;This procedure parses a single HL7 segment and builds an array + ;subscripted by the field number containing the data for that field. + ; Does not handle segments that span nodes + ; + ; Input: + ; SEG - HL7 segment to parse + ; HL - HL7 environment array + ; + ; Output: + ; Function value - field data array [SUB1:field, SUB2:repetition, + ; SUB3:component, SUB4:sub-component] + ; + N CMP ;component subscript + N CMPVAL ;component value + N FLD ;field subscript + N FLDVAL ;field value + N REP ;repetition subscript + N REPVAL ;repetition value + N SUB ;sub-component subscript + N SUBVAL ;sub-component value + N FS ;field separator + N CS ;component separator + N RS ;repetition separator + N SS ;sub-component separator + N ES ;escape character + ; + K DATA + S FS=$G(HL("FS"),"|") S:FS="" FS="|" + S CS=$E($G(HL("ECH")),1) S:CS="" CS="^" + S RS=$E($G(HL("ECH")),2) S:RS="" RS="~" + S ES=$E($G(HL("ECH")),3) S:ES="" ES="\" + S SS=$E($G(HL("ECH")),4) S:SS="" SS="&" + ; + S DATA(0)=$P(SEG,FS) + S SEG=$P(SEG,FS,2,9999) + ; + F FLD=1:1:$L(SEG,FS) D + . S FLDVAL=$P(SEG,FS,FLD) + . F REP=1:1:$L(FLDVAL,RS) D + . . S REPVAL=$P(FLDVAL,RS,REP) + . . I REPVAL[CS F CMP=1:1:$L(REPVAL,CS) D + . . . S CMPVAL=$P(REPVAL,CS,CMP) + . . . I CMPVAL[SS F SUB=1:1:$L(CMPVAL,SS) D + . . . . S SUBVAL=$P(CMPVAL,SS,SUB) + . . . . I SUBVAL'="" S DATA(FLD,REP,CMP,SUB)=SUBVAL + . . . I '$D(DATA(FLD,REP,CMP)),CMPVAL'="" S DATA(FLD,REP,CMP)=CMPVAL + . . I '$D(DATA(FLD,REP)),REPVAL'="",FLDVAL[RS S DATA(FLD,REP)=REPVAL + . I '$D(DATA(FLD)),FLDVAL'="" S DATA(FLD)=FLDVAL + Q +INP ; set up the INP array for calling ARSET^SDECAR2 to update the RTC orders + ; Need to add code to add the rtcparent to the HL7 message and to parse it out. + ;D APPERROR^%ZTER("SDHL7APU 196") + N NODE3,INTV,NUMAPTS,ORDATE,CONSID1,ORDNUM + S CONSID1=$P(SDAPTYP,"|",2) S:$G(CONSID1)>0 SDDDT=$P(^GMR(123,CONSID1,0),"^",24),ORDNUM=$P(^GMR(123,CONSID1,0),"^",3) + K INP + S INP(1)="" ; This is a new request so this is always null for a new request + S INP(2)=$G(SDDFN) + D NOW^%DTC N NOW S NOW=$$HTFM^XLFDT($H),INP(3)=$$FMTE^XLFDT(NOW) + ;S INP(3)=$G(ORDATE) + ;NEEDS THE TEXT INSTITUTION NAME + S INP(4)=$$NAME^XUAF4(+$G(DUZ(2))) ;Required, DUZ(2) is the signed on users division they are signed into, +DUZ(2) is the parent station number + S INP(5)="APPT" + S INP(6)=$G(SDCL) + S INP(8)="FUTURE" + S INP(9)="PROVIDER" + S INP(11)=$G(SDDDT) ; Clinically Indicate Date for first appointment in the sequence, each of the remaining appointments have to be calculated + S INP(12)=$G(SDECNOTE) + S PCE="" S PCE=$P($G(^DPT(SDDFN,"ENR")),U,1) I PCE'="" D + .S INP(13)=$$GET1^DIQ(27.11,PCE,.07,"E") + ;S INP(13)="" ;Enrollment priority will be null for TMP + S INP(14)="" + S INP(17)="" ;null for TMP + S SCPERC=0 + S SCPERC=$P(^DPT($G(INP(2)),.3),"^",2) + S INP(19)=SCPERC + S INP(22)="9" + S INP(23)="NEW" + S INP(28)=$G(ORDNUM) + K SCPERC,PCE + Q diff --git a/Packages/Scheduling/Routines/SDCCRSEN.m b/Packages/Scheduling/Routines/SDCCRSEN.m new file mode 100644 index 00000000000..fc4213b9795 --- /dev/null +++ b/Packages/Scheduling/Routines/SDCCRSEN.m @@ -0,0 +1,371 @@ +SDCCRSEN ;CCRA/LB,PB - Appointment retrieval API;APR 4, 2019 + ;;5.3;Scheduling;**707**;APR 4, 2019;Build 57 + ;;Per VA directive 6402, this routine should not be modified. + Q + ; Documented API's and Integration Agreements + ; ---------------------------------------------- + ; 2165 GENACK^HLMA1 + ; 2701 $$GETDFN^MPIF001 + ; 2701 $$GETICN^MPIF001 + ; 3535 MAKEADD^TIUSRVP2 + ; 10103 $$HL7TFM^XLFDT +EN() ;Primary entry routine for HL7 based CCRA scheduling processing. + ; Will take all scheduling messages through this one point. + N FS,CS,RS,ES,SS,MID,HLQUIT,HLNODE,USER,USERMAIL,NAKMSG,ICN + N MSG,HDR,SEG,SEGTYPE,MSGARY,LASTSEG,HDRTIME,ABORT,BASEDT,CLINARY,COUNT,PROVDTL,RESULTS + S RESULTS=0 + S DUZ="" + S FS=$G(HL("FS"),"|") + S CS=$E($G(HL("ECH")),1) S:CS="" CS="^" + S RS=$E($G(HL("ECH")),2) S:RS="" RS="~" + S ES=$E($G(HL("ECH")),3) S:ES="" ES="\" + S SS=$E($G(HL("ECH")),4) S:SS="" SS="&" + S MID=$G(HL("MID")) + S (HLQUIT,HLNODE)=0 + ;initialize message from queue + D COPYMSG^SDCCRCOR(.MSG) + Q:$$CHKMSG^SDCCRCOR(.MSG) + Q:$$PROCMSG(.MSG) + D ACK^SDCCRCOR("CA",MID) + Q + ; +PROCMSG(MSG1) ; Process message + N QUIT,I,SEGTYPE,ERR1 + N GMRCDFN,GMRCTIU,GMRCTIUS,ADDTXT,GMRCATIU,STID,RAWSEG,APTTM,DFN,CONID,CONTITLE,PROVIDER + K SDECSTART,SDECEND,SDDFN,SDECRES,SDECLEN,SDECNOTE,SDECATID,SDECCR,SDMRTC,SDDDT,SDREQBY,SDLAB,PROVIEN,SDID,SDAPTYP,SDSVCP,SDSVCPR,SDCL,SDEKG,SDXRAY,APPTYPE,EESTAT,OVB,SDPARENT,SDEL + S (SDECSTART,SDECEND,SDDFN,SDECRES,SDECLEN,SDECNOTE,SDECATID,SDECCR,SDMRTC,SDDDT,SDREQBY,SDLAB,PROVIEN,SDID,SDAPTYP,SDSVCP,SDSVCPR,SDCL,SDEKG,SDXRAY,APPTYPE,EESTAT,OVB,SDPARENT,SDEL)="" + S ABORT=0,BASEDT="" + S (QUIT,XX)=0 + ;F S XX=$O(MSG1(XX)) Q:XX'>0!ABORT D + F S XX=$O(MSG1(XX)) Q:XX'>0 D + . Q:+$G(ABORT)>0 + . S SEGTYPE=$E(MSG1(XX),1,3),RAWSEG=$G(MSG1(XX)) + . I SEGTYPE'="NTE" S LASTSEG=SEGTYPE + . S SEG=$G(MSG1(XX)) + . I SEGTYPE="SCH" D SCH(SEG,.MSGARY,.ABORT,.BASEDT) ;SCH MUST BE PROCESSED FIRST SOME VALIDATION DEPENDS ON APPOINTMENT STATUS IN SCH-25 + . I SEGTYPE="NTE" D NTE(SEG,.MSGARY,LASTSEG,.CLINARY,.ABORT,.PROVDTL) + . I SEGTYPE="PID" D PID(SEG,.MSGARY,.ABORT) + . I SEGTYPE="PV1" D PV1(SEG,.MSGARY,HDRTIME,.ABORT) + . I SEGTYPE="RGS" D RGS(SEG,.MSGARY) + . I SEGTYPE="AIS" D AIS(SEG,.MSGARY) + . I SEGTYPE="AIG" D AIG(SEG,.MSGARY,.PROVDTL,BASEDT) + . I SEGTYPE="AIL" D AIL(SEG,.MSGARY) + . I SEGTYPE="AIP" D AIP(SEG,.MSGARY,.PROVDTL,BASEDT) + K XX + I $G(NAKMSG)'="" S DUZ=.5,QUIT=1 D ANAK^SDCCRCOR($G(NAKMSG),$G(USERMAIL),$G(ICN),$G(DFN),$G(APTTM),$G(CONID)) + I +$G(ABORT)=1 D MESSAGE^SDCCRCOR(MID,.ABORT) Q 1 + I +$G(ABORT)=2 D APPMSG^SDCCRCOR(MID,.ABORT) Q 1 + ;-------------------------------------- + ;Process Message by Event Type + ;-------------------------------------- + ;ADD NEW APPOINTMENT: "S12"="SCHEDULE" + I MSGARY("EVENT")="SCHEDULE" D + . S SDECLEN=$P(^SC(SDCL,"SL"),"^",1),SDECAPTID=0 + . S:$G(DFN)>0 SDDFN=DFN + . S:$G(SDECLEN)'>0 SDECLEN=15 + . S:$G(SDDFN)>0 SDECAPTID=$$APPTGET^SDECUTL(SDDFN,SDECSTART,SDCL,SDRES) + . I SDECAPTID>0 D ACK^SDCCRCOR("CE",MID,"","","","","Patient already has an appointment at that datetime.",1) + . S ABORT="1^Patient already has an appointment at that datetime." + . I $G(SDECAPTID)'>0 D INP^SDCCRSCU,ARSET^SDECAR2(.RET,.INP) + . Q:$G(SDECAPTID)>0 + . S SDECSTART=$P(SDECSTART,".",1)_"."_$E($P(SDECSTART,".",2),1,4) + . S SDECSTART=$$FMTE^XLFDT(SDECSTART,2) + . D APPADD^SDEC07(.SDECY,SDECSTART,SDECEND,SDDFN,SDECRES,SDECLEN,,,,,,,,,,SDAPTYP,,,SDCL,,,,,1,,"") ;ADD NEW APPOINTMENT + ; + ;CANCEL APPOINTMENT: "S15"="CANCEL" + I MSGARY("EVENT")="CANCEL" D + . S SDECLEN=$P(^SC(SDCL,"SL"),"^",1),SDECAPTID=0 + . S:$G(DFN)>0 SDDFN=DFN + . S:$G(SDECLEN)'>0 SDECLEN=15 + . ;check if appointment exists + . ;Retrieve SDECAPTID pointer to SDEC APPOINTMENT file + . S:$G(SDDFN)>0 SDECAPTID=$$APPTGET^SDECUTL(SDDFN,SDECSTART,SDCL,SDRES) + . I $G(SDECAPTID)="" D + . . D ACK^SDCCRCOR("CE",MID,"","","","","NO APPOINTMENT Found to CANCEL for requested PATIENT,DATE/TIME,and CLINIC",1) + . . S ABORT="1^NO APPOINTMENT Found to CANCEL for requested PATIENT,DATE/TIME,and CLINIC" + . . S QUIT=1 + . S SDECSTART=$P(SDECSTART,".",1)_"."_$E($P(SDECSTART,".",2),1,4) + . S SDECSTART=$$FMTE^XLFDT(SDECSTART,2) + . D:'QUIT APPDEL^SDEC08(.SDECY,SDECAPTID,$G(MSGARY("CANCEL CODE")),$G(MSGARY("CANCEL REASON")),$G(MSGARY("COMMENT")),$G(SDECDATE),$G(MSGARY("USER"))) ;CANCEL APPOINTMENT + ; + ;NOSHOW APPOINTMENT: "S26"="NOSHOW" + I MSGARY("EVENT")="NOSHOW" D + . S SDECLEN=$P(^SC(SDCL,"SL"),"^",1),SDECAPTID=0 + . S:$G(DFN)>0 SDDFN=DFN + . S:$G(SDECLEN)'>0 SDECLEN=15 + . ;check if appointment exists + . ;Retrieve SDECAPTID pointer to SDEC APPOINTMENT file + . S SDECSTART=$P(SDECSTART,".",1)_"."_$E($P(SDECSTART,".",2),1,4) + . S SDECSTART=$$FMTE^XLFDT(SDECSTART,2) + . S SDECAPTID=$$APPTGET^SDECUTL(SDDFN,SDECSTART,SDCL,SDRES) + . I $G(SDECAPTID)'>0 D + . . D ACK^SDCCRCOR("CE",MID,"","","","","NO APPOINTMENT Found to NOSHOW for requested PATIENT,DATE/TIME,and CLINIC",1) + . . S ABORT="1^NO APPOINTMENT Found to NOSHOW for requested PATIENT,DATE/TIME,and CLINIC" + . . S QUIT=1 + . I +$G(ABORT)=1 D MESSAGE^SDCCRCOR(MID,ABORT) Q + . D:'QUIT NOSHOW^SDEC31(.SDECY,SDECAPTID,1,$G(MSGARY("USER")),$G(SDECDATE)) + ; + D DONEINC^SDCCRCOR + ; + K MSG1,SDRES,SDECY,SDECDATE,SDECAPTID,RSNAME,SDAPTYP,SDCL,SDDFN,SDECNOT,SDECNOTE,INP,RET + Q QUIT + ; +SETEVENT(EVENT,MSGARY) ;Takes the scheduling event and sets a message event to process. + ; EVENT (I/REQ) - Message event from the MSH header. EX. S12, S14, S15, S26 + ; MSGARY (I/O,REQ) message array structure with reformatted and translated data ready for filing. See PARSEMSG for details. + ; + I $G(EVENT)="" Q 0 + I EVENT="S12" S MSGARY("EVENT")="SCHEDULE" Q 1 + I EVENT="S14" S MSGARY("EVENT")="UPDATE" Q 1 + I EVENT="S15" S MSGARY("EVENT")="CANCEL" Q 1 + I EVENT="S26" S MSGARY("EVENT")="NOSHOW" Q 1 + Q 0 + ; +SCH(SCH,MSGARY,ABORT,BASEDT) ;SCH segment processing.: + ; SEG (I/REQ) - SCH message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; ABORT (O,OPT) - Error parameter if we did not receive an appointment date and time. Fatal case to this message. + ; BASEDT (O,REQ) - appointment base date/time to use. May be incremented later if processing multiple joint clinic scheduling + N ORDIDTYP,SRVNAME,CONSULTID + D PARSESEG^SDCCRSCU(SCH,.SCH) + S MSGARY("PLACER ID")=$G(SCH(1)) ;SCH-1.1 + ; Cancel Reason + S CONID=$G(SCH(2)),PROVIDER=$G(SCH(12,1,2))_" "_$G(SCH(12,1,3)) + I MSGARY("EVENT")="CANCEL" S MSGARY("CANCEL REASON")=$$GETRSN($G(SCH(6,1,2))),MSGARY("CANCEL CODE")=$G(SCH(6,1,5)) ;SCH-6 + ; Duration + S (SDECLEN,MSGARY("DURATION"))=$G(SCH(9)) ;SCH-9,10 + ; Appointment Date + N Y + S (SDECSTART,BASEDT)=$$HL7TFM^XLFDT($G(SCH(11,1,4)),"L") ;SCH-11.3 + S APTTM=$G(SCH(11,1,4)) + N Y S SDECEND=$$HL7TFM^XLFDT($G(SCH(11,1,5)),"L") ;SCH-11.3 + I $G(BASEDT)="" S ERR1="NO APPOINTMENT DATE AND TIME" D ACK^SDCCRCOR("CE",MID,"SCH","",11,305,ERR1,1) S ABORT="1^"_ERR1 Q + ; User + S (MSGARY("USER"))=$$GETUSER($G(SCH(20,1,1))) ;SCH-20 + S USERMAIL=$G(SCH(13,1,4)) S:$G(USERMAIL)'="" DUZ=$O(^VA(200,"ADUPN",$$LOW^XLFSTR(USERMAIL),"")) + I DUZ'>0 S DUZ=.5,(NAKMSG,ERR1)="SCHEDULER DOESN'T HAVE AN ACCOUNT ON THIS SYSTEM",ABORT="1^"_ERR1 Q + S MSGARY("STATUS")=$$GETSTAT($G(SCH(25))) ;SCH-25 + ; Linked Consults/Orders + S ORDIDTYP=$$GET^SDCCRSCU(.SCH,27,2) ;Placer ID Type + Q + ; +NTE(NTE,MSGARY,LASTSEG,CLINARY,ABORT,PROVDTL) ;NTE segment processing. + ; NTE (I/REQ) - NTE message segment data + ; MSGARY (I/O,REQ) - message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; LASTSEG (I,REQ) - segment previous to the NTE to determine context of note. + ; CLINARY (I/O,REQ) - List of Clinics to be scheduled. Could contain more than one for joint appointments + ; ABORT (O,REQ) - quit parameter to the whole tag. Having one clinic unmapped must stop filing. + ; PROVDTL (I/OPT) - passed when NTE concerns a preceding AIP or AIG segment + N NOTE,NOTETYPE,CLINIC + S LASTSEG=$G(LASTSEG) + ;;;lb ===> change to HL7 + S NOTE=$$GET^SDCCRSCU(.NTE,3,1) ;NTE-3.1 + S NOTETYPE=$$GET^SDCCRSCU(.NTE,4,1) ;NTE-4.1 + ; Process NTE following SCH for scheduling comments. + S NOTE=$TR(NOTE,"^","?") ;FILEMAN can't handle "^" + I LASTSEG="SCH" D + . I ($G(MSGARY("COMMENT"))'=""),(NOTE'="") S MSGARY("COMMENT")=$G(MSGARY("COMMENT"))_" " + . S MSGARY("COMMENT")=NOTE + ; Process NTE following AIG/AIP for getting clinics + I (LASTSEG="AIP")!(LASTSEG="AIG") D + . I NOTETYPE="CLINIC" D + . . S CLINIC=$$GETCLIN(NOTE) + . . I CLINIC="" S ERR1="CLINIC MAPPING ERROR VALUE" D ACK^SDCCRCOR("CE",MID,"NTE","",1,300,ERR1,1) S ABORT="1^"_ERR1 Q + . . S CLINARY(0)=$G(CLINARY(0))+1 + . . S CLINARY(CLINARY(0))=CLINIC + . . S CLINARY(CLINARY(0),"DT")=$G(PROVDTL("DT")) + . . S CLINARY(CLINARY(0),"LN")=$G(PROVDTL("LN")) + Q + ; +PID(PID,MSGARY,ABORT) ;PID segment processing. + ; PID (I/REQ) - PID message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; ABORT (O,OPT) - Error parameter if we failed to find a valid patient. Fatal case to this message. + N IDENTIFIERS,IENCHECK,OK + D PARSESEG^SDCCRSCU(PID,.PID) + S ICN=$G(PID(3,1,1)),(SDDFN,DFN)=$$GETDFN^MPIF001($P(ICN,"V")) + Q + ; +PV1(PV1,MSGARY,HDRTIME,ABORT) ;PV1 segment processing. + ; PV1 (I/REQ) - PV1 message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; HDRTIME (I,OPT) - TIME FROM MSH-7, USED AS A DEFAULTING OPTION + ; ABORT (O,OPT) - Error parameter if we failed to find a valid patient. Fatal case to this message. + N ERROR + ; + D PARSESEG^SDCCRSCU(PV1,.PV1) + S CONSULTID=0,(CONID,CONSULTID)=$G(PV1(19)) + S MSGARY("FILLER ID")=CONSULTID + S SDAPTYP="C|"_$G(CONSULTID) + N Y,RESNAME + S SDECRES=$$GET1^DIQ(123,$G(CONSULTID)_",",1,"I"),(CONTITLE,SRVNAME)=$$GET1^DIQ(123,$G(CONSULTID)_",",1,"E") + Q:$G(SRVNAME)'["COMMUNITY CARE" + S:$G(SRVNAME)[" - " SRVNAME=$P(SRVNAME," - ",1)_"-"_$P(SRVNAME," - ",2) + S:$G(SRVNAME)[" -" SRVNAME=$P(SRVNAME," -",1)_"-"_$P(SRVNAME," -",2) + S:$G(SRVNAME)["- " SRVNAME=$P(SRVNAME,"- ",1)_"-"_$P(SRVNAME,"- ",2) + ;RSNAME and SRVNAME is the full name after the transform from COMMUNITY CARE to COMM CARE. RSNAME is used to look up the resource + ;using the full name in SDEC(409.831, SRVNAME is used to look up the clinic in the Hospital Location file + S (RSNAME,SRVNAME)="COM CARE-"_$P(SRVNAME,"-",2),SRVNAME=$E(SRVNAME,1,30) S:$E(SRVNAME,30)=" " SRVNAME=$E(SRVNAME,1,29) + S:$E($P(RSNAME,"-",2),1,3)="DOD" (RSNAME,SRVNAME)="CC-"_$P(RSNAME,"-",2) + S SDCL=$O(^SC("B",$G(SRVNAME),"")) + I $G(SDCL)="" S ERROR="NO MATCH FOR "_SRVNAME_" PV1-19 CONSULT ID:"_CONSULTID,ERR1=ERROR D ACK^SDCCRCOR("CE",MID,"PV1","",19,305,ERR1,1) S ABORT="2^"_ERR1 Q ;WE NEED AN ERR HERE FOR PV1(19) + S SDRES=$O(^SDEC(409.831,"B",$G(SRVNAME),"")) S:$G(SDRES)>0 SDECRES=$G(SDRES) + I $G(SDRES)="" S ERROR="NO CLINIC RESOURCE MATCH FOR "_SRVNAME,ERR1=ERROR D ACK^SDCCRCOR("CE",MID,"PV1","",19,305,ERR1) S ABORT="1^"_ERR1 Q + ;ONLY LOG DEFAULTING ERRORS + ;CHECK IN DATE/TIME + S MSGARY("CHECKINDT")=$$DETTIME($$GET^SDCCRSCU(.PV1,44,1),$G(HDRTIME),.ERROR) ;PV1-44.1 + I ($G(ERROR)'=""),($G(MSGARY("STATUS"))="CHECKED IN") D ACK^SDCCRCOR("CE",MID,"PV1","",44,306,"NO CHECK IN TIME IN PV1-44 "_ERROR,1) S ABORT="1^NO CHECK IN TIME IN PV1-44 "_ERROR Q + ;CHECK OUT DATE/TIME + S MSGARY("CHECKOUTDT")=$$DETTIME($$GET^SDCCRSCU(.PV1,45,1),$G(HDRTIME),.ERROR) ;PV1-45.1 + I ($G(ERROR)'=""),($G(MSGARY("STATUS"))="CHECKED OUT") D ACK^SDCCRCOR("CE",MID,"PV1","",45,307,"NO CHECK IN TIME IN PV1-45 "_ERROR,1) S ABORT="1^NO CHECK IN TIME IN PV1-44 "_ERROR Q + ; + Q +RGS(RGS,MSGARY) ; RGS segment processing. + ; Per HL7 this segment repeats and has multiple AIS/AIG/AIP segments underneath. + ; RGS (I/REQ) - RGS message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + Q +AIS(AIS,MSGARY) ;AIS segment processing. + ; Per HL7 this field can repeat within each RGS group. + ; AIS (I/REQ) - AIS message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + Q +AIP(AIP,MSGARY,PROVDTL,BASEDTE) ;AIP segment processing. + ; Per HL7 this field can repeat within each RGS group. + ; AIP (I/REQ) - AIP message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; PROVDTL (O,REQ) - AIP date/time and length + ; BASEDTE (I,REQ) - Appt D/T from SCH + D PARSESEG^SDCCRSCU(AIP,.AIP) + I $$HL7TFM^XLFDT($$GET^SDCCRSCU(.AIP,6,1),"L")'="" S PROVDTL("DT")=$$HL7TFM^XLFDT($$GET^SDCCRSCU(.AIP,6,1),"L") ;AIP-6 + E S PROVDTL("DT")=BASEDTE + ;I $$GETLEN^SDCCRCOR(,.AIP)'="" S PROVDTL("LN")=$$GETLEN^SDCCRCOR(,.AIP) ;AIP-9 + ;E + S PROVDTL("LN")=MSGARY("DURATION") + Q + ; +AIL(AIL,RETVAL) ; Process AIL Segment + Q +AIG(AIG,MSGARY,PROVDTL,BASEDTE) ;AIG segment processing. + ; Per HL7 this field can repeat within each RGS group. + ; AIG (I/REQ) - AIG message segment data + ; MSGARY (I/O,REQ) message array structure with deformated and translated data ready for filing. See PARSEMSG for details. + ; PROVDTL (O,REQ) - AIG date/time and length + ; BASEDTE (I,REQ) - Appt D/T from SCH + D PARSESEG^SDCCRSCU(AIG,.AIG) + I $$HL7TFM^XLFDT($$GET^SDCCRSCU(.AIG,8,1),"L")'="" S PROVDTL("DT")=$$HL7TFM^XLFDT($$GET^SDCCRSCU(.AIG,8,1),"L") ;AIG-8 + E S PROVDTL("DT")=BASEDTE + S PROVDTL("LN")=MSGARY("DURATION") + Q + ; +GETRSN(SCH) ; Collects appointment reason and translates into internal format. + ; Tries using the Title to lookup the reason. If that fails uses the ID to lookup + ; the reason against the title. If that fails tries using the ID against the ID. + ; SCH (I/REQ) - SCH message segment data + Q $$DATALKUP(.SCH,"409.2","^SD(409.2,",6,302,"APPOINTMENT REASON MAPPING ERROR") +GETTYPE(OBX) ;translates appointment type into internal format + ; OBX (I/REQ) - OBX message segment data + N APPTTYPE + S APPTTYPE=$$DATALKUP(.OBX,"409.1","^SD(409.1,",5,303,"APPOINTMENT TYPE MAPPING ERROR") + I $G(APPTTYPE)="" S APPTTYPE=9 + Q APPTTYPE + ; +GETUSER(SCH) ;collects appointment entered by user and confirms they are a user in the 200 file + ; SCH (I/REQ) - SCH message segment data + Q:$G(SCH)="" + S USER=$$FIND1^DIC(200,,"X",$G(SCH),"ASECID",,"SCERR") + S USER=.5 + Q USER +GETSTAT(SCH) ; Translates status into appropriate scheduling statuses + ; Options: (SCHEDULED,CHECKED IN,CHECKED OUT,CANCELLED,NO SHOW) + ; SCH (I/REQ) - SCH message segment data + N STATUS,ID,TITLE + S ID=$$GET^SDCCRSCU(.SCH,25,1) + S TITLE=$$GET^SDCCRSCU(.SCH,25,2) + I $$INSTRING^SDCCRCOR(TITLE,"SCHEDULED,CHECKED IN,CHECKED OUT,CANCELLED,NO SHOW") Q TITLE + I $$INSTRING^SDCCRCOR(ID,"SCHEDULED,CHECKED IN,CHECKED OUT,CANCELLED,NO SHOW") Q ID + I (ID'="")!(TITLE'="") D ACK^SDCCRCOR("CE",MID,"SCH",25,"",309,"SCHEDULING STATUS MAPPING ERROR",1) S ABORT="1^SCHEDULING STATUS MAPPING ERROR" Q + Q "NA" +GETIDS(PID,IDENTIFIERS) ;Loops over PID-3 and extracts all IDs out into an array. Currently will identify ICN and IEN identifiers only + ; PID (I,REQ) - PID message segment data + ; IDENTIFIERS (O,REQ) - Identifier array to return + ; + K IDS ;force output parameter + N REP,ID,ASSIGN,IDTYPE + S ID=PID(3,1,5) + S IDENTIFIERS("PATIENT IEN")=$G(PID(3,2,1)) ;DFN + S IDENTIFIERS("PATIENT ICN")=$G(PID(3,1,1)) ;ICN + Q +ISPATIEN(ASSIGN,IDTYPE) ;Determines if given id descriptors are the IEN for this instance + ; ASSIGN (I,OPT) - Assigning Authority of this identifier + ; IDTYPE (I,OPT) - ID Type of this identifier + I $G(IDTYPE)="IEN" Q 1 + Q 0 +ISPATICN(ASSIGN,IDTYPE) ;Determines if given id descriptors are the ICN for this instance + ; ASSIGN (I,OPT) - Assigning Authority of this identifier + ; IDTYPE (I,OPT) - ID Type of this identifier + I $G(IDTYPE)="ICN" Q 1 + Q 0 +GTIENICN(PATICN) ;Lookup the IEN for a given ICN + ; PATICN (I,REQ) - Patient ICN + ; IDTYPE (I,OPT) - ID Type of this identifier + N PATIEN + S PATIEN="" + Q PATIEN +GETCLIN(ID) ;Collects clinic from the PV1-3.1 segment. There is no title component to this data type. + ; ID (I/REQ) - Clinic string to lookup clinic with + ; + ; Check Requirements + I $G(ID)="" Q "" + ; + N CLINIC + ; Try robust mutli tier lookup + S CLINIC=$O(^SC("B",ID,"")) + I CLINIC'="" Q CLINIC + I $G(^SC(ID,0))'="" Q ID + Q "" +GETELIG(OBX) ;Collects appointment eligibility and translates into internal format + ; Tries using the Title to lookup the eligibility. If that fails uses the + ; ID to lookup the reason against the title. If that fails tries using the ID against the ID. + ; OBX (I/REQ) - OBX message segment data + Q $$DATALKUP(.OBX,"8","^DIC(8,",5) +DETTIME(PV1TIME,HDRTIME,ERROR) ;RETURNS THE BEST CHECK IN/OUT TIME AVAILABLE IN THE MESSAGE OR DEFAULTS TO NOW + ; PV1TIME (I,OPT) - HIGHEST PRIORITY TIME TO RETURN FROM EITHER PV1-44 OR PV1-45 + ; HDRTIME (I,OPT) - TIME FROM MSH-7 + ; ERROR (O,OPT) - ERROR OUTPUT PARAMETER + K ERROR + I $G(PV1TIME)'="" Q $$HL7TFM^XLFDT(PV1TIME,"L") + I $G(HDRTIME)'="" S ERROR="FALLING BACK TO MSH-7" Q $$HL7TFM^XLFDT(HDRTIME,"L") + S ERROR="FALLING BACK TO FILING TIME" + Q $$NOW^XLFDT() +DATALKUP(SEG,FILE,FILEPATH,FIELD,ERRCODE,ERRTEXT) ; Translates a data element for a given fileman file in an HL7 field + ; Tries using the Title to lookup the data. If that fails uses the ID to lookup + ; the reason against the title. If that fails tries using the ID against the ID. + ; SEG (I,REQ) - Message segment to parse + ; FILE (I,REQ) - Fileman File to lookup + ; FILEPATH (I,REQ) - global path to the file's storage location for DIC lookup. Make sure to end with a comma ^(, + ; FIELD (I,REQ) - message field to look in + ; ERRCODE (I,OPT) - error to log if failure + ; ERRTEXT (I,OPT) - error text to log if failure + ; + ; Check Requirements + I ($G(FILE)="")!($G(FIELD)="") Q + ; + N ID,TITLE,DATA,X,Y,DIC + ; + S DATA="" + S ID=$$GET^SDCCRSCU(.SEG,FIELD,1) ;component 1 HL7 ID field + S TITLE=$$GET^SDCCRSCU(.SEG,FIELD,2) ;component 2 HL7 Title field + I (ID=""),(TITLE="") Q "" ;No data to translate + ; + ; Try robust mutli tier lookup + I TITLE'="" S DIC=FILEPATH,DIC(0)="B",X=TITLE D ^DIC S DATA=$P(Y,"^",1) ;lookup "B" node with the second component + I DATA'="",DATA'=-1 Q DATA + I ID'="" d + . S DIC=FILEPATH,DIC(0)="B",X=ID D ^DIC S DATA=$P(Y,"^",1) ;lookup "B" node with the first component + . I DATA'="",DATA'=-1 Q + . I $$GET1^DIQ(FILE,ID,".01")'="" S DATA=ID ;check if the ID matches a record in the File. if so use it. + I DATA'="" Q DATA + I $G(ERRCODE)'="" D ACK^SDCCRCOR("CE",MID,"","","",ERRCODE,ERRTEXT,1) ;All lookups have failed and data exists so send an error + Q "" + ; diff --git a/Packages/Scheduling/Routines/SDPRE707.m b/Packages/Scheduling/Routines/SDPRE707.m new file mode 100644 index 00000000000..c4e5424297f --- /dev/null +++ b/Packages/Scheduling/Routines/SDPRE707.m @@ -0,0 +1,73 @@ +SDPRE707 ;;MS/PB/MJ - CCRA PRE INSTALL;APR 22, 2019 + ;;5.3;Scheduling;**707**;APR 4, 2019;Build 57 + ;;Per VA directive 6402, this routine should not be modified. + ;Pre install routine for patch SD*5.3*707. + ;Checks for the CCRA-NAK logical link, if it exists, it doesn't re-install the link + ;if it doesn't exist, it gets the HealthShare server address and port and installs + ;and configures the link. + Q +LINK ; update the TMP_Send Link + N LIEN,OPSITE,DOMAIN,VAL,SDERR,FDA,PRE1,PRE2,X,STOP + D MES^XPDUTL("Checking VistA system for CCRA-NAK logical link setup...") + S VAL="CCRA-NAK",STOP=0 + S LIEN=$$FIND1^DIC(870,,"B",.VAL) + I LIEN D MES^XPDUTL("Link already exists, no new setup needed") Q + D MES^XPDUTL("") + D MES^XPDUTL("") + D MES^XPDUTL("") + D MES^XPDUTL("CCRA-NAK logical link being set up now. We'll need some information from you.") + D MES^XPDUTL("Please have the HealthConnect server IP address and Port number ready.") + D MES^XPDUTL("") + D MES^XPDUTL("") + D MES^XPDUTL("") + ; +Q1 ; QUESTION 1 - IP ADDRESS - PRE 1 + S DIR("A")="PLEASE ENTER THE HEALTHCONNECT SERVER IP ADDRESS" + S DIR(0)="F" + D ^DIR S PRE1=X + I $G(PRE1)="^"!($G(PRE1)="") D + . N X,Y,DIR,DTOUT,DUOUT,DIRUT + . S DIR(0)="Y" + . S DIR("A",1)="Quitting out will result in the CCRA-NAK logical link not being installed." + . S DIR("A",2)="The CCRA-NAK logical link is required and must be configured for this patch to work properly." + . S DIR("A")="Are you sure you want to exit out of the PRE-install process?" + . D ^DIR + . S:$G(Y)'=0 STOP=1 + . G:$G(Y)=0 Q1 + . G:$G(STOP)=1 QABORT + ; +Q2 ; QUESTION 2 - PORT NUMBER - PRE 2 + G:$G(STOP)=1 QABORT + N X,Y,DIR,DTOUT,DUOUT,DIRUT + S DIR("A")="PLEASE ENTER THE HEALTHCONNECT SERVER PORT NUMBER" + S DIR(0)="F" + D ^DIR S PRE2=X + I $G(PRE2)="^"!($G(PRE2)="") D + . N X,Y,DIR,DTOUT,DUOUT,DIRUT + . S DIR(0)="Y" + . S DIR("A",1)="Quitting out will result in the CCRA-NAK logical link not being installed." + . S DIR("A",2)="The CCRA-NAK logical link is required and must be configured for this patch to work properly." + . S DIR("A")="Are you sure you want to exit out of the PRE-install process?" + . D ^DIR + . S:$G(Y)'=0 STOP=1 + . G:$G(Y)=0 Q2 + . G:$G(STOP)=1 QABORT + ; + ; file link with IP address and port entered + G:$G(STOP)=1 QABORT + K FDA,LIEN,SDERR + S FDA(870,"+1,",.01)="CCRA-NAK" + S FDA(870,"+1,",.02)=$$KSP^XUPARAM("INST") ; site station number + S FDA(870,"+1,",2)=4 ; TCP/IP + S FDA(870,"+1,",4.5)=1 ; auto start + S FDA(870,"+1,",400.01)=$G(PRE1) ; ip address + S FDA(870,"+1,",400.02)=$G(PRE2) ; hl7 port + S FDA(870,"+1,",400.03)="C" ; Client (Sender) TCP/IP Service Type + ; S FDA(870,"+1,",400.08)=$G(PRE2) ; hlo port + D UPDATE^DIE(,"FDA","LIEN","SDERR") K FDA + D MES^XPDUTL("") + I $D(SDERR) D Q ; something went wrong + .D MES^XPDUTL("FileMan error when creating the CCCRA-NAK Link.") + D MES^XPDUTL("CCRA-NAK Link has been updated.") +QEND K DIR,SDERR Q +QABORT S XPDABORT=1 K DIR,SDERR Q