@openmrs/esm-laboratory-app
Version:
An O3 frontend module for managing laboratory requests and queues
47 lines (43 loc) • 1.95 kB
text/typescript
import { Type, validators } from '@openmrs/esm-framework';
const allowedLabTableColumns = ['name', 'urgency', 'age', 'dob', 'sex', 'totalOrders', 'action', 'patientId'] as const;
type LabTableColumnName = (typeof allowedLabTableColumns)[number];
export const configSchema = {
laboratoryOrderTypeUuid: {
_type: Type.String,
_default: '52a447d3-a64a-11e3-9aeb-50e549534c5e',
_description: 'UUID for orderType',
},
labTableColumns: {
_type: Type.Array,
_default: ['name', 'urgency', 'age', 'sex', 'totalOrders', 'action'] as Array<LabTableColumnName>,
_description: 'The columns to display in the lab table. Allowed values: ' + allowedLabTableColumns.join(', '),
_elements: {
_type: Type.String,
_validators: [validators.oneOf(allowedLabTableColumns)],
},
},
patientIdIdentifierTypeUuid: {
_type: Type.UUID,
_default: '05a29f94-c0ed-11e2-94be-8c13b969e334',
_description: 'Needed if the "id" column of "labTableColumns" is used. Is the OpenMRS ID by default.',
},
usePreferredPatientIdentifier: {
_type: Type.Boolean,
_default: true,
_description:
"When true (default), the patientId column shows an identifier only when it is both preferred and matches patientIdIdentifierTypeUuid. When false, any identifier of the configured type is shown regardless of preferred status, with a fallback to the patient's preferred identifier of any type.",
},
enableReviewingLabResultsBeforeApproval: {
_type: Type.Boolean,
_default: false,
_description:
'Enable reviewing lab results before final approval. When enabled, lab results will be submitted for review before being approved and finalized.',
},
};
export type Config = {
enableReviewingLabResultsBeforeApproval: boolean;
laboratoryOrderTypeUuid: string;
labTableColumns: Array<LabTableColumnName>;
patientIdIdentifierTypeUuid: string;
usePreferredPatientIdentifier: boolean;
};