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

SCCVU.m

Go to the documentation of this file.
  1. SCCVU ;ALB/RMO,TMP - Encounter Conversion Utilities; [ 08/02/95 10:15 AM ]
  1. ;;5.3;Scheduling;**211**;Aug 13, 1993
  1. ;
  1. INACT(SCDT) ; -- Check if encounter is "inactive"
  1. ;An inactive encounter is "an encounter which occurred prior
  1. ;to the beginning of the last fiscal year"
  1. ; Input -- SCDT Date
  1. ; Output -- 1=Yes and 0=No
  1. N X,X1,X2
  1. S X1=($E(DT,1,3)-$S($E(DT,4,5)>9:1,1:2))_"1001",X2=-1 D C^%DTC
  1. Q $S(SCDT>X:0,1:1)
  1. ;
  1. CON(SCOE) ; -- Check if encounter has already been converted
  1. ; Input -- SCOE Outpatient encounter IEN
  1. ; Output -- 1=Yes and 0=No
  1. N SCOE0,SCORG,Y
  1. S SCOE0=$G(^SCE(+SCOE,0)),SCORG=+$P(SCOE0,U,8)
  1. I SCORG=1 D ;appointment
  1. . S Y=+$P($G(^DPT(+$P(SCOE0,U,2),"S",+SCOE0,0)),U,23)
  1. I SCORG=2 D ;add/edit
  1. . S Y=+$P($G(^SDV($$SDVIEN(+$P(SCOE0,U,2),+SCOE0),"CS",+$P(SCOE0,U,9),0)),U,9)
  1. I SCORG=3 D ;disposition
  1. . S Y=+$P($G(^DPT(+$P(SCOE0,U,2),"DIS",9999999-SCOE0,0)),U,19)
  1. Q +$G(Y)
  1. ;
  1. PAUSE ;
  1. N DIR
  1. W ! S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR K DIR W !
  1. Q
  1. ;
  1. CCREATE(SCOE) ; Check if encounter or its visit was created by the conversion
  1. ; routines
  1. ; SCOE = ien of the encounter
  1. ; RETURNS:
  1. ; 0 if neither the encounter nor the visit were created by the
  1. ; conversion
  1. ; 1 if the encounter and visit were created by the conversion
  1. ; 2 if the visit only was created by the conversion
  1. ;
  1. N SCCVNV,STAT
  1. ;
  1. S STAT=0
  1. ; In encounter, if conversion completed flag is set, the visit had to
  1. ; have been created by the conversion routines
  1. S SCCVNV=$G(^SCE(SCOE,"CNV"))
  1. I +SCCVNV,$P(SCCVNV,U,4) S STAT=1 ; encounter created and completed
  1. I 'SCCVNV,$P(SCCVNV,U,4) S STAT=2 ; encounter not created, but completed
  1. Q STAT
  1. ;
  1. OK(SCMODE) ; -- is it ok to allow conversion and re-conversion (for testing)
  1. ; input: SCMODE := 1 - interactive | 0 - silent
  1. ;
  1. N SCOK
  1. S SCOK=1 ; <<-- set this flag to 1 allow all functionality, 0 otherwise
  1. IF SCMODE,SCOK=0 D
  1. . W !!,"Conversion functionality is disabled." D PAUSE
  1. Q +$G(SCOK)
  1. ;
  1. SDVIEN(DFN,DATE) ; -- get sdv ien for patient/date-time
  1. Q +$G(^SDV("ADT",+DFN,+$P(DATE,".")))
  1. ;
  1. ENDDATE() ; -- conversion end date
  1. N Y
  1. S Y=$$FMDATE^SCDXUTL()
  1. IF Y S Y=$$FMADD^XLFDT(Y,-1)
  1. IF 'Y S Y=2960930
  1. Q Y
  1. ;