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

QAOSCNV8.m

Go to the documentation of this file.
QAOSCNV8 ;HISC/DAD-CONVERT REASONS FOR REFERRAL ;9/9/93  13:52
 ;;3.0;Occurrence Screen;;09/14/1993
 W !!,"Converting text of reasons for referral"
 W !,"---------------------------------------"
 I $O(^QA(741.1,0))'>0,$O(^QA(741.4,0)) D  Q
 . S DIU="^QA(741.4,",DIU(0)="DT" D EN^DIU2
 . Q
 K ^TMP($J,"QAOSCNV8") S QAOCOUNT=0
 F QAOSLINE=3:3 S QAOSDATA=$P($T(REFER+QAOSLINE),";;",2) Q:QAOSDATA=""  D
 . S QAOCOUNT=QAOCOUNT+1
 . S ^TMP($J,"QAOSCNV8",QAOCOUNT)=QAOSDATA
 . S ^TMP($J,"QAOSCNV8",QAOCOUNT,"S")=$P($T(REFER+QAOSLINE+1),";;",2)
 . S ^TMP($J,"QAOSCNV8",QAOCOUNT,"L")=$P($T(REFER+QAOSLINE+2),";;",2)
 . Q
 D ^QAOSCNV9
 F QAOSLINE=1:1:QAOCOUNT D LOOP
 K DA,DIC,DIE,DINUM,DLAYGO,DO,DR,QAOCOUNT,QAOFOUND,QAOLDNEW,QAOSD0
 K QAOSDATA,QAOSHORT,QAOSLINE,QAOSLONG,QAOSREAS,QAOSSCRN,QAOSTEXT,X,Y
 K ^TMP($J,"QAOSCNV8")
 Q
LOOP ;
 S QAOSDATA=^TMP($J,"QAOSCNV8",QAOSLINE),QAOSSCRN=$P(QAOSDATA,"^")
 S QAOSREAS("OLD")=$P(QAOSDATA,"^",2),QAOSREAS("NEW")=$P(QAOSDATA,"^",3)
 S QAOSTEXT("SHORT")=^TMP($J,"QAOSCNV8",QAOSLINE,"S")
 S QAOSTEXT("LONG")=^TMP($J,"QAOSCNV8",QAOSLINE,"L")
 W !!,"Screen: ",QAOSSCRN
 I $G(^QA(741.1,QAOSSCRN,0))="" W "   *** NOT FOUND ***" Q
 W !?5,"Reason for referral code  ==>  "
 W "Old: ",$S(QAOSREAS("OLD")]"":QAOSREAS("OLD"),1:"??")
 W ?45,"New: ",QAOSREAS("NEW")
 S QAOFOUND=0
 F QAOLDNEW="NEW","OLD" D  Q:QAOFOUND
 . S X=QAOSREAS(QAOLDNEW),QAOSREAS=+X+($A(X,$L(X))/100)
 . F QAOSD0=0:0 S QAOSD0=$O(^QA(741.4,"AC",QAOSSCRN,QAOSREAS,QAOSD0)) Q:QAOSD0'>0  D  Q:QAOFOUND
 .. S QAOSREAS(0)=$P($G(^QA(741.4,QAOSD0,0)),"^") Q:QAOSREAS(0)=""
 .. S QAOSLONG=$P($G(^QA(741.4,QAOSD0,1)),"^")
 .. S QAOSHORT=$P($G(^QA(741.4,QAOSD0,2)),"^")
 .. I QAOSREAS(0)=QAOSREAS("NEW"),QAOSLONG=QAOSTEXT("LONG"),QAOSHORT=QAOSTEXT("SHORT") S QAOFOUND=2 Q
 .. I QAOSREAS(0)=QAOSREAS("OLD") S QAOFOUND=1
 .. Q
 . Q
 I 'QAOFOUND D
 . K DD,DIC,DINUM,DO
 . S DIC="^QA(741.4,",DIC(0)="L",DIC("DR")=""
 . S DLAYGO=741.4,X=QAOSREAS("NEW")
 . D FILE^DICN S QAOSD0=+Y
 . Q
 W !?10,"Old text: ",$P($G(^QA(741.4,QAOSD0,2)),"^")
 W !?10,"New text: ",QAOSTEXT("SHORT")
 Q:QAOFOUND=2
 K DA,DIC,DIE,DR
 S DIE="^QA(741.4,",DA=QAOSD0
 S DR=".01////"_QAOSREAS("NEW")_";2////"_QAOSSCRN
 S DR(1,741.4,1)="1////"_QAOSTEXT("LONG")
 S DR(1,741.4,2)="3////"_QAOSTEXT("SHORT")
 D ^DIE
 Q
