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

AGEDGUA1.m

Go to the documentation of this file.
AGEDGUA1 ; IHS/ASDS/TPF - EDIT/DISP GUARANTOR SCREEN OVERFLOW ;    
 ;;7.1;PATIENT REGISTRATION;**1,2**;JAN 31, 2007
 ;NEW ROUTINE TO HANDLE OVERFLOW FROM AGEDGUAR PER SAC
 Q
GETDATES(WD0) ;EP - GET DTS
 S FLAGS=""
 S FIELDS=";.01I;.02I"
 D LIST^DIC(9000043.0111,WD0,FIELDS,FLAGS,"*",,,,,,"RESULT","ERROR")
 D DATESORT(.RESULT)
 Q
DATESHOW(RESULT) ;EP - SHOW DATE
 N REC
 S REC=0
 F  S REC=$O(RESULT("DILIST","ID",REC)) Q:'REC  D
 . I REC'=1 W !
 . S Y=RESULT("DILIST","ID",REC,.01) X ^DD("DD")
 . S Y=RESULT("DILIST","ID",REC,.02) X ^DD("DD")
 . W ?67,Y
 . W ?79,$S($$ISACTIVE^AGINS(RESULT("DILIST","ID",REC,.01),RESULT("DILIST","ID",REC,.02)):"A",1:"I")
DATESORT(RESULT) ;EP
 N DATESORT,SPECSUB,EFFDT,ENDDT,CVG
 S REC=0
 F  S REC=$O(RESULT("DILIST","ID",REC)) Q:'REC  D
 .S ENDDT=RESULT("DILIST","ID",REC,.02)
 .S EFFDT=RESULT("DILIST","ID",REC,.01)
 .S SPECSUB=$S(ENDDT="":"O",1:"T")  ;O=OPEN ENDED , T=TERM DT
 .I SPECSUB="O" S DATESORT(SPECSUB,EFFDT)=ENDDT
 .E  S DATESORT(SPECSUB,ENDDT)=EFFDT_U
 D SHOWNEW(.DATESORT)
 Q
SHOWNEW(DATESORT) ;EP
 N SPECSUB,DATE,DATE1,EFFDT,ENDDT,REC
 S SPECSUB=""
 S REC=1
 F  S SPECSUB=$O(DATESORT(SPECSUB)) Q:SPECSUB=""  D
 .S DATE=""
 .F  S DATE=$O(DATESORT(SPECSUB,DATE)) Q:DATE=""  D
 ..S DATE1=$P(DATESORT(SPECSUB,DATE),U)
 ..I SPECSUB="O" S EFFDT=DATE,ENDDT=""
 ..E  S EFFDT=DATE1,ENDDT=DATE
 ..I REC'=1 W !
 ..S ITEMNUM=ITEMNUM+1
 ..S ENTRYARY(ITEMNUM)=EFFDT
 ..S $P(AG("C"),",",ITEMNUM)="NEWEFFDT"
 ..W ?0,ITEMNUM_"."
 ..S Y=EFFDT X ^DD("DD")
 ..S DEFEFFDT(ITEMNUM)=EFFDT
 ..W ?4,Y
 ..S Y=ENDDT X ^DD("DD")
 ..W ?40,Y
 ..W ?79,$S($$ISACTIVE^AGINS(EFFDT,ENDDT):"A",1:"I")
 ..S REC=REC+1
 S AG("N")=ITEMNUM
 Q