Skip to content

Commit e28c765

Browse files
authored
BB2-3524: Contract ID and formatting updates (#83)
* Upgrade ds library, adjust contract id for part c/d, minor formatting adjustments * Revert ds update
1 parent d6290eb commit e28c765

File tree

3 files changed

+27
-44
lines changed

3 files changed

+27
-44
lines changed

client/src/components/c4dic.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default function InsuranceCard() {
168168
<hr/>
169169
<h6>Benefits</h6>
170170
{insInfo?.coverages.map(c => {
171-
const startDateDiv = (c.startDate != null && c.startDate != "") ?
171+
const startDateDiv = (c.startDate !== null && c.startDate !== "") ?
172172
(
173173
<div>
174174
<text className="field-label">Start Date</text>
@@ -248,6 +248,8 @@ export default function InsuranceCard() {
248248
</div>
249249
</div>
250250
)
251+
default:
252+
return []
251253
}
252254
})}
253255
</div>

client/src/styles/index.scss

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ $image-path: "~@cmsgov/design-system/dist/images";
55
// Core CMSDS styles
66
@import "@cmsgov/design-system/dist/scss/index";
77

8-
@import url('https://fonts.googleapis.com/css?family=Cutive+Mono|Teko');
9-
108
.ins-card {
119
border-radius: 6px;
1210
width: 400px;
@@ -21,7 +19,6 @@ $image-path: "~@cmsgov/design-system/dist/images";
2119
0 30px 50px -10px rgba(0,0,0,.2);
2220
}
2321

24-
2522
.ins-c4dic-card {
2623
border-radius: 6px;
2724
width: 480px;
@@ -36,37 +33,6 @@ $image-path: "~@cmsgov/design-system/dist/images";
3633
}
3734
}
3835

39-
label {
40-
font-family: 'Teko';
41-
text-transform: uppercase;
42-
letter-spacing: 1px;
43-
font-size: 13px;
44-
display: block;
45-
line-height: 0.675;
46-
}
47-
48-
input {
49-
border-radius: 4px;
50-
font-family: 'Cutive Mono';
51-
position: absolute;
52-
background: transparent;
53-
-webkit-font-smoothing: antialiased;
54-
text-shadow: 0 1px 0 rgba(79, 48, 96,1);
55-
border: none;
56-
color: #f0f0f0;
57-
font-size: 1.75rem;
58-
padding: 0.125em 0;
59-
transition: all .1s;
60-
letter-spacing: 1px;
61-
text-transform: uppercase;
62-
63-
&:hover,
64-
&:focus {
65-
// background: rgba(255,255,255,.1);
66-
outline: none;
67-
}
68-
}
69-
7036
.card-number {
7137
width: 345px;
7238
right: 20px;
@@ -159,20 +125,26 @@ input[type=number]::-webkit-input-placeholder {
159125
background-position: center;
160126

161127
.field-label {
162-
font-size: 10px;
163-
font-weight: lighter;
164-
text-transform: uppercase;
128+
font-size: 12px;
129+
font-style: normal;
130+
font-weight: 300;
131+
line-height: normal;
165132
}
166133

167134
.field-value {
168-
font-size: 18px;
135+
font-family: var(--theme-font-family-body, "Open Sans");
136+
font-size: var(--theme-font-size-md, 16px);
137+
font-style: normal;
138+
font-weight: var(--theme-font-weight-body-md, 700);
139+
line-height: 150%; /* 24px */
169140
}
170141

171142
h6 {
172-
font-size: 10px;
143+
font-family: var(--theme-font-family-body, "Open Sans");
144+
font-size: var(--theme-font-size-sm, 14px);
173145
font-style: normal;
174-
font-weight: 700;
175-
line-height: normal;
146+
font-weight: var(--theme-font-weight-body-sm, 700);
147+
line-height: 150%; /* 21px */
176148
margin: 0px
177149
}
178150

@@ -261,6 +233,7 @@ input[type=number]::-webkit-input-placeholder {
261233

262234
.bb-c-c4dic-card-org-contact {
263235
.contact-list {
236+
white-space: pre-line;
264237
display: grid;
265238
grid-template-columns: 1fr 1fr 1fr;
266239
}

server/app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ def get_patient_insurance():
221221

222222
for c in coverage_array:
223223
coverage = {}
224+
c_resource_id = c['resource'].get('id')
224225
c_coverageClass = lookup_1_and_get("$.resource.class[?(@.type.coding[0].code=='plan')]", "value", c)
226+
if c_coverageClass and (c_coverageClass != "Part A" or c_coverageClass != "Part B"):
227+
if "c4dic-part-c" in c_resource_id:
228+
c_coverageClass = "Part C"
229+
elif "c4dic-part-d" in c_resource_id:
230+
c_coverageClass = "Part D"
225231
coverage['coverageClass'] = c_coverageClass if c_coverageClass else "Null"
226232
c_status = c['resource']['status']
227233
coverage['status'] = c_status
@@ -258,9 +264,11 @@ def get_patient_insurance():
258264
coverage['contacts'] = c_contacts
259265
c_contract_id = "" ## Part A and Part B does not have contract number
260266
if c_coverageClass == "Part C":
261-
c_contract_id = lookup_1_and_get(f"$.resource.extension[?(@.url=='{CMS_VAR_PTC_CNTRCT_ID_01}')]", "valueCoding", c).get('code')
267+
c_contract_id = lookup_1_and_get("$.resource.class[?(@.type.coding[0].code=='plan')]", "value", c)
268+
# c_contract_id = lookup_1_and_get(f"$.resource.extension[?(@.url=='{CMS_VAR_PTC_CNTRCT_ID_01}')]", "valueCoding", c).get('code')
262269
if c_coverageClass == "Part D":
263-
c_contract_id = lookup_1_and_get(f"$.resource.extension[?(@.url=='{CMS_VAR_PTD_CNTRCT_ID_01}')]", "valueCoding", c).get('code')
270+
c_contract_id = lookup_1_and_get("$.resource.class[?(@.type.coding[0].code=='plan')]", "value", c)
271+
# c_contract_id = lookup_1_and_get(f"$.resource.extension[?(@.url=='{CMS_VAR_PTD_CNTRCT_ID_01}')]", "valueCoding", c).get('code')
264272
coverage['contractId'] = c_contract_id
265273
c_reference_year = lookup_1_and_get(f"$.resource.extension[?(@.url=='{CMS_VAR_REF_YR}')]", "valueDate", c)
266274
coverage['referenceYear'] = c_reference_year

0 commit comments

Comments
 (0)