Skip to content

Commit 213296a

Browse files
authored
Merge pull request #11 from beda-software/emr-update
WIP emr update
2 parents 5b7b8f5 + 9bba42f commit 213296a

6 files changed

Lines changed: 110 additions & 56 deletions

File tree

contrib/fhir-emr

Submodule fhir-emr updated 65 files

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
"contrib/*"
2020
],
2121
"dependencies": {
22-
"@beda.software/emr": "*"
22+
"@beda.software/emr": "*",
23+
"@beda.software/fhir-questionnaire": "^0.1.0-alpha.13",
24+
"@beda.software/web-item-controls": "^0.1.21",
25+
"react": "^18.2.0",
26+
"react-hook-form": "^7.53.2"
2327
},
2428
"devDependencies": {
2529
"@chromatic-com/storybook": "^1.6.1",

src/containers/App/index.tsx

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
PractitionerDetails,
99
PractitionerList,
1010
} from '@beda.software/emr/containers';
11+
import { ClinicalContext } from '@beda.software/fhir-questionnaire';
1112

1213
import { useApp } from './hooks';
1314
import { menuLayout } from './layout';
@@ -20,30 +21,35 @@ import { SignIn } from '../SignIn';
2021

2122
export function App() {
2223
const { sharedUserInitService, setAuthProvider } = useApp();
24+
const context = [
25+
{ name: "gpccmppractitionerrole", resource: { resourceType: "PractitionerRole" } as any }
26+
]
2327

2428
return (
25-
<EMR
26-
authenticatedRoutes={
27-
<>
28-
<Route path="/practitioners" element={<PractitionerList />} />
29-
<Route path="/practitioners/:id/*" element={<PractitionerDetails />} />
30-
<Route path="/healthcare-services" element={<HealthcareServiceList />} />
31-
<Route path="/organizations" element={<OrganizationResourceList />} />
32-
<Route path="/locations" element={<LocationResourceList />} />
33-
<Route path="/patients" element={<PatientResourceList />} />
34-
<Route path="/patients/:id/encounter/:encounter/*" element={<EncounterPage />} />
35-
<Route path="/patients/:id/*" element={<PatientDetails />} />
36-
</>
37-
}
38-
anonymousRoutes={
39-
<>
40-
<Route path="/signin" element={<SignIn onSwitchService={setAuthProvider} />} />
41-
<Route path="/auth" element={<CodeGrantAuth />} />
42-
<Route path="/auth-aidbox" element={<ImplicitGrantAuth />} />
43-
</>
44-
}
45-
populateUserInfoSharedState={sharedUserInitService}
46-
menuLayout={menuLayout}
47-
/>
29+
<ClinicalContext context={context}>
30+
<EMR
31+
authenticatedRoutes={
32+
<>
33+
<Route path="/practitioners" element={<PractitionerList />} />
34+
<Route path="/practitioners/:id/*" element={<PractitionerDetails />} />
35+
<Route path="/healthcare-services" element={<HealthcareServiceList />} />
36+
<Route path="/organizations" element={<OrganizationResourceList />} />
37+
<Route path="/locations" element={<LocationResourceList />} />
38+
<Route path="/patients" element={<PatientResourceList />} />
39+
<Route path="/patients/:id/encounter/:encounter/*" element={<EncounterPage />} />
40+
<Route path="/patients/:id/*" element={<PatientDetails />} />
41+
</>
42+
}
43+
anonymousRoutes={
44+
<>
45+
<Route path="/signin" element={<SignIn onSwitchService={setAuthProvider} />} />
46+
<Route path="/auth" element={<CodeGrantAuth />} />
47+
<Route path="/auth-aidbox" element={<ImplicitGrantAuth />} />
48+
</>
49+
}
50+
populateUserInfoSharedState={sharedUserInitService}
51+
menuLayout={menuLayout}
52+
/>
53+
</ClinicalContext>
4854
);
4955
}

