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

WIIGATD.m

Go to the documentation of this file.
WIIGATD ;VISN20/WDE/WHN WII-EXTRACT DATA ; [6/26/08 07:21am]
 ;;1.0;Wounded Injured and Ill Warriors;**1**;06/26/2008;Build 28;
 ;API used see Appendix A Message Server Protocol
 ;http://www.domain.ext/vdl/documents/Infrastructure/Mailman/xm_8_0_developerguide.pdf
 ; INTEGRATION REFERENCE #3041  All fields can be accessed/edited using FileMan tools.
 ;      ACCESS TO FILE 20 NAME COMPONENTS     VA(20
 ;Once the data is approved at the local facility this routine is called from the exit action of option
 ;WII REVIEW ADT EVENTS.  The function is to send the data off to the single collection point.
 ;
 ;Data is sent to the server that is entered in file WII PARAMETERS (#987.6) field 1.
 ;  The otion to review the data is the series of WIILM* routines. 
EN ;Entry Point
 D CLEAN
 S (WIICNT,WIIENT)=0 F  S WIIENT=$O(^WII(987.5,"C",2,WIIENT)) Q:(WIIENT="")!('+WIIENT)  D
 . D BUILD
 . Q
 I $D(^TMP($J))>0 D XMB
 D CLEAN
 Q
BUILD ;
 S WIIDATA=$G(^WII(987.5,WIIENT,0)) Q:WIIDATA=""
 S WIIP2=$P(WIIDATA,U,2)  ;PATIENT
 S WIIP3=$P(WIIDATA,U,3)  ;SSN
 S WIIP5=$P(WIIDATA,U,5)  ;FACILITY
 S WIIP6=$P(WIIDATA,U,6)  ;ADMISSION DATE
 S WIIP7=$P(WIIDATA,U,7)  ;DISCHARGE DATE
 S WIIP8=$P(WIIDATA,U,8)  ;ICN
 S WIIP10=$P(WIIDATA,U,10)  ;DATE COLLECTED AT THE FACILITY
 S WIIDATA=$G(^WII(987.5,WIIENT,1))  ;SUBSCRIPT 1
 S WIIP11=$P(WIIDATA,U,1)  ;PATIENTS ZIP CODE
 S WIIP12=$P(WIIDATA,U,2)  ;DATE OF BIRTH
 S WIIP13=$P(WIIDATA,U,3)  ;GENDER
 S WIIP14=$P(WIIDATA,U,4)  ;QUALIFYING ELIGIBILITY
 S WIIP15=DT  ;DATE GOING TO THE REPOSITORY
 S WIIDFN=$P($G(WIIDATA),U,6)
 ;NAMES FROM VA(20 COMPONETS
 S WIICOMP=$$GET1^DIQ(2,WIIDFN,1.01,"I")
 ;INTEGRATION REFERENCE #3041
 S WIICOMA=$$GET1^DIQ(20,WIICOMP,1,"E") S:WIICOMA="" WIICOMA=$P($G(WIIP2),",",1)  ;"ERROR LAST NAME"
 S WIICOMB=$$GET1^DIQ(20,WIICOMP,2,"E") S:WIICOMB="" WIICOMB=$P($G(WIIP2),",",2)  ;"ERROR FIRST NAME"
 S WIICOMC=$$GET1^DIQ(20,WIICOMP,3,"E") S:WIICOMC="" WIICOMC="   "
 ;NO THE REFERENCE TO 987.7 IS NOT A TYPO THIS IS THE FILE NUMBER THAT THIS DATA STRING IS GOING TO POPULATE
 S WIISTRG="987.7^"_WIIP5_U_WIICOMA_U_WIIP3_U_WIIP6_U_WIIP7_U_WIIP8_U_WIIP10_U_1_U_WIIP11_U_WIIP12_U_WIIP13_U_WIIP14_U_WIIP15_U_WIICOMB_U_WIICOMC
 S WIICNT=WIICNT+1
 S ^TMP($J,WIICNT,0)=WIISTRG
 S DIE="^WII(987.5,",DA=WIIENT,DR="8///4"
 D ^DIE
 Q
XMB ;
 ; XMY..........RECIPIENTS OF MSG
 ; XMDUZ........MESSAGE SENDER
 ; XMSUB........MESSAGE SUBJECT
 ; XMTEXT.......MESSAGE TEXT
 ; below line send output to XMB
 ;API used see Appendix A Message Server Protocol
 S WIIREV=$$GET1^DIQ(987.6,1,1,"I")  ;NATIONAL REVIEWER OF THE DATA BEFORE IT GOES OFF TO DEFAS
 S XMY(WIIREV)=""
 S XMDUZ=.5,XMSUB=^DD("SITE")_" - Admissions/Discharges",XMTEXT="^TMP($J," D ^XMD,KILL^XM
 Q
CLEAN ;
 K XMDUZ,XMY,WIIREV
 K ^TMP($J)
 K WIIENT,WIICNT,WIIDATA,WIIP2,WIIP3,WIIP4,WIIP5,WIIP6,WIIP7,WIIP8,WIIP9,WIIP10,WIISTRG
 K DA,DIC,DIE,DR,XMDUZ,XMSUB,XMTEXT,WIIP15
 K WIIP11,WIIP12,WIIP13,WIIP14,WIIP2,WIICOMP,WIICOMA,WIICOMB,WIICOMC,WIIDFN
 Q