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

BPMXWP.m

Go to the documentation of this file.
BPMXWP ;IHS/PHXAO/AEF - PROCESS WORD PROCESSING FIELDS - 6/26/12 ;
 ;;1.0;IHS PATIENT MERGE;**2**;MAR 01, 2010;Build 1
 ;IHS/OIT/LJF 10/26/2006 routine originated from Phoenix Area Office
 ;                       changed namespace from BZXM to BPM
 ;IHS/OIT/NKD  6/13/2012 Added DT to WP's 3rd piece in 0 node
 ;                       Removed ^GMR processing
 ;                       Delete WP after merging
 ;                       Create an entry in the parent file if none existed
 ;;
DESC ;----- ROUTINE DESCRIPTION
 ;;
 ;;BPMXWP:
 ;;THIS ROUTINE MERGES THE CONTENTS OF THE SPECIFIED WORD PROCESSING 
 ;;FIELD FOR THE SPECIFIED ENTRY FOR DINUM'ED FILES.
 ;;
 ;;THIS ROUTINE IS CALLED BY THE SPECIAL MERGE ROUTINE DRIVER - ^BPMXDRV
 ;;
 ;;THE IHS PATIENT MERGE SOFTWARE ENTERS AT EN LINE LABEL.  IT IS EXPECTED
 ;;THAT THE FOLLOWING GLOBAL WOULD HAVE BEEN SET UP BY THE PATIENT MERGE
 ;;SOFTWARE:
 ;;  ^TMP("XDRFROM",$J,FROMIEN,TOIEN,FROMIEN_GLOBROOT,TOIEN_GLOBROOT)=FILE
 ;;EXAMPLE:
 ;;  ^TMP("XDRFROM",2804,6364,1991,"6364;DPT(","1991;DPT(")=2
 ;;WHERE =2 IS THE PARENT FILE (VA PATIENT FILE).
 ;;
 ;;$$END
 ;
 N I,X F I=1:1 S X=$P($T(DESC+I),";;",2) Q:X["$$END"  D EN^DDIOL(X)
 Q
EN(BPMRY) ;EP
 ;----- MAIN ENTRY POINT FROM DUPLICATE PATIENT MERGE SOFTWARE
 ;
 ;      BPMRY  =  TEMP GLOBAL SET UP BY THE PATIENT MERGE SOFTWARE,
 ;                 I.E., "^TMP(""XDRFROM"",$J)"
 ;
 N BPMFR,BPMTO
 ;
 S BPMFR=$O(@BPMRY@(0))
 Q:'BPMFR
 S BPMTO=$O(@BPMRY@(BPMFR,0))
 Q:'BPMTO
 ;
 D PROC(BPMFR,BPMTO)
 Q
PROC(BPMFR,BPMTO) ;
 ;----- PROCESS WP FIELDS
 ;
 N I,FLD
 ; 
 F I=1:1 S FLD=$P($T(WPFLDS+I),";;",2) Q:FLD["$$END"  D
 . D ONE(BPMFR,BPMTO,FLD)
 Q
ONE(BPMFR,BPMTO,FLD) ;
 ;----- PROCESS ONE WP FIELD
 ;
 K ^TMP("BPM",$J)
 ;
 D GET(BPMFR,FLD)
 Q:'$D(^TMP("BPM",$J))
 D PUT(BPMTO,FLD)
 ;
 K ^TMP("BPM",$J)
 ;
 Q
GET(IEN,FLD) ;
 ;----- GET TEXT FROM WP FIELD
 ;
 N G,Z,DA,DIK,DO,DD
 ;
 S G=$P(FLD,";")_IEN_","_$P(FLD,";",2)_","
 S Z=0
 F  S Z=$O(@(G_Z_")")) Q:'Z  D
 . S ^TMP("BPM",$J,Z)=@(G_Z_",0)")
 ;IHS/OIT/NKD BPM*1.0*2 REMOVE WP DATA AFTER STORING
 K @($P(FLD,";")_IEN_","_$P(FLD,";",2)_")")
 Q
PUT(IEN,FLD) ;
 ;----- PUT TEXT INTO WP FIELD
 ;
 ;IHS/OIT/NKD BPM*1.0*2 CREATE PARENT FILE ENTRY IF NONE EXISTED
 I '$D(@($P(FLD,";")_IEN_",0)")) D
 . N DIC,X,DINUM
 . S DIC=$P(FLD,";"),DIC(0)=""
 . S X=IEN,DINUM=X
 . K DD,DO
 . D FILE^DICN
 ;
 N D1,G,Z
 ;
 S G=$P(FLD,";")_IEN_","_$P(FLD,";",2)_","
 S D1=+$P($G(@(G_"0)")),U,3)
 S Z=0
 F  S Z=$O(^TMP("BPM",$J,Z)) Q:'Z  D
 . S D1=D1+1
 . S @(G_D1_",0)")=^TMP("BPM",$J,Z)
 . ;IHS/OIT/NKD BPM*1.0*2 ADD DT TO 3RD PIECE
 . S $P(@(G_"0)"),U,3,5)=D1_U_D1_U_$$DT^XLFDT()
 Q
WPFLDS ;----- LIST OF WORD PROCESSING FIELDS TO BE MERGED - GBLROOT;SUBSCRPT
 ;;^AUPNPAT(;12;LOCATION OF HOME FIELD IN PATIENT FILE
 ;;^AUPNPAT(;13;ADDITIONAL REGISTRATION INFO FIELD IN PATIENT FILE
 ;;^AUPNPAT(;14;REMARKS FIELD IN PATIENT FILE
 ;;^AUPNPAT(;15;ALERTS FIELD IN PATIENT FILE
 ;;^AUPNPAT(;16;CHS NOTES FIELD IN PATIENT FILE
 ;;^BATREG(;11;NOTES/COMMENTS FIELD IN ASTHMA REGISTER FILE
 ;;^AMHPINTK(;10;REFERRED BY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;11;INFORMANTS INCLUDE FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;12;HISTORY OF PRESENTING PROBLEM FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;13;PAST PSYCHIATRIC HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;14;DRUG/ALCOHOL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;15;LEGAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;16;SOCIAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;17;MEDICAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;18;CURRENT MEDICATIONS FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;19;MENTAL STATUS EXAM FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;21;IMPRESSION/FORMULATION FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;22;DEVELOPMENTAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;23;EDUCATIONAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;24;FAMILY HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;25;VOCATIONAL HISTORY FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;26;HOBBIES FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;27;STRENGTHS/RESOURCES FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;28;INITIAL PLAN FIELD IN MHSS INTAKE FILE
 ;;^AMHPINTK(;41;INTAKE DOCUMENTATION/NARRATIVE FIELD IN MHSS INTAKE FILE
 ;;^BIP(;1;IMM/SERVE TEXT FIELD IN BI PATIENT FILE
 ;;^BWP(;1;NOTES FIELD IN BW PATIENT FILE
 ;;^PS(55,;5.2;COMMENTS FIELD IN PHARMACY PATIENT FILE
 ;;^SCPT(404.41,;"C";COMMENTS FIELD IN OUTPATIENT PROFILE FILE
 ;;^ABSPE(;"TRANS";TRANSMISSION RAW DATA FIELD IN ABSP ELIGIBILITY FILE
 ;;^ABSPE(;"RESP";RESPONSE RAW DATA FIELD IN ABSP ELIGIBILITY FILE
 ;;$$END
 ;;^GMR(126,;"IN";INTAKE FIELD IN GMRY PATIENT I/0 FILE
 ;;^GMR(126,;"IV";IV FIELD IN GMRY PATIENT I/O FILE
 ;;^GMR(126,;"OUT";OUTPUT FIELD IN GMRY PATIENT I/O FILE