Changeset 434


Ignore:
Timestamp:
Apr 14, 2009, 10:57:24 AM (16 years ago)
Author:
George Lilly
Message:

rollback of Lab for RPMS code

Location:
ccr/trunk/p
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CLA7Q.m

    r433 r434  
    1 C0CLA7Q ;WV/JMC - CCD/CCR Lab HL7 Query Utility ;Apr 12, 2009
    2         ;;5.2;;****;Sep 27, 1994
     1C0CLA7Q ;WV/JMC - CCD/CCR Lab HL7 Query Utility ;Apr 13, 2009
     2        ;;n.n;;****;
    33        ;
    44        ;
     
    1212        ;
    1313        ; Check and retrieve lab results from LAB DATA file (#63)
    14         D GCPR^LA7QRY(C0CPTID,C0CSDT,C0CEDT,.C0CSC,.C0CSPEC,.C0CERR,C0CDEST,C0CHL7)
     14        D GCPR^LA7QRY($G(C0CPTID),$G(C0CSDT),$G(C0CEDT),.C0CSC,.C0CSPEC,.C0CERR,$G(C0CDEST),$G(C0CHL7))
    1515        ;
    1616        ; If V LAB file present then check for lab results that are only in this file
    17         I $D(^AUPNVLAB) D VCHECK
    18         ;
    1917        ; If results found in V Lab file then build results and add to above results.
    20         I $D(^TMP("C0C-VLAB",$J,3)) D VBUILD
     18        I $D(^AUPNVLAB) D
     19        . D VCHECK
     20        . I $D(^TMP("C0C-VLAB",$J,3)) D VBUILD
    2121        ;
    2222        ;K ^TMP("C0C-VLAB",$J)
     
    8484        I C0CLN'="" D
    8585        . S X=$P(LA7X,"^",3)
    86         . S $P(X,"!",3)=C0CLN
     86        . I $P(X,"!",3)="" S $P(X,"!",3)=C0CLN
    8787        . S $P(LA7X,"^",3)=X
    8888        ;
     
    9696        F I=0,12 S C0CVLAB(I)=^AUPNVLAB(C0CDA,I)
    9797        ;
     98        ; JMC 04/13/09 - Store anything for now that meets date criteria.
    9899        D VSTORE
    99100        ;
     
    103104VSTORE  ; Store entry for building in HL7 message when parent is from V LAB file.
    104105        ;
    105         S ^TMP("C0C-VLAB",$J,3,$P(C0CVLAB(12),"^"),$P(C0CVLAB,"^",2))=""
     106        N PARENT
     107        ;
     108        ; Determine parent test to use for OBR segment
     109        S PARENT=$P(C0CVLAB(12),"^",8)
     110        I PARENT="" S PARENT=$P(C0CVLAB(0),"^")
     111        ;
     112        ;                                patient ien
     113        ;                                |                 collection date/time
     114        ;                                |                 |             parent test (ordered test)
     115        ;                                |                 |             |      ien of entry in V LAB file
     116        ;                                |                 |             |      |
     117        S ^TMP("C0C-VLAB",$J,3,$P(C0CVLAB(0),"^",2),$P(C0CVLAB(12),"^"),PARENT,C0CDA)=""
     118        ;
    106119        Q
  • ccr/trunk/p/LA7QRY2.m

    r433 r434  
    1 LA7QRY2 ;DALOI/JMC - Lab HL7 Query Utility ;1/30/07  19:05
    2  ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,69,73**;Sep 27, 1994;Build 7
     1LA7QRY2 ;DALOI/JMC - Lab HL7 Query Utility ; 04/13/09
     2 ;;5.2;AUTOMATED LAB INSTRUMENTS;**46**;Sep 27, 1994
    33 ; JMC - mods to check for IHS V LAB file
    44 ;
     
    1010 ;
    1111 S (DFN,LRDFN)="",LA7PTYP=0
    12  ; VOE changes, Use HRN cross reference, Daou;;June 8,2005
    13  S LA7X=$O(^AUPNPAT("D",LA7PTID,""))
    14  I LA7X>0 D SETDFN(LA7X) S LA7PTYP=1
    1512 ;
    16  ; See if SSN passed as patient identifier
    17  I DFN'>0 S LA7X=$O(^DPT("SSN",LA7PTID,0)) I LA7X>0 D SETDFN(LA7X) S LA7PTYP=1
     13 ; SSN passed as patient identifier
     14 I LA7PTID?9N.1A D
     15 . S LA7PTYP=1
     16 . S LA7X=$O(^DPT("SSN",LA7PTID,0))
     17 . I LA7X>0 D SETDFN(LA7X)
    1818 ;
    1919 ; MPI/ICN (integration control number) passed as patient identifier
    20  I DFN'>0 S LA7X=$$GETDFN^MPIF001($P(LA7PTID,"V")) I LA7X>0 D SETDFN(LA7X) S LA7PTYP=2
     20 I LA7PTID?10N1"V"6N D
     21 . S LA7PTYP=2
     22 . S LA7X=$$GETDFN^MPIF001($P(LA7PTID,"V"))
     23 . I LA7X>0 D SETDFN(LA7X)
    2124 ;
    2225 ; If no patient identified/no laboratory record - return exception message
     
    3639 I LA7EDT S LA7EDT(0)=9999999-LA7EDT
    3740 ;
    38  S LRSS=""
    39  F  S LRSS=$O(LRSSLST(LRSS))  Q:LRSS=""  D
     41 F LRSS="CH","MI","SP" D
    4042 . S (LA7QUIT,LRIDT)=0
    4143 . I LA7EDT(0) S LRIDT=$O(^LR(LRDFN,LRSS,LA7EDT(0)),-1)
     
    6870 . . F  S LA7ROOT=$Q(@LA7ROOT) Q:LA7ROOT=""!($QS(LA7ROOT,2)'=LA7DT)!($QS(LA7ROOT,4)'="AN")  D
    6971 . . . I $QS(LA7ROOT,6)'=LRDFN Q
    70  . . . S LRIDT=$QS(LA7ROOT,7),LRSS=""
    71  . . . F  S LRSS=$O(LRSSLST(LRSS))  Q:LRSS="" D SEARCH
     72 . . . S LRIDT=$QS(LA7ROOT,7)
     73 . . . F LRSS="CH","MI","SP" D SEARCH
    7274 ;
    7375 ; If no orders in #69 then do long search through file #63.
    74  I 'LA7SRC  D
    75  . S LRSS=""
    76  . F  S LRSS=$O(LRSSLST(LRSS))  Q:LRSS=""  D
     76 I 'LA7SRC D
     77 . F LRSS="CH","MI","SP" D
    7778 . . S LRIDT=0
    7879 . . F  S LRIDT=$O(^LR(LRDFN,LRSS,LRIDT)) Q:'LRIDT  D
     
    118119 F  S LRSB=$O(^LR(LRDFN,LRSS,LRIDT,LRSB)) Q:'LRSB  D
    119120 . S LA7X=$G(^LR(LRDFN,LRSS,LRIDT,LRSB))
    120  . I $P($P(LA7X,"^",3),"!",3)="",$D(^AUPNVLAB) D LNCHK^C0CLA7Q ; WV check for IHS.
     121 . I $D(^AUPNVLAB) D LNCHK^C0CLA7Q ; WV check for IHS.
    121122 . S LA7CODE=$$DEFCODE^LA7VHLU5(LRSS,LRSB,$P(LA7X,"^",3),LA761)
    122123 . D CHECK
     
    182183 S DFN=LA7X,LRDFN=$P($G(^DPT(DFN,"LR")),"^")
    183184 Q
    184  ;
    185  ;***** SETUP THE SEARCH CODES
    186 SCLIST(SCLST) ;
    187  N I,RC,SCALL,TMP  K LRSSLST
    188  S SCALL=",CH,MI,SP,"
    189  S SCLST=$$UP^XLFSTR($TR(SCLST," ")),RC="*"
    190  S:SCLST?.1"*" RC=SCLST,SCLST=$P(SCALL,",",2,999)
    191  F I=1:1  S TMP=$P(SCLST,",",I)  Q:TMP=""  D  Q:$D(LA7ERR)>1
    192  . I SCALL[(","_TMP_",")  S LRSSLST(TMP)=""  Q
    193  . S LA7ERR(7)="Invalid list of subscripts: '"_SCLST_"'"
    194  Q RC
  • ccr/trunk/p/LA7VOBX1.m

    r433 r434  
    1 LA7VOBX1 ;DALOI/JMC - LAB OBX Segment message builder (CH subscript) cont'd ;Apr 8, 2009
    2  ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,61,63,64,71**;Sep 27, 1994
     1LA7VOBX1 ;DALOI/JMC - LAB OBX Segment message builder (CH subscript) cont'd; 04/13/09
     2 ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,61,63**;Sep 27, 1994
    33 ; JMC - mods to check for IHS V LAB file
    44 ;
     
    66 ; Called by LA7VOBX
    77 ;
    8  N LA76304,LA7ALT,LA7DIV,LA7I,LA7RS,LA7X,LA7Y,X
     8 N LA76304,LA7ALT,LA7DIV,LA7I,LA7X,LA7Y,X
    99 ;
    1010 ; "CH" subscript requires a dataname
     
    1313 ; get result node from LR global.
    1414 S LA76304(0)=$G(^LR(LRDFN,LRSS,LRIDT,0))
    15  S LA7RS=$P(LRSB,"^",2),LRSB=$P(LRSB,"^")
    1615 S LA7VAL=$G(^LR(LRDFN,LRSS,LRIDT,LRSB))
    17  ; If previous results have been corrected then send corrected status
    18  I LA7RS="",$P(LA7VAL,"^",10)=2 S LA7RS="C"
    1916 ;
    2017 ; Check if test is OK to send - (O)utput or (B)oth
    2118 S LA7X=$P(LA7VAL,"^",12)
    2219 I LA7X]"","BO"'[LA7X Q
    23  I LA7X="",'$$OKTOSND^LA7VHLU1(LRSS,LRSB,+$P($P(LA7VAL,"^",3),"!",7)) Q
     20 I LA7X="",'$$OKTOSND^LA7VHLU1(LRSS,LRSB,+$P($P(LA7VAL,"^",3),"!",5)) Q
    2421 ;
    2522 ; If no result NLT or LOINC try to determine from file #60
    2623 S LA7X=$P(LA7VAL,"^",3)
    27  ;
    28  ; Check for no LOINC in 63 and LOINC found in V LAB file.
    29  I $P(LA7X,"!",3)="",$D(^TMP("C0C-VLAB",$J,2,LRDFN,LRSS,LRIDT,LRSB)) S $P(LA7X,"!",3)=$P(^TMP("C0C-VLAB",$J,2,LRDFN,LRSS,LRIDT,LRSB),"^")
    30  ;
     24  ; Check for no LOINC in 63 and LOINC found in V LAB file.
     25 I $P(LA7X,"!",3)="",$D(^TMP("LA7-VLAB",$J,2,LRDFN,LRSS,LRIDT,LRSB)) S $P(LA7X,"!",3)=$P(^TMP("LA7-VLAB",$J,2,LRDFN,LRSS,LRIDT,LRSB),"^")
     26        ;
    3127 I $P(LA7X,"!",2)=""!($P(LA7X,"!",3)="") S $P(LA7VAL,"^",3)=$$DEFCODE^LA7VHLU5(LRSS,LRSB,LA7X,$P(LA76304(0),"^",5))
    3228 ; No result NLT code - log error
     
    7167 ;
    7268 ; Value type
    73  ; If result is "cancel" or "comment" then data type is ST - string data
    74  S LA7X=$S("canccomment"[$P(LA7VAL,"^"):1,1:0)
    75  I LA7X S LA7OBX(2)="ST"
    76  E  S LA7OBX(2)=$$OBX2^LA7VOBX(63.04,LRSB)
     69 S LA7OBX(2)=$$OBX2^LA7VOBX(63.04,LRSB)
    7770 ;
    7871 ; Observation identifer
     
    8376 ;
    8477 ; Test value
    85  ; If DoD and "canc" then report "PL Cancelled" per Lab Interop ICD.
    86  S LA7X=$P(LA7VAL,"^")
    87  I LA7X'="canc",$$GET1^DID(63.04,LRSB,"","TYPE","","LA7ERR")="SET" D
    88  . S LA7X=$$EXTERNAL^DILFD(63.04,LRSB,"",LA7X)
    89  . I LA7X="" S LA7X=$P(LA7VAL,"^")
    90  I $G(LA7NVAF)=1,LA7X="canc" S LA7X="PL Cancelled"
    91  S LA7OBX(5)=$$OBX5^LA7VOBX(LA7X,LA7OBX(2),LA7FS,LA7ECH)
     78 S LA7OBX(5)=$$OBX5^LA7VOBX($P(LA7VAL,"^"),LA7OBX(2),LA7FS,LA7ECH)
    9279 ;
    93  ; Units
    94  S LA7X=$P(LA7VAL,"^",5)
     80 ; Units - remove leading and trailing spaces
     81 S LA7X=$P(LA7VAL,"^",5),LA7X=$$TRIM^XLFSTR(LA7X,"LR"," ")
    9582 S LA7OBX(6)=$$OBX6^LA7VOBX($P(LA7X,"!",7),"",LA7FS,LA7ECH)
    9683 ;
     
    9986 ;
    10087 ; Abnormal flags
    101  S LA7OBX(8)=$$OBX8^LA7VOBX($P(LA7VAL,"^",2))
     88 S LA7OBX(8)=$$OBX8^LA7VOBX($P(LA7VAL,U,2))
    10289 ;
    10390 ; "P"artial or "F"inal results
    104  S LA7X=$S("canccommentpending"[$P(LA7VAL,"^"):$P(LA7VAL,"^"),1:"F")
    105  I LA7RS="C" S LA7X=LA7RS
    106  S LA7OBX(11)=$$OBX11^LA7VOBX(LA7X)
     91 S LA7OBX(11)=$$OBX11^LA7VOBX($S("canccommentpending"[$P(LA7VAL,"^"):$P(LA7VAL,"^"),1:"F"))
    10792 ;
    10893 ; Observation date/time - collection date/time per HL7 standard
Note: See TracChangeset for help on using the changeset viewer.