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

PXRMGECZ.m

Go to the documentation of this file.
PXRMGECZ ;SLC/JVS - GEC Debug Utilities#3 ;7/14/05  10:46
 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
 ;
 Q
PAGE ;On printed reports, form feed and add page numbers
 I $Y=(IOSL-2)!($Y>IOSL) W @IOF D
 .S PAGE=PAGE+1
 .W !,?(IOM-10),"Page "_PAGE,!
 Q
 ;
MATCHB ;Build tmp global with origingal health factor names from PXRMGECY
 ;
 N GECNA,I,GECDA
 S CNT=0
 S GECNA=""
 F I=1:1:301 S GECNA=$P($T(MATCH+I),";",4) S CNT=CNT+1 Q:GECNA=""  D
 .S GECDA=$P($T(MATCH+I),";",3)
 .S ^TMP("PXRMGEC",$J,"MATCH",GECNA,$S(GECDA="":0,1:$P($T(MATCH+I),";",3)))=""
 ;
 Q
 ;
MATCH ;MATCH AGINST
 ;;100;GEC ALL INCLUSIVE CARE/PACE PROGRAM
 ;;117;GEC ASSISTED LIVING (REFERRING TO)
 ;;147;GEC CHORE SERVICES IN HOME
 ;;185;GEC DOMICILIARY CARE
 ;;218;GEC RESPITE CARE OUTPATIENT
 ;;226;GEC HOME BASED PR. CARE (REFERRING TO)
 ;;263;GEC LONG TERM NURSING HOME CARE
 ;;300;GEC OTHER REFERRAL PROGRAM(REFERRING TO)
 ;;313;GEC INPATIENT PALLIATIVE/HOSPICE (NHCU)
 ;;367;GEC RESIDENTIAL CARE (SUPERVISED LIVING)
 ;;370;GEC RESPITE CARE INPATIENT
 ;;374;GEC SHORT TERM NURSING HOME CARE
 ;;375;GEC SKILLED CARE IN HOME
 ;;384;GEC SPECIALIZED DEMENTIA/GEROPSYCH CARE
 ;;340;GEC REFERRAL DOMICILIARY
 ;;186;GEC DOMICILIARY FUNDING-MEDICAID
 ;;187;GEC DOMICILIARY FUNDING-MEDICARE
 ;;188;GEC DOMICILIARY FUNDING-OTHER
 ;;189;GEC DOMICILIARY FUNDING-OTHER INSURANCE
 ;;190;GEC DOMICILIARY FUNDING-PRIVATE PAY
 ;;191;GEC DOMICILIARY FUNDING-VA
 ;;387;GEC STATE HOME DOMICILIARY
 ;;417;GEC VA DOMICILIARY (REFERRED TO)
 ;;343;GEC REFERRAL GERIATRIC SERVICES
 ;;210;GEC GERI SERVICES FUNDING-MEDICAID
 ;;211;GEC GERI SERVICES FUNDING-MEDICARE
 ;;212;GEC GERI SERVICES FUNDING-OTHER
 ;;213;GEC GERI SERVICES FUNDING-OTHER INSURER
 ;;214;GEC GERI SERVICES FUNDING-PRIVATE PAY
 ;;215;GEC GERI SERVICES FUNDING-VA
 ;;216;GEC GERIATRIC EVAL/MGMT CLINIC
 ;;217;GEC GERIATRIC EVAL/MGMT INPT UNIT
 ;;219;GEC GERIATRIC PRIMARY CARE
 ;;345;GEC REFERRAL HOME CARE
 ;;95;GEC ADULT DAY HEALTH CARE (REFERRED TO)
 ;;153;GEC COMMUNITY SKILLED HOME HEALTH CARE
 ;;225;GEC HOME BASED PR. CARE (REFERRED TO)
 ;;231;GEC HOMECARE FUNDING-MEDICAID
 ;;232;GEC HOMECARE FUNDING-MEDICARE
 ;;233;GEC HOMECARE FUNDING-OTHER
 ;;234;GEC HOMECARE FUNDING-OTHER INSURANCE
 ;;235;GEC HOMECARE FUNDING-PRIVATE PAY
 ;;236;GEC HOMECARE FUNDING-VA
 ;;239;GEC HOMEMAKER/HOME HEALTH AIDE
 ;;415;GEC VA BOWEL AND BLADDER
 ;;418;GEC VA IN-HOME RESPITE
 ;;347;GEC REFERRAL HOSPICE CARE
 ;;149;GEC COMMUNITY HOSPICE
 ;;240;GEC HOSPICE FUNDING-MEDICAID
 ;;241;GEC HOSPICE FUNDING-MEDICARE
 ;;242;GEC HOSPICE FUNDING-OTHER
 ;;243;GEC HOSPICE FUNDING-OTHER INSURANCE
 ;;244;GEC HOSPICE FUNDING-PRIVATE PAY
 ;;245;GEC HOSPICE FUNDING-VA
 ;;421;GEC VA NHCU (RESPITE HOSPICE)
 ;;425;GEC VA OUTPATIENT HOSPICE
 ;;276;GEC REFERRAL NOT REFERRED TO CARE
 ;;183;GEC DOES NOT MEET CRITERIA
 ;;254;GEC INSUFFICIENT FINANCIAL RESOURCES
 ;;317;GEC PATIENT BECAME TOO ILL
 ;;318;GEC PATIENT EXPIRED
 ;;326;GEC PROGRAM UNABLE TO ACCOMMODATE
 ;;352;GEC REFERRAL NURSING HOME CARE
 ;;151;GEC COMMUNITY NURSING HOME
 ;;279;GEC NURSING HOME FUNDING-MEDICAID
 ;;280;GEC NURSING HOME FUNDING-MEDICARE
 ;;281;GEC NURSING HOME FUNDING-OTHER
 ;;282;GEC NURSING HOME FUNDING-OTHER INSURANCE
 ;;283;GEC NURSING HOME FUNDING-PRIVATE PAY
 ;;284;GEC NURSING HOME FUNDING-VA
 ;;388;GEC STATE VETERANS NURSING HOME
 ;;419;GEC VA NHCU (LONG-TERM CARE)
 ;;420;GEC VA NHCU (REHAB)
 ;;422;GEC VA NHCU (RESPITE)
 ;;423;GEC VA NHCU (SUBACUTE CARE)
 ;;353;GEC REFERRAL OTHER REFERRAL PROGRAM
 ;;293;GEC OTHER REF PROGRAM FUNDING-MEDICAID
 ;;294;GEC OTHER REF PROGRAM FUNDING-MEDICARE
 ;;295;GEC OTHER REF PROGRAM FUNDING-OTHER
 ;;296;GEC OTHER REF PROGRAM FUNDING-OTHER INS.
 ;;297;GEC OTHER REF PROGRAM FUNDING-PRIV PAY
 ;;298;GEC OTHER REF PROGRAM FUNDING-VA
 ;;299;GEC OTHER REFERRAL PROGRAM (REFERRED TO)
 ;;363;GEC REFERRAL STRUCTURED LIVING SITUATION
 ;;116;GEC ASSISTED LIVING (REFERRED TO)
 ;;152;GEC COMMUNITY RESIDENTIAL CARE PROGRAM
 ;;320;GEC PERSONAL CARE HOME
 ;;391;GEC STRUCTURED LIVING FUNDING-MEDICAID
 ;;392;GEC STRUCTURED LIVING FUNDING-MEDICARE
 ;;393;GEC STRUCTURED LIVING FUNDING-OTHER
 ;;394;GEC STRUCTURED LIVING FUNDING-OTHER INS.
 ;;395;GEC STRUCTURED LIVING FUNDING-PRIV PAY
 ;;396;GEC STRUCTURED LIVING FUNDING-VA
 ;;134;GEC CARE COORDINATION COMMENTS
 ;;135;GEC CARE RECOMMENDATIONS COMMENTS
 ;;277;GEC NURSING ASSESSMENT COMMENTS
 ;;379;GEC SOCIAL SERVICES COMMENTS
 ;;337;GEC REFERRAL COMMENTS
 ;;660149;GEC OUTPATIENT PALLIATIVE/HOSPICE (HOME)
 ;;660148;GEC VA NHCU (HOSPICE)
 ;;660158;GEC HOME TELEHEALTH (REFERRING TO)
 ;;660157;GEC HOME TELEHEALTH (REFERRED TO)
 ;;660151;GEC TELEHEALTH FUNDING-VA
 ;
