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

ACMPROB.m

Go to the documentation of this file.
ACMPROB ; IHS/TUCSON/TMJ - DISPLAY OF PCC PROBLEM LIST ; [ 07/11/1999  8:59 PM ]
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;**1**;JAN 10, 1996
 ;IHS/CMI/LAB - y2k patch 1
 ;Called from CASE MANAGEMENT SYSTEM to display PCC problems
 ;ACMPTNO must equal the patient DFN
 ;EP;ENTRY POINT
 ;begin Y2K
 ;S ACMTCVD="S:Y]"""" Y=+Y,Y=$E(Y,4,5)_""/""_$E(Y,6,7)_""/""_$E(Y,2,3)",ACMTTAT="A" ;Y2000
 S ACMTCVD="S:Y]"""" Y=+Y,Y=$E(Y,4,5)_""/""_$E(Y,6,7)_""/""_(1700+$E(Y,1,3))",ACMTTAT="A" ;Y2000
 ;end Y2K
 D COMMON
 S ACMTTAT="I"
 D COMMON
 K ACMTCVD,ACMTQ,Y
 D PROBX
 Q
COMMON ;
 I '$D(^AUPNPROB("AC",ACMPTNO)) W !!?4,"********** No ",$S(ACMTTAT="A":"  ACTIVE",1:"INACTIVE")," Problems in PCC file for this Patient **********",!?4,"(To update the PCC problem list use PCC encounter form.)",! Q
 K ACMTDFT
 S ACMTNDF=0,ACMTFAC=""
 F ACMTQ=0:0 S ACMTFAC=$O(^AUPNPROB("AA",ACMPTNO,ACMTFAC)) Q:'ACMTFAC  D PROBSCH
 I ACMTNDF=0 W !!?4,"********** No ",$S(ACMTTAT="A":"  ACTIVE",1:"INACTIVE")," Problems in PCC file for this Patient **********",!?4,"(To update the PCC problem list use PCC encounter form.)",! Q
 W !!?4,"****************"_$S(ACMTTAT="A":"    ACTIVE ",1:"  INACTIVE ")_"PCC PROBLEMS AND NOTES  *********************",!?4,"(To update PCC problem list use PCC encounter form.)",!
 S ACMTFPP=""
 F ACMTQ=0:0 S ACMTFPP=$O(ACMT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V(ACMTNRQ)):$P(^AUTNPOV(ACMTNRQ,0),U,1),1:"***** "_ACMTNRQ_" *****")
 E  S ACMTNRQ=""
 Q
 ;
GETSITE ;
 S:ACMTITE="" ACMTITE="null"
 S %=$S($D(^AUTTLOC(ACMTITE,0)):^(0),1:""),ACMTNFL=$P(%,U,1),ACMTNFL=$S($D(^DIC(4,ACMTITE,0)):$P(^(0),U,1),1:"<"_ACMTITE_">"),ACMTNSH=$P(%,U,2)
 I ACMTNSH="" S ACMTNSH="<"_ACMTITE_">"
 S ACMTNAB=$J($P(%,U,7),4)
 I ACMTNAB="" S ACMTNAB="<"_ACMTITE_">"
 Q
PAUSE ;
 I IOST["C-" S DIR(0)="EOA",DIR("A")="Press <ENTER> to continue..... " D ^DIR K DIR
 Q