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

SD53142.m

Go to the documentation of this file.
  1. SD53142 ;BP/JRP - POST INIT FOR PATCH SD*5.3*142;9-APR-1998
  1. ;;5.3;Scheduling;**142,1015**;AUG 13, 1993;Build 21
  1. ;
  1. ;Portions of this routine were copied from SD5370PT (ALB/ABR)
  1. ; and SCMSP66 (ALB/JLU)
  1. ;
  1. PRE ;Main entry point for pre init
  1. ;Remove ERROR CODE DESCRIPTION (field #11) as an identifier of the
  1. ; TRANSMITTED OUTPATIENT ENCOUNTER ERROR CODE file (#409.76)
  1. ; (this causes problems when installing error codes)
  1. I ($D(^DD(409.76,0,"ID",11))) D
  1. .N TMP
  1. .K ^DD(409.76,0,"ID",11)
  1. .Q:($D(^DD(409.76,0,"ID")))
  1. .S TMP=$P(^SD(409.76,0),U,2)
  1. .S TMP=$TR(TMP,"I","")
  1. .S $P(^SD(409.76,0),U,2)=TMP
  1. .Q
  1. Q
  1. ;
  1. POST ;Main entry point for post init
  1. ;Make ERROR CODE DESCRIPTION (field #11) an identifier of the
  1. ; TRANSMITTED OUTPATIENT ENCOUNTER ERROR CODE file (#409.76)
  1. ; (this was removed by the pre init routine)
  1. I ('$D(^DD(409.76,0,"ID",11))) D
  1. .N TMP
  1. .S ^DD(409.76,0,"ID",11)="D EN^DDIOL($P(^(1),U,1))"
  1. .S TMP=$P(^SD(409.76,0),U,2)
  1. .S TMP=$TR(TMP,"I","")
  1. .S $P(^SD(409.76,0),U,2)=TMP_"I"
  1. ;Change status of HL7 messages
  1. D HLM
  1. ;Change HL7 application name
  1. D HLAPP
  1. Q
  1. ;
  1. HLM ;Change status of HL7 messages to '3' (SUCCESSFULLY COMPLETED)
  1. ; to enable purging of message
  1. N DA,DIC,DIE,DR,X,Y,SDAPP,HLMID,XPDIDTOT,HLPTR,COUNT,TEXT
  1. S X=$$NOW^XLFDT()
  1. S Y=$$FMTE^XLFDT(X)
  1. S TEXT=">> Beginning HL7 Message Text file (#772) update on "
  1. S TEXT=TEXT_$P(Y,"@",1)_" @ "_$P(Y,"@",2)
  1. D BMES^XPDUTL(TEXT)
  1. S XPDIDTOT=+$O(^HL(772,"A"),-1)
  1. S DIC="^HL(771,"
  1. S DIC(0)="M"
  1. S X="AMBCARE-DH70"
  1. D ^DIC
  1. I (Y<0) D Q
  1. .D BMES^XPDUTL(" *** AMBCARE-DH70 application not found ***")
  1. S SDAPP=+Y
  1. S HLMID=""
  1. S COUNT=0
  1. F S HLMID=$O(^HL(772,"AH",SDAPP,HLMID)) Q:(HLMID="") D
  1. .S HLPTR=0
  1. .F S HLPTR=+$O(^HL(772,"AH",SDAPP,HLMID,HLPTR)) Q:('HLPTR) D
  1. ..D UPDATE^XPDID(HLPTR)
  1. ..S DIE="^HL(772,"
  1. ..S DA=HLPTR
  1. ..S DR="20////3"
  1. ..D ^DIE
  1. ..S COUNT=COUNT+1
  1. D UPDATE^XPDID(XPDIDTOT)
  1. S X=$$NOW^XLFDT()
  1. S Y=$$FMTE^XLFDT(X)
  1. S TEXT=" Updating of HL7 Message Text file completed on "
  1. S TEXT=TEXT_$P(Y,"@",1)_" @ "_$P(Y,"@",2)
  1. D MES^XPDUTL(TEXT)
  1. S TEXT=" "_COUNT_" entries were updated"
  1. D MES^XPDUTL(TEXT)
  1. Q
  1. ;
  1. HLAPP ;Change HL7 application name from AMBCARE-DH70 to AMBCARE-DH142
  1. N DIE,DIC,DA,DR,X,Y
  1. D BMES^XPDUTL(">> Changing HL7 Application name from AMBCARE-DH70 to AMBCARE-DH142")
  1. S DIC="^HL(771,"
  1. S DIC(0)="X"
  1. S X="AMBCARE-DH70"
  1. D ^DIC
  1. I (Y<0) D Q
  1. .D BMES^XPDUTL(" *** AMBCARE-DH70 application not found ***")
  1. S DIE=DIC
  1. S DA=+Y
  1. S DR=".01///AMBCARE-DH142"
  1. D ^DIE
  1. D MES^XPDUTL(" HL7 application name successfully changed to AMBCARE-DH142")
  1. Q
  1. ;
  1. ;
  1. DEL6050 ;Delete entries in Transmitted Outpatient Encounter file (#409.73)
  1. ;that are Lab stops to an OOS clinic and don't have any CPTs. Net
  1. ;result is removal of 6050 errors from error listing.
  1. ;
  1. N IOP
  1. S IOP="Q"
  1. D EN^XUTMDEVQ("TASK6050^SD53142","DELETE ACRP 6050 ERRORS")
  1. D HOME^%ZIS
  1. Q
  1. TASK6050 ;Entry point for tasking
  1. ;Declare variables
  1. N L,DIC,FLDS,BY,FR,TO,DHD,DHIT,IOP,SD53142
  1. ;Sort through Transmitted Outpatient Encounter Error file (#409.75)
  1. S L=""
  1. S DIC="^SD(409.75,"
  1. ;Find entries that match the following criteria:
  1. ; (1) Error code is 6050
  1. ; (2) Related Visit file entry is a Lab stop
  1. ; (3) Related Visit file entry is at an OOS clinic
  1. S BY="@.02,@.01:.02:.05:.08:1,@.01:.02:.05:.22:50.01"
  1. S FR(1)="6050"
  1. S TO(1)="6050"
  1. S FR(2)="108"
  1. S TO(2)="108"
  1. S FR(3)="YES"
  1. S TO(3)="YES"
  1. ;Print basic information about the entry
  1. S FLDS="INTERNAL(#.01);""XMITPTR"""
  1. S FLDS(1)=".01:.02:INTERNAL(NUMBER);""ENCPTR"""
  1. S FLDS(2)=".01:.02:.05:INTERNAL(NUMBER);""VSITPTR"""
  1. S FLDS(3)=".01:.02:.05:NUMDATE(#.01);""DATE"""
  1. S FLDS(4)=".01:.02:.05:15001;L10;""VISIT ID"""
  1. S FLDS(5)=".01:.02:.05:.08:1;L4;""AMIS"""
  1. S FLDS(6)=".01:.02:.05:.22;L16;""CLINIC"""
  1. ;Delete entry from Transmitted Outpatient Encounter file
  1. S DHIT="S ZJRP=$$DELXMIT^SCDXFU03(+$G(^SD(409.75,D0,0)),0) K ZJRP"
  1. ;Send output to current device
  1. S IOP=IO
  1. ;Remember IO("S")
  1. S SD53142=+$G(IO("S"))
  1. ;Call FileMan
  1. S DHD="6050 ERRORS DELETED FROM ACRP FILES"
  1. D EN1^DIP
  1. ;Reset IO("S")
  1. S:(SD53142) IO("S")=SD53142
  1. ;Done
  1. S:($D(ZTQUEUED)) ZTREQ="@"
  1. Q