Skip to content

Commit

Permalink
Merge pull request #390 from beda-software/encounter-create-additiona…
Browse files Browse the repository at this point in the history
…l-launch-context

Added additional launch context to encounter create modal
  • Loading branch information
qscgyjqscgyj authored Nov 28, 2024
2 parents 15ce5fe + 93995fc commit de963c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/ModalNewEncounter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PlusOutlined } from '@ant-design/icons';
import { t } from '@lingui/macro';
import { Button, notification } from 'antd';
import { Patient } from 'fhir/r4b';
import { ParametersParameter, Patient } from 'fhir/r4b';
import { useMemo, useState } from 'react';

import { Modal } from 'src/components/Modal';
Expand All @@ -12,9 +12,10 @@ import { Role, matchCurrentUserRole } from 'src/utils/role';
export interface ModalNewEncounterProps {
patient: Patient;
reloadEncounter: () => void;
launchContextParameters?: ParametersParameter[];
}

export const ModalNewEncounter = ({ patient, reloadEncounter }: ModalNewEncounterProps) => {
export const ModalNewEncounter = ({ patient, launchContextParameters, reloadEncounter }: ModalNewEncounterProps) => {
const [isModalVisible, setIsModalVisible] = useState(false);
const title = useMemo(
() =>
Expand Down Expand Up @@ -55,7 +56,10 @@ export const ModalNewEncounter = ({ patient, reloadEncounter }: ModalNewEncounte
<QuestionnaireResponseForm
questionnaireLoader={questionnaireIdLoader('encounter-create')}
onSuccess={handleSuccess}
launchContextParameters={[{ name: 'Patient', resource: patient }]}
launchContextParameters={[
{ name: 'Patient', resource: patient },
...(launchContextParameters || []),
]}
onCancel={() => setIsModalVisible(false)}
/>
</Modal>
Expand Down

0 comments on commit de963c3

Please sign in to comment.