COM ;FORMAT COMMENT
 Q:'$D(COMMENT)
 N WORD,SENT,I
 S SENT=""
 I $L(COMMENT)<52 W !,?6,"Comment: ",COMMENT D PB^PXRMGECR Q:Y=0  Q
 I $L(COMMENT)>51 D
 .W !,?6,"Comment:"
 .S WORD="" F I=1:1:$L(COMMENT," ") S WORD=$P(COMMENT," ",I) D
 ..S SENT=SENT_" "_WORD
 ..I $L(SENT)>51 W !,?6,SENT D PB^PXRMGECR Q:Y=0  S SENT=""
 I SENT'="" W !,?6,SENT D PB^PXRMGECR Q:Y=0
 Q
 ;
COMQ ;FORMAT PRINTED COMMENT
 Q:'$D(COMMENT)
 N WORD,SENT,I
 S SENT=""
 I $L(COMMENT)<52 W !,?6,"Comment: ",COMMENT Q
 I $L(COMMENT)>51 D
 .W !,?6,"Comment:"
 .S WORD="" F I=1:1:$L(COMMENT," ") S WORD=$P(COMMENT," ",I) D
 ..S SENT=SENT_" "_WORD
 ..I $L(SENT)>51 W !,?6,SENT S SENT="" D PAGE
 I SENT'="" W !,?6,SENT D PAGE
 Q
 ;
