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

PXP236.m

Go to the documentation of this file.
  1. PXP236 ;ISP/RFR - CREATE NEW-STYLE XREF ;Sep 08, 2023@15:42
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**236**;Aug 12, 1996;Build 17
  1. ;
  1. N PXXR,PXRES,PXOUT,PXMSG,PXERROR,PXMESSAGE,PXLINE
  1. S PXMSG(1)=" Creating the AB index definition in the V IMM CONTRA/REFUSAL EVENTS file"
  1. S PXMSG(2)=" (#9000010.707)..."
  1. D BMES^XPDUTL(.PXMSG)
  1. S PXXR("FILE")=9000010.707
  1. S PXXR("NAME")="AB"
  1. S PXXR("TYPE")="R"
  1. S PXXR("USE")="S"
  1. S PXXR("EXECUTION")="R"
  1. S PXXR("ACTIVITY")="IR"
  1. S PXXR("SHORT DESCR")="Sort entries by patient, then by immunization, then by visit date."
  1. S PXXR("DESCR",1)="This cross-reference sorts contraindication/refusal events in sequence by"
  1. S PXXR("DESCR",2)="patient, immunization, and then visit date."
  1. S PXXR("VAL",1)=.02
  1. S PXXR("VAL",1,"SUBSCRIPT")=1
  1. S PXXR("VAL",1,"COLLATION")="F"
  1. S PXXR("VAL",2)=.04
  1. S PXXR("VAL",2,"SUBSCRIPT")=2
  1. S PXXR("VAL",2,"COLLATION")="F"
  1. S PXXR("VAL",3)=.03
  1. S PXXR("VAL",3,"SUBSCRIPT")=3
  1. S PXXR("VAL",3,"COLLATION")="F"
  1. S PXXR("VAL",3,"XFORM FOR STORAGE")="S X=$P(+^AUPNVSIT(X,0),""."",1)"
  1. D CREIXN^DDMOD(.PXXR,"W",.PXRES,"PXOUT","PXERROR")
  1. I $G(PXRES)="" D Q
  1. .D BMES^XPDUTL(" FAILED to create the AB index.")
  1. .D MSG^DIALOG("WE",.PXMESSAGE,($G(IOM,80)-7),,"PXERROR")
  1. .F PXLINE=1:1:PXMESSAGE D
  1. ..D MES^XPDUTL(" "_PXMESSAGE(PXLINE))
  1. K PXMSG
  1. S PXMSG(1)=" DONE",PXMSG(2)=" "
  1. S PXMSG(3)=" Queueing a task to populate the AB index..."
  1. D MES^XPDUTL(.PXMSG)
  1. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC,ZTSK,ZTSAVE
  1. S ZTRTN="INDEX^PXP236",ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,5),ZTIO=""
  1. S ZTDESC="PCE V IMM CONTRA/REFUSAL EVENTS FILE AB CROSS-REFERENCE BUILDER"
  1. S ZTSAVE("PXPERSON")=DUZ
  1. D ^%ZTLOAD
  1. I $G(ZTSK)>0,$G(ZTSK("D"))>0 D Q
  1. .D MES^XPDUTL(" Task #"_ZTSK_" scheduled to run at "_$$HTE^XLFDT(ZTSK("D")))
  1. K PXMSG
  1. S PXMSG(1)=" FAILED to task the cross-reference builder"
  1. S PXMSG(2)=" Execute DO INDEX^PXP236 from the programmer's prompt."
  1. D BMES^XPDUTL(.PXMSG)
  1. Q
  1. INDEX ;BUILD AB INDEX
  1. N DIK,DA,PXMSG
  1. S DIK="^AUPNVICR(",DIK(1)=".02"_U_"AB"
  1. I $D(^AUPNVICR("AB")) D ENALL2^DIK
  1. D ENALL^DIK
  1. S PXMSG(2,0)="(#9000010.707)"
  1. I $P($G(^AUPNVICR(0)),U,4)>0 D
  1. .I $D(^AUPNVICR("AB")) S PXMSG(1,0)="Successfully built"
  1. .E S PXMSG(1,0)="Failed to build"
  1. .S PXMSG(1,0)=PXMSG(1,0)_" the AB index in the V IMM CONTRA/REFUSAL EVENTS file"
  1. .S PXMSG(2,0)=PXMSG(2,0)_"."
  1. I $P($G(^AUPNVICR(0)),U,4)<1 D
  1. .S PXMSG(1,0)="There are no entries in the V IMM CONTRA/REFUSAL EVENTS file"
  1. .S PXMSG(2,0)=PXMSG(2,0)_" to add to the new AB index."
  1. N XMDUZ,XMSUB,XMTEXT,XMY,XMZ,XMMG,XMSTRIP,XMROU,DIFROM,XMYBLOB,XMERR
  1. S XMDUZ="PCE PATCH 236",XMSUB="AB CROSS-REFERENCE TASK",XMTEXT="PXMSG(",XMY("I:"_PXPERSON)=""
  1. D ^XMD
  1. I $G(XMMG)'="" D
  1. .N %ZT S %ZT("^TMP(""XMERR"",$J)")=""
  1. .D APPERROR^%ZTER("PCE ERROR SENDING STATUS MESSAGE")
  1. S ZTREQ="@"
  1. Q