- LRSRVR9A ;BPFO/DTG - LAB NTRT DATA SERVER CONT'D MISSING VUID EXTRACT ;02/10/2016
- ;;5.2;LAB SERVICE;**468**;FEB 10 2016;Build 64
- ;
- ; Based on LRSRVR2,LRSRVR2A
- ;
- UUEN(STR) ; Uuencode string passed in.
- N J,K,LEN,LRI,LRX,S,TMP,X,Y
- S TMP="",LEN=$L(STR)
- F LRI=1:3:LEN D
- . S LRX=$E(STR,LRI,LRI+2)
- . I $L(LRX)<3 S LRX=LRX_$E(" ",1,3-$L(LRX))
- . S S=$A(LRX,1)*256+$A(LRX,2)*256+$A(LRX,3),Y=""
- . F K=0:1:23 S Y=(S\(2**K)#2)_Y
- . F K=1:6:24 D
- . . S J=$$DEC^XLFUTL($E(Y,K,K+5),2)
- . . S TMP=TMP_$C(J+32)
- S TMP=$C(LEN+32)_TMP
- Q TMP
- ;
- TSTTYP(LRX) ; Determine test data type
- N LRSTUB,LRTYPE,LRY
- I LRX="" Q "|"
- S LRX=$P(LRX,"(",2)
- ;
- ; Data type
- S LRTYPE=$$GET1^DID($P(LRX,","),$P(LRX,",",2,99),"","TYPE")
- S $P(LRSTUB,"|",2)=LRTYPE
- ;
- ; Input transform
- S LRY=$$GET1^DID($P(LRX,","),$P(LRX,",",2,99),"",$S(LRTYPE="SET":"POINTER",1:"INPUT TRANSFORM"))
- I LRTYPE="NUMERIC",LRY["LRNUM" D
- . S LRX=$P(LRY,"""",2)
- . I LRX?.1"-".N1","1.N1","1N S LRY="Number from "_$P(LRX,",")_" to "_$P(LRX,",",2)_" with "_$P(LRX,",",3)_" decimal"
- S $P(LRSTUB,"|",1)=LRY
- ; Help prompt
- I LRTYPE="FREE TEXT" D
- . S LRY=$$GET1^DID($P(LRX,","),$P(LRX,",",2,99),"","HELP-PROMPT")
- . S $P(LRSTUB,"|",1)=LRY
- Q LRSTUB
- ;
- ENCODE(LRSTR) ; Encode a string, keep remainder for next line
- ; Call with LRSTR by reference, Remainder returned in LRSTR
- ;
- S LRQUIT=0,LRLEN=$L(LRSTR)
- F D Q:LRQUIT
- . I $L(LRSTR)<45 S LRQUIT=1 Q
- . S LRX=$E(LRSTR,1,45)
- . S LRNODE=LRNODE+1,^TMP($J,"LRDATA",LRNODE)=$$UUEN(LRX)
- . S LRSTR=$E(LRSTR,46,LRLEN)
- Q
- ;
- MAILSEND(LRMSUBJ) ; Send extract back to requestor.
- ;
- N LRINSTR,LRTASK,LRTO,XMERR,XMZ
- ;
- ;ZEXCEPT: XQSND
- ;
- S LRTO(XQSND)=""
- S LRINSTR("ADDR FLAGS")="R"
- S LRINSTR("FROM")="LAB_PACKAGE"
- S LRMSUBJ=$E(LRMSUBJ,1,65)
- D SENDMSG^XMXAPI(.5,LRMSUBJ,"^TMP($J,""LRDATA"")",.LRTO,.LRINSTR,.LRTASK)
- Q
- ;
- CLEAN ;
- K ^TMP($J,"LR60")
- K ERR,LA7PCNT,LR60IEN,LR60NM,LR6421,LR64IEN
- K LRACTION,LRCC,LRCCNX,LOINCDTA,LRRNLT,LRCDEF,LREND
- K LRL,LRLNC,LRLNC80,LRLNCN,LRLNCX,LRNODE,LROUT,LROUT1,LRR64
- K LRSPEC,LRSPEC60,LRSPECN,LRSPECTA,LRST,LRSTN,LRSTR,LRSTSYN
- K LRTA,LRUNIT,LRX,LRY,X,Y,LRMISP
- K LSITE,LRNT,LRNTI,AR,LRBLD,LRSUBSCRIPT,LRTYPER,LRTXT
- K LRCDEF,LRCREATE,LREXPY,LRINACT,LRNODE,LRSPECCT,LA7TREE
- D CLEAN^LRSRVR
- D ^%ZISC
- Q
- ;
- ;
- HDR ; Set the header information
- N XA S XA=""
- S ^TMP($J,"LRDATA",1)="Report Generated.......: "_$$FMTE^XLFDT($$NOW^XLFDT)_" at "_LRSTN
- S ^TMP($J,"LRDATA",2)="Report requested.......: "_LRSUB
- S ^TMP($J,"LRDATA",3)="LOINC version..........: "_$$GET1^DID(95.3,"","","PACKAGE REVISION DATA")
- S ^TMP($J,"LRDATA",4)="VistA File version.....: "_$G(^LAB(95.3,"VR"))
- S ^TMP($J,"LRDATA",5)="Extract version........: 1.1"
- F I=6,12,13 S ^TMP($J,"LRDATA",I)=" "
- S ^TMP($J,"LRDATA",14)="Legend:"
- S X="Station #-60 ien-Spec ien-Index|Test Name|Spec|Time Aspect|Units|Mapped LOINC|NLT #|Battery Code|Battery Description|Lab Section|Subscript|Comment|Data Type|Reference low|Reference high|Therapeutic low|Therapeutic high|"
- S ^TMP($J,"LRDATA",15)=X,XA=$L(X)
- ; S ^TMP($J,"LRDATA",17)=$$REPEAT^XLFSTR("-",$L(X))
- ;S X=" 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |"
- ;S ^TMP($J,"LRDATA",16)=X
- S X="Use Ref Lab|Site Comment|Test Synonyms|Test Type |MLTF 66.3 IEN|MLTF LOINC|MLTF Name|MLTF Alt Name|Default LOINC|Submitted to NTRT|Specimen Create Date|Extract Ver|"
- ;S X=" 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |"
- I LRMISP=1 D
- . S X="Use Ref Lab|Site Comment|Test Synonyms|Test Type |MLTF 66.3 IEN|MLTF LOINC|MLTF Name|MLTF Alt Name|Default LOINC|Submitted to NTRT|Specimen Create Date| MISSING SPECIMENS|Extract Ver|"
- . ;S X=" 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |"
- S ^TMP($J,"LRDATA",16)=X,XA=XA+$L(X)
- ;S ^TMP($J,"LRDATA",18)=X
- ;S ^TMP($J,"LRDATA",18)=$$REPEAT^XLFSTR("-",$L(X))
- I XA<245 S ^TMP($J,"LRDATA",17)=$$REPEAT^XLFSTR("-",XA)
- I XA>245 S X=245,^TMP($J,"LRDATA",17)=$$REPEAT^XLFSTR("-",X)
- S ^TMP($J,"LRDATA",18)=" "
- I 'LRTXT D
- . S LRFILENM=$TR(LRSTN," ","_")_"-"_LRSUB_"-"_$P($$FMTHL7^XLFDT($$NOW^XLFDT),"-")_".TXT"
- . S ^TMP($J,"LRDATA",12)="Attached LMOF file.....: "_LRFILENM
- . S ^TMP($J,"LRDATA",19)=$$UUBEGFN(LRFILENM)
- K XA
- Q
- ;
- ;
- SITENOTE ; Build site's test notes for first record
- ;
- N LRI,LRSTNDT
- K LRSTNOTE
- S (LRSTNOTE,LRI)=0
- F S LRI=$O(^LAB(60,LR60IEN,11,LRI)) Q:'LRI D
- . S LRSTNDT=$P($G(^LAB(60,LR60IEN,11,LRI,0)),"^")
- . M LRSTNOTE(LRI)=^LAB(60,LR60IEN,11,LRI,1)
- . S LRSTNOTE(LRI,1,0)=$S(LRI>1:"^",1:"")_$$FMTE^XLFDT(LRSTNDT,"1M")_": "_$G(LRSTNOTE(LRI,1,0))
- . K LRSTNOTE(LRI,0)
- I $D(LRSTNOTE) S LRSTNOTE=1
- Q
- ;
- ;
- SUFFIX ; If Result NLT does not have a suffix, i.e. it has .0000 then check for suffixed NLT codes which can also be used
- N LR64,LRRNLT,LRROOT,LRX,LRY
- S LRRNLT=$$GET1^DIQ(64,LRR64_",",1,"E")
- S LRROOT="^LAM(""E"","_LRRNLT_")"
- F S LRROOT=$Q(@LRROOT) Q:LRROOT="" Q:$P($QS(LRROOT,2),".")'=$P(LRRNLT,".") D
- . S LR64=$QS(LRROOT,3)
- . I $G(^LAM(LR64,5,LRSPEC60,0)) S LRSPEC(LRSPEC60_"-"_LR64)=LRSPEC60_U_LRSPECN_U_LRSPECTA_U_LRUNIT_U_LR64
- Q
- ;
- ;
- UUBEGFN(LRFILENM) ; Construct uuencode "begin" coding
- ; Call with LRFILENM = name of uuencoded file attachment
- ;
- ; Returns LRX = string with "begin..."_file name
- ;
- N LRX
- S LRX="begin 644 "_LRFILENM
- Q LRX
- ;
- ; this is from LA7ADL1
- UNWIND(LA760,LA7URG,LA7PARNT) ; Unwind profile - set tests into array LA7TREE with urgency.
- ;
- ; Call with LA760 = file #60 ien
- ; LA7URG = file #62.05 ien
- ; LA7PARNT = file #60 ien - ordered parent (panel)
- ;
- ; Recursive panel, caught in a loop.
- I $G(LA7PCNT)>50 Q
- ;
- ; If no urgency, set to routine (9), default value.
- I 'LA7URG S LA7URG=9
- ;
- ; Test does not exist in file 60.
- I '$D(^LAB(60,LA760,0)) Q
- ;
- ; Bypass "workload" type tests.
- I $P(^LAB(60,LA760,0),"^",4)="WK" Q
- ;
- ; Test already listed, check if urgency different.
- I $D(LA7TREE(LA760)) D Q
- . S LA7PCNT=0
- . ; Convert expanded panel test urgency to regular urgency
- . I LA7URG>50 S LA7URG=LA7URG-50
- . ; Found test with higher urgency, save new urgency.
- . I LA7URG<LA7TREE(LA760) S $P(LA7TREE(LA760),"^")=LA7URG
- ;
- ; Not a panel, list test with urgency.
- I '$O(^LAB(60,LA760,2,0)) S LA7TREE(LA760)=LA7URG_"^"_LA7PARNT,LA7PCNT=0 Q
- ;
- N I
- ;
- ; Increment panel and test loop counter.
- S LA7PCNT=$G(LA7PCNT)+1,I=0
- ;
- ; Expand test on panel.
- F S I=$O(^LAB(60,LA760,2,I)) Q:'I D
- . N II
- . ; IEN of test on panel.
- . S II=+$G(^LAB(60,LA760,2,I,0))
- . ; Recursive panel, panel calls itself.
- . I II,II=LA760 Q
- . I II D UNWIND(II,LA7URG,LA7PARNT)
- ;
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRSRVR9A 7070 printed Mar 13, 2025@21:25:26 Page 2
- LRSRVR9A ;BPFO/DTG - LAB NTRT DATA SERVER CONT'D MISSING VUID EXTRACT ;02/10/2016
- +1 ;;5.2;LAB SERVICE;**468**;FEB 10 2016;Build 64
- +2 ;
- +3 ; Based on LRSRVR2,LRSRVR2A
- +4 ;
- UUEN(STR) ; Uuencode string passed in.
- +1 NEW J,K,LEN,LRI,LRX,S,TMP,X,Y
- +2 SET TMP=""
- SET LEN=$LENGTH(STR)
- +3 FOR LRI=1:3:LEN
- Begin DoDot:1
- +4 SET LRX=$EXTRACT(STR,LRI,LRI+2)
- +5 IF $LENGTH(LRX)<3
- SET LRX=LRX_$EXTRACT(" ",1,3-$LENGTH(LRX))
- +6 SET S=$ASCII(LRX,1)*256+$ASCII(LRX,2)*256+$ASCII(LRX,3)
- SET Y=""
- +7 FOR K=0:1:23
- SET Y=(S\(2**K)#2)_Y
- +8 FOR K=1:6:24
- Begin DoDot:2
- +9 SET J=$$DEC^XLFUTL($EXTRACT(Y,K,K+5),2)
- +10 SET TMP=TMP_$CHAR(J+32)
- End DoDot:2
- End DoDot:1
- +11 SET TMP=$CHAR(LEN+32)_TMP
- +12 QUIT TMP
- +13 ;
- TSTTYP(LRX) ; Determine test data type
- +1 NEW LRSTUB,LRTYPE,LRY
- +2 IF LRX=""
- QUIT "|"
- +3 SET LRX=$PIECE(LRX,"(",2)
- +4 ;
- +5 ; Data type
- +6 SET LRTYPE=$$GET1^DID($PIECE(LRX,","),$PIECE(LRX,",",2,99),"","TYPE")
- +7 SET $PIECE(LRSTUB,"|",2)=LRTYPE
- +8 ;
- +9 ; Input transform
- +10 SET LRY=$$GET1^DID($PIECE(LRX,","),$PIECE(LRX,",",2,99),"",$SELECT(LRTYPE="SET":"POINTER",1:"INPUT TRANSFORM"))
- +11 IF LRTYPE="NUMERIC"
- IF LRY["LRNUM"
- Begin DoDot:1
- +12 SET LRX=$PIECE(LRY,"""",2)
- +13 IF LRX?.1"-".N1","1.N1","1N
- SET LRY="Number from "_$PIECE(LRX,",")_" to "_$PIECE(LRX,",",2)_" with "_$PIECE(LRX,",",3)_" decimal"
- End DoDot:1
- +14 SET $PIECE(LRSTUB,"|",1)=LRY
- +15 ; Help prompt
- +16 IF LRTYPE="FREE TEXT"
- Begin DoDot:1
- +17 SET LRY=$$GET1^DID($PIECE(LRX,","),$PIECE(LRX,",",2,99),"","HELP-PROMPT")
- +18 SET $PIECE(LRSTUB,"|",1)=LRY
- End DoDot:1
- +19 QUIT LRSTUB
- +20 ;
- ENCODE(LRSTR) ; Encode a string, keep remainder for next line
- +1 ; Call with LRSTR by reference, Remainder returned in LRSTR
- +2 ;
- +3 SET LRQUIT=0
- SET LRLEN=$LENGTH(LRSTR)
- +4 FOR
- Begin DoDot:1
- +5 IF $LENGTH(LRSTR)<45
- SET LRQUIT=1
- QUIT
- +6 SET LRX=$EXTRACT(LRSTR,1,45)
- +7 SET LRNODE=LRNODE+1
- SET ^TMP($JOB,"LRDATA",LRNODE)=$$UUEN(LRX)
- +8 SET LRSTR=$EXTRACT(LRSTR,46,LRLEN)
- End DoDot:1
- if LRQUIT
- QUIT
- +9 QUIT
- +10 ;
- MAILSEND(LRMSUBJ) ; Send extract back to requestor.
- +1 ;
- +2 NEW LRINSTR,LRTASK,LRTO,XMERR,XMZ
- +3 ;
- +4 ;ZEXCEPT: XQSND
- +5 ;
- +6 SET LRTO(XQSND)=""
- +7 SET LRINSTR("ADDR FLAGS")="R"
- +8 SET LRINSTR("FROM")="LAB_PACKAGE"
- +9 SET LRMSUBJ=$EXTRACT(LRMSUBJ,1,65)
- +10 DO SENDMSG^XMXAPI(.5,LRMSUBJ,"^TMP($J,""LRDATA"")",.LRTO,.LRINSTR,.LRTASK)
- +11 QUIT
- +12 ;
- CLEAN ;
- +1 KILL ^TMP($JOB,"LR60")
- +2 KILL ERR,LA7PCNT,LR60IEN,LR60NM,LR6421,LR64IEN
- +3 KILL LRACTION,LRCC,LRCCNX,LOINCDTA,LRRNLT,LRCDEF,LREND
- +4 KILL LRL,LRLNC,LRLNC80,LRLNCN,LRLNCX,LRNODE,LROUT,LROUT1,LRR64
- +5 KILL LRSPEC,LRSPEC60,LRSPECN,LRSPECTA,LRST,LRSTN,LRSTR,LRSTSYN
- +6 KILL LRTA,LRUNIT,LRX,LRY,X,Y,LRMISP
- +7 KILL LSITE,LRNT,LRNTI,AR,LRBLD,LRSUBSCRIPT,LRTYPER,LRTXT
- +8 KILL LRCDEF,LRCREATE,LREXPY,LRINACT,LRNODE,LRSPECCT,LA7TREE
- +9 DO CLEAN^LRSRVR
- +10 DO ^%ZISC
- +11 QUIT
- +12 ;
- +13 ;
- HDR ; Set the header information
- +1 NEW XA
- SET XA=""
- +2 SET ^TMP($JOB,"LRDATA",1)="Report Generated.......: "_$$FMTE^XLFDT($$NOW^XLFDT)_" at "_LRSTN
- +3 SET ^TMP($JOB,"LRDATA",2)="Report requested.......: "_LRSUB
- +4 SET ^TMP($JOB,"LRDATA",3)="LOINC version..........: "_$$GET1^DID(95.3,"","","PACKAGE REVISION DATA")
- +5 SET ^TMP($JOB,"LRDATA",4)="VistA File version.....: "_$GET(^LAB(95.3,"VR"))
- +6 SET ^TMP($JOB,"LRDATA",5)="Extract version........: 1.1"
- +7 FOR I=6,12,13
- SET ^TMP($JOB,"LRDATA",I)=" "
- +8 SET ^TMP($JOB,"LRDATA",14)="Legend:"
- +9 SET X="Station #-60 ien-Spec ien-Index|Test Name|Spec|Time Aspect|Units|Mapped LOINC|NLT #|Battery Code|Battery Description|Lab Section|Subscript|Comment|Data Type|Reference low|Reference high|Therapeutic low|Therapeutic high|"
- +10 SET ^TMP($JOB,"LRDATA",15)=X
- SET XA=$LENGTH(X)
- +11 ; S ^TMP($J,"LRDATA",17)=$$REPEAT^XLFSTR("-",$L(X))
- +12 ;S X=" 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |"
- +13 ;S ^TMP($J,"LRDATA",16)=X
- +14 SET X="Use Ref Lab|Site Comment|Test Synonyms|Test Type |MLTF 66.3 IEN|MLTF LOINC|MLTF Name|MLTF Alt Name|Default LOINC|Submitted to NTRT|Specimen Create Date|Extract Ver|"
- +15 ;S X=" 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |"
- +16 IF LRMISP=1
- Begin DoDot:1
- +17 SET X="Use Ref Lab|Site Comment|Test Synonyms|Test Type |MLTF 66.3 IEN|MLTF LOINC|MLTF Name|MLTF Alt Name|Default LOINC|Submitted to NTRT|Specimen Create Date| MISSING SPECIMENS|Extract Ver|"
- +18 ;S X=" 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |"
- End DoDot:1
- +19 SET ^TMP($JOB,"LRDATA",16)=X
- SET XA=XA+$LENGTH(X)
- +20 ;S ^TMP($J,"LRDATA",18)=X
- +21 ;S ^TMP($J,"LRDATA",18)=$$REPEAT^XLFSTR("-",$L(X))
- +22 IF XA<245
- SET ^TMP($JOB,"LRDATA",17)=$$REPEAT^XLFSTR("-",XA)
- +23 IF XA>245
- SET X=245
- SET ^TMP($JOB,"LRDATA",17)=$$REPEAT^XLFSTR("-",X)
- +24 SET ^TMP($JOB,"LRDATA",18)=" "
- +25 IF 'LRTXT
- Begin DoDot:1
- +26 SET LRFILENM=$TRANSLATE(LRSTN," ","_")_"-"_LRSUB_"-"_$PIECE($$FMTHL7^XLFDT($$NOW^XLFDT),"-")_".TXT"
- +27 SET ^TMP($JOB,"LRDATA",12)="Attached LMOF file.....: "_LRFILENM
- +28 SET ^TMP($JOB,"LRDATA",19)=$$UUBEGFN(LRFILENM)
- End DoDot:1
- +29 KILL XA
- +30 QUIT
- +31 ;
- +32 ;
- SITENOTE ; Build site's test notes for first record
- +1 ;
- +2 NEW LRI,LRSTNDT
- +3 KILL LRSTNOTE
- +4 SET (LRSTNOTE,LRI)=0
- +5 FOR
- SET LRI=$ORDER(^LAB(60,LR60IEN,11,LRI))
- if 'LRI
- QUIT
- Begin DoDot:1
- +6 SET LRSTNDT=$PIECE($GET(^LAB(60,LR60IEN,11,LRI,0)),"^")
- +7 MERGE LRSTNOTE(LRI)=^LAB(60,LR60IEN,11,LRI,1)
- +8 SET LRSTNOTE(LRI,1,0)=$SELECT(LRI>1:"^",1:"")_$$FMTE^XLFDT(LRSTNDT,"1M")_": "_$GET(LRSTNOTE(LRI,1,0))
- +9 KILL LRSTNOTE(LRI,0)
- End DoDot:1
- +10 IF $DATA(LRSTNOTE)
- SET LRSTNOTE=1
- +11 QUIT
- +12 ;
- +13 ;
- SUFFIX ; If Result NLT does not have a suffix, i.e. it has .0000 then check for suffixed NLT codes which can also be used
- +1 NEW LR64,LRRNLT,LRROOT,LRX,LRY
- +2 SET LRRNLT=$$GET1^DIQ(64,LRR64_",",1,"E")
- +3 SET LRROOT="^LAM(""E"","_LRRNLT_")"
- +4 FOR
- SET LRROOT=$QUERY(@LRROOT)
- if LRROOT=""
- QUIT
- if $PIECE($QSUBSCRIPT(LRROOT,2),".")'=$PIECE(LRRNLT,".")
- QUIT
- Begin DoDot:1
- +5 SET LR64=$QSUBSCRIPT(LRROOT,3)
- +6 IF $GET(^LAM(LR64,5,LRSPEC60,0))
- SET LRSPEC(LRSPEC60_"-"_LR64)=LRSPEC60_U_LRSPECN_U_LRSPECTA_U_LRUNIT_U_LR64
- End DoDot:1
- +7 QUIT
- +8 ;
- +9 ;
- UUBEGFN(LRFILENM) ; Construct uuencode "begin" coding
- +1 ; Call with LRFILENM = name of uuencoded file attachment
- +2 ;
- +3 ; Returns LRX = string with "begin..."_file name
- +4 ;
- +5 NEW LRX
- +6 SET LRX="begin 644 "_LRFILENM
- +7 QUIT LRX
- +8 ;
- +9 ; this is from LA7ADL1
- UNWIND(LA760,LA7URG,LA7PARNT) ; Unwind profile - set tests into array LA7TREE with urgency.
- +1 ;
- +2 ; Call with LA760 = file #60 ien
- +3 ; LA7URG = file #62.05 ien
- +4 ; LA7PARNT = file #60 ien - ordered parent (panel)
- +5 ;
- +6 ; Recursive panel, caught in a loop.
- +7 IF $GET(LA7PCNT)>50
- QUIT
- +8 ;
- +9 ; If no urgency, set to routine (9), default value.
- +10 IF 'LA7URG
- SET LA7URG=9
- +11 ;
- +12 ; Test does not exist in file 60.
- +13 IF '$DATA(^LAB(60,LA760,0))
- QUIT
- +14 ;
- +15 ; Bypass "workload" type tests.
- +16 IF $PIECE(^LAB(60,LA760,0),"^",4)="WK"
- QUIT
- +17 ;
- +18 ; Test already listed, check if urgency different.
- +19 IF $DATA(LA7TREE(LA760))
- Begin DoDot:1
- +20 SET LA7PCNT=0
- +21 ; Convert expanded panel test urgency to regular urgency
- +22 IF LA7URG>50
- SET LA7URG=LA7URG-50
- +23 ; Found test with higher urgency, save new urgency.
- +24 IF LA7URG<LA7TREE(LA760)
- SET $PIECE(LA7TREE(LA760),"^")=LA7URG
- End DoDot:1
- QUIT
- +25 ;
- +26 ; Not a panel, list test with urgency.
- +27 IF '$ORDER(^LAB(60,LA760,2,0))
- SET LA7TREE(LA760)=LA7URG_"^"_LA7PARNT
- SET LA7PCNT=0
- QUIT
- +28 ;
- +29 NEW I
- +30 ;
- +31 ; Increment panel and test loop counter.
- +32 SET LA7PCNT=$GET(LA7PCNT)+1
- SET I=0
- +33 ;
- +34 ; Expand test on panel.
- +35 FOR
- SET I=$ORDER(^LAB(60,LA760,2,I))
- if 'I
- QUIT
- Begin DoDot:1
- +36 NEW II
- +37 ; IEN of test on panel.
- +38 SET II=+$GET(^LAB(60,LA760,2,I,0))
- +39 ; Recursive panel, panel calls itself.
- +40 IF II
- IF II=LA760
- QUIT
- +41 IF II
- DO UNWIND(II,LA7URG,LA7PARNT)
- End DoDot:1
- +42 ;
- +43 QUIT