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

TIUPNCV3.m

Go to the documentation of this file.
  1. TIUPNCV3 ;SLC/DJP ;PNs ==> TIU cnv rtns ;5-7-97
  1. ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
  1. ERRORLOG ;Captures information on records that are NOT converted.
  1. S BADREC=1 I '$D(ERRCTR) S ERRCTR=0
  1. S ERRCTR=ERRCTR+1 S $P(^TIU(8925.97,1,0),U,7)=ERRCTR
  1. S ^GMR(121,"ERROR",GMRPIFN)=PROBLEM
  1. Q
  1. ;
  1. TITLE ;Defines variables required for Document Definition look-up
  1. ; PNT=^GMR(121.2,TIU("TITLE")),0)
  1. ; (1)=TITLE * (2)=TYPE * (3) TYPE NARRATIVE
  1. ; (4)=INACTIVE * (5) TIU TITLE IEN
  1. S PNT=$G(^GMR(121.2,TIU("TITLE"),0))
  1. I PNT="" S PROBLEM="Progress Note - IFN "_GMRPIFN_": TITLE not defined in ^GMR(121.2 - (broken pointer)." D ERRORLOG K PROBLEM Q
  1. S PNT(5)=$P($G(^GMR(121.2,TIU("TITLE"),1)),U,3)
  1. I PNT(5)'>0 S PROBLEM="Progress Note IFN "_GMRPIFN_": TITLE not defined in ^TIU(8925.1." D ERRORLOG K PROBLEM Q
  1. S PNT(1)=$P($G(PNT),U,1),PNT(2)=$P($G(PNT),U,2),PNT(4)=$P($G(PNT),U,4)
  1. I PNT(1)=""!PNT(2)="" S PROBLEM="Progress Note - IFN "_GMRPIFN_": Incomplete TITLE information in ^GMR(121.2." D ERRORLOG K PROBLEM Q
  1. S X=PNT(2),DIC=121.1,DIC(0)="X,Z" D ^DIC K DIC
  1. I +Y<0 S PROBLEM="Progress Note IFN "_GMRPIFN_": TYPE not defined in ^GMR(121.1 (broken pointer)." D ERRORLOG K PROBLEM Q
  1. S PNT(3)=$P(Y,U,2)
  1. I $P($G(^TIU(8925.1,PNT(5),0)),U,4)'="DOC" S PROBLEM="Progress Note Title: "_PNT(3)_" not defined correctly in ^TIU(8925.1." D ERRORLOG K PROBLEM Q
  1. I PNT(4)'="" S TIU(1701)=PNT(1),X=PNT(2) D TITLESET Q
  1. D TITLESET
  1. Q
  1. ;
  1. TITLESET ;Sets pointers for Document Definition
  1. ; .01 DOCUMENT TYPE * .04 PARENT DOCUMENT TYPE
  1. ; 1506 COSIGNATURE REQUIRED * 1701 SUBJECT (description)
  1. S TIU(.01)=PNT(5),TIUNM=$P(^TIU(8925.1,PNT(5),0),U,1)
  1. S TIU(.04)="",TIU(.04)=$O(^TIU(8925.1,"AD",TIU(.01),TIU(.04)))
  1. K X,Y,DIC
  1. Q
  1. ;
  1. STATUS(TIUSTAT) ;Returns DOCUMENT STATUS pointer
  1. N DIC,X,Y
  1. I TIU("MHCONV")="Y" S TIUSTAT="COMPLETED"
  1. S X=TIUSTAT,DIC="^TIU(8925.6,",DIC(0)="X,Z" D ^DIC Q:+Y<1
  1. Q $P(Y,U,1)
  1. ;
  1. DXLS(TIUDX) ;Resolves variable DXLS ptr from Final Discharge Note
  1. S P5=""
  1. S P1=$P(TIUDX,";",2) ; Global reference
  1. S P2=$P(TIUDX,";",1) ; IEN
  1. S P3="^"_P1_P2_","_0_")" ;^(0) reference
  1. S P4="^"_P1_P2_",""D"")" ;^("D") reference
  1. I P1["ICD9" D Q P5
  1. .S P5=$P(@P3,U,3)_" ("_$P(@P3,U)_")"
  1. .I P1["YSD" D Q P5
  1. ..S P4=$G(@P4) Q:P4']""
  1. ..S P5=P4
  1. ..S P3=$P($G(@P3),U)
  1. ..S:P3]"" P5=P5_" ("_P3_")"
  1. .I P1["DIC" D
  1. ..S P5=$P(@P3,U)_" ("_$P(@P3,U,2)_")"
  1. Q P5
  1. ;
  1. BEDSEC(TIUBS) ;Resolves D/C Bedsection ptr from the Final Discharge Note
  1. N Y
  1. S Y=$P(^DIC(42,TIUBS,0),U,1)
  1. Q Y
  1. ;
  1. ROLLEM ;Rolls back ^GMR(121 entries in ^TIU(8925
  1. K DIR W @IOF W !!?16,"****** ROLL BACK ******"
  1. W !!?5,"This option will delete all progress notes entered"
  1. W !?5,"into ^TIU(8925 from the GMRPN/TIU Conversion. The"
  1. W !?5,"option uses ^DIK to roll back the file. Run time is"
  1. W !?5,"dependent upon the number of entries made during the"
  1. W !?5,"conversion."
  1. W !! S DIR(0)="Y",DIR("A")="Do you want to continue",DIR("B")="YES"
  1. S DIR("?")="^D HELP10^TIUPNCV3" D ^DIR I $D(DIRUT)!(Y=0) Q
  1. W !!?5,"BEGINNING ROLL BACK...",!
  1. S TST=$P($G(^TIU(8925.97,1,2)),U,1),LST=$P($G(^TIU(8925.97,1,2)),U,2)
  1. S DIK="^TIU(8925,"
  1. Q:TST!LST=""
  1. F DA=TST:1:LST D:$P($G(^TIU(8925,DA,13)),U,3)="C" ^DIK
  1. W !!,"ROLLBACK COMPLETED",!
  1. K TST,DIK,LST,DA,TIUDIV
  1. Q
  1. ;
  1. HELP10 ;Help text for ROLLBACK prompt
  1. W !!?5,"Press <ret> to continue with roll back of Progress Notes"
  1. W !?5,"entered during the conversion. The rollback will begin and"
  1. W !?5,"based on rollback fields in ^TIU(8925.97, TIU Conversions."
  1. W !!?5,"Enter NO or ""^"" to stop this option."
  1. Q
  1. ;