src/containers/PatientDetails/encounter.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const tabs: Array<Tab<Encounter|Patient>> = [
2525
{
2626
path: 'documents',
2727
label: 'Documents',
28-
component: ({ resource, bundle }) => <Documents patient={getPatient(bundle)!} encounter={resource as Encounter}/>,
28+
component: ({ bundle }) => <Documents patient={getPatient(bundle)!} />,
2929
},
3030

3131

@@ -56,6 +56,15 @@ export function EncounterPage() {
5656
patient: id,
5757
_include: ['Encounter:patient', 'Encounter:practitioner'],
5858
})}
59+
getClinicalContext={({ resource, bundle }) => {
60+
const patient = getPatient(bundle)!;
61+
return [
62+
{ name: 'patient', resource: patient },
63+
{ name: 'Patient', resource: patient },
64+
{ name: 'encounter', resource: resource },
65+
{ name: 'Encounter', resource: resource },
66+
];
67+
}}
5968
getTitle={({ resource, bundle }) => getName(resource, bundle) ?? 'N/A'}
6069
tabs={tabs}
6170
maxWidth="100%"

src/containers/PatientDetails/index.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Encounter, Patient } from 'fhir/r4b';
1+
import { Patient } from 'fhir/r4b';
22
import React from 'react';
33
import { Route, Routes } from 'react-router-dom';
44

@@ -9,7 +9,7 @@ import { PatientDocumentDetails } from '@beda.software/emr/dist/containers/Patie
99
import { PatientDocuments } from '@beda.software/emr/dist/containers/PatientDetails/PatientDocuments/index';
1010
import { PatientOverview } from '@beda.software/emr/dist/containers/PatientDetails/PatientOverviewDynamic/index';
1111
import { PageTabs, ResourceDetailPage, Tab } from '@beda.software/emr/dist/uberComponents/ResourceDetailPage/index';
12-
import { compileAsFirst, renderHumanName, selectCurrentUserRoleResource } from '@beda.software/emr/dist/utils/index';
12+
import { compileAsFirst, renderHumanName } from '@beda.software/emr/dist/utils/index';
1313
import { service } from '@beda.software/emr/services';
1414
import config from '@beda.software/emr-config';
1515
import { RenderRemoteData, useService, WithId } from '@beda.software/fhir-react';
@@ -171,27 +171,20 @@ function OrionHealthPatientDetails() {
171171
);
172172
}
173173