OBJECT(DFN) ;
 N CNT,CNT1,RESULT,STR,STR1,X
 S CNT=0
 K ^TMP("PXRMGECZ",$J,"REFERRAL")
 S STR=$NA(^TMP("PXRMGECZ",$J,"REFERRAL"))
 S RESULT=$P($$STATUS^PXRMGECU(DFN),U)
 I $G(RESULT)["No GEC Referral on record." D NONE Q "~@"_$NA(@STR)
 F X=1:1:$L(RESULT) I $E(RESULT,X,X+2)="~ ~" S CNT=CNT+1
 S STR1=$P(RESULT,"~ ~",CNT+1),CNT1=0
 S @STR@(CNT1+1,0)="=================================================="
 S @STR@(CNT1+1,0)="REFERRAL STATUS:"
 F X=1:1:CNT  D
 .S CNT1=CNT1+1
 .I $L($P(RESULT,"~ ~",X))'>0 Q
 .S @STR@(CNT1,0)=$P(RESULT,"~ ~",X)
 .S:@STR@(CNT1,0)["~" @STR@(CNT1,0)=$TR(@STR@(CNT1,0),"~","")
 S CNT=0 F X=1:1:$L(STR1) I $E(STR1,X,X+1)="~ "!($E(STR1,X,X+1)="~~") S CNT=CNT+1
 F X=1:1:CNT  D
 .S CNT1=CNT1+1
 .I $L($P(STR1,"~",X))'>0 Q
 .I $P(STR1,"~",X)["Care Coo" Q
 .S @STR@(CNT1,0)=$P(STR1,"~",X)
 .S:@STR@(CNT1,0)["~" @STR@(CNT1,0)=$TR(@STR@(CNT1,0),"~","")
 G EXIT
NONE ;If no activity happening
 S @STR@(1,0)="=================================================="
 S @STR@(2,0)="REFERRAL STATUS:"
 S @STR@(3,0)="This is the first dialog activity on this Referral."
 S @STR@(4,0)="=================================================="
 Q
EXIT ;Exit
 S @STR@(CNT1+1,0)="=================================================="
 Q "~@"_$NA(@STR)