Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate auto ID's #110

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/TableComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface ShortenCol {
title?: string;
}

export interface TableProps extends TableHTMLAttributes {
export interface TableProps extends /* @vue-ignore */ TableHTMLAttributes {
cols: TableCol[];
data: any[];
mobileView?: "moveable" | "collapsed" | "transformed" | "shorten";
Expand Down
4 changes: 2 additions & 2 deletions src/components/base/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props = defineProps<Props>();

const refViewBox = props.viewBox || props.size || 20;

const viewBox: string =
const viewBoxL: string =
typeof refViewBox === "number" || refViewBox.indexOf(" ") < 0
? `0 0 ${refViewBox} ${refViewBox}`
: refViewBox;
Expand All @@ -26,7 +26,7 @@ const width = props.width || props.size;
<svg
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
:viewBox="viewBox"
:viewBox="viewBoxL"
:height="height"
:width="width"
:class="props.class"
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SimpleInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { InputHTMLAttributes } from "vue";

interface InputProps extends InputHTMLAttributes {
interface InputProps extends /* @vue-ignore */ InputHTMLAttributes {
hint?: string;
hintType?: "error" | "warning" | "success" | "none";
label?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SimpleSelect.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { SelectHTMLAttributes } from "vue";

interface InputProps extends SelectHTMLAttributes {
interface InputProps extends /* @vue-ignore */ SelectHTMLAttributes {
hint?: string;
hintType?: "error" | "warning" | "success" | "none";
label?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/notification/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTimeoutFn } from "@vueuse/core";

import type { CSSProperties } from "vue";
import type { NotificationProps } from ".";
interface Props extends NotificationProps {
interface Props extends /* @vue-ignore */ NotificationProps {
id: string;
}

Expand Down
21 changes: 19 additions & 2 deletions src/views/patients/PatientForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,35 @@ const tests = ref<Record<string, any>[]>((props.toEdit?.tests as any) ?? []);

const refererValue = ref<string>("");

const patientId = ref<string>(props.toEdit?.id ?? "");

onMounted(async () => {
window.scrollTo(0, 0);
if (props.toEdit) {
advance.value = (props.toEdit.advance as any) / 100;
discount.value = (props.toEdit.discount as any) / 100;
refererValue.value = props.toEdit.referer;
complementary.value = !!props.toEdit.complementary;
patientId.value = props.toEdit.id;
// @ts-ignore
total.value = props.toEdit.tests[0].price;
} else {
getAutoID({ target: { value: "cyto" } });
}
getAllTests();
});

const getAutoID = async (evt: any) => {
const res = await fetchApi(
API_BASE + "/patient-autoid?type=" + evt.target.value
);
if (!res.success) {
console.error(res.message);
return;
}
patientId.value = res.data.id;
};

async function getAllTests() {
const res = await fetchApi(API_BASE + "/misc?name=test");
if (!res.success) {
Expand Down Expand Up @@ -247,7 +263,8 @@ const onTestDelete = (id: string) => {
label="Type"
:un-wrap="true"
:hint="fieldErrors?.type?.[0]"
:value="toEdit?.type"
:value="toEdit?.type || 'cyto'"
@input="getAutoID"
>
<option value="cyto">Cytopathology</option>
<option value="histo">Histopathology</option>
Expand All @@ -257,7 +274,7 @@ const onTestDelete = (id: string) => {
label="ID"
:un-wrap="true"
:hint="fieldErrors?.id?.[0]"
:value="toEdit?.id"
:value="patientId"
/>

<h4 class="section-title all-col">Patient Information</h4>
Expand Down
20 changes: 10 additions & 10 deletions worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
"cli": "node ./cli/main.js"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230419.0",
"@inquirer/prompts": "^3.1.1",
"@types/bcryptjs": "^2.4.3",
"@cloudflare/workers-types": "^4.20240712.0",
"@inquirer/prompts": "^3.3.2",
"@types/bcryptjs": "^2.4.6",
"cli-spinner": "^0.2.10",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.19.13",
"drizzle-orm": "^0.28.5",
"typescript": "^5.0.4",
"wrangler": "^3.22.5"
"drizzle-orm": "^0.28.6",
"typescript": "^5.5.3",
"wrangler": "^3.64.0"
},
"dependencies": {
"@faker-js/faker": "^8.1.0",
"@faker-js/faker": "^8.4.1",
"@libsql/client": "^0.3.6",
"bcryptjs": "^2.4.3",
"itty-router": "^4.0.22",
"zod": "^3.22.2"
"itty-router": "^4.2.2",
"zod": "^3.23.8"
}
}
Loading