Skip to content

Commit cd311ee

Browse files
committed
First pass of adding hardcoded default data
1 parent 77ba9fc commit cd311ee

File tree

8 files changed

+58228
-2
lines changed

8 files changed

+58228
-2
lines changed

client/src/components/patientData.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export default function PatientData() {
3131
});
3232
console.log(authUrlResponseData);
3333
}
34+
async function goLoadDefaults() {
35+
const authUrlResponse = await axios.get(`/api/bluebutton/loadDefaults`);
36+
window.location.href = authUrlResponse.data || '/';
37+
}
3438

3539
/* DEVELOPER NOTES:
3640
* Here we are hard coding the users information for the sake of saving time
@@ -50,7 +54,12 @@ export default function PatientData() {
5054
<div>
5155
<h4>{ header }</h4>
5256
</div>
53-
<Button id="auth_btn" variation="solid" onClick={goAuthorize}>Authorize</Button>
57+
<div className='ds-u-margin-top--2'>
58+
<Button id="auth_btn" variation="solid" onClick={goAuthorize}>Authorize</Button>
59+
</div>
60+
<div className='ds-u-margin-top--2'>
61+
<Button id="load_defaults_btn" variation="solid" onClick={goLoadDefaults}>Load default data</Button>
62+
</div>
5463
</div>
5564
</div>
5665
);

server/app.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import os, json
22

33
from flask import redirect, request, Flask
44
from cms_bluebutton.cms_bluebutton import BlueButton
@@ -96,6 +96,17 @@ def authorization_callback():
9696

9797
return redirect(get_fe_redirect_url())
9898

99+
@app.route('/api/bluebutton/loadDefaults', methods=['GET'])
100+
def load_default_data():
101+
# TODO: add config var or param to detemine dataset
102+
logged_in_user['eobData'] = load_data_file("Dataset 1", "eobData")
103+
return get_fe_redirect_url()
104+
105+
def load_data_file(dataset_name, resource_file_name):
106+
response_file = open("./defaultDatasets/{}/{}.json".format(dataset_name, resource_file_name), 'r')
107+
resource = json.load(response_file)
108+
response_file.close()
109+
return resource
99110

100111
@app.route('/api/data/benefit', methods=['GET'])
101112
def get_patient_eob():

server/defaultDatasets/Dataset 1/c4dicCoverage.json

Lines changed: 1821 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"resourceType": "Bundle",
3+
"id": "51dfb956-aef7-4b2c-bc54-7f63286433b5",
4+
"meta": {
5+
"lastUpdated": "2024-11-27T07:02:46.387-05:00"
6+
},
7+
"type": "searchset",
8+
"total": 1,
9+
"link": [
10+
{
11+
"relation": "first",
12+
"url": "https://test.bluebutton.cms.gov/v2/fhir/Patient?_format=application%2Fjson%2Bfhir&startIndex=0&_count=10&_id=-10000010254647"
13+
},
14+
{
15+
"relation": "last",
16+
"url": "https://test.bluebutton.cms.gov/v2/fhir/Patient?_format=application%2Fjson%2Bfhir&startIndex=0&_count=10&_id=-10000010254647"
17+
},
18+
{
19+
"relation": "self",
20+
"url": "https://test.bluebutton.cms.gov/v2/fhir/Patient/?_count=10&_format=application%2Fjson%2Bfhir&_id=-10000010254647&startIndex=0"
21+
}
22+
],
23+
"entry": [
24+
{
25+
"resource": {
26+
"resourceType": "Patient",
27+
"id": "-10000010254647",
28+
"meta": {
29+
"lastUpdated": "2023-06-14T14:17:07.293-04:00",
30+
"profile": [
31+
"http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Patient"
32+
]
33+
},
34+
"extension": [
35+
{
36+
"url": "https://bluebutton.cms.gov/resources/variables/race",
37+
"valueCoding": {
38+
"system": "https://bluebutton.cms.gov/resources/variables/race",
39+
"code": "2",
40+
"display": "Black"
41+
}
42+
},
43+
{
44+
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
45+
"extension": [
46+
{
47+
"url": "ombCategory",
48+
"valueCoding": {
49+
"system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor",
50+
"code": "UNK",
51+
"display": "Unknown"
52+
}
53+
},
54+
{
55+
"url": "text",
56+
"valueString": "Unknown"
57+
}
58+
]
59+
},
60+
{
61+
"url": "https://bluebutton.cms.gov/resources/variables/rfrnc_yr",
62+
"valueDate": "2025"
63+
},
64+
{
65+
"url": "https://bluebutton.cms.gov/resources/variables/dual_01",
66+
"valueCoding": {
67+
"system": "https://bluebutton.cms.gov/resources/variables/dual_01",
68+
"code": "02",
69+
"display": "QMB and full Medicaid coverage, including prescription drugs"
70+
}
71+
},
72+
{
73+
"url": "https://bluebutton.cms.gov/resources/variables/dual_02",
74+
"valueCoding": {
75+
"system": "https://bluebutton.cms.gov/resources/variables/dual_02",
76+
"code": "02",
77+
"display": "QMB and full Medicaid coverage, including prescription drugs"
78+
}
79+
},
80+
{
81+
"url": "https://bluebutton.cms.gov/resources/variables/dual_03",
82+
"valueCoding": {
83+
"system": "https://bluebutton.cms.gov/resources/variables/dual_03",
84+
"code": "02",
85+
"display": "QMB and full Medicaid coverage, including prescription drugs"
86+
}
87+
}
88+
],
89+
"identifier": [
90+
{
91+
"type": {
92+
"coding": [
93+
{
94+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
95+
"code": "MB",
96+
"display": "Member Number"
97+
}
98+
]
99+
},
100+
"system": "https://bluebutton.cms.gov/resources/variables/bene_id",
101+
"value": "-10000010254647"
102+
},
103+
{
104+
"type": {
105+
"coding": [
106+
{
107+
"extension": [
108+
{
109+
"url": "https://bluebutton.cms.gov/resources/codesystem/identifier-currency",
110+
"valueCoding": {
111+
"system": "https://bluebutton.cms.gov/resources/codesystem/identifier-currency",
112+
"code": "current",
113+
"display": "Current"
114+
}
115+
}
116+
],
117+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
118+
"code": "MC",
119+
"display": "Patient's Medicare number"
120+
}
121+
]
122+
},
123+
"system": "http://hl7.org/fhir/sid/us-mbi",
124+
"value": "1S00EU7JH47"
125+
}
126+
],
127+
"name": [
128+
{
129+
"use": "usual",
130+
"family": "Ratke343",
131+
"given": [
132+
"Johnie961",
133+
"C"
134+
]
135+
}
136+
],
137+
"gender": "male",
138+
"birthDate": "1990-08-14",
139+
"deceasedBoolean": false,
140+
"address": [
141+
{
142+
"state": "01",
143+
"postalCode": "35756"
144+
}
145+
]
146+
}
147+
}
148+
]
149+
}

0 commit comments

Comments
 (0)