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

GMTSLRA.m

Go to the documentation of this file.
  1. GMTSLRA ; SLC/JER,KER - Surgical Pathology Component ; 09/21/2001
  1. ;;2.7;Health Summary;**28,47**;Oct 20, 1995
  1. ;
  1. ; External References
  1. ; DBIA 10035 ^DPT( field 63 Read w/Fileman
  1. ; DBIA 2056 $$GET1^DIQ (file 2)
  1. ;
  1. MAIN ; Surgical Pathology
  1. N GMI,MAX,LRDFN,IX,X,SP,IX0
  1. S LRDFN=+($$GET1^DIQ(2,(+($G(DFN))_","),63,"I")) Q:+LRDFN=0
  1. S MAX=$S(+($G(GMTSNDM))>0:+($G(GMTSNDM)),1:999) D ^GMTSLRAE
  1. I '$D(^TMP("LRA",$J)) Q
  1. S IX=0 F GMI=1:1:MAX S IX=$O(^TMP("LRA",$J,IX)) Q:$D(GMTSQIT) Q:IX'>0 D Q:$D(GMTSQIT)
  1. . D:GMI>1 CKP^GMTSUP Q:$D(GMTSQIT) W:GMI>1&('GMTSNPG) ! D
  1. . . S IX0="" F S IX0=$O(^TMP("LRA",$J,IX,IX0)) Q:IX0=""!(IX0?1A) D
  1. . . . S X=^TMP("LRA",$J,IX,IX0)
  1. . . . S SP=$G(^TMP("LRA",$J,IX,"SPP")) D WRT
  1. . . I $D(^TMP("LRA",$J,IX,1.2)) D SUPPR
  1. K ^TMP("LRA",$J)
  1. Q
  1. WRT ; Writes Surgical Pathology Record
  1. N IX1,GMJ
  1. I IX0=0 D Q
  1. . D CKP^GMTSUP Q:$D(GMTSQIT)
  1. . W ?8,"Collected:",?19,$P(X,U),?31,"Acc:",?36,$P(X,U,2),!
  1. . Q:'$L($G(SP)) D CKP^GMTSUP Q:$D(GMTSQIT)
  1. . W "Surgeon/Physician:",?19,$G(SP),!
  1. I IX0=.1 D WRTSPC Q
  1. I $S(IX0=.2:1,IX0=1:1,IX0=1.1:1,IX0=1.3:1,IX0=1.4:1,1:0) D TEXT Q
  1. I IX0=2 S IX1=0 F S IX1=$O(^TMP("LRA",$J,IX,IX0,IX1)) Q:IX1'>0 S X=^(IX1) D WRTTM,WRTP
  1. Q
  1. WRTSPC ; Writes Specimen field entries
  1. N GMS
  1. D CKP^GMTSUP Q:$D(GMTSQIT) W ?9,"Specimen:"
  1. S GMS=0
  1. F S GMS=$O(^TMP("LRA",$J,IX,.1,GMS)) Q:GMS'>0 D CKP^GMTSUP Q:$D(GMTSQIT) W ?19,^TMP("LRA",$J,IX,.1,GMS),!
  1. Q
  1. TEXT ; Handles GROSS DESCRIPTION & MICROSCOPIC EXAM/DX Print
  1. N LN,GMTSLN,GMTSLNI
  1. D CKP^GMTSUP Q:$D(GMTSQIT) W ?(17-$L(X)),X_":",!
  1. S LN=0
  1. F S LN=$O(^TMP("LRA",$J,IX,IX0,LN)) Q:LN'>0 S GMTSLN=^(LN) D
  1. .I $L(GMTSLN)>78 S GMTSLN=$$WRAP^GMTSORC(GMTSLN,78)
  1. .D CKP^GMTSUP Q:$D(GMTSQIT) W $P(GMTSLN,"|"),! D
  1. ..F GMTSLNI=2:1:$L(GMTSLN,"|") D CKP^GMTSUP Q:$D(GMTSQIT) W:$P(GMTSLN,"|",GMTSLNI)]"" $P(GMTSLN,"|",GMTSLNI),!
  1. Q
  1. SUPPR ; Writes Supplementary Report
  1. N GMTSR,SRDATE,GMTSRL,GMTSRLI,X
  1. S IX1=0
  1. F S IX1=$O(^TMP("LRA",$J,IX,1.2,IX1)) Q:IX1'>0 D CKP^GMTSUP Q:$D(GMTSQIT) S SRDATE=^TMP("LRA",$J,IX,1.2,IX1,0) S X=SRDATE D REGDTM4^GMTSU W "Supplementary Rpt: ",X,! D
  1. .S GMTSR=0
  1. .F S GMTSR=$O(^TMP("LRA",$J,IX,1.2,IX1,GMTSR)) Q:GMTSR'>0 S GMTSRL=^(GMTSR) D
  1. ..I $L(GMTSRL)>78 S GMTSRL=$$WRAP^GMTSORC(GMTSRL,78)
  1. ..W $P(GMTSRL,"|"),! D
  1. ...F GMTSRLI=2:1:$L(GMTSRL,"|") D CKP^GMTSUP Q:$D(GMTSQIT) W:$P(GMTSRL,"|",GMTSRLI)]"" $P(GMTSRL,"|",GMTSRLI),!
  1. Q
  1. WRTTM ; Writes Topography and Morphology
  1. N GMT,GMD,GME
  1. D CKP^GMTSUP Q:$D(GMTSQIT) W ?7,"Topography:",?19,$P(X,U),!
  1. I $O(^TMP("LRA",$J,IX,IX0,IX1,1,0)) D CKP^GMTSUP Q:$D(GMTSQIT)
  1. S GMD=0
  1. F S GMD=$O(^TMP("LRA",$J,IX,IX0,IX1,1,GMD)) Q:GMD'>0 W:GMD=1 ?9,"Disease:" W ?21,^TMP("LRA",$J,IX,IX0,IX1,1,GMD),! Q
  1. I $O(^TMP("LRA",$J,IX,IX0,IX1,2,0)) D CKP^GMTSUP Q:$D(GMTSQIT)
  1. S GMT=0
  1. F S GMT=$O(^TMP("LRA",$J,IX,IX0,IX1,2,GMT)) Q:GMT'>0 D
  1. .I GMT'=4 D CKP^GMTSUP Q:$D(GMTSQIT)
  1. .I W ?7,"Morphology:",?21,^TMP("LRA",$J,IX,IX0,IX1,2,GMT),! D Q
  1. ..S GME=0
  1. ..F S GME=$O(^TMP("LRA",$J,IX,IX0,IX1,2,GMT,1,GME)) Q:GME'>0 D
  1. ...D CKP^GMTSUP Q:$D(GMTSQIT) W:GME=1 ?9,"Etiology:" W ?23,^TMP("LRA",$J,IX,IX0,IX1,2,GMT,1,GME),! Q
  1. Q
  1. WRTP ; Writes Procedure field
  1. N GMQ,GMK
  1. I $O(^TMP("LRA",$J,IX,IX0,IX1,4,0)) D CKP^GMTSUP Q:$D(GMTSQIT) W ?7,"Procedures:"
  1. S GMT=0
  1. F S GMT=$O(^TMP("LRA",$J,IX,IX0,IX1,4,GMT)) Q:GMT'>0 D
  1. .S GMQ=$P(^TMP("LRA",$J,IX,IX0,IX1,4,GMT),U)
  1. .I $L(GMQ)>56 S GMQ=$$WRAP^GMTSORC(GMQ,56)
  1. .D CKP^GMTSUP Q:$D(GMTSQIT) W ?21,$P(GMQ,"|"),! D
  1. ..F GMK=2:1:$L(GMQ,"|") D CKP^GMTSUP Q:$D(GMTSQIT) W:$P(GMQ,"|",GMK)]"" ?23,$P(GMQ,"|",GMK),!
  1. Q