-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logic for capturing encounter provider
- Loading branch information
Showing
8 changed files
with
73 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import styles from './inline-loader.scss'; | ||
import { InlineLoading } from '@carbon/react'; | ||
|
||
const InlineLoader: React.FC = () => ( | ||
<div className={styles.formField}> | ||
<span className="cds--label"></span> | ||
<div className={styles.row}> | ||
<InlineLoading status="active" /> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default InlineLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@use '@carbon/colors'; | ||
.formField { | ||
margin-left: 2rem; | ||
max-width: 19rem; | ||
|
||
> div > div > label { | ||
color: colors.$gray-70; | ||
} | ||
} | ||
.row { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: baseline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useSession } from '@openmrs/esm-framework'; | ||
import { SubmissionHandler } from '..'; | ||
import { OpenmrsEncounter, OHRIFormField } from '../api/types'; | ||
import { EncounterContext } from '../ohri-form-context'; | ||
|
||
export const EncounterProviderHandler: SubmissionHandler = { | ||
handleFieldSubmission: (field: OHRIFormField, value: any, context: EncounterContext) => { | ||
context.setEncounterProvider(value); | ||
return value; | ||
}, | ||
getInitialValue: (encounter: OpenmrsEncounter, field: OHRIFormField, allFormFields?: OHRIFormField[]) => { | ||
return encounter.encounterProviders[0]; | ||
}, | ||
|
||
getDisplayValue: (field: OHRIFormField, value: any) => { | ||
return field.value ? field.value : null; | ||
}, | ||
getPreviousValue: (field: OHRIFormField, value: any) => { | ||
return null; | ||
}, | ||
}; |