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

VPRSDASR.m

Go to the documentation of this file.
  1. VPRSDASR ;SLC/MKB -- SDA Surgery utilities ;7/29/22 15:29
  1. ;;1.0;VIRTUAL PATIENT RECORD;**30**;Sep 01, 2011;Build 9
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; Supported by DBIA #4750
  1. ;
  1. ; External References DBIA#
  1. ; ------------------- -----
  1. ; ^SRF 5675
  1. ; DIQ 2056
  1. ; SROESTV 3533
  1. ;
  1. ;
  1. QRY ; -- get Surgeries
  1. ; Query called from GET^DDE, returns DLIST(#)=ien
  1. ; Expects context variables DFN, DSTRT, DSTOP, DMAX
  1. ;
  1. N VPRY,VPRN,I,X
  1. D LIST^SROESTV(.VPRY,DFN,DSTRT,DSTOP,DMAX,1)
  1. S VPRN=0 F S VPRN=$O(@VPRY@(VPRN)) Q:VPRN<1 I $G(@VPRY@(VPRN)) D
  1. . S I=+$O(@VPRY@(VPRN,0)) Q:I<1
  1. . S X=$G(@VPRY@(VPRN,I)) ;TIU ien ^ $$RESOLVE^TIUSRVLO data string
  1. . I $P(X,U,7)'="completed",$P(X,U,7)'="amended" Q
  1. . I $P(X,U,2)["Addendum to " Q
  1. . S DLIST(VPRN)=+$G(@VPRY@(VPRN))
  1. K @VPRY
  1. Q
  1. ;
  1. PROC(IEN) ; -- returns primary CPT code^name[^CPT-4] for surgery IEN in
  1. ; VALUE = procedure code^name
  1. ; DATA = Prin Procedure name
  1. N X,SROP,SDT
  1. I $G(VPRSR(+$G(IEN)))="" Q
  1. S X=$P(VPRSR(IEN),U,2),SDT=$P(VPRSR(IEN),U,3)
  1. ; Use CPT ien if defined
  1. S SROP=$$GET1^DIQ(136,IEN_",",.02,"I")
  1. S:'SROP SROP=$P($G(^SRF(IEN,"OP")),U,2)
  1. I SROP S VALUE=$$CPT^VPRSDA(SROP,SDT),DATA=X Q
  1. ; else use procedure name for both pieces
  1. S VALUE=X_U_X
  1. Q
  1. ;
  1. RPTS(IEN) ; -- put Op Reports into DLIST(#) = TIU ien
  1. N I,X S IEN=+$G(IEN)
  1. S I=0 F S I=$O(VPRSR(IEN,I)) Q:I<1 S X=$G(VPRSR(IEN,I)) I X D
  1. . ;X = ien ^ $$RESOLVE^TIUSRVLO data string
  1. . I $P(X,U,7)'="completed",$P(X,U,7)'="amended" Q
  1. . I $P(X,U,2)["Addendum to " Q
  1. . S DLIST(I)=+X_";TIU"
  1. . ; X["OPERATION REPORT"!(X["PROCEDURE REPORT") S SURG("opReport")=X
  1. Q