-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/mtb/src/runtime/components/core/validation/MValidations.ts
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,42 @@ | ||
/* | ||
* Copyright (c) 2024. | ||
* Author Peter Placzek (tada5hi) | ||
* For the full copyright and license information, | ||
* view the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
import type { ObjectLiteral, PatientMatchBase, ResourceCollectionSlots } from '@dnpm-dip/core'; | ||
import { createResourceCollectionManager } from '@dnpm-dip/core'; | ||
import type { PropType, SlotsType } from 'vue'; | ||
import { defineComponent, toRef } from 'vue'; | ||
import { injectHTTPClient } from '../../../core/http-client'; | ||
|
||
export default defineComponent({ | ||
props: { | ||
filters: { | ||
type: Object as PropType<ObjectLiteral>, | ||
}, | ||
}, | ||
slots: Object as SlotsType<ResourceCollectionSlots<PatientMatchBase>>, | ||
setup(props, setup) { | ||
const api = injectHTTPClient(); | ||
|
||
const filters = toRef(props, 'filters'); | ||
|
||
const manager = createResourceCollectionManager({ | ||
load: async () => { | ||
const response = await api.validation.getValidationReport(); | ||
|
||
return { | ||
data: response.entries, | ||
total: response.size, | ||
}; | ||
}, | ||
slots: setup.slots, | ||
expose: setup.expose, | ||
filters, | ||
}); | ||
|
||
return () => manager.render(); | ||
}, | ||
}); |
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,25 @@ | ||
/* | ||
* Copyright (c) 2024. | ||
* Author Peter Placzek (tada5hi) | ||
* For the full copyright and license information, | ||
* view the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
import { BaseAPI, type ResourceCollectionResponse } from '@dnpm-dip/core'; | ||
|
||
export class ValidationAPI extends BaseAPI { | ||
async getValidationReport() : Promise<ResourceCollectionResponse<Record<string, any>>> { | ||
const response = await this.client.get('mtb/validation/infos'); | ||
return response.data; | ||
} | ||
|
||
async getValidationPatientReport(id: string) { | ||
const response = await this.client.get(`mtb/validation/report/${id}`); | ||
return response.data; | ||
} | ||
|
||
async getValidationPatientRecord(id: string) { | ||
const response = await this.client.get(`mtb/validation/patient-record/${id}`); | ||
return response.data; | ||
} | ||
} |
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,8 @@ | ||
/* | ||
* Copyright (c) 2024. | ||
* Author Peter Placzek (tada5hi) | ||
* For the full copyright and license information, | ||
* view the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
export * from './api'; |
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,26 @@ | ||
<!-- | ||
- Copyright (c) 2024. | ||
- Author Peter Placzek (tada5hi) | ||
- For the full copyright and license information, | ||
- view the LICENSE file that was distributed with this source code. | ||
--> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import MValidations from '../../components/core/validation/MValidations'; | ||
|
||
export default defineComponent({ | ||
components: { MValidations }, | ||
}); | ||
</script> | ||
<template> | ||
<div> | ||
<h1 class="title no-border mb-3"> | ||
<i class="fa fa-shield" /> Validierung | ||
</h1> | ||
<MValidations> | ||
<template #default="props"> | ||
{{ props.data }} | ||
</template> | ||
</MValidations> | ||
</div> | ||
</template> |
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