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

APCDDPAP.m

Go to the documentation of this file.
  1. APCDDPAP ; IHS/CMI/LAB - DISPLAY EXISTING LAB DATA FOR PATIENT ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. ;
  1. ;called from data entry input templates
  1. ;APCDVSIT must = visit dfn
  1. ;
  1. START ;
  1. NEW X
  1. W !!?29,"PAP SMEAR RESULTS",!!,"Patient Name: ",$P(^DPT(AUPNPAT,0),U)," ","Patient Age: ",$J((AUPNDAYS/365.25),6,1)," years"
  1. W !!?5,"Date/Time of Visit",?28,"Pap Smear Result",?55,"Test Name",!?5,"------------------",?28,"----------------",?55,"---------"
  1. I '$D(^AUPNVLAB("AC",AUPNPAT)) W !,"NO Pap Smear Lab Tests on File",! Q
  1. S DIC="^LAB(60,",X="PAP SMEAR",DIC(0)="M" D ^DIC K DIC I Y=-1 W !,$C(7),$C(7),"PAP SMEAR NOT FOUND IN LABORATORY TEST FILE" K Y Q
  1. S APCDDPAP("TEST",+Y)=""
  1. S T=$O(^ATXLAB("B","BGP PAP SMEAR TAX",0))
  1. I T S (X,Y)=0 F S X=$O(^ATXLAB(T,21,"B",X)) Q:X'=+X S APCDDPAP("TEST",X)=""
  1. ;I '$D(^AUPNVLAB("AA",AUPNPAT,+Y)) W !,"NO Pap Smear Lab Tests on File",! K Y Q
  1. S X="" F S X=$O(APCDDPAP("TEST",X)) Q:X'=+X D
  1. .S APCDDPAP("IDATE")=0 F S APCDDPAP("IDATE")=$O(^AUPNVLAB("AA",AUPNPAT,X,APCDDPAP("IDATE"))) Q:APCDDPAP("IDATE")="" D
  1. .. S APCDDPAP("X")=0 F S APCDDPAP("X")=$O(^AUPNVLAB("AA",AUPNPAT,X,APCDDPAP("IDATE"),APCDDPAP("X"))) Q:APCDDPAP("X")="" D
  1. ... S APCDDPAP("VDFN")=$P(^AUPNVLAB(APCDDPAP("X"),0),U,3),Y=$P(^AUPNVSIT(APCDDPAP("VDFN"),0),U) D DD^%DT S APCDDPAP("VDATE")=Y
  1. ... W !?5,APCDDPAP("VDATE"),?28,$S($P(^AUPNVLAB(APCDDPAP("X"),0),U,4)]"":$P(^AUPNVLAB(APCDDPAP("X"),0),U,4),1:"NO RESULTS ON FILE"),?55,$P(^LAB(60,X,0),U)
  1. ... Q
  1. . Q
  1. K APCDDPAP,Y
  1. Q