REFER ;;SCREEN ^ OLD NUMBER ^ NEW NUMBER
 ;;NEW TEXT (SHORT)
 ;;NEW TEXT (LONG)
1011 ;;101.1^10^99
 ;;OTHER
 ;;OTHER
 ;;101.1^^10
 ;;PATIENT NON-COMPLIANCE
 ;;READMISSION APPEARS TO BE RELATED TO ISSUES OF PATIENT NON-COMPLIANCE
 ;;101.1^9^9
 ;;DECUBITI DEHYDRATION OR DRUG TOXICITY
 ;;PATIENT REHOSPITALIZED FOR DECUBITI DEHYDRATION OR DRUG TOXICITY
 ;;101.1^8^8
 ;;FAILURE OF CONTINUING TREATMENT DURING OUTPATIENT PERIOD
 ;;READMISSION APPEARS TO BE RELATED TO FAILURE OF CONTINUING TREATMENT DURING OUTPATIENT PERIOD
 ;;101.1^7^7
 ;;UNEXPECTED EXACERBATION OF ILLNESS
 ;;READMISSION APPEARS TO BE RELATED TO UNEXPECTED EXACERBATION OF ILLNESS
 ;;101.1^6^6
 ;;PATIENT EDUCATION
 ;;READMISSION APPEARS TO BE RELATED TO PATIENT EDUCATION CONCERNING PROBLEMS TREATED DURING FIRST HOSPITALIZATION
 ;;101.1^5^5
 ;;DISCHARGE ORDERS
 ;;READMISSION APPEARS TO BE RELATED TO SOME ASPECT OF DISCHARGE ORDERS
 ;;101.1^4^4
 ;;PRE-EXISTENT UNDIAGNOSED CONDITION
 ;;READMISSION APPEARS TO BE RELATED TO CONDITION WHICH MAY HAVE EXISTED AT TIME OF FIRST HOSPITALIZATION BUT WAS NOT DIAGNOSED
 ;;101.1^3^3
 ;;TIMELINESS OF DISCHARGE
 ;;READMISSION APPEARS TO BE RELATED TO TIMELINESS OF DISCHARGE
 ;;101.1^2^2
 ;;DISCHARGE PLANS MADE DURING PREVIOUS HOSPITALIZATION
 ;;READMISSION APPEARS TO BE RELATED TO DISCHARGE PLANS MADE DURING PREVIOUS HOSPITALIZATION
 ;;101.1^1^1
 ;;COMPLICATION OF TREATMENT DURING PRIOR HOSPITALIZATION
 ;;READMISSION APPEARS TO BE RELATED TO COMPLICATION OF TREATMENT DURING PRIOR HOSPITALIZATION
102 ;;102^5^99
 ;;OTHER
 ;;OTHER
 ;;102^2^2
 ;;OUTPATIENT DRUG THERAPY
 ;;ADMISSION APPEARS TO HAVE BEEN A CONSEQUENCE OF OUTPATIENT DRUG THERAPY
 ;;102^3^3
 ;;FOLLOWED TWO OR MORE OUTPATIENT VISITS FOR SAME ACUTE CONDITION
 ;;ADMISSION FOLLOWED TWO OR MORE OUTPATIENT VISITS FOR SAME ACUTE CONDITION
 ;;102^4^4
 ;;ESCALATION OF CARE INAPPROPRIATELY DELAYED
 ;;ESCALATION OF CARE TO INPATIENT LEVEL APPEARS TO HAVE BEEN INAPPROPRIATELY DELAYED
 ;;102^^1K
 ;;OUTPATIENT MANAGEMENT ISSUE: NON-COMPLIANCE AND FAILURE TO OBTAIN PRESCRIBED MEDICATIONS
 ;;ADMISSION APPEARS TO BE RELATED TO NON-COMPLIANCE AND FAILURE TO OBTAIN PRESCRIBED MEDICATIONS
 ;;102^1I^1J
 ;;OUTPATIENT MANAGEMENT ISSUE: FOLLOW-UP OF FINANCIAL OR SOCIAL SUPPORT PROBLEMS
 ;;ADMISSION APPEARS TO BE RELATED TO OUTPATIENT MANAGEMENT ISSUE: FOLLOW-UP OF FINANCIAL OR SOCIAL SUPPORT PROBLEMS PARTICULARLY FOR PSYCHIATRIC PATIENTS