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

GMTSPXU1.m

Go to the documentation of this file.
  1. GMTSPXU1 ; SLC/SBW - PCE Utilities sub-routines ;21-Jan-2014 14:19;MGH
  1. ;;2.7;Health Summary;**10,37,71,1006**;Oct 20, 1995;Build 3
  1. ;
  1. ; External References
  1. ; DBIA 3390 $$ICDDX^ICDCODE
  1. ; DBIA 3390 $$ICDOP^ICDCODE
  1. ; DBIA 3390 $$ICDD^ICDCODE
  1. ; DBIA 1995 $$CPT^ICPTCOD
  1. ; DBIA 10026 ^DIR
  1. ; DBIA 10011 ^DIWP
  1. ;Patch 1006 added new calls for ICD-10
  1. ;
  1. GETICDDX(GMTSICD,GMTSICF,GMMOD) ; Entry point to get ICD data
  1. N REC,CODE,NAME,DESC,ICDX,ICDI,ICDA
  1. S GMTSICD=$G(GMTSICD),GMTSICF=$G(GMTSICF),GMMOD=$G(GMMOD)
  1. I $$AICD^BHSUTL S ICDX=$$ICDDX^ICDEX(+GMTSICD)
  1. E S ICDX=$$ICDDX^ICDCODE(+GMTSICD)
  1. S REC(80,GMTSICD,.01,"E")=$P(ICDX,"^",2)
  1. S REC(80,GMTSICD,.01,"I")=$P(ICDX,"^",2)
  1. S REC(80,GMTSICD,3,"E")=$P(ICDX,"^",4)
  1. S REC(80,GMTSICD,3,"I")=$P(ICDX,"^",4)
  1. I $$AICD^BHSUTL S ICDI=$$ICDD^ICDEX($P(ICDX,"^",2),"ICDA")
  1. S ICDI=$$ICDD^ICDCODE($P(ICDX,"^",2),"ICDA")
  1. S REC(80,GMTSICD,10,"E")=$G(ICDA(1))
  1. S REC(80,GMTSICD,10,"I")=$G(ICDA(1))
  1. S CODE=REC(80,GMTSICD,.01,"I")
  1. S NAME=REC(80,GMTSICD,3,"E")
  1. S DESC=REC(80,GMTSICD,10,"E")
  1. S:GMTSICF="L"!(GMTSICF="") GMTSICD=CODE_"-"_DESC
  1. S:GMTSICF="S" GMTSICD=CODE_"-"_NAME
  1. S:GMTSICF="C" GMTSICD=CODE
  1. S:GMTSICF="T" GMTSICD=DESC
  1. I $G(GMMOD)]"" S GMMOD=$P(GMMOD,","),GMTSICD=GMMOD_" "_GMTSICD
  1. S:GMTSICF="N" GMTSICD=""
  1. Q
  1. ;
  1. GETICDOP(GMTSICD,GMTSICF,GMMOD) ; Entry point to get ICD0 data
  1. S GMTSICD=$G(GMTSICD),GMTSICF=$G(GMTSICF),GMMOD=$G(GMMOD)
  1. N REC,CODE,NAME,DESC,ICDX,ICDI,ICDA
  1. I $$AICD^BHSUTL S ICDX=$$ICDOP^ICDEX(+GMTSICD)
  1. E S ICDX=$$ICDOP^ICDCODE(+GMTSICD)
  1. S REC(80.1,GMTSICD,.01,"E")=$P(ICDX,"^",2)
  1. S REC(80.1,GMTSICD,.01,"I")=$P(ICDX,"^",2)
  1. S REC(80.1,GMTSICD,4,"E")=$P(ICDX,"^",5)
  1. S REC(80.1,GMTSICD,4,"I")=$P(ICDX,"^",5)
  1. I $$AICD^BHSUTL S ICDI=$$ICDD^ICDEX($P(ICDX,"^",2),"ICDA")
  1. E S ICDI=$$ICDD^ICDCODE($P(ICDX,"^",2),"ICDA")
  1. S REC(80.1,GMTSICD,10,"E")=$G(ICDA(1))
  1. S REC(80.1,GMTSICD,10,"I")=$G(ICDA(1))
  1. S CODE=REC(80.1,GMTSICD,.01,"I")
  1. S NAME=REC(80.1,GMTSICD,4,"E")
  1. S DESC=REC(80.1,GMTSICD,10,"E")
  1. S:GMTSICF="L"!(GMTSICF="") GMTSICD=CODE_"-"_DESC
  1. S:GMTSICF="S" GMTSICD=CODE_"-"_NAME
  1. S:GMTSICF="C" GMTSICD=CODE
  1. S:GMTSICF="T" GMTSICD=DESC
  1. S:GMTSICF="N" GMTSICD=""
  1. Q
  1. ;
  1. GETCPT(GMTSCPT) ; Entry point to get CPT data
  1. N ICPT S GMTSCPT=+($G(GMTSCPT)) Q:GMTSCPT=0 ""
  1. S ICPT=$$CPT^ICPTCOD(+GMTSCPT),ICPT=$P(ICPT,"^",2)_"-"_$P(ICPT,"^",3)
  1. Q ICPT
  1. ;
  1. TXTFMT(GMTSICD,GMTSNARR,GMICL,GMTAB,DIWL,GMTSQTY,GMTSPRIM) ; Formats GMTSICD & GMTSNARR together
  1. I GMTSICD="",GMTSNARR="" Q
  1. N DIWR,DIWF,X
  1. S DIWR=80-(GMICL+GMTAB)
  1. K ^UTILITY($J,"W")
  1. I $G(GMTSICD)]"" S X=GMTSICD S:$G(GMTSNARR)]"" X=X_"; "
  1. I $G(GMTSNARR)]"" S X=$G(X)_GMTSNARR D
  1. . I $G(GMTSPRIM)]"" S X=X_GMTSPRIM
  1. . I $G(GMTSQTY)]"" S X=X_GMTSQTY
  1. . D ^DIWP
  1. I $G(GMTSNARR)']"" D
  1. . I $G(GMTSQTY)]"" S X=$G(X)_GMTSQTY
  1. . I $G(GMTSPRIM)]"" S X=X_GMTSPRIM
  1. . D ^DIWP
  1. Q
  1. ;
  1. ORDERPRO(GMPROV,GMLEN) ; Re-order and format providers for visit
  1. N GMCNT,GMTSP,GMNODE,GMP
  1. S GMCNT=0
  1. F GMP="P","S","Z" S GMTSP="" F S GMTSP=$O(^TMP("PXHSV",$J,GMTSIVD,GMTSVDF,"P",GMP,GMTSP)) Q:GMTSP'>0 D
  1. . S GMNODE=^TMP("PXHSV",$J,GMTSIVD,GMTSVDF,"P",GMP,GMTSP)
  1. . Q:GMNODE']""
  1. . S GMCNT=GMCNT+1
  1. . S GMPROV(GMCNT)=$E($P(GMNODE,U),1,GMLEN-4)_$S(GMP="P"!(GMP="S"):" ("_GMP_")",1:"")
  1. Q
  1. ;
  1. ; The following code segments are called from "ROUTINE" type
  1. ; Menu Options to display items in a file
  1. ;
  1. LM ; Entry Point - for GMTS Measurement Panel
  1. S GMTSLST="^GMT(142.7," G DSPLST
  1. ;
  1. DSPLST ; Common code for Health Summary MNX Lists
  1. K DIR
  1. I '$D(@(GMTSLST_"""B"")")) W !,"NO ",$P(@(GMTSLST_"0)"),U),"S DEFINED.",! Q
  1. W @IOF,!!,"Existing ",$P(@(GMTSLST_"0)"),U),"S:",! S GMTSCNT=""
  1. CONT ; Continue
  1. F S GMTSCNT=$O(@(GMTSLST_"""B"",GMTSCNT)")) Q:GMTSCNT="" D G:1'[$G(Y)&($L($G(Y))) QUIT
  1. . N DIR K Y W !,?5,GMTSCNT I (IOSL-3)<$Y S DIR(0)="E" D
  1. . . D ^DIR W @IOF
  1. K DIR S DIR(0)="E" D ^DIR W !
  1. QUIT ; Quit
  1. K DIR,X,Y,GMTSLST,GMTSCNT
  1. Q