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

AGPHROPT.m

Go to the documentation of this file.
AGPHROPT ;IHS/OIT/NKD - EDIT ROUTINE FOR PHR FIELDS ; FEBRUARY 10, 2014
 ;;7.1;PATIENT REGISTRATION;**11**;AUG 25, 2005;Build 1
 ;
 ; THIS ROUTINE IS USED TO EDIT THE PHR FIELDS
 Q
EN ;EP - ENTRY THROUGH MENU OPTION
 N DFN
 D HDR^AG
 D PTLK^AG
 Q:'$D(DFN)
 D PHRA(DFN)
 Q
PHRA(DFN) ;EP - ENTRY OF PHR ACCESS FIELD
 N AGQUIT
 S AGQUIT=0
 F  Q:AGQUIT  D
 . N DIC,DA,DIE,DR,Y
 . S DA(1)=DFN
 . S DIC="^AUPNPAT("_DA(1)_",88,"
 . S DIC(0)="QEAL"
 . S DIC("DR")=""
 . D ^DIC
 . I Y=-1 S AGQUIT=1 Q
 . S DIE=DIC,DIE("NO^")="" K DIC
 . S DA=+Y
 . S DR=".01 Date of PHR Access;.02R~ Do you access your Personal Health Record?" D ^DIE
 Q
PHRH(DFN) ;EP - ENTRY OF PHR HANDOUT FIELD
 N AGQUIT
 S AGQUIT=0
 F  Q:AGQUIT  D
 . N DIC,DA,DIE,DR,Y
 . S DA(1)=DFN
 . S DIC="^AUPNPAT("_DA(1)_",89,"
 . S DIC(0)="QEAL"
 . S DIC("DR")=""
 . D ^DIC
 . I Y=-1 S AGQUIT=1 Q
 . S DIE=DIC,DIE("NO^")="" K DIC
 . S DA=+Y
 . S DR=".01 Date of PHR Handout;.02R~ Provided PHR handout?//YES" D ^DIE
 Q
PHRAP(DFN) ;EP - RETURNS LAST PHR ACCESS ENTRY IN DISPLAY FORMAT
 Q:'DFN ""
 N AGRES,AGLIEN
 S (AGRES,AGLIEN)=""
 S AGLIEN=$O(^AUPNPAT(DFN,88,"ACT",""),-1)
 I AGLIEN]"" D
 . S AGRES=$$GET1^DIQ(9000001.8801,AGLIEN_","_DFN_",",.02,"E")
 . S AGRES=AGRES_$J("",4-$L(AGRES))
 . S AGRES=AGRES_"("_$$GET1^DIQ(9000001.8801,AGLIEN_","_DFN_",",.01,"E")_")"
 Q AGRES
PHRHP(DFN) ;EP - RETURNS LAST PHR HANDOUT ENTRY IN DISPLAY FORMAT
 Q:'DFN ""
 N AGRES,AGLDT,AGLIEN
 S (AGRES,AGLDT,AGLIEN)=""
 S AGLDT=$O(^AUPNPAT(DFN,89,"B",""),-1)
 S:AGLDT]"" AGLIEN=$O(^AUPNPAT(DFN,89,"B",AGLDT,""))
 I AGLIEN]"" D
 . S AGRES=$$GET1^DIQ(9000001.8901,AGLIEN_","_DFN_",",.02,"E")
 . S AGRES=AGRES_$J("",4-$L(AGRES))
 . S AGRES=AGRES_"("_$$GET1^DIQ(9000001.8901,AGLIEN_","_DFN_",",.01,"E")_")"
 Q AGRES