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

ISIRAR02.m

Go to the documentation of this file.
  1. ISIRAR02 ; ISI/BT - RAD Report ; 10/17/2022
  1. ;;1.1;ESL ISI IMAGING;**102,110**;Dec 21, 2022;Build 41
  1. ;; This routine is the property of ViTel Net, and should not be modified.
  1. ;; This software is a medical device and is subject to FDA regulation.
  1. ;; Modifications to this software may only be made under the terms of
  1. ;; 21CFR820 regulation. 21CFR Subpart A 820.1: "The failure to comply
  1. ;; with any applicable provision in this part renders a device
  1. ;; adulterated under section 501(h) of the act. Such a device,
  1. ;; as well as any person responsible for the failure to comply,
  1. ;; is subject to regulatory action."
  1. ;
  1. QUIT
  1. ;;
  1. ERR ;
  1. N ERR S ERR=$$EC^%ZOSV S @MAGGRY@(0)="0^4~"_ERR
  1. D @^%ZOSF("ERRTN")
  1. Q:$Q 1 Q
  1. ;
  1. ;
  1. ; ##### Given RAD Standard Report IEN(s), return the Impression and Report text
  1. ;
  1. ; INPUT
  1. ; ISIIENS = RAD Standard Report IENs ("^" delimited)
  1. ; Example : 1^2^3
  1. ; OUTPUT
  1. ; ISIOUT = Global Array contains all of RAD 'Standard' reports
  1. ; ISIOUT(0) = Number of Records or 0^Error Message
  1. ;
  1. ; Pattern for reply is:
  1. ; *REPORT Start for REPORT lines
  1. ; (1:N lines of text follow)
  1. ; *REPORT_END End
  1. ; *IMPRESSION Start IMPRESSION lines
  1. ; (1:N lines of text follow)
  1. ; *IMPRESSION_END end
  1. ;
  1. ;
  1. GETSTDTX(ISIOUT,ISIIENS) ; RPC [ISI GET RAD STANDARD TEXT]
  1. N $ETRAP,$ESTACK S $ETRAP="D ERR^ISIRAR02"
  1. S ISIOUT=$NA(^TMP("ISIRAR02",$J))
  1. K @ISIOUT
  1. ;
  1. ; -- transform IENS ("^" delimited to array)
  1. N IDX,RAIEN,RAIENS
  1. F IDX=1:1:$L(ISIIENS,U) S RAIEN=+$P(ISIIENS,U,IDX) S:RAIEN RAIENS(IDX)=RAIEN
  1. I '$D(RAIENS) S @ISIOUT@(0)=0_U_"At least one Standard Report IEN required" QUIT
  1. ;
  1. ; -- compile Impression and Report text sections. Add blank line between reports
  1. N CNT
  1. S CNT=0
  1. N FIL S FIL=74.1
  1. N RTYPES S RTYPES("I")=300,RTYPES("R")=200
  1. N IDX,TMPOUT,TYP,WP
  1. ;
  1. F TYP="R","I" D
  1. . S CNT(TYP)=0
  1. . S IDX=0
  1. . F S IDX=$O(RAIENS(IDX)) Q:'IDX S RAIEN=RAIENS(IDX) D
  1. . . K WP S WP=$$GET1^DIQ(74.1,RAIEN,RTYPES(TYP),,"WP")
  1. . . S WP=0 F I=0:1 S WP=$O(WP(WP)) Q:'WP S CNT(TYP)=CNT(TYP)+1,TMPOUT(TYP,CNT(TYP))=WP(WP)
  1. . . S:I CNT(TYP)=CNT(TYP)+1,TMPOUT(TYP,CNT(TYP))=""
  1. F TYP="R","I" I CNT(TYP) D
  1. . S CNT=CNT+1,@ISIOUT@(CNT)=$S(TYP="R":"*REPORT",1:"*IMPRESSION")
  1. . F I=1:1:CNT(TYP) S CNT=CNT+1,@ISIOUT@(CNT)=TMPOUT(TYP,I)
  1. . S CNT=CNT+1,@ISIOUT@(CNT)=$S(TYP="R":"*REPORT_END",1:"*IMPRESSION_END")
  1. ;
  1. I 'CNT S @ISIOUT@(0)=0_U_"No text for the selected Standard Report IEN(s)" QUIT
  1. S @ISIOUT@(0)=CNT
  1. QUIT