@tellescope/react-components 1.246.1 → 1.246.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.246.1",
3
+ "version": "1.246.2",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -51,13 +51,13 @@
51
51
  "@reduxjs/toolkit": "1.9.0",
52
52
  "@stripe/react-stripe-js": "2.9.0",
53
53
  "@stripe/stripe-js": "1.52.1",
54
- "@tellescope/constants": "1.246.1",
55
- "@tellescope/sdk": "1.246.1",
56
- "@tellescope/types-client": "1.246.1",
57
- "@tellescope/types-models": "1.246.1",
58
- "@tellescope/types-utilities": "1.246.1",
59
- "@tellescope/utilities": "1.246.1",
60
- "@tellescope/validation": "1.246.1",
54
+ "@tellescope/constants": "1.246.2",
55
+ "@tellescope/sdk": "1.246.2",
56
+ "@tellescope/types-client": "1.246.2",
57
+ "@tellescope/types-models": "1.246.2",
58
+ "@tellescope/types-utilities": "1.246.2",
59
+ "@tellescope/utilities": "1.246.2",
60
+ "@tellescope/validation": "1.246.2",
61
61
  "css-to-react-native": "3.0.0",
62
62
  "draft-js": "0.11.7",
63
63
  "draftjs-to-html": "0.9.1",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "c18252ff9abffb701c1f4228ce2000acce3f660c",
87
+ "gitHead": "a9167f6d732de999cf012ffba3004f0d62ae8c14",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -1024,9 +1024,16 @@ const HistoricalDataSection = ({ sources, enduserId } : { sources: HistoricalDat
1024
1024
  const [loading, setLoading] = useState(true)
1025
1025
  const [error, setError] = useState('')
1026
1026
 
1027
+ const loadedKeyRef = useRef('')
1028
+
1027
1029
  useEffect(() => {
1028
1030
  if (!session) return
1029
1031
 
1032
+ // Build a stable key from enduserId + sources to avoid re-fetching on object reference changes
1033
+ const key = enduserId + ':' + JSON.stringify(sources)
1034
+ if (loadedKeyRef.current === key) return
1035
+ loadedKeyRef.current = key
1036
+
1030
1037
  const loadData = async () => {
1031
1038
  setLoading(true)
1032
1039
  setError('')
@@ -1130,21 +1137,41 @@ const HistoricalDataSection = ({ sources, enduserId } : { sources: HistoricalDat
1130
1137
  <table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 14 }}>
1131
1138
  <thead>
1132
1139
  <tr style={{ borderBottom: '2px solid #ccc', textAlign: 'left' }}>
1133
- <th style={{ padding: '6px 8px' }}>Title</th>
1140
+ <th style={{ padding: '6px 8px' }}>Medication</th>
1134
1141
  <th style={{ padding: '6px 8px' }}>Dosage</th>
1135
- <th style={{ padding: '6px 8px' }}>Prescribed By</th>
1136
- <th style={{ padding: '6px 8px' }}>Start Date</th>
1142
+ <th style={{ padding: '6px 8px' }}>Dispensing</th>
1143
+ <th style={{ padding: '6px 8px' }}>Pharmacy</th>
1144
+ <th style={{ padding: '6px 8px' }}>Prescriber</th>
1145
+ <th style={{ padding: '6px 8px' }}>Date</th>
1137
1146
  </tr>
1138
1147
  </thead>
1139
1148
  <tbody>
1140
1149
  {medications.map((med: any) => (
1141
1150
  <tr key={med.id} style={{ borderBottom: '1px solid #eee' }}>
1142
- <td style={{ padding: '6px 8px' }}>{med.title || '-'}</td>
1143
1151
  <td style={{ padding: '6px 8px' }}>
1144
- {med.dosage ? `${med.dosage.value} ${med.dosage.unit}` : '-'}
1152
+ {med.title || '-'}
1153
+ {med.allergyNote ? <div style={{ color: 'red', fontSize: 12 }}>Allergies: {med.allergyNote}</div> : null}
1154
+ {med.directions ? <div style={{ color: '#888', fontSize: 12 }}>Directions: {med.directions}</div> : null}
1155
+ </td>
1156
+ <td style={{ padding: '6px 8px' }}>
1157
+ {med.dosage
1158
+ ? med.dosage.description
1159
+ ? med.dosage.description
1160
+ : `${med.dosage.value || ''}${med.dosage.unit ? ` ${med.dosage.unit}` : ''}${med.dosage.quantity ? ` ${med.dosage.quantity} units` : ''}${med.dosage.frequency ? ` ${!isNaN(parseInt(med.dosage.frequency)) ? `${med.dosage.frequency}x ${med.dosage?.frequencyDescriptor ? `Per ${med.dosage.frequencyDescriptor}` : 'daily'}` : med.dosage.frequency}` : ''}`
1161
+ : '-'}
1162
+ </td>
1163
+ <td style={{ padding: '6px 8px' }}>
1164
+ {med.dispensing ? `${med.dispensing.quantity || ''} ${med.dispensing.unit || ''}`.trim() || '-' : '-'}
1165
+ </td>
1166
+ <td style={{ padding: '6px 8px' }}>{med.pharmacyName || med.pharmacyId || '-'}</td>
1167
+ <td style={{ padding: '6px 8px' }}>
1168
+ {med.prescriberName || '-'}
1169
+ {med.source ? <div style={{ fontStyle: 'italic', fontSize: 12 }}>{med.source}</div> : null}
1170
+ {med.notes ? <div style={{ fontSize: 12 }}>{med.notes}</div> : null}
1171
+ </td>
1172
+ <td style={{ padding: '6px 8px' }}>
1173
+ {formatted_date(new Date(med.startedTakingAt || med.prescribedAt || med.createdAt))}
1145
1174
  </td>
1146
- <td style={{ padding: '6px 8px' }}>{med.prescriberName || '-'}</td>
1147
- <td style={{ padding: '6px 8px' }}>{med.startedTakingAt ? formatted_date(new Date(med.startedTakingAt)) : '-'}</td>
1148
1175
  </tr>
1149
1176
  ))}
1150
1177
  </tbody>