updates to handle dangling pointers in the V LAB file

This commit is contained in:
george 2009-06-02 02:27:32 +00:00
parent 206c726dcb
commit 7ec7af7427
2 changed files with 404 additions and 184 deletions

View File

@ -1,23 +1,243 @@
C0CLA7DD ;xxxx/JMC-CREATE NEW-STYLE XREF ;8:32 PM 18 May 2009
C0CLA7DD ;WV/JMC - CCD/CCR Post Install DD X-Ref Setup Routine; ;18 May 2009
;;1.0;C0C;;May 19, 2009;
;
N C0CXR,C0CRES,C0COUT
; Tasked by C0C post-install routine C0CENV to create C0C cross-references on V LAB file.
;
Q
;
;
EN ; Add new style cross-references to V LAB file if it exists.
;
;
; Quit if AUPNVLAB global does not exist.
I $$VFILE^DILFD(9000010.09)'=1 Q
;
N MSG
;
S MSG="Starting installation of ALR1 cross-reference at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
D ALR1
S MSG="Installation of ALR1 cross-reference completed at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
;
S MSG="Starting installation of ALR2 cross-reference at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
D ALR2
S MSG="Installation of ALR2 cross-reference completed at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
;
S MSG="Starting installation of ALR3 cross-reference at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
D ALR3
S MSG="Installation of ALR3 cross-reference completed at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
;
S MSG="Starting installation of ALR4 cross-reference at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
D ALR4
S MSG="Installation of ALR4 cross-reference completed at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
;
S MSG="Starting installation of ALR5 cross-reference at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
D ALR5
S MSG="Installation of ALR5 cross-reference completed at "_$$HTE^XLFDT($H,"1Z")
D MES^XPDUTL(MSG)
;
Q
;
;
ALR1 ;
;
N C0CFLAG,C0CXR,C0CRES,C0COUT
;
S C0CFLAG="S"
I '$D(ZTQUEUED) S C0CFLAG=COCFLAG_"W"
;
S C0CXR("FILE")=9000010.09
S C0CXR("NAME")="ALR5"
S C0CXR("NAME")="ALR1"
S C0CXR("TYPE")="R"
S C0CXR("USE")="S"
S C0CXR("EXECUTION")="R"
S C0CXR("ACTIVITY")="IR"
S C0CXR("SHORT DESCR")="X-ref by patient and results availble date/time"
S C0CXR("DESCR",1)="This cross-reference is used to identify all lab results for a"
S C0CXR("DESCR",2)="patient by results available date/time. This includes results that are only in"
S C0CXR("DESCR",3)="this file and therefore do not have a corresponding entry in LAB DATA"
S C0CXR("DESCR",4)="file (#63)."
S C0CXR("SHORT DESCR")="X-ref to link entry with parent in LAB DATA file (#63)"
S C0CXR("VAL",1)=.02
S C0CXR("VAL",1,"SUBSCRIPT")=1
S C0CXR("VAL",1,"COLLATION")="F"
S C0CXR("VAL",2)=1212
S C0CXR("VAL",2)=.06
S C0CXR("VAL",2,"SUBSCRIPT")=2
S C0CXR("VAL",2,"LENGTH")=30
S C0CXR("VAL",2,"COLLATION")="F"
S C0CXR("VAL",3)=.01
S C0CXR("VAL",3,"SUBSCRIPT")=3
S C0CXR("VAL",3,"COLLATION")="F"
S C0CXR("VAL",4)=1201
S C0CXR("VAL",4,"SUBSCRIPT")=4
S C0CXR("VAL",4,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,COCFLAG,.C0CRES,"C0COUT")
;
Q
;
;
ALR2 ;
;
N C0CFLAG,C0CXR,C0CRES,C0COUT
;
S C0CFLAG="S"
I '$D(ZTQUEUED) S C0CFLAG=COCFLAG_"W"
;
S C0CXR("FILE")=9000010.09
S C0CXR("NAME")="ALR2"
S C0CXR("TYPE")="MU"
S C0CXR("USE")="S"
S C0CXR("EXECUTION")="R"
S C0CXR("ACTIVITY")="IR"
S C0CXR("SHORT DESCR")="X-ref for LOINC code related to test result."
S C0CXR("DESCR",1)="This cross-reference is used to identify the LOINC codes"
S C0CXR("DESCR",2)="that has been assigned to a lab result. Allows queries to"
S C0CXR("DESCR",3)="retrieve the LOINC code associated with a specific test"
S C0CXR("DESCR",4)="result."
S C0CXR("SET")="S ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)="""""
S C0CXR("KILL")="K ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)"
S C0CXR("WHOLE KILL")="K ^AUPNVLAB(""ALR2"")"
S C0CXR("VAL",1)=.02
S C0CXR("VAL",1,"SUBSCRIPT")=1
S C0CXR("VAL",1,"COLLATION")="F"
S C0CXR("VAL",2)=1201
S C0CXR("VAL",2,"SUBSCRIPT")=2
S C0CXR("VAL",2,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,"SW",.C0CRES,"C0COUT")
S C0CXR("VAL",3)=.06
S C0CXR("VAL",3,"SUBSCRIPT")=3
S C0CXR("VAL",3,"COLLATION")="F"
S C0CXR("VAL",4)=.01
S C0CXR("VAL",4,"SUBSCRIPT")=4
S C0CXR("VAL",4,"COLLATION")="F"
S C0CXR("VAL",5)=1113
S C0CXR("VAL",5,"SUBSCRIPT")=5
S C0CXR("VAL",5,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,C0CFLAG,.C0CRES,"C0COUT")
;
Q
;
;
ALR3 ;
;
N C0CFLAG,C0CXR,C0CRES,C0COUT
;
S C0CFLAG="S"
I '$D(ZTQUEUED) S C0CFLAG=COCFLAG_"W"
;
S C0CXR("FILE")=9000010.09
S C0CXR("NAME")="ALR2"
S C0CXR("TYPE")="MU"
S C0CXR("USE")="S"
S C0CXR("EXECUTION")="R"
S C0CXR("ACTIVITY")="IR"
S C0CXR("SHORT DESCR")="X-ref for LOINC code related to test result."
S C0CXR("DESCR",1)="This cross-reference is used to identify the LOINC codes"
S C0CXR("DESCR",2)="that has been assigned to a lab result. Allows queries to"
S C0CXR("DESCR",3)="retrieve the LOINC code associated with a specific test"
S C0CXR("DESCR",4)="result."
S C0CXR("SET")="S ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)="""""
S C0CXR("KILL")="K ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)"
S C0CXR("WHOLE KILL")="K ^AUPNVLAB(""ALR2"")"
S C0CXR("VAL",1)=.02
S C0CXR("VAL",1,"SUBSCRIPT")=1
S C0CXR("VAL",1,"COLLATION")="F"
S C0CXR("VAL",2)=1201
S C0CXR("VAL",2,"SUBSCRIPT")=2
S C0CXR("VAL",2,"COLLATION")="F"
S C0CXR("VAL",3)=.06
S C0CXR("VAL",3,"SUBSCRIPT")=3
S C0CXR("VAL",3,"COLLATION")="F"
S C0CXR("VAL",4)=.01
S C0CXR("VAL",4,"SUBSCRIPT")=4
S C0CXR("VAL",4,"COLLATION")="F"
S C0CXR("VAL",5)=1113
S C0CXR("VAL",5,"SUBSCRIPT")=5
S C0CXR("VAL",5,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,C0CFLAG,.C0CRES,"C0COUT")
;
Q
;
;
ALR4 ;
;
N C0CFLAG,C0CXR,C0CRES,C0COUT
;
S C0CFLAG="S"
I '$D(ZTQUEUED) S C0CFLAG=COCFLAG_"W"
;
S C0CXR("FILE")=9000010.09
S C0CXR("NAME")="ALR2"
S C0CXR("TYPE")="MU"
S C0CXR("USE")="S"
S C0CXR("EXECUTION")="R"
S C0CXR("ACTIVITY")="IR"
S C0CXR("SHORT DESCR")="X-ref for LOINC code related to test result."
S C0CXR("DESCR",1)="This cross-reference is used to identify the LOINC codes"
S C0CXR("DESCR",2)="that has been assigned to a lab result. Allows queries to"
S C0CXR("DESCR",3)="retrieve the LOINC code associated with a specific test"
S C0CXR("DESCR",4)="result."
S C0CXR("SET")="S ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)="""""
S C0CXR("KILL")="K ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)"
S C0CXR("WHOLE KILL")="K ^AUPNVLAB(""ALR2"")"
S C0CXR("VAL",1)=.02
S C0CXR("VAL",1,"SUBSCRIPT")=1
S C0CXR("VAL",1,"COLLATION")="F"
S C0CXR("VAL",2)=1201
S C0CXR("VAL",2,"SUBSCRIPT")=2
S C0CXR("VAL",2,"COLLATION")="F"
S C0CXR("VAL",3)=.06
S C0CXR("VAL",3,"SUBSCRIPT")=3
S C0CXR("VAL",3,"COLLATION")="F"
S C0CXR("VAL",4)=.01
S C0CXR("VAL",4,"SUBSCRIPT")=4
S C0CXR("VAL",4,"COLLATION")="F"
S C0CXR("VAL",5)=1113
S C0CXR("VAL",5,"SUBSCRIPT")=5
S C0CXR("VAL",5,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,C0CFLAG,.C0CRES,"C0COUT")
;
Q
;
;
ALR5 ;
;
N C0CFLAG,C0CXR,C0CRES,C0COUT
;
S C0CFLAG="S"
I '$D(ZTQUEUED) S C0CFLAG=COCFLAG_"W"
;
S C0CXR("FILE")=9000010.09
S C0CXR("NAME")="ALR2"
S C0CXR("TYPE")="MU"
S C0CXR("USE")="S"
S C0CXR("EXECUTION")="R"
S C0CXR("ACTIVITY")="IR"
S C0CXR("SHORT DESCR")="X-ref for LOINC code related to test result."
S C0CXR("DESCR",1)="This cross-reference is used to identify the LOINC codes"
S C0CXR("DESCR",2)="that has been assigned to a lab result. Allows queries to"
S C0CXR("DESCR",3)="retrieve the LOINC code associated with a specific test"
S C0CXR("DESCR",4)="result."
S C0CXR("SET")="S ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)="""""
S C0CXR("KILL")="K ^AUPNVLAB(""ALR2"",X(1),X(2),X(3),X(4),X(5),DA)"
S C0CXR("WHOLE KILL")="K ^AUPNVLAB(""ALR2"")"
S C0CXR("VAL",1)=.02
S C0CXR("VAL",1,"SUBSCRIPT")=1
S C0CXR("VAL",1,"COLLATION")="F"
S C0CXR("VAL",2)=1201
S C0CXR("VAL",2,"SUBSCRIPT")=2
S C0CXR("VAL",2,"COLLATION")="F"
S C0CXR("VAL",3)=.06
S C0CXR("VAL",3,"SUBSCRIPT")=3
S C0CXR("VAL",3,"COLLATION")="F"
S C0CXR("VAL",4)=.01
S C0CXR("VAL",4,"SUBSCRIPT")=4
S C0CXR("VAL",4,"COLLATION")="F"
S C0CXR("VAL",5)=1113
S C0CXR("VAL",5,"SUBSCRIPT")=5
S C0CXR("VAL",5,"COLLATION")="F"
D CREIXN^DDMOD(.C0CXR,C0CFLAG,.C0CRES,"C0COUT")
;
Q

View File

@ -1,6 +1,5 @@
C0CLA7Q ;WV/JMC - CCD/CCR Lab HL7 Query Utility ;May 4, 2009
C0CLA7Q ;WV/JMC - CCD/CCR Lab HL7 Query Utility ;May 31, 2009
;;1.0;C0C;;May 19, 2009;
;;n.n;;****;
;
;
Q
@ -86,6 +85,7 @@ LNCHK ; Check for corresponding entry in V LAB file and related LOINC code for a
. I $P($G(^AUPNVLAB(C0CDA,11)),"^",8)'=1 Q ; Source is not LAB DATA file - skip
. S C0CLN=$P($G(^AUPNVLAB(C0CDA,11)),"^",13)
. S C0CPDA=$P($G(^AUPNVLAB(C0CDA,12)),"^",8)
. I C0CPDA,'$D(^AUPNVLAB(C0CPDA,0)) S C0CPDA="" ; Dangling pointer
. I C0CPDA="" S C0CPDA=C0CDA
. S C0CTEST=$P($G(^AUPNVLAB(C0CDA,0)),"^"),X=$P($G(^LAB(60,C0CTEST,64)),"^",2)
. I X S C0CTEST(64)=$P($G(^LAM(X,0)),"^",2)