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

SCDXUTL2.m

Go to the documentation of this file.
  1. SCDXUTL2 ;ALB/MTC/JLU - PRINT UTILITY ROUTINES;23-MAY-1996 ; 20 Nov 98 12:25 AM
  1. ;;5.3;Scheduling;**44,66,154**;AUG 13, 1993
  1. ;
  1. PAT(D0) ;-- This function is used for the computed field 20.01 in file
  1. ; Transmission OutPatient Encounter file 409.73. For the given
  1. ; entry in 409.73 a determination of the PATIENT involved with
  1. ; the transaction will be determined.
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S X=$P($G(^SD(409.74,$P(SDTOE,U,3),0)),U,2)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S X=$P($G(^SCE($P(SDTOE,U,2),0)),U,2)
  1. E S X=""
  1. I X S X=$P($G(^DPT(X,0)),U)
  1. Q
  1. ;
  1. SSN(D0) ;-- This function is used for the computed field 20.04 in file
  1. ; Transmission OutPatient Encounter file 409.73. For the given
  1. ; entry in 409.73 a determination of the PATIENT SSN involved with
  1. ; the transaction will be determined.
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S X=$P($G(^SD(409.74,$P(SDTOE,U,3),0)),U,2)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S X=$P($G(^SCE($P(SDTOE,U,2),0)),U,2)
  1. E S X=""
  1. I X S X=$P($G(^DPT(X,0)),U,9)
  1. Q
  1. ;
  1. PATDFN(D0) ; This call will return the patient's DFN. It is identical to
  1. ;the PAT call above. The only difference is that it leaves DFN defined
  1. ;to the patient's DFN.
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S DFN=$P($G(^SD(409.74,$P(SDTOE,U,3),0)),U,2)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S DFN=$P($G(^SCE($P(SDTOE,U,2),0)),U,2)
  1. E S DFN=""
  1. Q
  1. ;
  1. ECDT(D0) ;-- This function is used for the computed field 20.02 in file
  1. ; Transmission OutPatient Encounter file 409.73. For the given
  1. ; entry in 409.73 a determination of the ENCOUNTER D/T involved with
  1. ; the transaction will be determined.
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S X=$P($G(^SD(409.74,$P(SDTOE,U,3),0)),U)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S X=$P($G(^SCE($P(SDTOE,U,2),0)),U)
  1. E S X=""
  1. I X S Y=X D DD^%DT S X=$TR(Y,"@"," ")
  1. Q
  1. ;
  1. EDIV(D0,INT) ;-- This function is used for the computed fields 20.05 and 20.06
  1. ; in the Transmission OutPatient Encounter file 409.73. For the
  1. ; given entry in 409.73 a determination of the ENCOUNTER DIVISION
  1. ; involved with the transaction will be determined.
  1. ;
  1. ; Optional input: INT='1' to return internal (ifn) value
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S X=$P($G(^SD(409.74,$P(SDTOE,U,3),1)),U,11)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S X=$P($G(^SCE($P(SDTOE,U,2),0)),U,11)
  1. E S X=""
  1. I '$G(INT),X S X=$P($G(^DG(40.8,+X,0)),U)
  1. Q
  1. ;
  1. ECLOC(D0) ;-- This function is used for the computed field 20.03 in file
  1. ; Transmission OutPatient Encounter file 409.73. For the given
  1. ; entry in 409.73 a determination of the LOCATION involved with
  1. ; the transaction will be determined.
  1. ;
  1. N SDTOE
  1. S SDTOE=$G(^SD(409.73,D0,0))
  1. I $P(SDTOE,U,2)="",$P(SDTOE,U,3) D
  1. . S X=$P($G(^SD(409.74,$P(SDTOE,U,3),1)),U,4)
  1. E I $P(SDTOE,U,2),$P(SDTOE,U,3)="" D
  1. . S X=$P($G(^SCE($P(SDTOE,U,2),0)),U,4)
  1. E S X=""
  1. I X S X=$P($G(^SC(X,0)),U)
  1. Q
  1. ;
  1. XDATE(D0) ;-- This function is used for the computed field 10.01 in file
  1. ; Transmitted OutPatinet Encounter Error file 409.75. For the given
  1. ; entry the x-mit date to NPCDB will be determined.
  1. N SDXDT
  1. S X=""
  1. S SDXDT=$P($G(^SD(409.73,+$P($G(^SD(409.75,D0,0)),U),1)),U)
  1. I SDXDT S Y=SDXDT X ^DD("DD") S X=$TR(Y,"@"," ")
  1. Q