-
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.
(feat) O3-3050: add support for rendering select-concept-answers (#214)
* feat: add support for rendering select-concept-answers * refactor: use concet-set-member-ds * chore: add unit tests * chore: rebase branch to main * fix: fix failed build * refactor: user ui-select-ext input * refactor: fix formating prettier * Fine-tune datasource config during schema preprocessing --------- Co-authored-by: samuelmale <samuelsmalek@gmail.com>
- Loading branch information
1 parent
ae36027
commit ab88063
Showing
9 changed files
with
149 additions
and
42 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,17 @@ | ||
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework'; | ||
import { BaseOpenMRSDataSource } from './data-source'; | ||
|
||
export class ConceptSetMembersDataSource extends BaseOpenMRSDataSource { | ||
constructor() { | ||
super(`${restBaseUrl}/concept/conceptUuid?v=custom:(uuid,setMembers:(uuid,display))`); | ||
} | ||
|
||
fetchData(searchTerm: string, config?: Record<string, any>): Promise<any[]> { | ||
let apiUrl = this.url; | ||
let urlParts = apiUrl.split('conceptUuid'); | ||
apiUrl = `${urlParts[0]}/${config.concept}${urlParts[1]}`; | ||
return openmrsFetch(apiUrl).then(({ data }) => { | ||
return data['setMembers']; | ||
}); | ||
} | ||
} |
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
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