fhir-react 0.3.6 → 0.3.9
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/.circleci/config.yml +1 -1
- package/.eslintrc +10 -1
- package/.stylelintrc +6 -2
- package/README.md +19 -1
- package/build/index.js +15 -11
- package/build/style.css +11 -10
- package/package.json +55 -54
- package/src/assets/containers/AdverseEvent/adverse-event.svg +6 -0
- package/src/assets/containers/Coverage/coverage.svg +4 -0
- package/src/assets/containers/Generic/generic.svg +3 -0
- package/src/assets/containers/Medication/medication.svg +5 -0
- package/src/assets/containers/MedicationDispense/medication-dispense.svg +5 -0
- package/src/assets/containers/Organization/organization.svg +5 -0
- package/src/assets/containers/PractitionerRole/practitioner-role.svg +5 -0
- package/src/assets/containers/ReferralRequest/referral-request.svg +8 -0
- package/src/assets/containers/RelatedPerson/related-person.svg +6 -0
- package/src/components/containers/Accordion/Accordion.js +44 -13
- package/src/components/containers/ResourceContainer/ResourceContainer.css +4 -0
- package/src/components/containers/ResourceContainer/ResourceContainer.js +28 -37
- package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +23 -1
- package/src/components/datatypes/Attachment/Attachment.css +5 -0
- package/src/components/datatypes/Attachment/Attachment.js +7 -2
- package/src/components/datatypes/CodeableConcept/CodeableConcept.js +6 -3
- package/src/components/datatypes/Coding/Coding.js +7 -3
- package/src/components/datatypes/Identifier/Identifier.js +7 -3
- package/src/components/datatypes/Reference/Reference.js +7 -1
- package/src/components/datatypes/Telecom/Telecom.js +2 -3
- package/src/components/resources/AdverseEvent/AdverseEvent.js +88 -42
- package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +12 -2
- package/src/components/resources/AdverseEvent/AdverseEvent.test.js +109 -2
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.js +9 -1
- package/src/components/resources/AllergyIntolerance/AllergyIntolerance.test.js +36 -1
- package/src/components/resources/Appointment/Appointment.js +9 -1
- package/src/components/resources/Appointment/Appointment.test.js +36 -1
- package/src/components/resources/Binary/Binary.js +2 -1
- package/src/components/resources/Bundle/Bundle.css +7 -0
- package/src/components/resources/Bundle/Bundle.js +15 -11
- package/src/components/resources/Bundle/Bundle.stories.js +12 -78
- package/src/components/resources/Bundle/Bundle.test.js +0 -3
- package/src/components/resources/CarePlan/CarePlan.js +9 -1
- package/src/components/resources/CarePlan/CarePlan.test.js +42 -6
- package/src/components/resources/CareTeam/CareTeam.js +79 -50
- package/src/components/resources/CareTeam/CareTeam.stories.js +20 -3
- package/src/components/resources/CareTeam/CareTeam.test.js +109 -1
- package/src/components/resources/CareTeam/CareTeamParticipants.js +1 -1
- package/src/components/resources/Claim/CareTeam.js +55 -0
- package/src/components/resources/Claim/Claim.css +2 -11
- package/src/components/resources/Claim/Claim.js +165 -309
- package/src/components/resources/Claim/Claim.stories.js +37 -5
- package/src/components/resources/Claim/Claim.test.js +104 -1
- package/src/components/resources/Claim/Diagnosis.js +61 -0
- package/src/components/resources/Claim/Insurance.js +58 -0
- package/src/components/resources/Claim/Item.js +79 -0
- package/src/components/resources/Claim/Items.js +29 -0
- package/src/components/resources/ClaimResponse/AddedItem.js +61 -11
- package/src/components/resources/ClaimResponse/AddedItems.js +5 -9
- package/src/components/resources/ClaimResponse/ClaimResponse.js +144 -83
- package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +15 -2
- package/src/components/resources/ClaimResponse/ClaimResponse.test.js +112 -1
- package/src/components/resources/ClaimResponse/Item.js +44 -9
- package/src/components/resources/ClaimResponse/Items.js +5 -4
- package/src/components/resources/Condition/Condition.js +10 -3
- package/src/components/resources/Condition/Condition.test.js +37 -4
- package/src/components/resources/Coverage/Coverage.js +104 -69
- package/src/components/resources/Coverage/Coverage.stories.js +31 -5
- package/src/components/resources/Coverage/Coverage.test.js +111 -4
- package/src/components/resources/Device/Device.js +9 -1
- package/src/components/resources/Device/Device.test.js +36 -1
- package/src/components/resources/DiagnosticReport/DiagnosticReport.js +9 -2
- package/src/components/resources/DiagnosticReport/DiagnosticReport.test.js +36 -1
- package/src/components/resources/DocumentReference/DocumentReference.js +9 -2
- package/src/components/resources/DocumentReference/DocumentReference.test.js +42 -1
- package/src/components/resources/Encounter/Encounter.js +9 -1
- package/src/components/resources/Encounter/Encounter.test.js +36 -1
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.js +4 -0
- package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.test.js +38 -1
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.js +9 -2
- package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.test.js +36 -1
- package/src/components/resources/Generic/Generic.js +21 -7
- package/src/components/resources/Generic/Generic.stories.js +2 -1
- package/src/components/resources/Generic/Generic.test.js +26 -7
- package/src/components/resources/Goal/Goal.js +9 -3
- package/src/components/resources/Goal/Goal.test.js +32 -1
- package/src/components/resources/Immunization/Immunization.js +9 -2
- package/src/components/resources/Immunization/Immunization.test.js +36 -1
- package/src/components/resources/List/DrugTierDefinitionExtension.js +79 -35
- package/src/components/resources/List/Entries.js +3 -3
- package/src/components/resources/List/List.js +137 -88
- package/src/components/resources/List/List.stories.js +38 -5
- package/src/components/resources/List/List.test.js +105 -1
- package/src/components/resources/Location/Location.js +66 -47
- package/src/components/resources/Location/Location.stories.js +11 -4
- package/src/components/resources/Location/Location.test.js +106 -4
- package/src/components/resources/Medication/Medication.js +98 -51
- package/src/components/resources/Medication/Medication.stories.js +37 -7
- package/src/components/resources/Medication/Medication.test.js +114 -5
- package/src/components/resources/MedicationAdministration/MedicationAdministration.js +88 -62
- package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +7 -0
- package/src/components/resources/MedicationAdministration/MedicationAdministration.test.js +117 -1
- package/src/components/resources/MedicationDispense/DosageInstruction.js +25 -0
- package/src/components/resources/MedicationDispense/MedicationDispense.js +70 -68
- package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +7 -0
- package/src/components/resources/MedicationDispense/MedicationDispense.test.js +108 -1
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.js +117 -66
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +6 -0
- package/src/components/resources/MedicationKnowledge/MedicationKnowledge.test.js +110 -1
- package/src/components/resources/MedicationOrder/MedicationOrder.js +3 -3
- package/src/components/resources/MedicationOrder/MedicationOrder.test.js +35 -4
- package/src/components/resources/MedicationRequest/MedicationRequest.js +8 -1
- package/src/components/resources/MedicationRequest/MedicationRequest.test.js +33 -4
- package/src/components/resources/MedicationStatement/MedicationStatement.js +9 -2
- package/src/components/resources/MedicationStatement/MedicationStatement.test.js +36 -1
- package/src/components/resources/Observation/Observation.js +3 -1
- package/src/components/resources/Observation/Observation.test.js +30 -1
- package/src/components/resources/Observation/ObservationGraph.js +1 -1
- package/src/components/resources/Organization/Organization.js +63 -37
- package/src/components/resources/Organization/Organization.stories.js +15 -2
- package/src/components/resources/Organization/Organization.test.js +109 -1
- package/src/components/resources/Patient/Patient.js +4 -0
- package/src/components/resources/Patient/Patient.test.js +31 -2
- package/src/components/resources/Practitioner/Practitioner.js +9 -1
- package/src/components/resources/Practitioner/Practitioner.test.js +36 -1
- package/src/components/resources/PractitionerRole/PractitionerRole.js +52 -29
- package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +7 -0
- package/src/components/resources/PractitionerRole/PractitionerRole.test.js +108 -1
- package/src/components/resources/Procedure/Procedure.js +3 -2
- package/src/components/resources/Procedure/Procedure.test.js +30 -1
- package/src/components/resources/Questionnaire/Group.js +53 -0
- package/src/components/resources/Questionnaire/Items.js +45 -0
- package/src/components/resources/Questionnaire/Questionnaire.css +24 -5
- package/src/components/resources/Questionnaire/Questionnaire.js +38 -170
- package/src/components/resources/Questionnaire/Questionnaire.stories.js +8 -0
- package/src/components/resources/Questionnaire/Questionnaire.test.js +194 -15
- package/src/components/resources/Questionnaire/Questions.js +40 -0
- package/src/components/resources/Questionnaire/getQuestionText.js +20 -0
- package/src/components/resources/QuestionnaireResponse/Answers.js +59 -0
- package/src/components/resources/QuestionnaireResponse/Group.js +70 -0
- package/src/components/resources/QuestionnaireResponse/Items.js +45 -0
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.css +33 -8
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.js +54 -236
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +8 -0
- package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.test.js +38 -3
- package/src/components/resources/QuestionnaireResponse/Questions.js +43 -0
- package/src/components/resources/QuestionnaireResponse/getQuestionText.js +22 -0
- package/src/components/resources/ReferralRequest/ReferralRequest.js +72 -40
- package/src/components/resources/ReferralRequest/ReferralRequest.test.js +111 -11
- package/src/components/resources/RelatedPerson/RelatedPerson.js +158 -0
- package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +46 -0
- package/src/components/resources/RelatedPerson/RelatedPerson.test.js +156 -0
- package/src/components/resources/RelatedPerson/index.js +3 -0
- package/src/components/resources/ResearchStudy/ResearchStudy.js +167 -130
- package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +2 -0
- package/src/components/resources/ResearchStudy/ResearchStudy.test.js +108 -1
- package/src/components/resources/ResourceCategory/ResourceCategory.js +1 -1
- package/src/components/ui/index.js +56 -32
- package/src/fixtures/dstu2/resources/relatedPerson/example1.json +79 -0
- package/src/fixtures/example-icons.jsx +63 -0
- package/src/fixtures/r4/resources/relatedPerson/example1.json +64 -0
- package/src/fixtures/stu3/resources/relatedPerson/example1.json +43 -0
- package/src/style.scss +14 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MissingValue,
|
|
3
|
+
Table,
|
|
4
|
+
TableCell,
|
|
5
|
+
TableHeader,
|
|
6
|
+
TableRow,
|
|
7
|
+
ValueSection,
|
|
8
|
+
} from '../../ui';
|
|
9
|
+
import Coding from '../../datatypes/Coding';
|
|
10
|
+
import Reference from '../../datatypes/Reference';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
|
|
13
|
+
const Diagnosis = ({ diagnosis }) => {
|
|
14
|
+
return (
|
|
15
|
+
<ValueSection label="Diagnosis" data-testid="diagnosis" marginTop>
|
|
16
|
+
<Table>
|
|
17
|
+
<thead>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableHeader>Diagnosis</TableHeader>
|
|
20
|
+
<TableHeader>Type</TableHeader>
|
|
21
|
+
<TableHeader>Package code</TableHeader>
|
|
22
|
+
</TableRow>
|
|
23
|
+
</thead>
|
|
24
|
+
<tbody className="border-top-0">
|
|
25
|
+
{diagnosis.map((diagnosis, idx) => (
|
|
26
|
+
<TableRow key={idx}>
|
|
27
|
+
<TableCell data-testid="diagnosis.diagnosis" className="col-md-4">
|
|
28
|
+
{diagnosis.coding ? (
|
|
29
|
+
<Coding fhirData={diagnosis.coding} />
|
|
30
|
+
) : diagnosis.refrence ? (
|
|
31
|
+
<Reference fhirData={diagnosis.reference} />
|
|
32
|
+
) : (
|
|
33
|
+
<MissingValue />
|
|
34
|
+
)}
|
|
35
|
+
</TableCell>
|
|
36
|
+
<TableCell data-testid="diagnosis.type" className="col-md-4">
|
|
37
|
+
{diagnosis.typeCoding ? (
|
|
38
|
+
<Coding fhirData={diagnosis.typeCoding} />
|
|
39
|
+
) : (
|
|
40
|
+
<MissingValue />
|
|
41
|
+
)}
|
|
42
|
+
</TableCell>
|
|
43
|
+
<TableCell
|
|
44
|
+
data-testid="diagnosis.packageCode"
|
|
45
|
+
className="col-md-4"
|
|
46
|
+
>
|
|
47
|
+
{diagnosis.packageCodeCoding ? (
|
|
48
|
+
<Coding fhirData={diagnosis.packageCodeCoding} />
|
|
49
|
+
) : (
|
|
50
|
+
<MissingValue />
|
|
51
|
+
)}
|
|
52
|
+
</TableCell>
|
|
53
|
+
</TableRow>
|
|
54
|
+
))}
|
|
55
|
+
</tbody>
|
|
56
|
+
</Table>
|
|
57
|
+
</ValueSection>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default Diagnosis;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MissingValue,
|
|
3
|
+
Table,
|
|
4
|
+
TableCell,
|
|
5
|
+
TableHeader,
|
|
6
|
+
TableRow,
|
|
7
|
+
ValueSection,
|
|
8
|
+
} from '../../ui';
|
|
9
|
+
import Reference from '../../datatypes/Reference';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
const Insurance = ({ insurance }) => {
|
|
13
|
+
return (
|
|
14
|
+
<ValueSection label="Insurance" data-testid="insurance" marginTop>
|
|
15
|
+
<Table>
|
|
16
|
+
<thead>
|
|
17
|
+
<TableRow>
|
|
18
|
+
<TableHeader>Coverage</TableHeader>
|
|
19
|
+
<TableHeader>Business Arrangement</TableHeader>
|
|
20
|
+
<TableHeader>Claim Response</TableHeader>
|
|
21
|
+
</TableRow>
|
|
22
|
+
</thead>
|
|
23
|
+
<tbody className="border-top-0">
|
|
24
|
+
{insurance.map((insurance, idx) => (
|
|
25
|
+
<TableRow key={idx}>
|
|
26
|
+
<TableCell data-testid="insurance.coverage" className="col-md-4">
|
|
27
|
+
<Reference fhirData={insurance.coverage} />
|
|
28
|
+
{insurance.focal && ' (focal)'}
|
|
29
|
+
</TableCell>
|
|
30
|
+
<TableCell
|
|
31
|
+
data-testid="insurance.businessArrangement"
|
|
32
|
+
className="col-md-4"
|
|
33
|
+
>
|
|
34
|
+
{insurance.businessArrangement ? (
|
|
35
|
+
insurance.businessArrangement
|
|
36
|
+
) : (
|
|
37
|
+
<MissingValue />
|
|
38
|
+
)}
|
|
39
|
+
</TableCell>
|
|
40
|
+
<TableCell
|
|
41
|
+
data-testid="insurance.claimResponse"
|
|
42
|
+
className="col-md-4"
|
|
43
|
+
>
|
|
44
|
+
{insurance.claimResponse ? (
|
|
45
|
+
<Reference fhirData={insurance.claimResponse} />
|
|
46
|
+
) : (
|
|
47
|
+
<MissingValue />
|
|
48
|
+
)}
|
|
49
|
+
</TableCell>
|
|
50
|
+
</TableRow>
|
|
51
|
+
))}
|
|
52
|
+
</tbody>
|
|
53
|
+
</Table>
|
|
54
|
+
</ValueSection>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default Insurance;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Chevron, MissingValue, TableCell, TableRow } from '../../ui';
|
|
3
|
+
import Coding from '../../datatypes/Coding';
|
|
4
|
+
import Money from '../../datatypes/Money';
|
|
5
|
+
|
|
6
|
+
const Item = ({ item, parentSequences, parentId, isCollapse = false }) => {
|
|
7
|
+
const itemSequences = [...parentSequences, item.sequence];
|
|
8
|
+
const id = itemSequences.join('.');
|
|
9
|
+
const collapseId = parentSequences.length ? parentId : item.sequence;
|
|
10
|
+
|
|
11
|
+
const [rotate, setRotate] = useState(false);
|
|
12
|
+
const handleTableExpand = () => setRotate(!rotate);
|
|
13
|
+
|
|
14
|
+
const isExpandable =
|
|
15
|
+
parentSequences.length === 0 && item.subItems.length !== 0;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<TableRow
|
|
20
|
+
className={`${isCollapse ? `collapse item-${parentId}` : ''} ${
|
|
21
|
+
isExpandable ? 'fw-bold table-expandable-row border-top' : ''
|
|
22
|
+
}`}
|
|
23
|
+
data-bs-target={`.item-${collapseId}`}
|
|
24
|
+
data-bs-toggle={'collapse'}
|
|
25
|
+
aria-controls={id}
|
|
26
|
+
aria-expanded="false"
|
|
27
|
+
onClick={handleTableExpand}
|
|
28
|
+
>
|
|
29
|
+
<TableCell data-testid="items.sequence" className="col-md-2">
|
|
30
|
+
{id}
|
|
31
|
+
</TableCell>
|
|
32
|
+
<TableCell data-testid="items.service" className="col-md-2">
|
|
33
|
+
<Coding fhirData={item.service} />
|
|
34
|
+
</TableCell>
|
|
35
|
+
<TableCell data-testid="items.unitPrice" className="col-md-2">
|
|
36
|
+
{item.unitPrice ? (
|
|
37
|
+
<Money fhirData={item.unitPrice} />
|
|
38
|
+
) : (
|
|
39
|
+
<MissingValue />
|
|
40
|
+
)}
|
|
41
|
+
{item.factor != null ? (
|
|
42
|
+
<span> × {item.factor}</span>
|
|
43
|
+
) : null}
|
|
44
|
+
</TableCell>
|
|
45
|
+
<TableCell data-testid="items.quantity" className="col-md-2">
|
|
46
|
+
{item.quantity != null ? item.quantity : <MissingValue />}
|
|
47
|
+
</TableCell>
|
|
48
|
+
<TableCell data-testid="items.net" className="col-md-2">
|
|
49
|
+
{item.net ? <Money fhirData={item.net} /> : <MissingValue />}
|
|
50
|
+
</TableCell>
|
|
51
|
+
{isExpandable ? (
|
|
52
|
+
<TableCell className="col-md-2">
|
|
53
|
+
<button
|
|
54
|
+
className="fhir-container__Accordion__header-button w-100 p-0 border-0 rounded-1 collapsed text-dark bg-transparent shadow-none "
|
|
55
|
+
type="button"
|
|
56
|
+
>
|
|
57
|
+
<div className={` ${rotate ? ' header-rotate' : ''}`}>
|
|
58
|
+
<Chevron strokeColor={rotate ? '#2a6fd7' : '#6f83a9'} />
|
|
59
|
+
</div>
|
|
60
|
+
</button>
|
|
61
|
+
</TableCell>
|
|
62
|
+
) : (
|
|
63
|
+
<TableCell style={{ width: '64px' }} className="col-md-2" />
|
|
64
|
+
)}
|
|
65
|
+
</TableRow>
|
|
66
|
+
{item.subItems.map((subItem, idx) => (
|
|
67
|
+
<Item
|
|
68
|
+
key={idx}
|
|
69
|
+
item={subItem}
|
|
70
|
+
parentSequences={itemSequences}
|
|
71
|
+
parentId={collapseId}
|
|
72
|
+
isCollapse
|
|
73
|
+
/>
|
|
74
|
+
))}
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default Item;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Table, TableHeader, TableRow, ValueSection } from '../../ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Item from './Item';
|
|
4
|
+
|
|
5
|
+
const Items = ({ items }) => {
|
|
6
|
+
return (
|
|
7
|
+
<ValueSection label="Items" data-testid="items" marginTop>
|
|
8
|
+
<Table>
|
|
9
|
+
<thead>
|
|
10
|
+
<TableRow>
|
|
11
|
+
<TableHeader>ID</TableHeader>
|
|
12
|
+
<TableHeader>Service</TableHeader>
|
|
13
|
+
<TableHeader>Unit price</TableHeader>
|
|
14
|
+
<TableHeader>Quantity</TableHeader>
|
|
15
|
+
<TableHeader>Total</TableHeader>
|
|
16
|
+
<TableHeader></TableHeader>
|
|
17
|
+
</TableRow>
|
|
18
|
+
</thead>
|
|
19
|
+
<tbody className="border-top-0">
|
|
20
|
+
{items.map((item, idx) => (
|
|
21
|
+
<Item key={idx} item={item} parentSequences={[]} />
|
|
22
|
+
))}
|
|
23
|
+
</tbody>
|
|
24
|
+
</Table>
|
|
25
|
+
</ValueSection>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Items;
|
|
@@ -1,27 +1,62 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { TableCell, TableRow } from '../../ui';
|
|
3
|
+
import { Chevron, TableCell, TableRow } from '../../ui';
|
|
4
4
|
import Coding from '../../datatypes/Coding';
|
|
5
5
|
import Money from '../../datatypes/Money';
|
|
6
6
|
import Item from './Item';
|
|
7
7
|
|
|
8
|
-
const AddedItem =
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const AddedItem = ({
|
|
9
|
+
addedItem,
|
|
10
|
+
parentSequences,
|
|
11
|
+
parentId,
|
|
12
|
+
isCollapse = false,
|
|
13
|
+
}) => {
|
|
11
14
|
const itemSequences = [...parentSequences, addedItem.sequenceLinkId];
|
|
12
15
|
const id = itemSequences.join('.');
|
|
16
|
+
const collapseId = parentSequences.length
|
|
17
|
+
? parentId
|
|
18
|
+
: addedItem.sequenceLinkId;
|
|
19
|
+
|
|
20
|
+
const [rotate, setRotate] = useState(false);
|
|
21
|
+
const handleTableExpand = () => setRotate(!rotate);
|
|
22
|
+
|
|
23
|
+
const isExpandable =
|
|
24
|
+
parentSequences.length === 0 && addedItem.subItems.length !== 0;
|
|
13
25
|
|
|
14
26
|
return (
|
|
15
27
|
<>
|
|
16
|
-
<TableRow
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
<TableRow
|
|
29
|
+
className={`${isCollapse ? `collapse item-${parentId}` : ''} ${
|
|
30
|
+
isExpandable ? 'fw-bold table-expandable-row border-top' : ''
|
|
31
|
+
}`}
|
|
32
|
+
data-bs-target={`.item-${collapseId}`}
|
|
33
|
+
data-bs-toggle={'collapse'}
|
|
34
|
+
aria-controls={id}
|
|
35
|
+
aria-expanded="false"
|
|
36
|
+
onClick={handleTableExpand}
|
|
37
|
+
>
|
|
38
|
+
<TableCell
|
|
39
|
+
data-testid="addedItems.sequence"
|
|
40
|
+
className="col-md-2"
|
|
41
|
+
isAlignTop
|
|
42
|
+
>
|
|
43
|
+
{id}
|
|
44
|
+
</TableCell>
|
|
45
|
+
<TableCell
|
|
46
|
+
data-testid="addedItems.service"
|
|
47
|
+
className="col-md-2"
|
|
48
|
+
isAlignTop
|
|
49
|
+
>
|
|
19
50
|
{addedItem.service && <Coding fhirData={addedItem.service} />}
|
|
20
51
|
</TableCell>
|
|
21
|
-
<TableCell data-testid="addedItems.fee">
|
|
52
|
+
<TableCell data-testid="addedItems.fee" className="col-md-2" isAlignTop>
|
|
22
53
|
{addedItem.fee && <Money fhirData={addedItem.fee} />}
|
|
23
54
|
</TableCell>
|
|
24
|
-
<TableCell
|
|
55
|
+
<TableCell
|
|
56
|
+
data-testid="addedItems.adjudication"
|
|
57
|
+
className="col-md-2"
|
|
58
|
+
isAlignTop
|
|
59
|
+
>
|
|
25
60
|
{addedItem.adjudication.map((adjudication, idx) => (
|
|
26
61
|
<div
|
|
27
62
|
key={idx}
|
|
@@ -36,13 +71,28 @@ const AddedItem = props => {
|
|
|
36
71
|
</div>
|
|
37
72
|
))}
|
|
38
73
|
</TableCell>
|
|
74
|
+
{isExpandable ? (
|
|
75
|
+
<TableCell className="col-md-2" isAlignTop>
|
|
76
|
+
<button
|
|
77
|
+
className="fhir-container__Accordion__header-button w-100 p-0 border-0 rounded-1 collapsed text-dark bg-transparent shadow-none "
|
|
78
|
+
type="button"
|
|
79
|
+
>
|
|
80
|
+
<div className={` ${rotate ? ' header-rotate' : ''}`}>
|
|
81
|
+
<Chevron strokeColor={rotate ? '#2a6fd7' : '#6f83a9'} />
|
|
82
|
+
</div>
|
|
83
|
+
</button>
|
|
84
|
+
</TableCell>
|
|
85
|
+
) : (
|
|
86
|
+
<TableCell style={{ width: '64px' }} className="col-md-2" />
|
|
87
|
+
)}
|
|
39
88
|
</TableRow>
|
|
40
89
|
{addedItem.subItems.map((subItem, idx) => (
|
|
41
90
|
<Item
|
|
42
91
|
key={idx}
|
|
43
92
|
addedItem={subItem}
|
|
44
|
-
level={level + 1}
|
|
45
93
|
parentSequences={itemSequences}
|
|
94
|
+
parentId={collapseId}
|
|
95
|
+
isCollapse
|
|
46
96
|
/>
|
|
47
97
|
))}
|
|
48
98
|
</>
|
|
@@ -7,24 +7,20 @@ const AddedItems = props => {
|
|
|
7
7
|
const { addedItems } = props;
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
|
-
<ValueSection label="Added Items" data-testid="addedItems">
|
|
10
|
+
<ValueSection label="Added Items" data-testid="addedItems" marginTop>
|
|
11
11
|
<Table>
|
|
12
12
|
<thead>
|
|
13
13
|
<TableRow>
|
|
14
14
|
<TableHeader>ID</TableHeader>
|
|
15
15
|
<TableHeader>Service</TableHeader>
|
|
16
16
|
<TableHeader>Fee</TableHeader>
|
|
17
|
-
<TableHeader
|
|
17
|
+
<TableHeader>Adjudication</TableHeader>
|
|
18
|
+
<TableHeader></TableHeader>
|
|
18
19
|
</TableRow>
|
|
19
20
|
</thead>
|
|
20
|
-
<tbody>
|
|
21
|
+
<tbody className="border-top-0">
|
|
21
22
|
{addedItems.map((item, idx) => (
|
|
22
|
-
<AddedItem
|
|
23
|
-
key={idx}
|
|
24
|
-
addedItem={item}
|
|
25
|
-
level={0}
|
|
26
|
-
parentSequences={[]}
|
|
27
|
-
/>
|
|
23
|
+
<AddedItem key={idx} addedItem={item} parentSequences={[]} />
|
|
28
24
|
))}
|
|
29
25
|
</tbody>
|
|
30
26
|
</Table>
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
Header,
|
|
22
22
|
MissingValue,
|
|
23
23
|
Root,
|
|
24
|
-
Title,
|
|
25
|
-
Value,
|
|
26
24
|
ValueSection,
|
|
27
25
|
BadgeSecondary,
|
|
26
|
+
ValueSectionItem,
|
|
28
27
|
} from '../../ui';
|
|
28
|
+
import Accordion from '../../containers/Accordion';
|
|
29
29
|
|
|
30
30
|
const commonDTO = fhirResource => {
|
|
31
31
|
const id = _get(fhirResource, 'id');
|
|
@@ -285,8 +285,13 @@ const hasPaymentInfo = payment => {
|
|
|
285
285
|
return Object.values(payment).filter(item => item).length > 0;
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
const ClaimResponse =
|
|
289
|
-
|
|
288
|
+
const ClaimResponse = ({
|
|
289
|
+
fhirVersion,
|
|
290
|
+
fhirResource,
|
|
291
|
+
fhirIcons,
|
|
292
|
+
onClick,
|
|
293
|
+
rawOnClick,
|
|
294
|
+
}) => {
|
|
290
295
|
let fhirResourceData = {};
|
|
291
296
|
try {
|
|
292
297
|
fhirResourceData = resourceDTO(fhirVersion, fhirResource);
|
|
@@ -314,88 +319,144 @@ const ClaimResponse = props => {
|
|
|
314
319
|
const hasAddedItems = addedItems.length > 0;
|
|
315
320
|
const hasPayment = hasPaymentInfo(payment);
|
|
316
321
|
|
|
322
|
+
const tableData = [
|
|
323
|
+
{
|
|
324
|
+
label: 'Created At',
|
|
325
|
+
testId: 'created',
|
|
326
|
+
data: created && <DateType fhirData={created} isBlack />,
|
|
327
|
+
status: created,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
label: 'Request claim',
|
|
331
|
+
testId: 'request',
|
|
332
|
+
data: requestReference && <Reference fhirData={requestReference} />,
|
|
333
|
+
status: requestReference,
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
label: 'Disposition',
|
|
337
|
+
testId: 'disposition',
|
|
338
|
+
data: disposition,
|
|
339
|
+
status: disposition,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
label: 'Total cost',
|
|
343
|
+
testId: 'totalCost',
|
|
344
|
+
data: totalCost && <Money fhirData={totalCost} />,
|
|
345
|
+
status: totalCost,
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
label: 'Total benefit',
|
|
349
|
+
testId: 'totalBenefit',
|
|
350
|
+
data: totalBenefit && <Money fhirData={totalBenefit} />,
|
|
351
|
+
status: totalBenefit,
|
|
352
|
+
},
|
|
353
|
+
];
|
|
354
|
+
|
|
355
|
+
const paymentData = [
|
|
356
|
+
{
|
|
357
|
+
label: 'Type',
|
|
358
|
+
testId: 'payment.type',
|
|
359
|
+
data: payment.typeCoding ? (
|
|
360
|
+
<Coding fhirData={payment.typeCoding} />
|
|
361
|
+
) : (
|
|
362
|
+
<MissingValue />
|
|
363
|
+
),
|
|
364
|
+
status: true,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
label: 'Amount',
|
|
368
|
+
testId: 'payment.amount',
|
|
369
|
+
data: payment.amount ? (
|
|
370
|
+
<Money fhirData={payment.amount} />
|
|
371
|
+
) : (
|
|
372
|
+
<MissingValue />
|
|
373
|
+
),
|
|
374
|
+
status: payment.amount,
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
label: 'Date',
|
|
378
|
+
testId: 'payment.date',
|
|
379
|
+
data: payment.date ? (
|
|
380
|
+
<DateType fhirData={payment.date} isBlack />
|
|
381
|
+
) : (
|
|
382
|
+
<MissingValue />
|
|
383
|
+
),
|
|
384
|
+
status: payment.date,
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
label: 'Reference',
|
|
388
|
+
testId: 'payment.ref',
|
|
389
|
+
data: payment.ref ? (
|
|
390
|
+
<Identifier fhirData={payment.ref} />
|
|
391
|
+
) : (
|
|
392
|
+
<MissingValue />
|
|
393
|
+
),
|
|
394
|
+
status: payment.ref,
|
|
395
|
+
},
|
|
396
|
+
];
|
|
397
|
+
|
|
317
398
|
return (
|
|
318
399
|
<Root name="ClaimResponse">
|
|
319
|
-
<
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
400
|
+
<Accordion
|
|
401
|
+
headerContent={
|
|
402
|
+
<Header
|
|
403
|
+
resourceName="ClaimResponse"
|
|
404
|
+
title={`Claim response #${id}`}
|
|
405
|
+
badges={
|
|
406
|
+
<>
|
|
407
|
+
{outcome && <Badge data-testid="outcome">{outcome}</Badge>}
|
|
408
|
+
{status && (
|
|
409
|
+
<BadgeSecondary data-testid="status">{status}</BadgeSecondary>
|
|
410
|
+
)}
|
|
411
|
+
</>
|
|
412
|
+
}
|
|
413
|
+
icon={fhirIcons}
|
|
414
|
+
/>
|
|
415
|
+
}
|
|
416
|
+
bodyContent={
|
|
417
|
+
<Body tableData={tableData}>
|
|
418
|
+
{isNotEmptyArray(totalCostsArr) && (
|
|
419
|
+
<ValueSection label="Total" data-testid="totalSection" marginTop>
|
|
420
|
+
{totalCostsArr.map(
|
|
421
|
+
({ category, amount }, i) =>
|
|
422
|
+
category && (
|
|
423
|
+
<ValueSectionItem
|
|
424
|
+
label={category}
|
|
425
|
+
key={`total-value-${i}`}
|
|
426
|
+
>
|
|
427
|
+
<Money fhirData={amount} />
|
|
428
|
+
</ValueSectionItem>
|
|
429
|
+
),
|
|
430
|
+
)}
|
|
431
|
+
</ValueSection>
|
|
432
|
+
)}
|
|
433
|
+
{hasPayment && (
|
|
434
|
+
<ValueSection
|
|
435
|
+
label="Payment"
|
|
436
|
+
data-testid="paymentSection"
|
|
437
|
+
marginTop
|
|
438
|
+
>
|
|
439
|
+
{paymentData.map(
|
|
440
|
+
(item, index) =>
|
|
441
|
+
item.status && (
|
|
442
|
+
<ValueSectionItem
|
|
443
|
+
key={`payment-item-${index}`}
|
|
444
|
+
label={item.label}
|
|
445
|
+
data-testid={item.testId}
|
|
446
|
+
>
|
|
447
|
+
{item.data}
|
|
448
|
+
</ValueSectionItem>
|
|
449
|
+
),
|
|
450
|
+
)}
|
|
451
|
+
</ValueSection>
|
|
361
452
|
)}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
) : (
|
|
370
|
-
<MissingValue />
|
|
371
|
-
)}
|
|
372
|
-
</Value>
|
|
373
|
-
<Value label="Amount" data-testid="payment.amount">
|
|
374
|
-
{payment.amount ? (
|
|
375
|
-
<Money fhirData={payment.amount} />
|
|
376
|
-
) : (
|
|
377
|
-
<MissingValue />
|
|
378
|
-
)}
|
|
379
|
-
</Value>
|
|
380
|
-
<Value label="Date" data-testid="payment.date">
|
|
381
|
-
{payment.date ? (
|
|
382
|
-
<DateType fhirData={payment.date} />
|
|
383
|
-
) : (
|
|
384
|
-
<MissingValue />
|
|
385
|
-
)}
|
|
386
|
-
</Value>
|
|
387
|
-
<Value label="Reference" data-testid="payment.ref">
|
|
388
|
-
{payment.ref ? (
|
|
389
|
-
<Identifier fhirData={payment.ref} />
|
|
390
|
-
) : (
|
|
391
|
-
<MissingValue />
|
|
392
|
-
)}
|
|
393
|
-
</Value>
|
|
394
|
-
</ValueSection>
|
|
395
|
-
)}
|
|
396
|
-
{hasAddedItems && <AddedItems addedItems={addedItems} />}
|
|
397
|
-
{hasItems && <Items items={items} />}
|
|
398
|
-
</Body>
|
|
453
|
+
{hasAddedItems && <AddedItems addedItems={addedItems} />}
|
|
454
|
+
{hasItems && <Items items={items} />}
|
|
455
|
+
</Body>
|
|
456
|
+
}
|
|
457
|
+
onClick={onClick}
|
|
458
|
+
rawOnClick={rawOnClick}
|
|
459
|
+
/>
|
|
399
460
|
</Root>
|
|
400
461
|
);
|
|
401
462
|
};
|
|
@@ -10,6 +10,8 @@ import example2ClaimResponseSTU3 from '../../../fixtures/stu3/resources/claimRes
|
|
|
10
10
|
import example1ClaimResponseR4 from '../../../fixtures/r4/resources/claimResponse/example1.json';
|
|
11
11
|
import example2ClaimResponseR4 from '../../../fixtures/r4/resources/claimResponse/example2.json';
|
|
12
12
|
import example3ClaimResponseR4 from '../../../fixtures/r4/resources/claimResponse/example3.json';
|
|
13
|
+
import fhirIcons from '../../../fixtures/example-icons';
|
|
14
|
+
import ClaimResponseIcon from '../../../assets/containers/ClaimResponse/claim-response.svg';
|
|
13
15
|
|
|
14
16
|
export default { title: 'Claim Response' };
|
|
15
17
|
|
|
@@ -19,6 +21,7 @@ export const ExampleDSTU2 = () => {
|
|
|
19
21
|
<ClaimResponse
|
|
20
22
|
fhirResource={fhirResource}
|
|
21
23
|
fhirVersion={fhirVersions.DSTU2}
|
|
24
|
+
fhirIcons={require('../../../assets/containers/ClaimResponse/claim-response.svg')}
|
|
22
25
|
/>
|
|
23
26
|
);
|
|
24
27
|
};
|
|
@@ -29,6 +32,7 @@ export const Example1OfSTU3 = () => {
|
|
|
29
32
|
<ClaimResponse
|
|
30
33
|
fhirResource={fhirResource}
|
|
31
34
|
fhirVersion={fhirVersions.STU3}
|
|
35
|
+
fhirIcons={ClaimResponseIcon}
|
|
32
36
|
/>
|
|
33
37
|
);
|
|
34
38
|
};
|
|
@@ -38,6 +42,7 @@ export const Example2OfSTU3 = () => {
|
|
|
38
42
|
<ClaimResponse
|
|
39
43
|
fhirResource={fhirResource}
|
|
40
44
|
fhirVersion={fhirVersions.STU3}
|
|
45
|
+
fhirIcons={fhirIcons}
|
|
41
46
|
/>
|
|
42
47
|
);
|
|
43
48
|
};
|
|
@@ -45,13 +50,21 @@ export const Example2OfSTU3 = () => {
|
|
|
45
50
|
export const Example1OfR4 = () => {
|
|
46
51
|
const fhirResource = object('Resource', example1ClaimResponseR4);
|
|
47
52
|
return (
|
|
48
|
-
<ClaimResponse
|
|
53
|
+
<ClaimResponse
|
|
54
|
+
fhirResource={fhirResource}
|
|
55
|
+
fhirVersion={fhirVersions.R4}
|
|
56
|
+
fhirIcons={false}
|
|
57
|
+
/>
|
|
49
58
|
);
|
|
50
59
|
};
|
|
51
60
|
export const Example2OfR4 = () => {
|
|
52
61
|
const fhirResource = object('Resource', example2ClaimResponseR4);
|
|
53
62
|
return (
|
|
54
|
-
<ClaimResponse
|
|
63
|
+
<ClaimResponse
|
|
64
|
+
fhirResource={fhirResource}
|
|
65
|
+
fhirVersion={fhirVersions.R4}
|
|
66
|
+
fhirIcons={'random text'}
|
|
67
|
+
/>
|
|
55
68
|
);
|
|
56
69
|
};
|
|
57
70
|
export const Example3OfR4 = () => {
|