-
Notifications
You must be signed in to change notification settings - Fork 3
/
shinryoukoui-basic-tab.tsx
275 lines (260 loc) · 10.7 KB
/
shinryoukoui-basic-tab.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
import { ColorChip } from "@/components/color-chip";
import { HStack } from "@/components/h-stack";
import { LabeledChip } from "@/components/labeled-chip";
import { UncontrolledToggle } from "@/components/toggle";
import { getValue } from "@/features/fields/get-values";
import {
formatCodeValue,
getAgeAdditionalFeeData,
getKubunBangouColor,
getTensuuranShuukeisakiShikibetsuLabel,
normalizeUnit,
} from "@/features/shinryoukoui-master-fields/shinryoukoui-master-utils";
import { getField } from "../shinryoukoui-master-fields/shinryoukoui-master-fields";
import { shinryoukouiMasterVirtualFields } from "../shinryoukoui-master-fields/shinryoukoui-master-virtual-field";
import { AgeAdditionalFeeTable } from "./age-additional-fee-table";
import { ChuukasanTable } from "./chuukasan-table";
import { KizamichiFormula } from "./kizamichi-formula";
import { KokujiShikibetsu1Chip } from "./kokuji-shikibetsu1-chip";
import { OthersSection } from "./others-section";
import { SectionHeading } from "./section-heading";
import { ShinryoukouiTable } from "./shinryoukoui-table";
import { ShisetsukijunList } from "./shisetsukijun-list";
import { SubHeading } from "./sub-heading";
export type DetailBasicTabProps = {
row: string[];
rows: string[][];
};
export function ShinryoukouiBasicTab({ row, rows }: DetailBasicTabProps) {
const kubunBangou = shinryoukouiMasterVirtualFields.kubunNo.value(row);
const ageAdditionalFeeData = getAgeAdditionalFeeData(row);
const 告示等識別区分 = getValue(row, getField("告示等識別区分(1)"));
const is基本項目 = 告示等識別区分 === "1" || 告示等識別区分 === "3" || 告示等識別区分 === "5";
return (
<>
<section className="mb-4">
<HStack className="mb-2 gap-2">
{kubunBangou !== "-" && (
<ColorChip color={getKubunBangouColor(kubunBangou)}>{kubunBangou}</ColorChip>
)}
<KokujiShikibetsu1Chip row={row} />
</HStack>
<div>
<span className="text-slate-500">{getValue(row, getField("診療行為コード"))}</span>
<span className="text-slate-300 text-lg"> | </span>
<span className="text-lg">{getValue(row, getField("基本漢字名称"))}</span>
</div>
{getValue(row, getField("基本漢字名称")) !==
getValue(row, getField("診療行為省略名称/省略漢字名称")) && (
<div className="text-sm my-1 text-slate-500">
略称: {getValue(row, getField("診療行為省略名称/省略漢字名称"))}
</div>
)}
</section>
<section>
<SectionHeading>基本情報</SectionHeading>
<HStack>
<LabeledChip label="告示等識別区分(1)">
{formatCodeValue(row, getField("告示等識別区分(1)"))}
</LabeledChip>
<LabeledChip label="告示等識別区分(2)">
{formatCodeValue(row, getField("告示等識別区分(2)"))}
</LabeledChip>
{getValue(row, getField("異動関連")) !== "0" && (
<LabeledChip label="異動前の診療行為コード">
{getValue(row, getField("異動関連"))}
</LabeledChip>
)}
</HStack>
</section>
<section>
<SectionHeading>算定可能な状況</SectionHeading>
<HStack>
<LabeledChip label="入外適用区分">
{formatCodeValue(row, getField("入外適用区分"))}
</LabeledChip>
<LabeledChip label="病院・診療所区分">
{formatCodeValue(row, getField("病院・診療所区分"))}
</LabeledChip>
<LabeledChip label="後期高齢者医療適用区分">
{formatCodeValue(row, getField("後期高齢者医療適用区分"))}
</LabeledChip>
<LabeledChip label="上下限年齢">
{shinryoukouiMasterVirtualFields.ageRange.value(row)}
</LabeledChip>
<LabeledChip label="上限回数">
{shinryoukouiMasterVirtualFields.limitCount.value(row)}
</LabeledChip>
<LabeledChip label="病床数区分">
{formatCodeValue(row, getField("病床数区分"))}
</LabeledChip>
<LabeledChip label="DPC適用区分">
{formatCodeValue(row, getField("DPC適用区分"))}
</LabeledChip>
</HStack>
<ShisetsukijunList row={row} />
</section>
<section>
<SectionHeading>点数</SectionHeading>
<HStack>
<LabeledChip label="点数">{shinryoukouiMasterVirtualFields.point.value(row)}</LabeledChip>
<LabeledChip label="旧点数">
{shinryoukouiMasterVirtualFields.prevPoint.value(row)}
</LabeledChip>
</HStack>
{is基本項目 && (
<HStack className="mt-1">
<LabeledChip label="逓減対象区分">
{formatCodeValue(row, getField("逓減対象区分"))}
</LabeledChip>
{getValue(row, getField("逓減対象区分")) === "1" && (
<LabeledChip label="包括逓減区分">
{formatCodeValue(row, getField("包括逓減区分"))}
</LabeledChip>
)}
</HStack>
)}
{getValue(row, getField("きざみ値/きざみ値計算識別")) === "1" && (
<div>
<SubHeading>きざみ値</SubHeading>
<KizamichiFormula row={row} />
</div>
)}
</section>
<section>
<SectionHeading>記録</SectionHeading>
<HStack>
<LabeledChip label="点数欄集計先識別(入院外)">
{emptyToHyphen(
getTensuuranShuukeisakiShikibetsuLabel(
getValue(row, getField("点数欄集計先識別(入院外)")),
),
)}
</LabeledChip>
<LabeledChip label="点数欄集計先識別(入院)">
{emptyToHyphen(
getTensuuranShuukeisakiShikibetsuLabel(
getValue(row, getField("点数欄集計先識別(入院)")),
),
)}
</LabeledChip>
</HStack>
<HStack className="mt-1">
<LabeledChip label="データ規格">
{getValue(row, getField("データ規格コード")) === "0"
? "数量の記録は不要"
: `数量の記録が必要 (単位=${normalizeUnit(
getValue(row, getField("データ規格名/漢字名称")),
)})`}
</LabeledChip>
</HStack>
</section>
{getValue(row, getField("注加算/注加算コード")) !== "0" && (
<section>
<SectionHeading>注加算</SectionHeading>
<>
<HStack>
<LabeledChip label="注加算コード">
{getValue(row, getField("注加算/注加算コード"))}
</LabeledChip>
<LabeledChip label="注加算通番">
{getValue(row, getField("注加算/注加算通番"))}
</LabeledChip>
</HStack>
<UncontrolledToggle label="同じ注加算コードの診療行為..." className="mb-4 mt-2">
{(open) =>
open && (
<ChuukasanTable
rows={rows}
chuukasanCode={getValue(row, getField("注加算/注加算コード"))}
shinryoukouiCodeToHighlight={getValue(row, getField("診療行為コード"))}
/>
)
}
</UncontrolledToggle>
</>
</section>
)}
{ageAdditionalFeeData.length > 0 && (
<section>
<SectionHeading>年齢加算</SectionHeading>
<AgeAdditionalFeeTable data={ageAdditionalFeeData} originalRows={rows} />
</section>
)}
{(getValue(row, getField("検査等実施判断区分")) !== "0" ||
getValue(row, getField("包括対象検査")) !== "0") && (
<section>
<SectionHeading>検査</SectionHeading>
<HStack>
<LabeledChip label="検査等実施判断区分">
{formatCodeValue(row, getField("検査等実施判断区分"))}
</LabeledChip>
<LabeledChip label="検査等実施判断グループ区分">
{formatCodeValue(row, getField("検査等実施判断グループ区分"))}
</LabeledChip>
{getValue(row, getField("検査等実施判断区分")) === "1" && (
<>
<LabeledChip label="包括対象検査">
{formatCodeValue(row, getField("包括対象検査"))}
</LabeledChip>
</>
)}
</HStack>
{getValue(row, getField("検査等実施判断区分")) === "2" && (
<UncontrolledToggle label="対応する検査等の実施料..." className="my-2">
{(open) =>
open && (
<ShinryoukouiTable
rows={rows}
filter={[
{
fieldKey: "検査等実施判断区分",
operator: ":",
value: "1",
negative: false,
},
{
fieldKey: "検査等実施判断グループ区分",
operator: ":",
value: getValue(row, getField("検査等実施判断グループ区分")),
negative: false,
},
]}
/>
)
}
</UncontrolledToggle>
)}
{getValue(row, getField("検査等実施判断区分")) === "1" && (
<>
<SubHeading>対応する判断料・診断料</SubHeading>
<div className="pb-2">
<ShinryoukouiTable
rows={rows}
filter={[
{
fieldKey: "検査等実施判断区分",
operator: ":",
value: "2",
negative: false,
},
{
fieldKey: "検査等実施判断グループ区分",
operator: ":",
value: getValue(row, getField("検査等実施判断グループ区分")),
negative: false,
},
]}
/>
</div>
</>
)}
</section>
)}
<OthersSection row={row} />
</>
);
}
function emptyToHyphen(value: string | undefined): string {
return value ? value : "-";
}