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

WIISERV.m

Go to the documentation of this file.
WIISERV ;VISN20/WDE/WHN/WII-EXTRACT DATA ; [6/26/08 07:21am]
 ;;1.0;Wounded Injured and Ill Warriors;**1**;06/26/2008;Build 28;
 ;;    WII ADT SERVER  MAIL SERVER CALLED S.WII ADT SERVER
 ;API used see Appendix A Message Server Protocol
 ;http://www.domain.ext/vdl/documents/Infrastructure/Mailman/xm_8_0_developerguide.pdf
 ;UNLOAD^WIISERV
UNLOAD ;Entry Point
 ;http://www.domain.ext/vdl/documents/Infrastructure/Mailman/xm_8_0_developerguide.pdf
 F WII=1:1 X XMREC Q:(XMER=-1)  D
 .I $P($G(XMRG),U,1)="987.7" D DATA1
 .I $P($G(XMRG),U,1)="987.8 DATA" D DATA2
 D CLEAN
 Q
DATA1 ;
 ;
 S WIIDATA=$G(XMRG)
 S WIIP1=$P($G(WIIDATA),U,2)  ;STATION
 S WIIP2=$P($G(WIIDATA),U,3)  ;PATIENT LAST NAME ONLY
 S WIIP3=$P($G(WIIDATA),U,4)  ;SSN
 S WIIP4=$P($G(WIIDATA),U,5)  ;ADMIT DATE
 S WIIP5=$P($G(WIIDATA),U,6)  ;DISCHARGE DATE
 S WIIP6=$P($G(WIIDATA),U,7)  ;ICN
 S WIIP7=$P($G(WIIDATA),U,8)  ;ORIG COLLECTION DATE
 S WIIP8=$P($G(WIIDATA),U,9)  ;STATUS
 S WIIP10=$P($G(WIIDATA),U,10)  ;PATIENTS ZIP CODE
 S WIIP11=$P($G(WIIDATA),U,11)  ;DATE OF BIRTH
 S WIIP12=$P($G(WIIDATA),U,12)  ;GENDER
 S WIIP13=$P($G(WIIDATA),U,13)  ;QUALIFYING ELIGIBILITY
 S WIIP16=$P($G(WIIDATA),U,15)  ;first name         NAME COMP FIRST NAME VERY LONG MAYBE
 S WIIP17=$P($G(WIIDATA),U,16)  ;MIDDLE NAME
 ;DIC ;  BUILD ENTRY
 S DIC="^WII(987.7,"
 S DIC(0)="Z"
 S X=$P($G(^WII(987.7,0)),U,3) S:X="" X=0 S X=X+1
 S WIINOW=$$NOW^XLFDT
 S DIC("DR")=".01///"_X
 D FILE^DICN
 K X,DA,WIINOW
 I Y>0 D
 .S DA=$P($G(Y),U,1) Q:DA=""
 .S DIE=DIC
 .S DR="1///"_WIIP1_";2///"_WIIP2_";3///"_WIIP3_";4///"_WIIP4_";5///"_WIIP5_";6///"_WIIP6_";7///"_WIIP7_";9///"_WIIP8
 .S DR=DR_";10///"_WIIP10_";11///"_WIIP11_";12///"_WIIP12_";13///"_WIIP13_";14///"_DT
 .D ^DIE
 .K DR
 .S DR="16///"_WIIP16_";17///"_WIIP17
 .D ^DIE
 .K X,DA,Y,DR
 .Q
 Q
CLEAN ;
 K WIIP1,WIIP2,WIIP3,WIIP4,WIIP5,WIIP6,WIIP7,WIIP8,Y,DA,X,DIE,DIC,WIINOW,X
 K WIIP10,WIIP11,WIIP12,WIIP13,DA,DIE,DIC,Y,X,WII,WIIDATA,XMER,XMREC,XMRG
 K WIIP15,WIIP16,WIIP17
 Q
DATA2 ;
 ;S ^TMP("DAVE",WIICNT)=XMRG
 ;DIC ;  BUILD ENTRY
 S DIC="^WII(987.8,"
 S DIC(0)="Z"
 S X=$P($G(^WII(987.8,0)),U,3) S:X="" X=0 S X=X+1
 S WIINOW=$$NOW^XLFDT
 S DIC("DR")=".01///"_X
 D FILE^DICN
 K X,DA,WIINOW
 I Y>0 D
 .S DA=$P($G(Y),U,1) Q:DA=""
 .S DIE=DIC
 .;;SITE  ^  COUNT  ^  DATE RAN  ^  Start of reporting period  ^ End of REPORTING PERIOD
 .S WIIDATA=$G(XMRG)
 .S WIIP1=$P(WIIDATA,U,2)
 .S WIIP2=$P(WIIDATA,U,3)
 .S WIIP3=$P(WIIDATA,U,4)
 .S WIIP4=$P(WIIDATA,U,5)
 .S WIIP5=$P(WIIDATA,U,6)
 .S DR="1///"_WIIP1_";2///"_WIIP2_";3///"_WIIP3_";4///"_WIIP4_";5///"_WIIP5
 .D ^DIE
 .K X,DA,Y,DR
 .Q
 Q