174-
export function Documents({ patient, encounter }: { patient: WithId<Patient>, encounter?: Encounter }) {
175-
const author = selectCurrentUserRoleResource();
174+
export function Documents({ patient }: { patient: WithId<Patient> }) {
176175
return (
177176
<Routes>
178177
<Route path="/" element={<PatientDocuments patient={patient} />} />
179178
<Route
180179
path="/new/:questionnaireId"
181180
element={
182181
<S.PatientDocument>
183-
<PatientDocument
184-
patient={patient}
185-
author={author}
186-
autoSave={true}
187-
onSuccess={() => {
188-
window.history.back();
189-
}}
190-
launchContextParameters={[
191-
{name: "encounter", resource: encounter },
192-
{ name: "gpccmppractitionerrole", resource: {resourceType: "PractitionerRole"} },
193-
]}
194-
/>
182+
<PatientDocument
183+
autoSave={true}
184+
onSuccess={() => {
185+
window.history.back();
186+
}}
187+
/>
195188
</S.PatientDocument>
196189
}
197190
/>

yarn.lock

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,14 @@
13871387
"@babel/helper-create-regexp-features-plugin" "^7.24.7"
13881388
"@babel/helper-plugin-utils" "^7.24.7"
13891389

1390+
"@babel/polyfill@^7.10.1":
1391+
version "7.12.1"
1392+
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.12.1.tgz#1f2d6371d1261bbd961f3c5d5909150e12d0bd96"
1393+
integrity sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==
1394+
dependencies:
1395+
core-js "^2.6.5"
1396+
regenerator-runtime "^0.13.4"
1397+
13901398
"@babel/preset-env@^7.24.4":
13911399
version "7.24.8"
13921400
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.24.8.tgz#e0db94d7f17d6f0e2564e8d29190bc8cdacec2d1"
@@ -1664,10 +1672,10 @@
16641672
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
16651673
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
16661674

1667-
"@beda.software/fhir-questionnaire@^0.1.0-alpha.8":
1668-
version "0.1.0-alpha.8"
1669-
resolved "https://registry.yarnpkg.com/@beda.software/fhir-questionnaire/-/fhir-questionnaire-0.1.0-alpha.8.tgz#9bc71a03604c74cb474b9150e968e472603b3664"
1670-
integrity sha512-3dQc4NmWBsPw3sAMw78fYjqqJYAgVt3+SkyC9Ls/ZkLAynw85LF8uMHv0lPiVpxw+J09EuLMIURNaet8WOyhGA==
1675+
"@beda.software/fhir-questionnaire@^0.1.0-alpha.13":
1676+
version "0.1.0-alpha.13"
1677+
resolved "https://registry.yarnpkg.com/@beda.software/fhir-questionnaire/-/fhir-questionnaire-0.1.0-alpha.13.tgz#010251725e3ffb844661db1856b93dbace490639"
1678+
integrity sha512-MSghN+LJ1sE2hvqA6S2w0YYuDq7hfAcdaKrNNDSn0yJDvB2pM1Hm8MPkwLKP6VqjwbvmQg7VTwlNOTdip+dMjw==
16711679
dependencies:
16721680
"@beda.software/fhir-react" "^1.11.1"
16731681
"@beda.software/remote-data" "^1.1.4"
@@ -1681,7 +1689,7 @@
16811689
moment "^2.30.1"
16821690
query-string "^7.1.1"
16831691
react-hook-form "^7.49.3"
1684-
sdc-qrf "1.1.0-alpha.9"
1692+
sdc-qrf "^1.1.0-alpha.11"
16851693
tslib "^2.8.1"
16861694
yup "^1.2.0"
16871695

@@ -1719,10 +1727,10 @@
17191727
magic-string "^0.30.10"
17201728
vue-tsc "2.0.19"
17211729

1722-
"@beda.software/web-item-controls@^0.1.19":
1723-
version "0.1.19"
1724-
resolved "https://registry.yarnpkg.com/@beda.software/web-item-controls/-/web-item-controls-0.1.19.tgz#361423989102bc3a5b2d28d93487337d25e257ba"
1725-
integrity sha512-loG+yjOb4i62rr5D/I8kIuvPwCW41e5pvF574nuhfGNWgal72jmq/iS4GFbyruGzzKCOgfXTaZWBLJw7vnr4hQ==
1730+
"@beda.software/web-item-controls@^0.1.21":
1731+
version "0.1.21"
1732+
resolved "https://registry.yarnpkg.com/@beda.software/web-item-controls/-/web-item-controls-0.1.21.tgz#5b97a2d16287b73aa9ab6a80304fbbc69df438a7"
1733+
integrity sha512-bUMkba4YEh6er2OsOoLsCOOmJEhc8Ez/hy/PVKkUSE+fK+Hx/f901Jr/jlF6P9o1dGOhMMd7BYw8qDYxCBxz2g==
17261734
dependencies:
17271735
"@ant-design/colors" "^7.0.0"
17281736
"@ant-design/icons" "^5.1.4"
@@ -7956,6 +7964,11 @@ clean-stack@^2.0.0:
79567964
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
79577965
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
79587966

7967+
clear-cut@^2.0.2:
7968+
version "2.0.2"
7969+
resolved "https://registry.yarnpkg.com/clear-cut/-/clear-cut-2.0.2.tgz#082db32ecaa44a358a7b086852fe1d5480bbeed1"
7970+
integrity sha512-WVgn/gSejQ+0aoR8ucbKIdo6icduPZW6AbWwyUmAUgxy63rUYjwa5rj/HeoNPhf0/XPrl82X8bO/hwBkSmsFtg==
7971+
79597972
cli-cursor@^3.1.0:
79607973
version "3.1.0"
79617974
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307"
@@ -8247,6 +8260,11 @@ core-js-compat@^3.37.1:
82478260
dependencies:
82488261
browserslist "^4.23.0"
82498262

8263+
core-js@^2.6.5:
8264+
version "2.6.12"
8265+
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
8266+
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
8267+
82508268
core-util-is@~1.0.0:
82518269
version "1.0.3"
82528270
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
@@ -8335,6 +8353,14 @@ css-to-react-native@3.2.0:
83358353
css-color-keywords "^1.0.0"
83368354
postcss-value-parser "^4.0.2"
83378355

8356+
css-tree@^1.1.3:
8357+
version "1.1.3"
8358+
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d"
8359+
integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==
8360+
dependencies:
8361+
mdn-data "2.0.14"
8362+
source-map "^0.6.1"
8363+
83388364
css.escape@^1.5.1:
83398365
version "1.5.1"
83408366
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
@@ -12501,6 +12527,11 @@ mdast-util-to-string@^4.0.0:
1250112527
dependencies:
1250212528
"@types/mdast" "^4.0.0"
1250312529

12530+
mdn-data@2.0.14:
12531+
version "2.0.14"
12532+
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
12533+
integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==
12534+
1250412535
media-typer@0.3.0:
1250512536
version "0.3.0"
1250612537
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
@@ -13498,6 +13529,17 @@ package-hash@^4.0.0:
1349813529
lodash.flattendeep "^4.4.0"
1349913530
release-zalgo "^1.0.0"
1350013531

13532+
pagedjs@^0.4.3:
13533+
version "0.4.3"
13534+
resolved "https://registry.yarnpkg.com/pagedjs/-/pagedjs-0.4.3.tgz#d8345d04a929867ca44daa2c0487fe40f7817e42"
13535+
integrity sha512-YtAN9JAjsQw1142gxEjEAwXvOF5nYQuDwnQ67RW2HZDkMLI+b4RsBE37lULZa9gAr6kDAOGBOhXI4wGMoY3raw==
13536+
dependencies:
13537+
"@babel/polyfill" "^7.10.1"
13538+
"@babel/runtime" "^7.21.0"
13539+
clear-cut "^2.0.2"
13540+
css-tree "^1.1.3"
13541+
event-emitter "^0.3.5"
13542+
1350113543
parent-module@^1.0.0:
1350213544
version "1.0.1"
1350313545
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
@@ -14882,7 +14924,7 @@ regenerate@^1.4.2:
1488214924
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
1488314925
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
1488414926

14885-
regenerator-runtime@^0.13.7:
14927+
regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7:
1488614928
version "0.13.11"
1488714929
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
1488814930
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
@@ -15333,10 +15375,10 @@ scroll-into-view-if-needed@^3.1.0:
1533315375
dependencies:
1533415376
compute-scroll-into-view "^3.0.2"
1533515377

15336-
sdc-qrf@1.1.0-alpha.9, sdc-qrf@^1.1.0-alpha.9:
15337-
version "1.1.0-alpha.9"
15338-
resolved "https://registry.yarnpkg.com/sdc-qrf/-/sdc-qrf-1.1.0-alpha.9.tgz#5c666512c15cb406b830c67deb8ab60b7776d04b"
15339-
integrity sha512-wQFzglUDw9wgtut6MDpTKjIMC7M7unEpjPKSDkqNLQr+tmsHfUHRRimbMn5aRQ9BM9+LHOW1RIqIxb/cicoIsQ==
15378+
sdc-qrf@^1.1.0-alpha.11:
15379+
version "1.1.0-alpha.11"
15380+
resolved "https://registry.yarnpkg.com/sdc-qrf/-/sdc-qrf-1.1.0-alpha.11.tgz#9f15959d909aaa2889c5fd791f14ff9e83064dca"
15381+
integrity sha512-WHFx1S2s652Lox8WlUD3+c4WohZExP/K1pFkHL9sLhwrxZXN7u1/I4YaRIgCGouV4HHTP/XE4Ai+b81lsVbWhA==
1534015382
dependencies:
1534115383
classnames "^2.5.1"
1534215384
fhirpath "^3.18.0"

0 commit comments

Comments
 (0)