source: WorldVistAEHR/trunk/r/OCCURRENCE_SCREEN-QAO/QAOSCNV8.m@ 623

Last change on this file since 623 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1QAOSCNV8 ;HISC/DAD-CONVERT REASONS FOR REFERRAL ;9/9/93 13:52
2 ;;3.0;Occurrence Screen;;09/14/1993
3 W !!,"Converting text of reasons for referral"
4 W !,"---------------------------------------"
5 I $O(^QA(741.1,0))'>0,$O(^QA(741.4,0)) D Q
6 . S DIU="^QA(741.4,",DIU(0)="DT" D EN^DIU2
7 . Q
8 K ^TMP($J,"QAOSCNV8") S QAOCOUNT=0
9 F QAOSLINE=3:3 S QAOSDATA=$P($T(REFER+QAOSLINE),";;",2) Q:QAOSDATA="" D
10 . S QAOCOUNT=QAOCOUNT+1
11 . S ^TMP($J,"QAOSCNV8",QAOCOUNT)=QAOSDATA
12 . S ^TMP($J,"QAOSCNV8",QAOCOUNT,"S")=$P($T(REFER+QAOSLINE+1),";;",2)
13 . S ^TMP($J,"QAOSCNV8",QAOCOUNT,"L")=$P($T(REFER+QAOSLINE+2),";;",2)
14 . Q
15 D ^QAOSCNV9
16 F QAOSLINE=1:1:QAOCOUNT D LOOP
17 K DA,DIC,DIE,DINUM,DLAYGO,DO,DR,QAOCOUNT,QAOFOUND,QAOLDNEW,QAOSD0
18 K QAOSDATA,QAOSHORT,QAOSLINE,QAOSLONG,QAOSREAS,QAOSSCRN,QAOSTEXT,X,Y
19 K ^TMP($J,"QAOSCNV8")
20 Q
21LOOP ;
22 S QAOSDATA=^TMP($J,"QAOSCNV8",QAOSLINE),QAOSSCRN=$P(QAOSDATA,"^")
23 S QAOSREAS("OLD")=$P(QAOSDATA,"^",2),QAOSREAS("NEW")=$P(QAOSDATA,"^",3)
24 S QAOSTEXT("SHORT")=^TMP($J,"QAOSCNV8",QAOSLINE,"S")
25 S QAOSTEXT("LONG")=^TMP($J,"QAOSCNV8",QAOSLINE,"L")
26 W !!,"Screen: ",QAOSSCRN
27 I $G(^QA(741.1,QAOSSCRN,0))="" W " *** NOT FOUND ***" Q
28 W !?5,"Reason for referral code ==> "
29 W "Old: ",$S(QAOSREAS("OLD")]"":QAOSREAS("OLD"),1:"??")
30 W ?45,"New: ",QAOSREAS("NEW")
31 S QAOFOUND=0
32 F QAOLDNEW="NEW","OLD" D Q:QAOFOUND
33 . S X=QAOSREAS(QAOLDNEW),QAOSREAS=+X+($A(X,$L(X))/100)
34 . F QAOSD0=0:0 S QAOSD0=$O(^QA(741.4,"AC",QAOSSCRN,QAOSREAS,QAOSD0)) Q:QAOSD0'>0 D Q:QAOFOUND
35 .. S QAOSREAS(0)=$P($G(^QA(741.4,QAOSD0,0)),"^") Q:QAOSREAS(0)=""
36 .. S QAOSLONG=$P($G(^QA(741.4,QAOSD0,1)),"^")
37 .. S QAOSHORT=$P($G(^QA(741.4,QAOSD0,2)),"^")
38 .. I QAOSREAS(0)=QAOSREAS("NEW"),QAOSLONG=QAOSTEXT("LONG"),QAOSHORT=QAOSTEXT("SHORT") S QAOFOUND=2 Q
39 .. I QAOSREAS(0)=QAOSREAS("OLD") S QAOFOUND=1
40 .. Q
41 . Q
42 I 'QAOFOUND D
43 . K DD,DIC,DINUM,DO
44 . S DIC="^QA(741.4,",DIC(0)="L",DIC("DR")=""
45 . S DLAYGO=741.4,X=QAOSREAS("NEW")
46 . D FILE^DICN S QAOSD0=+Y
47 . Q
48 W !?10,"Old text: ",$P($G(^QA(741.4,QAOSD0,2)),"^")
49 W !?10,"New text: ",QAOSTEXT("SHORT")
50 Q:QAOFOUND=2
51 K DA,DIC,DIE,DR
52 S DIE="^QA(741.4,",DA=QAOSD0
53 S DR=".01////"_QAOSREAS("NEW")_";2////"_QAOSSCRN
54 S DR(1,741.4,1)="1////"_QAOSTEXT("LONG")
55 S DR(1,741.4,2)="3////"_QAOSTEXT("SHORT")
56 D ^DIE
57 Q
58REFER ;;SCREEN ^ OLD NUMBER ^ NEW NUMBER
59 ;;NEW TEXT (SHORT)
60 ;;NEW TEXT (LONG)
611011 ;;101.1^10^99
62 ;;OTHER
63 ;;OTHER
64 ;;101.1^^10
65 ;;PATIENT NON-COMPLIANCE
66 ;;READMISSION APPEARS TO BE RELATED TO ISSUES OF PATIENT NON-COMPLIANCE
67 ;;101.1^9^9
68 ;;DECUBITI DEHYDRATION OR DRUG TOXICITY
69 ;;PATIENT REHOSPITALIZED FOR DECUBITI DEHYDRATION OR DRUG TOXICITY
70 ;;101.1^8^8
71 ;;FAILURE OF CONTINUING TREATMENT DURING OUTPATIENT PERIOD
72 ;;READMISSION APPEARS TO BE RELATED TO FAILURE OF CONTINUING TREATMENT DURING OUTPATIENT PERIOD
73 ;;101.1^7^7
74 ;;UNEXPECTED EXACERBATION OF ILLNESS
75 ;;READMISSION APPEARS TO BE RELATED TO UNEXPECTED EXACERBATION OF ILLNESS
76 ;;101.1^6^6
77 ;;PATIENT EDUCATION
78 ;;READMISSION APPEARS TO BE RELATED TO PATIENT EDUCATION CONCERNING PROBLEMS TREATED DURING FIRST HOSPITALIZATION
79 ;;101.1^5^5
80 ;;DISCHARGE ORDERS
81 ;;READMISSION APPEARS TO BE RELATED TO SOME ASPECT OF DISCHARGE ORDERS
82 ;;101.1^4^4
83 ;;PRE-EXISTENT UNDIAGNOSED CONDITION
84 ;;READMISSION APPEARS TO BE RELATED TO CONDITION WHICH MAY HAVE EXISTED AT TIME OF FIRST HOSPITALIZATION BUT WAS NOT DIAGNOSED
85 ;;101.1^3^3
86 ;;TIMELINESS OF DISCHARGE
87 ;;READMISSION APPEARS TO BE RELATED TO TIMELINESS OF DISCHARGE
88 ;;101.1^2^2
89 ;;DISCHARGE PLANS MADE DURING PREVIOUS HOSPITALIZATION
90 ;;READMISSION APPEARS TO BE RELATED TO DISCHARGE PLANS MADE DURING PREVIOUS HOSPITALIZATION
91 ;;101.1^1^1
92 ;;COMPLICATION OF TREATMENT DURING PRIOR HOSPITALIZATION
93 ;;READMISSION APPEARS TO BE RELATED TO COMPLICATION OF TREATMENT DURING PRIOR HOSPITALIZATION
94102 ;;102^5^99
95 ;;OTHER
96 ;;OTHER
97 ;;102^2^2
98 ;;OUTPATIENT DRUG THERAPY
99 ;;ADMISSION APPEARS TO HAVE BEEN A CONSEQUENCE OF OUTPATIENT DRUG THERAPY
100 ;;102^3^3
101 ;;FOLLOWED TWO OR MORE OUTPATIENT VISITS FOR SAME ACUTE CONDITION
102 ;;ADMISSION FOLLOWED TWO OR MORE OUTPATIENT VISITS FOR SAME ACUTE CONDITION
103 ;;102^4^4
104 ;;ESCALATION OF CARE INAPPROPRIATELY DELAYED
105 ;;ESCALATION OF CARE TO INPATIENT LEVEL APPEARS TO HAVE BEEN INAPPROPRIATELY DELAYED
106 ;;102^^1K
107 ;;OUTPATIENT MANAGEMENT ISSUE: NON-COMPLIANCE AND FAILURE TO OBTAIN PRESCRIBED MEDICATIONS
108 ;;ADMISSION APPEARS TO BE RELATED TO NON-COMPLIANCE AND FAILURE TO OBTAIN PRESCRIBED MEDICATIONS
109 ;;102^1I^1J
110 ;;OUTPATIENT MANAGEMENT ISSUE: FOLLOW-UP OF FINANCIAL OR SOCIAL SUPPORT PROBLEMS
111 ;;ADMISSION APPEARS TO BE RELATED TO OUTPATIENT MANAGEMENT ISSUE: FOLLOW-UP OF FINANCIAL OR SOCIAL SUPPORT PROBLEMS PARTICULARLY FOR PSYCHIATRIC PATIENTS
Note: See TracBrowser for help on using the repository browser.