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

GMRCSTSU.m

Go to the documentation of this file.
  1. GMRCSTSU ;SLC/DLT - Change status based on current order status ;7/16/98 03:43
  1. ;;3.0;CONSULT/REQUEST TRACKING;**4**;DEC 27, 1997
  1. CPRSUPD(GMRCO) ;Update CPRS order with new status
  1. ;GMRCO=IEN from file 123
  1. Q
  1. N DFN,CTRLCODE,GMRCSTS,GMRCPROV,GMRCORFN,ORSTS,ORIFN
  1. S GMRCSTS=$P(^GMR(123,+GMRCO,0),"^",12),GMRCORFN=$P(^(0),"^",3),DFN=$P(^(0),"^",2),GMRCPROV=$P(^(0),"^",14)
  1. ;S CTRLCODE=$S(GMRCSTS=5:"ZU",GMRCSTS=6:"ZU",1:"ZR")
  1. ;S DIE="^GMR(123,",DA=GMRCO,DR=".03////^S X=""@"""
  1. ;D ^DIE
  1. K GMRCSTS,DIE,DA,DR
  1. Q
  1. ;D EN^GMRCHL7(DFN,+GMRCO,"","",CTRLCODE,GMRCPROV,"","") ;Send CPRS an HL-7 message about status of purge - can/can't purge record
  1. Q
  1. END Q
  1. END1 K DA,GMRCDT,GMRCPCNT,GMRCIDT,GMRCTRLC,GMRCOM
  1. K ^TMP("GMRCS",$J),^TMP("GMRCSLIST",$J)
  1. Q
  1. ;
  1. TIURSL ;Get TIU results to update the Consults package
  1. ;One time run to get the information TIU has into the consults package.
  1. ;
  1. F PASS=1,2 D LOOP
  1. Q
  1. ;
  1. LOOP ;LOOP Thru TIU entries to populate the 50th node.
  1. S TIUDA=0,TIUEDT=2980500,GMRCY=0
  1. F S TIUEDT=$O(^TIU(8925,"F",TIUEDT)) Q:'TIUEDT D
  1. . S TIUDA=$O(^TIU(8925,"F",TIUEDT,"")) Q:'TIUDA
  1. . Q:'$D(^TIU(8925,TIUDA,14))
  1. . S GMRCO=$P($G(^TIU(8925,TIUDA,14)),"^",5)
  1. . Q:$P(GMRCO,";",2)'="GMR(123,"
  1. . Q:'$D(^GMR(123,+GMRCO,0))
  1. . I PASS=1 K ^GMR(123,+GMRCO,50) Q
  1. . ;PASS 2 ADD
  1. . S GMRCVDA=TIUDA_";TIU(8925,"
  1. . D ADDRSLT^GMRCTIUA(+GMRCO,GMRCVDA)
  1. Q
  1. ;
  1. ONETIME ;One time run to load the file 123 consult entry multiple results
  1. ;with the TIU Narrative Result
  1. ;
  1. N ZTSK
  1. S ZTSK=$$QUEUE("ONETIMER^GMRCSTSU","One time run to load the file 123 consult entry multiple results and rebuild cross-references")
  1. I ZTSK W !,"One time load Queued to run. Task#",ZTSK
  1. E W !,"One Time load failed to queue."
  1. Q
  1. ;
  1. ONETIMER ;
  1. D XREF
  1. D NWXREF
  1. S GMRCDT=2970100,GMRCY=0
  1. F S GMRCDT=$O(^GMR(123,"B",GMRCDT)) Q:'GMRCDT D
  1. . S GMRCO=0 F S GMRCO=$O(^GMR(123,"B",GMRCDT,GMRCO)) Q:'GMRCO D
  1. .. I '$D(^GMR(123,+GMRCO,50)),+$P($G(^GMR(123,+GMRCO,0)),"^",20) S GMRCY=$$LOAD^GMRCTIUA(GMRCO)
  1. ;
  1. Q
  1. XREF ;re-create cross references for specific fields in files
  1. N SVC
  1. D BMES^XPDUTL("Re-indexing APC cross reference for service entries ")
  1. K ^GMR(123.5,"APC")
  1. S SVC=0
  1. F S SVC=$O(^GMR(123.5,SVC)) Q:'SVC D
  1. . S DA(1)=SVC
  1. . S DIK="^GMR(123.5,"_DA(1)_",10,"
  1. . S DIK(1)=".01^APC"
  1. . D ENALL^DIK
  1. D BMES^XPDUTL("Re-indexing AC cross reference for sub-service entries ")
  1. S SVC=0
  1. F S SVC=$O(^GMR(123.5,SVC)) Q:'SVC D
  1. . K ^GMR(123.5,SVC,10,"AC")
  1. . S DA(1)=SVC
  1. . S DIK="^GMR(123.5,"_DA(1)_",10,"
  1. . S DIK(1)=".01^AC"
  1. . D ENALL^DIK
  1. Q
  1. ;
  1. ;
  1. NWXREF ;Create new cross references for specific fields in file 123
  1. N DIK
  1. D BMES^XPDUTL("Creating new G cross-reference on Sending Provider for consults in 123 ...")
  1. S DIK="^GMR(123,"
  1. S DIK(1)="10^G"
  1. D ENALL^DIK
  1. ;
  1. D BMES^XPDUTL("Creating new H cross-reference on FROM location for consults in 123 ...")
  1. S DIK="^GMR(123,"
  1. S DIK(1)="2^H"
  1. D ENALL^DIK
  1. ;
  1. D BMES^XPDUTL("Creating new R cross-reference on consult results in file 123 ...")
  1. N GMRCO,DIK,DA
  1. S GMRCO=0
  1. F S GMRCO=$O(^GMR(123,GMRCO)) Q:'GMRCO D
  1. . S DA(1)=GMRCO
  1. . S DIK="^GMR(123,"_DA(1)_",50,"
  1. . S DIK(1)=".01^R"
  1. . D ENALL^DIK
  1. Q
  1. ;
  1. QUEUE(ZTRTN,ZTDESC,ZTDTH,ZTIO) ;
  1. ;
  1. ; ZTRTN -- ROUTINE TO RUN (MANDATORY)
  1. ; ZTDESC - DESCRIPTION OF THE TASK (OPTIONAL)
  1. ; ZTDTH -- TIME TO RUN (OPTIONAL - DEFAULT = NOW)
  1. ; ZTIO --- DEVICE TO SEND OUTPUT TO (OPTIONAL)
  1. ;
  1. N ZTCPU,ZTPAR,ZTPRE,ZTPRI
  1. N ZTSAVE,ZTSK,ZTUCI
  1. ;
  1. Q:'$L($G(ZTRTN)) 0
  1. S:'$L($G(ZTDESC)) ZTDESC="CONSULT/REQUEST PACKAGE TASK"
  1. S:'$L($G(ZTIO)) ZTIO=""
  1. S:'$L($G(ZTDTH)) ZTDTH=$H
  1. D ^%ZTLOAD
  1. ;
  1. Q $G(ZTSK)
  1. ;