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

BWUPTRAN.m

Go to the documentation of this file.
BWUPTRAN ;IHS/ANMC/MWR - UPLOAD: TRANSFERS WP TEXT;15-Feb-2003 22:13;PLS
 ;;2.0;WOMEN'S HEALTH;**8**;MAY 16, 1996
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  TRANSFERS WP TEXT IN LOCAL ARRAY BW1 TO WP NODE OF PROCEDURE
 ;;  OR IN UNMATCHED LAB RESULTS FILE.  CALLED BY BWUPRNI.
 ;
 ;
TRANSFER(BWYY,BWY) ;EP
 ;---> TRANSFERS TEXT OF LAB REPORT FROM BW1(N) LOCAL ARRAY INTO
 ;---> A BW PROCEDURE FILE ENTRY.
 ;---> REQUIRED VARIABLES: BWY =IEN OF THE PROCEDURE IN PROCEDURE FILE.
 ;--->                     BWYY=IEN OF LAB RESULT, FILE 9002086.82.
 ;--->                          OR BWYY="DONE", MEANS BW1 ARRAY EXISTS.
 ;--->                     (BW1( LOCAL ARRAY=FORMATTED LINES OF TEXT.)
 ;--->
 ;---> CALLED BY BWUPRNI WHEN UPLOADING RESULTS AND MOVING THEM INTO
 ;--->    EXISTING BW PROCEDURES.
 ;---> ALSO CALLED BY BWUPDISP WHEN MOVING AN UNMATCHED RESULT INTO A
 ;--->    A BW PROCEDURE.
 ;
 N M,N
 L +^BWPCD(BWY):5 I '$T S BWPOP=1 D:BWYY'="DONE" NOMATCH(BWYY,4) Q
 K ^BWPCD(BWY,1)
 D:BWYY'="DONE" FORMAT^BWUPRNI1(BWYY)
 S (M,N)=0
 F  S N=$O(BW1(N)) Q:'N  D
 .S ^BWPCD(BWY,1,N,0)=BW1(N),M=N
 S ^BWPCD(BWY,1,0)="^^"_M_U_M_U_DT
 ;---> SET STATUS OF THIS PROCEDURE = "NEW" (AND IT'S "S" XREF).
 ;---> SET THE "DATE RESULTS RECEIVED" FIELD = TODAY.
 S DR=".14////"_"n"_";.32////"_DT
 D DIE^BWFMAN(9002086.1,DR,BWY,.BWPOP,1) L -^BWPCD(BWY)
 S:$D(BWMATCH) BWMATCH=BWMATCH+1
 Q
 ;
 ;
NOMATCH(BWYY,BWREAS) ;EP
 ;---> STORE THIS RESULTS REPORT IN "BW UPLD UNMATCHED LAB REPORTS" FILE
 ;---> VARIABLES: BWYY=IEN OF THE LAB RESULT, FILE 9002086.82.
 ;--->            BWREAS=NUMERIC CODE FOR FAILURE (.02 FLD).
 ;--->                 1=NO MATCH BY ACC#, 2=TEXT ALREADY PRESENT
 ;--->                 3=CHART#'S DON'T MATCH, 4=PROCEDURE LOCKED,
 ;--->                 5=UNKNOWN,6=SSN#'S DON'T MATCH.
 ;--->            BWACC=FREE TEXT OF ACCESSION# IN LAB REPORT.
 ;--->            BWPNAME=FREE TEXT PATIENT NAME.
 ;--->            BW1( LOCAL ARRAY=FORMATTED LINES OF TEXT.
 ;
 Q:'$D(BWYY)  Q:+BWYY<1
 S BWACC=$P(^BWRNI(BWYY,0),U),BWPNAME=$P(^BWRNI(BWYY,0),U,2)
 S:BWPNAME="" BWPNAME="UNKNOWN"
 N DIC K DD,DO
 W !?10,"FAILED TO ADD/EDIT ",BWACC,"!"
 W !?5,"Storing this lab result in BW UPLD UNMATCHED LAB RESULTS FILE."
 S:'$D(BWREAS) BWREAS=5
 S:BWPNAME="" BWPNAME="UNKNOWN"
 S DIC="^BWRUN(",DIC(0)="L",X=BWACC,DLAYGO=9002086
 S DIC("DR")=".02////"_BWREAS_";.03////"_BWPNAME
 D FILE^DICN
 S BWY=+Y
 D FORMAT^BWUPRNI1(BWYY)
 ;---> SET UNMATCHED FILE WP NODES EQUAL TO LAB RESULT (IN BW1(N)).
 S (M,N)=0
 F  S N=$O(BW1(N)) Q:'N  D
 .S ^BWRUN(BWY,1,N,0)=BW1(N),M=N
 S ^BWRUN(BWY,1,0)="^^"_M_U_M_U_DT
 S BWNOMAT=BWNOMAT+1
 K BWACC,BWNAME
 Q