2026-02-01 21:47:55 +07:00

145 lines
4.6 KiB
JavaScript

import PlusIcon from "@lucide/svelte/icons/plus";
import Settings2Icon from "@lucide/svelte/icons/settings-2";
import FlaskConicalIcon from "@lucide/svelte/icons/flask-conical";
import ActivityIcon from "@lucide/svelte/icons/activity";
import PencilIcon from "@lucide/svelte/icons/pencil";
import NotepadTextIcon from "@lucide/svelte/icons/notepad-text";
export const searchFields = [
{
key: "PatientID",
label: "Patient ID",
placeholder: "",
type: "text",
defaultValue: "",
},
{
key: "Name",
label: "Patient Name",
placeholder: "",
type: "text",
defaultValue: "",
},
{
key: "Birthdate",
label: "Birthdate",
type: "date"
},
];
export const detailSections = [
{
class: "grid grid-cols-2 lg:grid-cols-3 gap-3",
fields: [
{ key: "PatientID", label: "Patient ID", },
{ parentKey: "PatIdt", key: "IdentifierType", label: "Identifier Type", },
{ key: "Birthdate", label: "Date of Birth", },
{ key: "SexLabel", label: "Sex", },
{ parentKey: "PatIdt", key: "Identifier", label: "Identifier", },
{ key: "Age", label: "Age", },
]
},
{
class: "grid grid-cols-1 sm:grid-cols-3 gap-3",
fields: [
{ key: "ReligionLabel", label: "Religion" },
{ keys: ["Street_1", "Street_2", "Street_3"], className: "row-span-2", label: "Address" },
{ key: "EmailAddress1", label: "Email Address 1" },
{ key: "MaritalStatusLabel", label: "Marital Status" },
{ key: "EmailAddress2", label: "Email Address 2" },
{ key: "EthnicLabel", label: "Ethnic" },
{
isGroup: true,
class: "grid grid-cols-2",
fields: [
{ key: "City", label: "City" },
{ key: "ZIP", label: "ZIP" },
],
},
{ key: "Phone", label: "Phone" },
{ key: "RaceLabel", label: "Race" },
{
isGroup: true,
class: "grid grid-cols-2",
fields: [
{ key: "Province", label: "Province" },
{ key: "CountryLabel", label: "Country" },
],
},
{ key: "MobilePhone", label: "Mobile Phone" },
{ key: "Citizenship", label: "Citizenship" },
{
isGroup: true,
class: "grid grid-cols-2",
fields: [
{ key: "LinkTo", label: "Link Patient" },
{ parentKey: "Custodian", key: "PatientID", label: "Custodian ID" },
],
},
{ key: "DeathIndicatorLabel", label: "Death Indicator" },
{ key: "CreateDate", label: "Create Date", isUTCDate: true },
{ key: "DelDate", label: "Disabled Date" },
{ key: "TimeOfDeath", label: "Death Date", isUTCDate: true },
]
},
{
class: "grid grid-cols-1 sm:grid-cols-2 gap-3",
fields: [
{ key: "", label: "Patient Visit ID" },
{ key: "", label: "Insurance" },
{ key: "", label: "Visit Class" },
{ key: "", label: "Service Class" },
{ key: "", label: "Location" },
{ key: "", label: "Doctor" },
{ key: "", label: "Admission Date", isUTCDate: true },
{ key: "", label: "Discharge Date", isUTCDate: true },
]
},
{
class: "grid grid-cols-1 sm:grid-cols-2 gap-3",
fields: [
{ key: "PatCom", label: "Patient Comment" },
{ key: "PatAtt", label: "Patient File", isFileList: true },
]
}
]
export function patientActions(masterDetail) {
return [
{
Icon: PlusIcon,
label: 'Add Patient',
onClick: masterDetail.enterCreate,
},
{
Icon: Settings2Icon,
label: 'Search Parameters',
},
];
}
export function viewActions(handlers){
return [
{
Icon: FlaskConicalIcon,
label: 'Order Lab',
onClick: handlers.orderLab,
},
{
Icon: ActivityIcon,
label: 'Medical Record',
onClick: handlers.medicalRecord,
},
{
Icon: NotepadTextIcon,
label: 'Audit Patient',
onClick: handlers.auditPatient,
},
{
Icon: PencilIcon,
label: 'Edit Patient',
onClick: handlers.editPatient,
},
]
}