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

BQISNOMS.m

Go to the documentation of this file.
BQISNOMS ;GDHS/HCSD/ALA-SNOMED Subsets ; 19 Dec 2016  1:28 PM
 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
 ;;
 ;
SN ;EP - Count entries in each subset
 K ^XTMP("BQISUBS")
 S ^XTMP("BQISUBS",0)=$$FMADD^XLFDT(DT,10)_U_DT_U_"List of SNOMED Subsets"
 S BQILIST=$NA(^TMP("BQISNLST",$J)) K @BQILIST
 D SUBSET^BSTSAPIA(BQILIST,"36^1")
 S BSN=0
 F  S BSN=$O(@BQILIST@(BSN)) Q:BSN=""  D
 . S BQISBST=$NA(^TMP("BQISNSB",$J)) K @BQISBST
 . S BQISUB=$P(@BQILIST@(BSN),"^",1)
 . S OK=$$SUBLST^BSTSAPI(BQISBST,BQISUB_"^36^1")
 . S BQSN=0,CNT=0
 . F  S BQSN=$O(@BQISBST@(BQSN)) Q:BQSN=""  S CNT=CNT+1
 . S ^XTMP("BQISUBS",BQISUB)=CNT
 Q
 ;
LST(DATA,FAKE) ;EP - BQI GET SNOMED SUBSETS
 NEW UID,II,BSN,BQILIST,NUM
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISNLST",UID))
 K @DATA
 ;
 S II=0
 S HDR="T00075SUBSET^T00010NUM_ITEMS",@DATA@(II)=HDR_$C(30)
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQITAXX D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S BQILIST=$NA(^TMP("BQISLST",UID)) K @BQILIST
 D SUBSET^BSTSAPIA(BQILIST,"36^1")
 S BSN=0
 F  S BSN=$O(@BQILIST@(BSN)) Q:BSN=""  D
 . S NAME=@BQILIST@(BSN)
 . S NUM=$G(^XTMP("BQISUBS",NAME)) I NUM'<5000 Q
 . I NUM="" Q
 . S II=II+1,@DATA@(II)=NAME_U_" ["_NUM_"]"_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
ITM(DATA,BQISUB) ;EP - BQI GET SNOMED SUBSET ITEMS
 NEW UID,II,BQISBST
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQISNLST",UID))
 K @DATA
 ;
 S II=0
 S HDR="T00100ID^T00245NAME"
 S @DATA@(II)=HDR_$C(30)
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQITAXX D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S BQISBST=$NA(^TMP("BQISNSB",UID)) K @BQISBST
 S OK=$$SUBLST^BSTSAPI(BQISBST,BQISUB_"^36^1")
 S BQSN=0,CNT=0
 F  S BQSN=$O(@BQISBST@(BQSN)) Q:BQSN=""  D
 . S CDATA=@BQISBST@(BQSN)
 . S CID=$P(CDATA,"^",1),TXT=$P(CDATA,"^",3)
 . I '$D(^AUPNPROB("ASCT",CID)) S CID="@"_CID
 . S II=II+1,@DATA@(II)=CID_"^"_TXT_$C(30)
 S II=II+1,@DATA@(II)=$C(31)
 Q