Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BQITXPRT

BQITXPRT.m

Go to the documentation of this file.
BQITXPRT ;GDIT/HS/ALA-Print LOINC Taxonomies ; 14 Jun 2012  7:48 AM
 ;;2.3;ICARE MANAGEMENT SYSTEM;**1,2**;Apr 18, 2012;Build 14
 ;
EN ; EP
 NEW BQIRUN,ZTRTN,J,L,P,POP,Y,ABORT,CT,DTOUT,DIRUT
 S BQIRUN=$$HTE^XLFDT($H,1)
 S ZTDESC="CANES LOINC REPORT",ZTRTN="BEG^BQITXPRT"
 S %ZIS="QM" D ^%ZIS G END:POP
 I '$D(IO("Q")) K ZTDESC G @ZTRTN
 S ZTIO=ION,ZTSAVE("*")=""
 D ^%ZTLOAD
 Q
 ;
BEG ;EP
 S (P,L,ABORT,CT)=0
 U IO D HDR I $G(ABORT)=1 Q
 NEW I,TAX,TREF
 S TREF=$NA(^TMP("BQITAX",$J))
 F I=1:1 S TAX=$P($T(TX+I),";;",2) Q:TAX=""  D  Q:$G(ABORT)=1
 . K @TREF
 . D BLD(TAX,TREF)
 . I L+4>IOSL D HDR Q:$G(ABORT)=1
 . W !,TAX S L=L+1
 . I L+4>IOSL D HDR Q:$G(ABORT)=1
 . S J="" F  S J=$O(@TREF@(J)) Q:J=""  D
 .. W !,?5,$P(@TREF@(J),U,2),?17,$P(@TREF@(J),U,1) S L=L+1
 . W ! S L=L+1
 . I L+4>IOSL D HDR Q:$G(ABORT)=1
 ;
 Q
 ;
END ;
 Q
 ;
HDR ;EP
 K DIR
 S DIR(0)="E"
 I $E(IOST,1,2)="C-",P D ^DIR I $G(DIRUT)=1!($G(DTOUT)=1) S ABORT=1 Q
 I $E(IOST,1,2)="C-"!P W @IOF
 S P=P+1,L=5
 W "CANES LOINC REPORT",?30,"Run Date: ",BQIRUN,?65,"Page ",$J(P,3)
 W !,"Taxonomy Name"
 W !,?5,"LOINC Code",?17,"Lab Test"
 W !,$TR($J(" ",IOM)," ","-"),!
 Q
 ;
BLD(TAX,TARGET) ;EP
 N FILEREF,TAXIEN,TAXREF,ENTRY,VALUE,VAL,END,FILE,INDEX,IEN,NAME
 I TARGET=""!(TAX="") Q
 S TAXIEN=$O(^ATXAX("B",TAX,0)),TAXREF="^ATXAX"
 I TAXIEN="" S TAXIEN=$O(^ATXLAB("B",TAX,0)),TAXREF="^ATXLAB"
 I TAXIEN="" Q
 I TAXREF="^ATXAX" S FILEREF=$$GET1^DIQ(9002226,TAXIEN,.15,"I")
 I TAXREF="^ATXLAB" S FILEREF=$$GET1^DIQ(9002228,TAXIEN,.09,"I")
 ;
 S ENTRY=0
 F  S ENTRY=$O(@TAXREF@(TAXIEN,21,ENTRY)) Q:'ENTRY  D
 .S VALUE=@TAXREF@(TAXIEN,21,ENTRY,0)
 .S VAL=$P(VALUE,U,1),END=$P(VALUE,U,2)
 .; LAB entries use the IEN and only specify one value.
 .I FILEREF=60 D  Q
 ..S NAME=$P($G(^LAB(60,VAL,0)),U,1),@TARGET@(VAL)=NAME
 .; Otherwise, treat all items as ranges (even if there is only one entry).
 .I END="" S END=VAL
 .D
 ..I FILEREF=95.3 D  Q
 ...; The LOINC x-ref in LAB does not use the check digit (piece 2).
 ...S VAL=$P(VAL,"-"),END=$P(END,"-")
 ...S FILE="^LAB(60)",INDEX="AF"
 .; Backup one entry so loop can find all the entries in the range.
 .S VAL=$O(@FILE@(INDEX,VAL),-1)
 .F  S VAL=$O(@FILE@(INDEX,VAL)) Q:VAL=""  Q:$$CHECK^BQITUIX(VAL,END)  D
 ..S IEN=""
 ..F  S IEN=$O(@FILE@(INDEX,VAL,IEN)) Q:IEN=""  D
 ...S NAME=$P($G(@FILE@(IEN,0)),U,1)
 ...S @TARGET@(IEN)=NAME_U_$P(VALUE,U,1)
 Q
 ;
TX ;
 ;;BKMV CD4 ABS LOINC CODES
 ;;BQI C.TRACH SPECIFIC LOINC
 ;;BQI C.TRACH NON-SPECIFIC LOINC
 ;;BQI C.TRACH DNA QUANT LOINC
 ;;SURVEILLANCE RAPID FLU LOINC
 ;;BQI HEP A TESTS LOINC
 ;;BQI HEP B CORE TEST LOINC
 ;;BQI HEP B QUAL TEST LOINC
 ;;BQI HEP B QUANT TEST LOINC
 ;;BQI HEP C QUAL TEST LOINC
 ;;BQI HEP C QUANT TEST LOINC
 ;;BQI ALT/AST/GGT TEST LOINC
 ;;BQI HIB QUAL TEST LOINC
 ;;BQI HIB CULTURE TEST LOINC
 ;;BQI HIB QUANT TEST LOINC
 ;;BQI HIV AB QUAL SCREEN LOINC
 ;;BQI HIV AB QUANT SCREEN LOINC
 ;;BQI HIV QUAL ANTIGEN LOINC
 ;;BQI HIV QUANT ANTIGEN LOINC
 ;;BQI HIV QUAL CONFIRM LOINC
 ;;BQI HIV QUANT CONFIRM LOINC
 ;;BQI HIV ID SPEC CONFIRM LOINC
 ;;BQI HIV QUAL NUC ACID LOINC
 ;;BQI HIV QUANT NUC ACID LOINC
 ;;BQI HIV VIROLOGIC TEST LOINC
 ;;BQI MEASLES QUAL TEST LOINC
 ;;BQI MEASLES ID SPEC TEST LOINC
 ;;BQI MEASLES QUAN TEST LOINC
 ;;BQI MENINGITIS QUAL TEST LOINC
 ;;BQI MENINGITIS ID SPEC LOINC
 ;;BQI MENINGITIS QUAN LOINC
 ;;BQI MYCOBACT TB CULT LOINC
 ;;BQI S PNEUM CULTURE TEST LOINC
 ;;BQI S PNEUM SUSCEPT TEST LOINC
 ;;BQI SYPHILIS TP-AB LOINC
 ;;BQI SYPHILIS REAGIN LOINC
 ;;BQI TB SPECIFIC AFB TEST LOINC
 ;;BQI TB NONSPEC AFB TEST LOINC
 ;;BQI TB GAMMA REL QUAL TEST LNC
 ;;BQI TB RNA DNA QUAL TEST LOINC
 ;;BQI TB RNA DNA QUANT TEST LNC
 ;;BQI PPD DIAMETER LOINC