fhir-react 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish_npmjs.yml +18 -0
- package/.storybook/config.js +9 -3
- package/.storybook/presets.js +1 -0
- package/.storybook/preview-head.html +4 -0
- package/README.md +47 -3
- package/package.json +13 -4
- package/src/assets/common/chevron-right.svg +3 -0
- package/src/assets/containers/AllergyIntolerance/allergy-intolerance.svg +9 -0
- package/src/assets/containers/Appointment/appointment.svg +14 -0
- package/src/assets/containers/CarePlan/care-plan.svg +10 -0
- package/src/assets/containers/CareTeam/care-team.svg +10 -0
- package/src/assets/containers/Claim/claim.svg +6 -0
- package/src/assets/containers/ClaimResponse/claim-response.svg +7 -0
- package/src/assets/containers/Condition/condition.svg +11 -0
- package/src/assets/containers/Device/device.svg +8 -0
- package/src/assets/containers/DiagnosticReport/diagnostic-report.svg +14 -0
- package/src/assets/containers/DocumentReference/document-reference.svg +10 -0
- package/src/assets/containers/Encounter/encounter.svg +10 -0
- package/src/assets/containers/ExplanationOfBenefit/explanation-of-benefit.svg +3 -0
- package/src/assets/containers/FamilyMemberHistory/family-member-history.svg +7 -0
- package/src/assets/containers/Goal/goal.svg +11 -0
- package/src/assets/containers/Immunization/immunization.svg +7 -0
- package/src/assets/containers/List/list.svg +3 -0
- package/src/assets/containers/Location/location.svg +4 -0
- package/src/assets/containers/Medication/medication.svg +5 -0
- package/src/assets/containers/MedicationAdministration/medication-administration.svg +6 -0
- package/src/assets/containers/MedicationKnowledge/medication-knowledge.svg +11 -0
- package/src/assets/containers/MedicationStatement/medication-statement.svg +5 -0
- package/src/assets/containers/Observation/observation.svg +12 -0
- package/src/assets/containers/Practitioner/practitioner.svg +5 -0
- package/src/assets/containers/Procedure/procedure.svg +9 -0
- package/src/assets/containers/Questionnaire/questionnaire.svg +6 -0
- package/src/assets/containers/QuestionnaireResponse/questionnaire-response.svg +6 -0
- package/src/assets/containers/QustionnaireResponse/questionnaire-response.svg +6 -0
- package/src/assets/containers/ResearchStudy/research-study.svg +9 -0
- package/src/assets/containers/ResourceCategory/resource-placeholder.svg +3 -0
- package/src/components/containers/Accordion/Accordion.js +80 -0
- package/src/components/containers/Accordion/Accordion.stories.js +76 -0
- package/src/components/containers/Accordion/index.js +3 -0
- package/src/components/containers/ResourceContainer/ResourceContainer.css +0 -1
- package/src/components/containers/ResourceContainer/ResourceContainer.js +1 -1
- package/src/components/datatypes/AccountBalance/AccountBalance.js +33 -0
- package/src/components/datatypes/AccountBalance/index.js +3 -0
- package/src/components/datatypes/Annotation/Annotation.js +1 -1
- package/src/components/datatypes/Date/Date.js +14 -4
- package/src/components/datatypes/DatePeriod/DatePeriod.js +38 -0
- package/src/components/datatypes/DatePeriod/index.js +3 -0
- package/src/components/datatypes/HeaderIcon/HeaderIcon.js +31 -0
- package/src/components/datatypes/HeaderIcon/index.js +3 -0
- package/src/components/datatypes/HumanName/HumanName.js +6 -21
- package/src/components/datatypes/Reference/Reference.js +3 -6
- package/src/components/resources/AdverseEvent/AdverseEvent.test.js +2 -2
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +4 -4
- package/src/components/resources/Appointment/Appointment.js +91 -65
- package/src/components/resources/Appointment/Appointment.test.js +3 -3
- package/src/components/resources/Bundle/Bundle.js +2 -2
- package/src/components/resources/Bundle/Bundle.stories.js +78 -12
- package/src/components/resources/Bundle/Bundle.test.js +3 -0
- package/src/components/resources/CarePlan/CarePlan.test.js +4 -4
- package/src/components/resources/CareTeam/CareTeam.js +13 -14
- package/src/components/resources/CareTeam/CareTeam.test.js +4 -4
- package/src/components/resources/Claim/Claim.test.js +6 -6
- package/src/components/resources/ClaimResponse/ClaimResponse.test.js +6 -6
- package/src/components/resources/Condition/Condition.js +63 -47
- package/src/components/resources/Condition/Condition.stories.js +41 -8
- package/src/components/resources/Condition/Condition.test.js +20 -14
- package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +5 -7
- package/src/components/resources/DocumentReference/DocumentReference.js +1 -1
- package/src/components/resources/DocumentReference/DocumentReference.test.js +3 -3
- package/src/components/resources/Encounter/Encounter.js +66 -36
- package/src/components/resources/Encounter/EncounterParticipants.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/CareTeam.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/Diagnosis.js +15 -5
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +272 -201
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +79 -62
- package/src/components/resources/ExplanationOfBenefit/Items.js +2 -2
- package/src/components/resources/ExplanationOfBenefit/PriceLabel.js +20 -0
- package/src/components/resources/ExplanationOfBenefit/Related.js +3 -3
- package/src/components/resources/ExplanationOfBenefit/SupportingInfo.js +14 -3
- package/src/components/resources/ExplanationOfBenefit/TotalGraph.js +68 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.js +89 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +78 -0
- package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.test.js +51 -0
- package/src/components/resources/ExplanationOfBenefitGraph/index.js +3 -0
- package/src/components/resources/Goal/Goal.test.js +1 -1
- package/src/components/resources/Immunization/Immunization.js +125 -94
- package/src/components/resources/Immunization/Immunization.stories.js +23 -4
- package/src/components/resources/Immunization/Immunization.test.js +17 -12
- package/src/components/resources/List/List.test.js +3 -3
- package/src/components/resources/MedicationAdministration/MedicationAdministration.test.js +7 -7
- package/src/components/resources/MedicationDispense/MedicationDispense.test.js +2 -2
- package/src/components/resources/MedicationRequest/MedicationRequest.test.js +4 -4
- package/src/components/resources/Observation/Observation.js +72 -54
- package/src/components/resources/Observation/Observation.test.js +6 -18
- package/src/components/resources/Observation/ObservationGraph.js +159 -55
- package/src/components/resources/Observation/ObservationGraph.test.js +47 -26
- package/src/components/resources/Patient/Patient.js +77 -87
- package/src/components/resources/Patient/Patient.test.js +1 -1
- package/src/components/resources/Practitioner/Practitioner.js +80 -60
- package/src/components/resources/Practitioner/Practitioner.test.js +4 -4
- package/src/components/resources/Procedure/Procedure.js +99 -87
- package/src/components/resources/Procedure/Procedure.stories.js +8 -6
- package/src/components/resources/Procedure/Procedure.test.js +11 -8
- package/src/components/resources/Questionnaire/Questionnaire.test.js +3 -3
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.test.js +5 -5
- package/src/components/resources/ReferralRequest/ReferralRequest.test.js +2 -2
- package/src/components/resources/ResearchStudy/ResearchStudy.test.js +1 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +56 -0
- package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +29 -0
- package/src/components/resources/ResourceCategory/ResourceCategory.test.js +101 -0
- package/src/components/resources/ResourceCategory/index.js +3 -0
- package/src/components/ui/_header.scss +3 -0
- package/src/components/ui/bootstrap-reboot.min.css +2 -22
- package/src/components/ui/index.js +191 -29
- package/src/constants/badge-status.jsx +98 -0
- package/src/fixtures/dstu2/resources/condition/condition.svg +35 -0
- package/src/fixtures/dstu2/resources/immunization/immunization.svg +10 -0
- package/src/fixtures/example-icons.jsx +169 -0
- package/src/index.js +6 -1
- package/src/style.scss +176 -0
- package/src/utils/formatDate.js +21 -0
- package/src/utils/formatDate.test.js +22 -0
- package/src/utils/getBadgeColor.js +6 -0
- package/src/utils/getBadgeColor.test.js +14 -0
- package/src/utils/isUrl.js +9 -0
- package/src/utils/isUrl.test.js +12 -0
- package/src/utils.js +7 -0
- package/build/bootstrap-reboot.min.css +0 -414
- package/build/index.js +0 -15
- package/build/style.css +0 -459
- package/src/components/datatypes/HumanName/HumanName.css +0 -15
- package/src/components/datatypes/Reference/Reference.css +0 -8
- package/src/components/resources/Observation/ObservationGraph.css +0 -51
- package/src/components/resources/Patient/Patient.css +0 -19
- package/src/components/ui/index.css +0 -123
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import _get from 'lodash/get';
|
|
4
|
-
import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
|
|
5
|
-
import fhirVersions from '../fhirResourceVersions';
|
|
6
|
-
|
|
7
1
|
import {
|
|
8
|
-
|
|
9
|
-
Header,
|
|
10
|
-
Title,
|
|
11
|
-
Value,
|
|
2
|
+
Badge,
|
|
12
3
|
Body,
|
|
13
|
-
|
|
4
|
+
Header,
|
|
5
|
+
MissingValue,
|
|
6
|
+
Root,
|
|
14
7
|
Table,
|
|
15
|
-
TableRow,
|
|
16
8
|
TableCell,
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
TableRow,
|
|
10
|
+
Value,
|
|
11
|
+
ValueSection,
|
|
19
12
|
} from '../../ui';
|
|
13
|
+
|
|
14
|
+
import CareTeam from './CareTeam';
|
|
15
|
+
import CodeableConcept from '../../datatypes/CodeableConcept';
|
|
20
16
|
import Coding from '../../datatypes/Coding';
|
|
21
17
|
import Date from '../../datatypes/Date';
|
|
22
|
-
import Money from '../../datatypes/Money';
|
|
23
|
-
import Reference from '../../datatypes/Reference';
|
|
24
|
-
import Period from '../../datatypes/Period';
|
|
25
|
-
import TotalSum from './TotalSum';
|
|
26
18
|
import Diagnosis from './Diagnosis';
|
|
27
|
-
import SupportingInfo from './SupportingInfo';
|
|
28
|
-
import Items from './Items';
|
|
29
19
|
import Identifier from '../../datatypes/Identifier/Identifier';
|
|
30
|
-
import
|
|
31
|
-
import
|
|
20
|
+
import Items from './Items';
|
|
21
|
+
import Money from '../../datatypes/Money';
|
|
22
|
+
import Period from '../../datatypes/Period';
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import Reference from '../../datatypes/Reference';
|
|
32
26
|
import Related from './Related';
|
|
27
|
+
import SupportingInfo from './SupportingInfo';
|
|
28
|
+
import TotalSum from './TotalSum';
|
|
29
|
+
import UnhandledResourceDataStructure from '../UnhandledResourceDataStructure';
|
|
30
|
+
import _get from 'lodash/get';
|
|
31
|
+
import fhirVersions from '../fhirResourceVersions';
|
|
32
|
+
import Accordion from '../../containers/Accordion';
|
|
33
|
+
import TotalGraph from './TotalGraph';
|
|
34
|
+
import PriceLabel from './PriceLabel';
|
|
35
|
+
import { TableHeader } from '../../ui';
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
38
|
* @typedef ExplanationOfBenefitServiceItem
|
|
@@ -275,191 +278,259 @@ const ExplanationOfBenefit = props => {
|
|
|
275
278
|
related,
|
|
276
279
|
} = fhirResourceData;
|
|
277
280
|
|
|
281
|
+
const getRowItem = (item, index) =>
|
|
282
|
+
('isLoaded' in item ? item.isLoaded : item.data) && (
|
|
283
|
+
<div
|
|
284
|
+
key={`details-item-${index}`}
|
|
285
|
+
className="col-12 col-sm-6 col-md-4 text-wrap"
|
|
286
|
+
>
|
|
287
|
+
<Value label={item.label} data-testid={item.testId} dirColumn>
|
|
288
|
+
{item.data}
|
|
289
|
+
</Value>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
const getHeaderPrice = () => {
|
|
294
|
+
if (totalCost) {
|
|
295
|
+
return <PriceLabel totalCost={totalCost} />;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const EOBRowData = [
|
|
300
|
+
{
|
|
301
|
+
label: 'Type',
|
|
302
|
+
testId: 'type',
|
|
303
|
+
data:
|
|
304
|
+
hasType &&
|
|
305
|
+
type.map((typeItem, i) => (
|
|
306
|
+
<Coding key={`item-${i}`} fhirData={typeItem} />
|
|
307
|
+
)),
|
|
308
|
+
isLoaded: hasType,
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
label: 'Identifier',
|
|
312
|
+
testId: 'identifier',
|
|
313
|
+
data:
|
|
314
|
+
identifier &&
|
|
315
|
+
identifier.map((id, index) => (
|
|
316
|
+
<div key={`identifier-${index}`}>
|
|
317
|
+
<Identifier fhirData={id} />
|
|
318
|
+
</div>
|
|
319
|
+
)),
|
|
320
|
+
isLoaded: identifier,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
label: 'Outcome',
|
|
324
|
+
testId: 'outcome',
|
|
325
|
+
data: outcome,
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
label: 'Insurer',
|
|
329
|
+
testId: 'insurer',
|
|
330
|
+
data: <Reference fhirData={insurer} />,
|
|
331
|
+
isLoaded: hasInsurer,
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
label: 'Claim provider',
|
|
335
|
+
testId: 'provider',
|
|
336
|
+
data: <Reference fhirData={provider} />,
|
|
337
|
+
isLoaded: provider,
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
label: 'Total',
|
|
341
|
+
testId: 'totalSum',
|
|
342
|
+
data: <TotalSum fhirData={total} />,
|
|
343
|
+
isLoaded: hasTotal,
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
label: 'Payment',
|
|
347
|
+
testId: 'payment',
|
|
348
|
+
data: <Money fhirData={payment} />,
|
|
349
|
+
isLoaded: payment,
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
label: 'Payee',
|
|
353
|
+
testId: 'payee',
|
|
354
|
+
data: (
|
|
355
|
+
<>
|
|
356
|
+
{payeeType && <CodeableConcept fhirData={payeeType} />}
|
|
357
|
+
{payeeParty && <Reference fhirData={payeeParty} />}
|
|
358
|
+
</>
|
|
359
|
+
),
|
|
360
|
+
isLoaded: payeeType || payeeParty,
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
label: 'Billable period',
|
|
364
|
+
testId: 'billablePeriod',
|
|
365
|
+
data: <Period fhirData={billablePeriod} />,
|
|
366
|
+
isLoaded: billablePeriod,
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
label: 'Purpose',
|
|
370
|
+
testId: 'purpose',
|
|
371
|
+
data: useCode,
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
label: 'Patient',
|
|
375
|
+
testId: 'patient',
|
|
376
|
+
data: <Reference fhirData={patient} />,
|
|
377
|
+
isLoaded: patient,
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
label: 'Insurance',
|
|
381
|
+
testId: 'insurance',
|
|
382
|
+
data: <Reference fhirData={insurance} />,
|
|
383
|
+
isLoaded: insurance,
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
label: 'Related',
|
|
387
|
+
testId: 'related',
|
|
388
|
+
data: <Related fhirData={related} />,
|
|
389
|
+
isLoaded: related,
|
|
390
|
+
},
|
|
391
|
+
];
|
|
392
|
+
|
|
278
393
|
return (
|
|
279
394
|
<Root name="ExplanationOfBenefit">
|
|
280
|
-
<
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
395
|
+
<Accordion
|
|
396
|
+
headerContent={
|
|
397
|
+
<Header
|
|
398
|
+
resourceName="ExplanationOfBenefit"
|
|
399
|
+
title={
|
|
400
|
+
disposition ? disposition : `Explanation Of Benefit (default)`
|
|
401
|
+
}
|
|
402
|
+
badges={getHeaderPrice()}
|
|
403
|
+
rightAdditionalContent={
|
|
404
|
+
resourceStatus && <Badge>{resourceStatus}</Badge>
|
|
405
|
+
}
|
|
406
|
+
additionalContent={
|
|
407
|
+
created &&
|
|
408
|
+
created !== 'undefined' && (
|
|
409
|
+
<Value label="Start date" data-testid="created">
|
|
410
|
+
<Date fhirData={created} isBlack />
|
|
411
|
+
</Value>
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
/>
|
|
415
|
+
}
|
|
416
|
+
bodyContent={
|
|
417
|
+
<Body>
|
|
418
|
+
<ValueSection
|
|
419
|
+
label="Details"
|
|
420
|
+
data-testid="details"
|
|
421
|
+
className="mt-3"
|
|
422
|
+
>
|
|
423
|
+
<div className="row gy-sm-3">
|
|
424
|
+
{EOBRowData.map((x, index) => getRowItem(x, index))}
|
|
302
425
|
</div>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
</Value>
|
|
310
|
-
)}
|
|
311
|
-
{hasInsurer && (
|
|
312
|
-
<Value label="Insurer" data-testid="insurer">
|
|
313
|
-
<Reference fhirData={insurer} />
|
|
314
|
-
</Value>
|
|
315
|
-
)}
|
|
316
|
-
{provider && (
|
|
317
|
-
<Value label="Claim provider" data-testid="provider">
|
|
318
|
-
<Reference fhirData={provider} />
|
|
319
|
-
</Value>
|
|
320
|
-
)}
|
|
321
|
-
{totalCost && (
|
|
322
|
-
<Value label="Total cost" data-testid="totalCost">
|
|
323
|
-
<Money fhirData={totalCost} />
|
|
324
|
-
</Value>
|
|
325
|
-
)}
|
|
326
|
-
{totalBenefit && (
|
|
327
|
-
<Value label="Total benefit" data-testid="totalBenefit">
|
|
328
|
-
<Money fhirData={totalBenefit} />
|
|
329
|
-
</Value>
|
|
330
|
-
)}
|
|
331
|
-
{hasTotal && (
|
|
332
|
-
<Value label="Total" data-testid="totalSum">
|
|
333
|
-
<TotalSum fhirData={total} />
|
|
334
|
-
</Value>
|
|
335
|
-
)}
|
|
336
|
-
{payment && (
|
|
337
|
-
<Value label="Payment" data-testid="payment">
|
|
338
|
-
<Money fhirData={payment} />
|
|
339
|
-
</Value>
|
|
340
|
-
)}
|
|
341
|
-
{(payeeType || payeeParty) && (
|
|
342
|
-
<Value label="Payee" data-testid="payee">
|
|
343
|
-
{payeeType && <CodeableConcept fhirData={payeeType} />}
|
|
344
|
-
{payeeParty && <Reference fhirData={payeeParty} />}
|
|
345
|
-
</Value>
|
|
346
|
-
)}
|
|
347
|
-
{billablePeriod && (
|
|
348
|
-
<Value label="Billable period" data-testid="billablePeriod">
|
|
349
|
-
<Period fhirData={billablePeriod} />
|
|
350
|
-
</Value>
|
|
351
|
-
)}
|
|
352
|
-
{useCode && (
|
|
353
|
-
<Value label="Purpose" data-testid="purpose">
|
|
354
|
-
{useCode}
|
|
355
|
-
</Value>
|
|
356
|
-
)}
|
|
357
|
-
{patient && (
|
|
358
|
-
<Value label="Patient" data-testid="patient">
|
|
359
|
-
<Reference fhirData={patient} />
|
|
360
|
-
</Value>
|
|
361
|
-
)}
|
|
362
|
-
{insurance && (
|
|
363
|
-
<Value label="Insurance" data-testid="insurance">
|
|
364
|
-
<Reference fhirData={insurance} />
|
|
365
|
-
</Value>
|
|
366
|
-
)}
|
|
367
|
-
{related && (
|
|
368
|
-
<Value label="Related" data-testid="related">
|
|
369
|
-
<Related fhirData={related} />
|
|
370
|
-
</Value>
|
|
371
|
-
)}
|
|
372
|
-
{hasDiagnosis && <Diagnosis fhirData={diagnosis} />}
|
|
373
|
-
{hasSupportingInfo && <SupportingInfo fhirData={supportingInfo} />}
|
|
426
|
+
</ValueSection>
|
|
427
|
+
{hasDiagnosis && <Diagnosis fhirData={diagnosis} />}
|
|
428
|
+
{hasSupportingInfo && <SupportingInfo fhirData={supportingInfo} />}
|
|
429
|
+
{totalCost && totalBenefit && (
|
|
430
|
+
<TotalGraph fhirData={{ totalCost, totalBenefit }} />
|
|
431
|
+
)}
|
|
374
432
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return (
|
|
389
|
-
<TableRow key={`serviceItem-${i}`}>
|
|
390
|
-
<TableCell>
|
|
391
|
-
<Coding fhirData={serviceItem.coding} />
|
|
392
|
-
</TableCell>
|
|
393
|
-
<TableCell>
|
|
394
|
-
{serviceItem.servicedDate ? (
|
|
395
|
-
<Date fhirData={serviceItem.servicedDate} />
|
|
396
|
-
) : (
|
|
397
|
-
<MissingValue />
|
|
398
|
-
)}
|
|
399
|
-
</TableCell>
|
|
400
|
-
<TableCell>
|
|
401
|
-
{Number.isFinite(Number(serviceItem.quantity)) ? (
|
|
402
|
-
serviceItem.quantity
|
|
403
|
-
) : (
|
|
404
|
-
<MissingValue />
|
|
405
|
-
)}
|
|
406
|
-
</TableCell>
|
|
407
|
-
<TableCell>
|
|
408
|
-
{Number.isFinite(
|
|
409
|
-
Number(_get(serviceItem, 'itemCost.value')),
|
|
410
|
-
) ? (
|
|
411
|
-
<Money fhirData={serviceItem.itemCost} />
|
|
412
|
-
) : (
|
|
413
|
-
<MissingValue />
|
|
414
|
-
)}
|
|
415
|
-
</TableCell>
|
|
433
|
+
{hasServices && (
|
|
434
|
+
<ValueSection
|
|
435
|
+
label="Services"
|
|
436
|
+
data-testid="hasServices"
|
|
437
|
+
marginTop
|
|
438
|
+
>
|
|
439
|
+
<Table>
|
|
440
|
+
<thead>
|
|
441
|
+
<TableRow>
|
|
442
|
+
<TableHeader>Service</TableHeader>
|
|
443
|
+
<TableHeader>Service date</TableHeader>
|
|
444
|
+
<TableHeader>Quantity</TableHeader>
|
|
445
|
+
<TableHeader>Item cost</TableHeader>
|
|
416
446
|
</TableRow>
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
447
|
+
</thead>
|
|
448
|
+
<tbody className="border-top-0">
|
|
449
|
+
{services.map((serviceItem, i) => {
|
|
450
|
+
return (
|
|
451
|
+
<TableRow key={`serviceItem-${i}`}>
|
|
452
|
+
<TableCell data-testid="explanation.service">
|
|
453
|
+
<Coding fhirData={serviceItem.coding} />
|
|
454
|
+
</TableCell>
|
|
455
|
+
<TableCell data-testid="explanation.servicedDate">
|
|
456
|
+
{serviceItem.servicedDate ? (
|
|
457
|
+
<Date fhirData={serviceItem.servicedDate} />
|
|
458
|
+
) : (
|
|
459
|
+
<MissingValue />
|
|
460
|
+
)}
|
|
461
|
+
</TableCell>
|
|
462
|
+
<TableCell data-testid="explanation.quantity">
|
|
463
|
+
{Number.isFinite(Number(serviceItem.quantity)) ? (
|
|
464
|
+
serviceItem.quantity
|
|
465
|
+
) : (
|
|
466
|
+
<MissingValue />
|
|
467
|
+
)}
|
|
468
|
+
</TableCell>
|
|
469
|
+
<TableCell data-testid="explanation.itemCost">
|
|
470
|
+
{Number.isFinite(
|
|
471
|
+
Number(_get(serviceItem, 'itemCost.value')),
|
|
472
|
+
) ? (
|
|
473
|
+
<Money fhirData={serviceItem.itemCost} />
|
|
474
|
+
) : (
|
|
475
|
+
<MissingValue />
|
|
476
|
+
)}
|
|
477
|
+
</TableCell>
|
|
478
|
+
</TableRow>
|
|
479
|
+
);
|
|
480
|
+
})}
|
|
481
|
+
</tbody>
|
|
482
|
+
</Table>
|
|
483
|
+
</ValueSection>
|
|
484
|
+
)}
|
|
485
|
+
{hasInformation && (
|
|
486
|
+
<ValueSection
|
|
487
|
+
label="Information"
|
|
488
|
+
data-testid="hasInformation"
|
|
489
|
+
marginTop
|
|
490
|
+
>
|
|
491
|
+
<Table>
|
|
492
|
+
<thead>
|
|
493
|
+
<TableRow>
|
|
494
|
+
<TableHeader />
|
|
495
|
+
<TableHeader>Status</TableHeader>
|
|
453
496
|
</TableRow>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
497
|
+
</thead>
|
|
498
|
+
<tbody className="border-top-0">
|
|
499
|
+
{information.map((informationItem, i) => {
|
|
500
|
+
const infoTitle = _get(
|
|
501
|
+
informationItem,
|
|
502
|
+
'category.coding.0',
|
|
503
|
+
);
|
|
504
|
+
const infoStatus = _get(informationItem, 'code.coding.0');
|
|
505
|
+
|
|
506
|
+
return (
|
|
507
|
+
<TableRow key={`serviceItem-${i}`}>
|
|
508
|
+
<TableCell>
|
|
509
|
+
{infoTitle ? (
|
|
510
|
+
<Coding fhirData={infoTitle} />
|
|
511
|
+
) : (
|
|
512
|
+
<MissingValue />
|
|
513
|
+
)}
|
|
514
|
+
</TableCell>
|
|
515
|
+
<TableCell>
|
|
516
|
+
{infoStatus ? (
|
|
517
|
+
<Coding fhirData={infoStatus} />
|
|
518
|
+
) : (
|
|
519
|
+
<MissingValue />
|
|
520
|
+
)}
|
|
521
|
+
</TableCell>
|
|
522
|
+
</TableRow>
|
|
523
|
+
);
|
|
524
|
+
})}
|
|
525
|
+
</tbody>
|
|
526
|
+
</Table>
|
|
527
|
+
</ValueSection>
|
|
528
|
+
)}
|
|
529
|
+
{hasItems && <Items fhirData={items} />}
|
|
530
|
+
{hasCareTeam && <CareTeam fhirData={careTeam} />}
|
|
531
|
+
</Body>
|
|
532
|
+
}
|
|
533
|
+
/>
|
|
463
534
|
</Root>
|
|
464
535
|
);
|
|
465
536
|
};
|