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

EASEZPVU.m

Go to the documentation of this file.
  1. EASEZPVU ;ALB/GTS/CMF - MT PICKER FOR EZ/EZR PRINT
  1. ;;1.0;ENROLLMENT APPLICATION SYSTEM;**57**;Mar 15, 2001
  1. ;
  1. Q
  1. PICK(EASDFN,EASMTIEN) ;validate or pick mtien for printing
  1. ; Input: EASDFN - POINTER TO PATIENT FILE (#2) - required
  1. ; EASMTIEN - POINTER TO MEANS TEST FILE (#408.31 - optional
  1. ; Output: RESULT - valid mt pointer, or null
  1. N RESULT,MTIEN,DIC,D,X,Y,DTOUT,DUOUT,EASSORT
  1. S RESULT=""
  1. ; if means test ien, then return it
  1. S MTIEN=$G(EASMTIEN)
  1. S MTIEN=$S($D(^DGMT(408.31,+MTIEN)):+MTIEN,MTIEN=0:0,MTIEN=-1:-1,1:"")
  1. I (+MTIEN>0)!(MTIEN=-1) Q MTIEN
  1. ;
  1. ; if no means test ien, then ask user for one
  1. D GETMTDAT(EASDFN)
  1. I $D(EASSORT) D
  1. .;display sort array here!
  1. .D DISPLAY
  1. .;lookup filtered by sort array
  1. .S DIC=408.31
  1. .S DIC(0)="AEMQ"
  1. .S DIC("A")="Select DATE OF TEST:"
  1. .S DIC("S")="I $D(EASSORT($P(^(0),U),Y))"
  1. .S D="ADFN"_EASDFN_"^B"
  1. .D MIX^DIC1
  1. .S RESULT=+Y
  1. Q RESULT
  1. ;
  1. GETMTDAT(EASDFN) ;sort primary tests for printing selection
  1. ;
  1. ; Input: EASDFN - Patient file IEN (DFN)
  1. ; Output: EASSORT - Array of Means Tests in the following format:
  1. ; EASSORT(DATE,MTIEN)=MT IEN^Date of Test^Status Name^Status Code^Source
  1. ;
  1. ;check for futures
  1. ; means test
  1. D SORT($$FUT^DGMTU(EASDFN,,1),"NO")
  1. ; copay test
  1. D SORT($$FUT^DGMTU(EASDFN,,2),"NO")
  1. ; ltc copay exemption test
  1. D SORT($$FUT^DGMTU(EASDFN,,4),"NO")
  1. ;look for current
  1. ; means test
  1. D SORT($$LST^DGMTU(EASDFN,,1),"YES")
  1. ; copay test
  1. D SORT($$LST^DGMTU(EASDFN,,2),"YES")
  1. ; ltc copay exemption test
  1. D SORT($$LST^DGMTU(EASDFN,,4),"YES")
  1. Q
  1. ;
  1. SORT(RETURN,PRIMARY) ;sort mt status string
  1. N DATE,MTIEN
  1. I +RETURN=0 Q
  1. S DATE=$P(RETURN,U,2)
  1. S MTIEN=$P(RETURN,U,1)
  1. S:$$GET1^DIQ(408.31,MTIEN_",",2)=PRIMARY EASSORT(DATE,MTIEN)=RETURN
  1. Q
  1. ;
  1. DISPLAY ; eassort array
  1. N MTDT,MTIEN,MTIENS
  1. W !?3,"Choose from:"
  1. S MTDT=""
  1. F S MTDT=$O(EASSORT(MTDT)) Q:MTDT="" D
  1. .S MTIEN=""
  1. .F S MTIEN=$O(EASSORT(MTDT,MTIEN)) Q:MTIEN="" D
  1. ..S MTIENS=MTIEN_","
  1. ..W !?3,MTDT_" "
  1. ..W $$GET1^DIQ(408.31,MTIENS,.01)_" " ;test date
  1. ..W $$GET1^DIQ(408.31,MTIENS,.019)_" " ;type of test
  1. ..W $$GET1^DIQ(408.31,MTIENS,.03)_" " ;status
  1. ..W $$GET1^DIQ(408.31,MTIENS,.23)_" " ;source of test
  1. ..W $S($$GET1^DIQ(408.31,MTIENS,2)="YES":"PRIMARY",1:"NOT PRIMARY")
  1. ..Q
  1. .Q
  1. Q
  1. ;