- ISIJUTL1 ; ISI/JHC - ISI Rad subroutines ; 10/17/2022
- ;;1.1;ESL ISI IMAGING;**99,106,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."
- ;
- Q
- ;
- ERR ;
- S @MAGRY@(0)="0^4~ERROR "_$$EC^%ZOSV
- D @^%ZOSF("ERRTN")
- Q:$Q 1 Q
- ;
- ;
- ASIGME(ASIGNEE,LIST,STATUS) ; ISI calc truth value re assignment status vs user type
- ; Called by: Exam Open code to control locking of an exam,
- ; Exam List compile to control display of an exam
- ; Input:
- ; ASIGNEE--DUZ of assignee, required
- ; LIST--optional, = List # for List compile to filter appropriately for Lists
- ; STATUS--optional, exam Status code, used for List compile ...
- ; Returns:
- ; TRUE--ok for this user to lock an exam, or see exam list entry, acc to calling routine
- ; FALSE--otherwise; see logic below
- N ASIGMINE,RESULT,RADTECH
- S LIST=$G(LIST,0),STATUS=$G(STATUS,0)
- S RESULT=1 ; default = allow LIST display; allow locking
- I ASIGNEE D ; only matters if case is assigned
- . S ASIGMINE=ASIGNEE=DUZ
- . I ASIGMINE Q ; OK if it is my assignment, for any purpose
- . I 'LIST S RESULT=$S(+MAGJOB("USER",1):0,1:1) Q ; Lock request: prevent for rist, else OK
- . I $$ASSTATUS(STATUS) Q ; exam list checks below only matter for certain status values
- . S RADTECH=$D(^VA(200,"ARC","T",+DUZ))
- . I +MAGJOB("USER",1)!RADTECH D ;
- . . ; line below: user has key to view "master" lists of all assigned exams
- . . I $D(MAGJOB("KEYS","ISIJ ASSIGN EXAMS-VIEW ALL")),((LIST=9802)!(LIST=9803)) Q
- . . I RADTECH,'((LIST=9800)!(LIST=9801)) Q:'+MAGJOB("USER",1) ; tech--filter out the "My Assigned"; other lists allow
- . . S RESULT=0 ; block display or lock of another's assigned exam
- Q:$Q RESULT Q
- ;
- ASSTATUS(STS) ; return False if status is Waiting or Examined
- ; exams in these statuses are of interest regarding locks & list display
- N OK,X
- S OK=1
- I STS]"" D
- . S X=^RA(72,STS,0)
- . I $P(X,U,3)=1 S OK=0 Q ; Waiting
- . I $P(X,U,9)="R" S OK=0 Q ; Ready for Interp ; P106
- . I $P(X,U,9)="E" S OK=0 Q ; Examined
- Q:$Q OK Q
- ;
- ASENA(MAGRY) ; RPC: ISIJ ASSIGN ENABLE
- ; Deprecated functionality--reply will disable function in client
- ; RETURN: 0 ^ Menu
- ; Menu -- Hard code to nil
- ;
- N $ETRAP,$ESTACK S $ETRAP="D ERR^ISIJUTL1"
- N CT,MAGLST,REPLY
- S DIQUIET=1 D DT^DICRW
- S CT=0,MENU="",MAGLST="ISIASSIGNENA"
- K MAGRY S MAGRY=$NA(^TMP($J,MAGLST)) K @MAGRY ; assign MAGRY value
- S REPLY=CT_U_MENU
- S @MAGRY@(0)=REPLY
- Q
- ;
- QRYSTAT ; Inquire into ISIJ DYNAMIC QUERY STATS file entries
- N MAGIEN,IENCT,TEMP
- W !!?5,"NOTE: the output for this report works best on a 132 column display."
- QRYSLOOP S IENCT=0,TEMP="ISIJTEMP" K ^TMP($J,TEMP)
- W !!?15,"Display ISI Rad Query Statistics",!!
- S DIC=23450,DIC(0)="AMEQ"
- F D Q:Y=-1
- . D ^DIC I Y=-1 Q
- . S DA=+Y,IENCT=IENCT+1,^TMP($J,TEMP,IENCT,DA)=""
- W !
- I 'IENCT K DIC,DA,DR W ! Q
- S L(0)=2,BY(0)="^TMP($J,TEMP"
- S FLDS="[ISIJ QUERY STATS]"
- D EN1^DIP W !
- G QRYSLOOP
- Q
- ;
- END Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HISIJUTL1 3493 printed Feb 19, 2025@00:10:43 Page 2
- ISIJUTL1 ; ISI/JHC - ISI Rad subroutines ; 10/17/2022
- +1 ;;1.1;ESL ISI IMAGING;**99,106,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 SET @MAGRY@(0)="0^4~ERROR "_$$EC^%ZOSV
- +2 DO @^%ZOSF("ERRTN")
- +3 if $QUIT
- QUIT 1
- QUIT
- +4 ;
- +5 ;
- ASIGME(ASIGNEE,LIST,STATUS) ; ISI calc truth value re assignment status vs user type
- +1 ; Called by: Exam Open code to control locking of an exam,
- +2 ; Exam List compile to control display of an exam
- +3 ; Input:
- +4 ; ASIGNEE--DUZ of assignee, required
- +5 ; LIST--optional, = List # for List compile to filter appropriately for Lists
- +6 ; STATUS--optional, exam Status code, used for List compile ...
- +7 ; Returns:
- +8 ; TRUE--ok for this user to lock an exam, or see exam list entry, acc to calling routine
- +9 ; FALSE--otherwise; see logic below
- +10 NEW ASIGMINE,RESULT,RADTECH
- +11 SET LIST=$GET(LIST,0)
- SET STATUS=$GET(STATUS,0)
- +12 ; default = allow LIST display; allow locking
- SET RESULT=1
- +13 ; only matters if case is assigned
- IF ASIGNEE
- Begin DoDot:1
- +14 SET ASIGMINE=ASIGNEE=DUZ
- +15 ; OK if it is my assignment, for any purpose
- IF ASIGMINE
- QUIT
- +16 ; Lock request: prevent for rist, else OK
- IF 'LIST
- SET RESULT=$SELECT(+MAGJOB("USER",1):0,1:1)
- QUIT
- +17 ; exam list checks below only matter for certain status values
- IF $$ASSTATUS(STATUS)
- QUIT
- +18 SET RADTECH=$DATA(^VA(200,"ARC","T",+DUZ))
- +19 ;
- IF +MAGJOB("USER",1)!RADTECH
- Begin DoDot:2
- +20 ; line below: user has key to view "master" lists of all assigned exams
- +21 IF $DATA(MAGJOB("KEYS","ISIJ ASSIGN EXAMS-VIEW ALL"))
- IF ((LIST=9802)!(LIST=9803))
- QUIT
- +22 ; tech--filter out the "My Assigned"; other lists allow
- IF RADTECH
- IF '((LIST=9800)!(LIST=9801))
- if '+MAGJOB("USER",1)
- QUIT
- +23 ; block display or lock of another's assigned exam
- SET RESULT=0
- End DoDot:2
- End DoDot:1
- +24 if $QUIT
- QUIT RESULT
- QUIT
- +25 ;
- ASSTATUS(STS) ; return False if status is Waiting or Examined
- +1 ; exams in these statuses are of interest regarding locks & list display
- +2 NEW OK,X
- +3 SET OK=1
- +4 IF STS]""
- Begin DoDot:1
- +5 SET X=^RA(72,STS,0)
- +6 ; Waiting
- IF $PIECE(X,U,3)=1
- SET OK=0
- QUIT
- +7 ; Ready for Interp ; P106
- IF $PIECE(X,U,9)="R"
- SET OK=0
- QUIT
- +8 ; Examined
- IF $PIECE(X,U,9)="E"
- SET OK=0
- QUIT
- End DoDot:1
- +9 if $QUIT
- QUIT OK
- QUIT
- +10 ;
- ASENA(MAGRY) ; RPC: ISIJ ASSIGN ENABLE
- +1 ; Deprecated functionality--reply will disable function in client
- +2 ; RETURN: 0 ^ Menu
- +3 ; Menu -- Hard code to nil
- +4 ;
- +5 NEW $ETRAP,$ESTACK
- SET $ETRAP="D ERR^ISIJUTL1"
- +6 NEW CT,MAGLST,REPLY
- +7 SET DIQUIET=1
- DO DT^DICRW
- +8 SET CT=0
- SET MENU=""
- SET MAGLST="ISIASSIGNENA"
- +9 ; assign MAGRY value
- KILL MAGRY
- SET MAGRY=$NAME(^TMP($JOB,MAGLST))
- KILL @MAGRY
- +10 SET REPLY=CT_U_MENU
- +11 SET @MAGRY@(0)=REPLY
- +12 QUIT
- +13 ;
- QRYSTAT ; Inquire into ISIJ DYNAMIC QUERY STATS file entries
- +1 NEW MAGIEN,IENCT,TEMP
- +2 WRITE !!?5,"NOTE: the output for this report works best on a 132 column display."
- QRYSLOOP SET IENCT=0
- SET TEMP="ISIJTEMP"
- KILL ^TMP($JOB,TEMP)
- +1 WRITE !!?15,"Display ISI Rad Query Statistics",!!
- +2 SET DIC=23450
- SET DIC(0)="AMEQ"
- +3 FOR
- Begin DoDot:1
- +4 DO ^DIC
- IF Y=-1
- QUIT
- +5 SET DA=+Y
- SET IENCT=IENCT+1
- SET ^TMP($JOB,TEMP,IENCT,DA)=""
- End DoDot:1
- if Y=-1
- QUIT
- +6 WRITE !
- +7 IF 'IENCT
- KILL DIC,DA,DR
- WRITE !
- QUIT
- +8 SET L(0)=2
- SET BY(0)="^TMP($J,TEMP"
- +9 SET FLDS="[ISIJ QUERY STATS]"
- +10 DO EN1^DIP
- WRITE !
- +11 GOTO QRYSLOOP
- +12 QUIT
- +13 ;
- END QUIT
- +1 ;