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)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMGECZ 6763 printed Nov 22, 2024@16:56:08 Page 2
PXRMGECZ ;SLC/JVS - GEC Debug Utilities#3 ;7/14/05 10:46
+1 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
+2 ;
+3 QUIT
PAGE ;On printed reports, form feed and add page numbers
+1 IF $Y=(IOSL-2)!($Y>IOSL)
WRITE @IOF
Begin DoDot:1
+2 SET PAGE=PAGE+1
+3 WRITE !,?(IOM-10),"Page "_PAGE,!
End DoDot:1
+4 QUIT
+5 ;
MATCHB ;Build tmp global with origingal health factor names from PXRMGECY
+1 ;
+2 NEW GECNA,I,GECDA
+3 SET CNT=0
+4 SET GECNA=""
+5 FOR I=1:1:301
SET GECNA=$PIECE($TEXT(MATCH+I),";",4)
SET CNT=CNT+1
if GECNA=""
QUIT
Begin DoDot:1
+6 SET GECDA=$PIECE($TEXT(MATCH+I),";",3)
+7 SET ^TMP("PXRMGEC",$JOB,"MATCH",GECNA,$SELECT(GECDA="":0,1:$PIECE($TEXT(MATCH+I),";",3)))=""
End DoDot:1
+8 ;
+9 QUIT
+10 ;
MATCH ;MATCH AGINST
+1 ;;100;GEC ALL INCLUSIVE CARE/PACE PROGRAM
+2 ;;117;GEC ASSISTED LIVING (REFERRING TO)
+3 ;;147;GEC CHORE SERVICES IN HOME
+4 ;;185;GEC DOMICILIARY CARE
+5 ;;218;GEC RESPITE CARE OUTPATIENT
+6 ;;226;GEC HOME BASED PR. CARE (REFERRING TO)
+7 ;;263;GEC LONG TERM NURSING HOME CARE
+8 ;;300;GEC OTHER REFERRAL PROGRAM(REFERRING TO)
+9 ;;313;GEC INPATIENT PALLIATIVE/HOSPICE (NHCU)
+10 ;;367;GEC RESIDENTIAL CARE (SUPERVISED LIVING)
+11 ;;370;GEC RESPITE CARE INPATIENT
+12 ;;374;GEC SHORT TERM NURSING HOME CARE
+13 ;;375;GEC SKILLED CARE IN HOME
+14 ;;384;GEC SPECIALIZED DEMENTIA/GEROPSYCH CARE
+15 ;;340;GEC REFERRAL DOMICILIARY
+16 ;;186;GEC DOMICILIARY FUNDING-MEDICAID
+17 ;;187;GEC DOMICILIARY FUNDING-MEDICARE
+18 ;;188;GEC DOMICILIARY FUNDING-OTHER
+19 ;;189;GEC DOMICILIARY FUNDING-OTHER INSURANCE
+20 ;;190;GEC DOMICILIARY FUNDING-PRIVATE PAY
+21 ;;191;GEC DOMICILIARY FUNDING-VA
+22 ;;387;GEC STATE HOME DOMICILIARY
+23 ;;417;GEC VA DOMICILIARY (REFERRED TO)
+24 ;;343;GEC REFERRAL GERIATRIC SERVICES
+25 ;;210;GEC GERI SERVICES FUNDING-MEDICAID
+26 ;;211;GEC GERI SERVICES FUNDING-MEDICARE
+27 ;;212;GEC GERI SERVICES FUNDING-OTHER
+28 ;;213;GEC GERI SERVICES FUNDING-OTHER INSURER
+29 ;;214;GEC GERI SERVICES FUNDING-PRIVATE PAY
+30 ;;215;GEC GERI SERVICES FUNDING-VA
+31 ;;216;GEC GERIATRIC EVAL/MGMT CLINIC
+32 ;;217;GEC GERIATRIC EVAL/MGMT INPT UNIT
+33 ;;219;GEC GERIATRIC PRIMARY CARE
+34 ;;345;GEC REFERRAL HOME CARE
+35 ;;95;GEC ADULT DAY HEALTH CARE (REFERRED TO)
+36 ;;153;GEC COMMUNITY SKILLED HOME HEALTH CARE
+37 ;;225;GEC HOME BASED PR. CARE (REFERRED TO)
+38 ;;231;GEC HOMECARE FUNDING-MEDICAID
+39 ;;232;GEC HOMECARE FUNDING-MEDICARE
+40 ;;233;GEC HOMECARE FUNDING-OTHER
+41 ;;234;GEC HOMECARE FUNDING-OTHER INSURANCE
+42 ;;235;GEC HOMECARE FUNDING-PRIVATE PAY
+43 ;;236;GEC HOMECARE FUNDING-VA
+44 ;;239;GEC HOMEMAKER/HOME HEALTH AIDE
+45 ;;415;GEC VA BOWEL AND BLADDER
+46 ;;418;GEC VA IN-HOME RESPITE
+47 ;;347;GEC REFERRAL HOSPICE CARE
+48 ;;149;GEC COMMUNITY HOSPICE
+49 ;;240;GEC HOSPICE FUNDING-MEDICAID
+50 ;;241;GEC HOSPICE FUNDING-MEDICARE
+51 ;;242;GEC HOSPICE FUNDING-OTHER
+52 ;;243;GEC HOSPICE FUNDING-OTHER INSURANCE
+53 ;;244;GEC HOSPICE FUNDING-PRIVATE PAY
+54 ;;245;GEC HOSPICE FUNDING-VA
+55 ;;421;GEC VA NHCU (RESPITE HOSPICE)
+56 ;;425;GEC VA OUTPATIENT HOSPICE
+57 ;;276;GEC REFERRAL NOT REFERRED TO CARE
+58 ;;183;GEC DOES NOT MEET CRITERIA
+59 ;;254;GEC INSUFFICIENT FINANCIAL RESOURCES
+60 ;;317;GEC PATIENT BECAME TOO ILL
+61 ;;318;GEC PATIENT EXPIRED
+62 ;;326;GEC PROGRAM UNABLE TO ACCOMMODATE
+63 ;;352;GEC REFERRAL NURSING HOME CARE
+64 ;;151;GEC COMMUNITY NURSING HOME
+65 ;;279;GEC NURSING HOME FUNDING-MEDICAID
+66 ;;280;GEC NURSING HOME FUNDING-MEDICARE
+67 ;;281;GEC NURSING HOME FUNDING-OTHER
+68 ;;282;GEC NURSING HOME FUNDING-OTHER INSURANCE
+69 ;;283;GEC NURSING HOME FUNDING-PRIVATE PAY
+70 ;;284;GEC NURSING HOME FUNDING-VA
+71 ;;388;GEC STATE VETERANS NURSING HOME
+72 ;;419;GEC VA NHCU (LONG-TERM CARE)
+73 ;;420;GEC VA NHCU (REHAB)
+74 ;;422;GEC VA NHCU (RESPITE)
+75 ;;423;GEC VA NHCU (SUBACUTE CARE)
+76 ;;353;GEC REFERRAL OTHER REFERRAL PROGRAM
+77 ;;293;GEC OTHER REF PROGRAM FUNDING-MEDICAID
+78 ;;294;GEC OTHER REF PROGRAM FUNDING-MEDICARE
+79 ;;295;GEC OTHER REF PROGRAM FUNDING-OTHER
+80 ;;296;GEC OTHER REF PROGRAM FUNDING-OTHER INS.
+81 ;;297;GEC OTHER REF PROGRAM FUNDING-PRIV PAY
+82 ;;298;GEC OTHER REF PROGRAM FUNDING-VA
+83 ;;299;GEC OTHER REFERRAL PROGRAM (REFERRED TO)
+84 ;;363;GEC REFERRAL STRUCTURED LIVING SITUATION
+85 ;;116;GEC ASSISTED LIVING (REFERRED TO)
+86 ;;152;GEC COMMUNITY RESIDENTIAL CARE PROGRAM
+87 ;;320;GEC PERSONAL CARE HOME
+88 ;;391;GEC STRUCTURED LIVING FUNDING-MEDICAID
+89 ;;392;GEC STRUCTURED LIVING FUNDING-MEDICARE
+90 ;;393;GEC STRUCTURED LIVING FUNDING-OTHER
+91 ;;394;GEC STRUCTURED LIVING FUNDING-OTHER INS.
+92 ;;395;GEC STRUCTURED LIVING FUNDING-PRIV PAY
+93 ;;396;GEC STRUCTURED LIVING FUNDING-VA
+94 ;;134;GEC CARE COORDINATION COMMENTS
+95 ;;135;GEC CARE RECOMMENDATIONS COMMENTS
+96 ;;277;GEC NURSING ASSESSMENT COMMENTS
+97 ;;379;GEC SOCIAL SERVICES COMMENTS
+98 ;;337;GEC REFERRAL COMMENTS
+99 ;;660149;GEC OUTPATIENT PALLIATIVE/HOSPICE (HOME)
+100 ;;660148;GEC VA NHCU (HOSPICE)
+101 ;;660158;GEC HOME TELEHEALTH (REFERRING TO)
+102 ;;660157;GEC HOME TELEHEALTH (REFERRED TO)
+103 ;;660151;GEC TELEHEALTH FUNDING-VA
+104 ;
COM ;FORMAT COMMENT
+1 if '$DATA(COMMENT)
QUIT
+2 NEW WORD,SENT,I
+3 SET SENT=""
+4 IF $LENGTH(COMMENT)<52
WRITE !,?6,"Comment: ",COMMENT
DO PB^PXRMGECR
if Y=0
QUIT
QUIT
+5 IF $LENGTH(COMMENT)>51
Begin DoDot:1
+6 WRITE !,?6,"Comment:"
+7 SET WORD=""
FOR I=1:1:$LENGTH(COMMENT," ")
SET WORD=$PIECE(COMMENT," ",I)
Begin DoDot:2
+8 SET SENT=SENT_" "_WORD
+9 IF $LENGTH(SENT)>51
WRITE !,?6,SENT
DO PB^PXRMGECR
if Y=0
QUIT
SET SENT=""
End DoDot:2
End DoDot:1
+10 IF SENT'=""
WRITE !,?6,SENT
DO PB^PXRMGECR
if Y=0
QUIT
+11 QUIT
+12 ;
COMQ ;FORMAT PRINTED COMMENT
+1 if '$DATA(COMMENT)
QUIT
+2 NEW WORD,SENT,I
+3 SET SENT=""
+4 IF $LENGTH(COMMENT)<52
WRITE !,?6,"Comment: ",COMMENT
QUIT
+5 IF $LENGTH(COMMENT)>51
Begin DoDot:1
+6 WRITE !,?6,"Comment:"
+7 SET WORD=""
FOR I=1:1:$LENGTH(COMMENT," ")
SET WORD=$PIECE(COMMENT," ",I)
Begin DoDot:2
+8 SET SENT=SENT_" "_WORD
+9 IF $LENGTH(SENT)>51
WRITE !,?6,SENT
SET SENT=""
DO PAGE
End DoDot:2
End DoDot:1
+10 IF SENT'=""
WRITE !,?6,SENT
DO PAGE
+11 QUIT
+12 ;
OBJECT(DFN) ;
+1 NEW CNT,CNT1,RESULT,STR,STR1,X
+2 SET CNT=0
+3 KILL ^TMP("PXRMGECZ",$JOB,"REFERRAL")
+4 SET STR=$NAME(^TMP("PXRMGECZ",$JOB,"REFERRAL"))
+5 SET RESULT=$PIECE($$STATUS^PXRMGECU(DFN),U)
+6 IF $GET(RESULT)["No GEC Referral on record."
DO NONE
QUIT "~@"_$NAME(@STR)
+7 FOR X=1:1:$LENGTH(RESULT)
IF $EXTRACT(RESULT,X,X+2)="~ ~"
SET CNT=CNT+1
+8 SET STR1=$PIECE(RESULT,"~ ~",CNT+1)
SET CNT1=0
+9 SET @STR@(CNT1+1,0)="=================================================="
+10 SET @STR@(CNT1+1,0)="REFERRAL STATUS:"
+11 FOR X=1:1:CNT
Begin DoDot:1
+12 SET CNT1=CNT1+1
+13 IF $LENGTH($PIECE(RESULT,"~ ~",X))'>0
QUIT
+14 SET @STR@(CNT1,0)=$PIECE(RESULT,"~ ~",X)
+15 if @STR@(CNT1,0)["~"
SET @STR@(CNT1,0)=$TRANSLATE(@STR@(CNT1,0),"~","")
End DoDot:1
+16 SET CNT=0
FOR X=1:1:$LENGTH(STR1)
IF $EXTRACT(STR1,X,X+1)="~ "!($EXTRACT(STR1,X,X+1)="~~")
SET CNT=CNT+1
+17 FOR X=1:1:CNT
Begin DoDot:1
+18 SET CNT1=CNT1+1
+19 IF $LENGTH($PIECE(STR1,"~",X))'>0
QUIT
+20 IF $PIECE(STR1,"~",X)["Care Coo"
QUIT
+21 SET @STR@(CNT1,0)=$PIECE(STR1,"~",X)
+22 if @STR@(CNT1,0)["~"
SET @STR@(CNT1,0)=$TRANSLATE(@STR@(CNT1,0),"~","")
End DoDot:1
+23 GOTO EXIT
NONE ;If no activity happening
+1 SET @STR@(1,0)="=================================================="
+2 SET @STR@(2,0)="REFERRAL STATUS:"
+3 SET @STR@(3,0)="This is the first dialog activity on this Referral."
+4 SET @STR@(4,0)="=================================================="
+5 QUIT
EXIT ;Exit
+1 SET @STR@(CNT1+1,0)="=================================================="
+2 QUIT "~@"_$NAME(@STR)