- ISIRAR02 ; ISI/BT - RAD Report ; 10/17/2022
- ;;1.1;ESL ISI IMAGING;**102,110**;Dec 21, 2022;Build 41
- ;; This routine is the property of ViTel Net, and should not be modified.
- ;; This software is a medical device and is subject to FDA regulation.
- ;; Modifications to this software may only be made under the terms of
- ;; 21CFR820 regulation. 21CFR Subpart A 820.1: "The failure to comply
- ;; with any applicable provision in this part renders a device
- ;; adulterated under section 501(h) of the act. Such a device,
- ;; as well as any person responsible for the failure to comply,
- ;; is subject to regulatory action."
- ;
- QUIT
- ;;
- ERR ;
- N ERR S ERR=$$EC^%ZOSV S @MAGGRY@(0)="0^4~"_ERR
- D @^%ZOSF("ERRTN")
- Q:$Q 1 Q
- ;
- ;
- ; ##### Given RAD Standard Report IEN(s), return the Impression and Report text
- ;
- ; INPUT
- ; ISIIENS = RAD Standard Report IENs ("^" delimited)
- ; Example : 1^2^3
- ; OUTPUT
- ; ISIOUT = Global Array contains all of RAD 'Standard' reports
- ; ISIOUT(0) = Number of Records or 0^Error Message
- ;
- ; Pattern for reply is:
- ; *REPORT Start for REPORT lines
- ; (1:N lines of text follow)
- ; *REPORT_END End
- ; *IMPRESSION Start IMPRESSION lines
- ; (1:N lines of text follow)
- ; *IMPRESSION_END end
- ;
- ;
- GETSTDTX(ISIOUT,ISIIENS) ; RPC [ISI GET RAD STANDARD TEXT]
- N $ETRAP,$ESTACK S $ETRAP="D ERR^ISIRAR02"
- S ISIOUT=$NA(^TMP("ISIRAR02",$J))
- K @ISIOUT
- ;
- ; -- transform IENS ("^" delimited to array)
- N IDX,RAIEN,RAIENS
- F IDX=1:1:$L(ISIIENS,U) S RAIEN=+$P(ISIIENS,U,IDX) S:RAIEN RAIENS(IDX)=RAIEN
- I '$D(RAIENS) S @ISIOUT@(0)=0_U_"At least one Standard Report IEN required" QUIT
- ;
- ; -- compile Impression and Report text sections. Add blank line between reports
- N CNT
- S CNT=0
- N FIL S FIL=74.1
- N RTYPES S RTYPES("I")=300,RTYPES("R")=200
- N IDX,TMPOUT,TYP,WP
- ;
- F TYP="R","I" D
- . S CNT(TYP)=0
- . S IDX=0
- . F S IDX=$O(RAIENS(IDX)) Q:'IDX S RAIEN=RAIENS(IDX) D
- . . K WP S WP=$$GET1^DIQ(74.1,RAIEN,RTYPES(TYP),,"WP")
- . . 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)
- . . S:I CNT(TYP)=CNT(TYP)+1,TMPOUT(TYP,CNT(TYP))=""
- F TYP="R","I" I CNT(TYP) D
- . S CNT=CNT+1,@ISIOUT@(CNT)=$S(TYP="R":"*REPORT",1:"*IMPRESSION")
- . F I=1:1:CNT(TYP) S CNT=CNT+1,@ISIOUT@(CNT)=TMPOUT(TYP,I)
- . S CNT=CNT+1,@ISIOUT@(CNT)=$S(TYP="R":"*REPORT_END",1:"*IMPRESSION_END")
- ;
- I 'CNT S @ISIOUT@(0)=0_U_"No text for the selected Standard Report IEN(s)" QUIT
- S @ISIOUT@(0)=CNT
- QUIT
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HISIRAR02 2573 printed Feb 19, 2025@00:10:47 Page 2
- ISIRAR02 ; ISI/BT - RAD Report ; 10/17/2022
- +1 ;;1.1;ESL ISI IMAGING;**102,110**;Dec 21, 2022;Build 41
- +2 ;; This routine is the property of ViTel Net, and should not be modified.
- +3 ;; This software is a medical device and is subject to FDA regulation.
- +4 ;; Modifications to this software may only be made under the terms of
- +5 ;; 21CFR820 regulation. 21CFR Subpart A 820.1: "The failure to comply
- +6 ;; with any applicable provision in this part renders a device
- +7 ;; adulterated under section 501(h) of the act. Such a device,
- +8 ;; as well as any person responsible for the failure to comply,
- +9 ;; is subject to regulatory action."
- +10 ;
- +11 QUIT
- +12 ;;
- ERR ;
- +1 NEW ERR
- SET ERR=$$EC^%ZOSV
- SET @MAGGRY@(0)="0^4~"_ERR
- +2 DO @^%ZOSF("ERRTN")
- +3 if $QUIT
- QUIT 1
- QUIT
- +4 ;
- +5 ;
- +6 ; ##### Given RAD Standard Report IEN(s), return the Impression and Report text
- +7 ;
- +8 ; INPUT
- +9 ; ISIIENS = RAD Standard Report IENs ("^" delimited)
- +10 ; Example : 1^2^3
- +11 ; OUTPUT
- +12 ; ISIOUT = Global Array contains all of RAD 'Standard' reports
- +13 ; ISIOUT(0) = Number of Records or 0^Error Message
- +14 ;
- +15 ; Pattern for reply is:
- +16 ; *REPORT Start for REPORT lines
- +17 ; (1:N lines of text follow)
- +18 ; *REPORT_END End
- +19 ; *IMPRESSION Start IMPRESSION lines
- +20 ; (1:N lines of text follow)
- +21 ; *IMPRESSION_END end
- +22 ;
- +23 ;
- GETSTDTX(ISIOUT,ISIIENS) ; RPC [ISI GET RAD STANDARD TEXT]
- +1 NEW $ETRAP,$ESTACK
- SET $ETRAP="D ERR^ISIRAR02"
- +2 SET ISIOUT=$NAME(^TMP("ISIRAR02",$JOB))
- +3 KILL @ISIOUT
- +4 ;
- +5 ; -- transform IENS ("^" delimited to array)
- +6 NEW IDX,RAIEN,RAIENS
- +7 FOR IDX=1:1:$LENGTH(ISIIENS,U)
- SET RAIEN=+$PIECE(ISIIENS,U,IDX)
- if RAIEN
- SET RAIENS(IDX)=RAIEN
- +8 IF '$DATA(RAIENS)
- SET @ISIOUT@(0)=0_U_"At least one Standard Report IEN required"
- QUIT
- +9 ;
- +10 ; -- compile Impression and Report text sections. Add blank line between reports
- +11 NEW CNT
- +12 SET CNT=0
- +13 NEW FIL
- SET FIL=74.1
- +14 NEW RTYPES
- SET RTYPES("I")=300
- SET RTYPES("R")=200
- +15 NEW IDX,TMPOUT,TYP,WP
- +16 ;
- +17 FOR TYP="R","I"
- Begin DoDot:1
- +18 SET CNT(TYP)=0
- +19 SET IDX=0
- +20 FOR
- SET IDX=$ORDER(RAIENS(IDX))
- if 'IDX
- QUIT
- SET RAIEN=RAIENS(IDX)
- Begin DoDot:2
- +21 KILL WP
- SET WP=$$GET1^DIQ(74.1,RAIEN,RTYPES(TYP),,"WP")
- +22 SET WP=0
- FOR I=0:1
- SET WP=$ORDER(WP(WP))
- if 'WP
- QUIT
- SET CNT(TYP)=CNT(TYP)+1
- SET TMPOUT(TYP,CNT(TYP))=WP(WP)
- +23 if I
- SET CNT(TYP)=CNT(TYP)+1
- SET TMPOUT(TYP,CNT(TYP))=""
- End DoDot:2
- End DoDot:1
- +24 FOR TYP="R","I"
- IF CNT(TYP)
- Begin DoDot:1
- +25 SET CNT=CNT+1
- SET @ISIOUT@(CNT)=$SELECT(TYP="R":"*REPORT",1:"*IMPRESSION")
- +26 FOR I=1:1:CNT(TYP)
- SET CNT=CNT+1
- SET @ISIOUT@(CNT)=TMPOUT(TYP,I)
- +27 SET CNT=CNT+1
- SET @ISIOUT@(CNT)=$SELECT(TYP="R":"*REPORT_END",1:"*IMPRESSION_END")
- End DoDot:1
- +28 ;
- +29 IF 'CNT
- SET @ISIOUT@(0)=0_U_"No text for the selected Standard Report IEN(s)"
- QUIT
- +30 SET @ISIOUT@(0)=CNT
- +31 QUIT