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

ACHSEPAT.m

Go to the documentation of this file.
ACHSEPAT ; IHS/ITSC/PMF - PRINT EOBRS BY PATIENT ;  [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**22**;JUN 11, 2001;Build 43
 ;ACHS*3.1*22 Modification to fix error if patient is not defined
 ;
 K ACHSPAT,DFN
 W $G(IORVON),!,"THIS REPORT WILL ONLY INCLUDE PROCESSED DOCUMENTS.  ANY UNPROCESSED",!,"DOCUMENT WILL HAVE TO BE PRINTED USING ANOTHER OPTION.",$G(IORVOFF),!!!
 D PTLK^ACHS
 Q:'$D(DFN)
 S ACHSPAT=DFN
 W !
 S (ACHSDIEN,ACHSTIEN,ACHSX)=0
PAT1 ;
 S ACHSDIEN=$O(^ACHSF(DUZ(2),"EOBP",ACHSPAT,ACHSDIEN))
 I ACHSDIEN="" S I=1,ACHSPATI=0 G PATSEL   ;ACHS*3.1*22 ADDED IF TEST
 G:'$D(^ACHSF(DUZ(2),"D",ACHSDIEN)) PAT1  ;ACHS*3.1*22
 S ACHSTIEN=0
PAT2 ;
 S ACHSTIEN=$O(^ACHSF(DUZ(2),"EOBP",ACHSPAT,ACHSDIEN,ACHSTIEN))
 G PAT1:ACHSTIEN=""
 S ACHSDAT=0
PAT3 ;
 S ACHSDAT=$O(^ACHSF(DUZ(2),"EOBP",ACHSPAT,ACHSDIEN,ACHSTIEN,ACHSDAT))
 G:ACHSDAT="" PAT2
 S ACHSX=ACHSX+1,ACHSPAT(ACHSX)=ACHSDIEN_"^"_ACHSTIEN_"^"_ACHSDAT
 G PAT3
 ;
PAT4 ;NOT USED KEPT FOR FUTURE ENHANCEMENTS
 ;S ACHSPATI=$O(^ACHSEOBE("EOBP",DFN,ACHSPATI)) G PATSEL:ACHSPATI=""
 ;S ACHSX=ACHSX+1,ACHSPATI(ACHSX)=DFN_"^"_ACHSPATI
 ;G PAT4
 ;
PATSEL ;
 I ACHSX=0 G PATNO
 I ACHSX=1 S ACHSLST=1 G PATPR ;S:$D(ACHSPAT(ACHS)) PATPR
 W !!,"ENTRY #",?10,"DOCUMENT #",?27,"PATIENT NAME",?56,"CHART #",?67,"TRANS DATE",!,$$REPEAT^XLFSTR("-",79)
 ;S ACHSY=0
 ;F I=1:1:ACHSX D:$D(ACHSPAT(I)) PATSEL1 S ACHSY=ACHSY+1 I ACHSY#10=0 W !!,"Press <RETURN> To Continue" D READ^ACHSFU G PATSEL:Y="" G DIR:Y?1N.N ;D:$D(ACHSPATI(I)) PATSEL2
 F I=I:1:ACHSX D:$D(ACHSPAT(I)) PATSEL1 I I#10=0 D RTRN^ACHS Q:$D(DUOUT)     ;ACHS*3.1*22
DIR ;
 S ACHSLST=$$DIR^XBDIR("L^1:"_I,"ENTER NUMBER(S) OF SELECTION(S)","","","","",1)  ;ACHS*3.1*22
 G PATEND:$D(DUOUT)!$D(DTOUT),PATPR
 ;
PATSEL1 ;
 S ACHSDIEN=$P(ACHSPAT(I),U,1),ACHSTIEN=$P(ACHSPAT(I),U,2),ACHSDAT=$P(ACHSPAT(I),U,3),Y=$$FMTE^XLFDT(9999999-ACHSDAT)
 S ACHSPAT=$P(^ACHSF(DUZ(2),"D",ACHSDIEN,0),U,22),ACHSCHRT=$P(^AUPNPAT(ACHSPAT,41,DUZ(2),0),U,2),ACHSDOC=$P(^ACHSF(DUZ(2),"D",ACHSDIEN,0),U,14)_"-"_ACHSFC_"-"_$P(^(0),U,1)
 S ACHSPAT=$P(^DPT(ACHSPAT,0),U,1)
 D PATSELPR
 Q
 ;
PATSEL2 ;NOT USED KEPT FOR FUTURE ENHANCEMENTS
 ;S ACHSPATI=ACHSPATI(I)
 ;S DFN=$P(ACHSPATI,U,1),ACHSEPAT=$P(ACHSPATI,U,2)
 ;S ACHSPAT=$P(^DPT(DFN,0),U,1),ACHSDOC=$P(^ACHSEOBE(AC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