Compare commits
9 Commits
develop
...
prompt-fix
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0033e7fc3 | ||
![]() |
3318425372 | ||
![]() |
398da58d15 | ||
![]() |
baf998ba96 | ||
![]() |
58ba2f72a4 | ||
![]() |
c64f85a9ee | ||
![]() |
ebc86bfa6f | ||
![]() |
1e4b6b657c | ||
![]() |
23656c14c5 |
24
package-lock.json
generated
24
package-lock.json
generated
@ -26,7 +26,9 @@
|
||||
"react-i18next": "^15.4.0",
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"use-keyboard-shortcut": "^1.1.6"
|
||||
"use-keyboard-shortcut": "^1.1.6",
|
||||
"zod": "^3.24.1",
|
||||
"zod-to-ts": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.17.0",
|
||||
@ -3935,7 +3937,6 @@
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||
"devOptional": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@ -4230,6 +4231,23 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.24.1",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz",
|
||||
"integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
},
|
||||
"node_modules/zod-to-ts": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-1.2.0.tgz",
|
||||
"integrity": "sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA==",
|
||||
"peerDependencies": {
|
||||
"typescript": "^4.9.4 || ^5.0.2",
|
||||
"zod": "^3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,8 @@
|
||||
"react-i18next": "^15.4.0",
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"use-keyboard-shortcut": "^1.1.6"
|
||||
"use-keyboard-shortcut": "^1.1.6",
|
||||
"zod": "^3.24.1",
|
||||
"zod-to-ts": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ import {
|
||||
CrossCircledIcon,
|
||||
} from "@radix-ui/react-icons";
|
||||
import { useScribePosition } from "@/utils/controller-position";
|
||||
import { printNode, zodToTs } from "zod-to-ts";
|
||||
|
||||
export function Controller(props: {
|
||||
formState: unknown;
|
||||
@ -126,13 +127,45 @@ export function Controller(props: {
|
||||
const parsedFormData = JSON.parse(updatedFieldsResponse ?? "{}");
|
||||
// run type validations
|
||||
const changedData = Object.entries(parsedFormData)
|
||||
.filter(([k, v]) => {
|
||||
.map(([k, v]) => {
|
||||
const f = hfields.find((f) => f.id === k);
|
||||
if (!f) return false;
|
||||
if (v === f.current) return false;
|
||||
return true;
|
||||
const ogF = fields.find((_, i) => i === Number(f?.id));
|
||||
if (!f) return [k, null];
|
||||
if (v === f.current) return [k, null];
|
||||
if (
|
||||
ogF?.question.structured_type &&
|
||||
ogF.question.structured_type !== "encounter"
|
||||
) {
|
||||
const prompt =
|
||||
STRUCTURED_INPUT_PROMPTS[
|
||||
ogF.question
|
||||
.structured_type as keyof typeof STRUCTURED_INPUT_PROMPTS
|
||||
].prompt;
|
||||
|
||||
let parsedV = v;
|
||||
let jsonParsed = false;
|
||||
|
||||
try {
|
||||
parsedV = JSON.parse(v as string);
|
||||
jsonParsed = true;
|
||||
} catch (error) {
|
||||
parsedV = v;
|
||||
}
|
||||
const validation = prompt(true).safeParse(parsedV);
|
||||
if (!validation.success) {
|
||||
console.error("Validation error", parsedV, validation.error);
|
||||
return [k, null];
|
||||
} else {
|
||||
return [
|
||||
k,
|
||||
jsonParsed ? JSON.stringify(validation.data) : validation.data,
|
||||
];
|
||||
}
|
||||
}
|
||||
return [k, v];
|
||||
})
|
||||
.map(([k, v]) => ({ [k]: v }))
|
||||
.filter(([, v]) => !!v)
|
||||
.map(([k, v]) => ({ [k as string]: v }))
|
||||
.reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
||||
const replacedData = await Promise.all(
|
||||
Object.entries(changedData).map(async ([index, data]) => {
|
||||
@ -276,12 +309,16 @@ export function Controller(props: {
|
||||
? SCRIBE_REPEAT_PROMPT_MAP
|
||||
: SCRIBE_PROMPT_MAP;
|
||||
|
||||
let structuredPromptText = structuredPrompt
|
||||
? `A structure of type ${printNode(zodToTs(structuredPrompt.prompt()).node)}. Update existing data, delete existing data or append to the existing list as per the will of the user. NOTE: Make sure not to discard existing data until explicitly said so. Current datetime is ${new Date().toISOString()}`
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
friendlyName: field.question.text || "Unlabled Field",
|
||||
current: field.value,
|
||||
id: `${i}`,
|
||||
description:
|
||||
structuredPrompt?.prompt ||
|
||||
(structuredPrompt ? structuredPromptText : undefined) ||
|
||||
promptMap[field.question.type]?.prompt ||
|
||||
promptMap["default"]?.prompt,
|
||||
type: typeof (
|
||||
|
401
src/utils/constants.ts
Normal file
401
src/utils/constants.ts
Normal file
@ -0,0 +1,401 @@
|
||||
export const MEDICATION_REQUEST_TIMING_OPTIONS: Record<
|
||||
string,
|
||||
{
|
||||
display: string;
|
||||
timing: any;
|
||||
}
|
||||
> = {
|
||||
BID: {
|
||||
display: "BID (1-0-1)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 2,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "BID",
|
||||
display: "Two times a day",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
TID: {
|
||||
display: "TID (1-1-1)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 3,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "TID",
|
||||
display: "Three times a day",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
QID: {
|
||||
display: "QID (1-1-1-1)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 4,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "QID",
|
||||
display: "Four times a day",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
AM: {
|
||||
display: "AM (1-0-0)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "AM",
|
||||
display: "Every morning",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
PM: {
|
||||
display: "PM (0-0-1)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "PM",
|
||||
display: "Every afternoon",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
QD: {
|
||||
display: "QD (Once a day)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "QD",
|
||||
display: "Once a day",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
QOD: {
|
||||
display: "QOD (Alternate days)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 2,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 2,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "QOD",
|
||||
display: "Alternate days",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q1H: {
|
||||
display: "Q1H (Every 1 hour)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q1H",
|
||||
display: "Every 1 hour",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q2H: {
|
||||
display: "Q2H (Every 2 hours)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 2,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q2H",
|
||||
display: "Every 2 hours",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q3H: {
|
||||
display: "Q3H (Every 3 hours)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 3,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q3H",
|
||||
display: "Every 3 hours",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q4H: {
|
||||
display: "Q4H (Every 4 hours)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 4,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q4H",
|
||||
display: "Every 4 hours",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q6H: {
|
||||
display: "Q6H (Every 6 hours)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 6,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q6H",
|
||||
display: "Every 6 hours",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
Q8H: {
|
||||
display: "Q8H (Every 8 hours)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 8,
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q8H",
|
||||
display: "Every 8 hours",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
BED: {
|
||||
display: "BED (0-0-1)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "d",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "BED",
|
||||
display: "Bedtime",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
WK: {
|
||||
display: "WK (Weekly)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "wk",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "wk",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "WK",
|
||||
display: "Weekly",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
MO: {
|
||||
display: "MO (Monthly)",
|
||||
timing: {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "mo",
|
||||
bounds_duration: {
|
||||
value: 1,
|
||||
unit: "mo",
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "MO",
|
||||
display: "Monthly",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation",
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const BOUNDS_DURATION_UNITS = [
|
||||
// TODO: Are these smaller units required?
|
||||
// "ms",
|
||||
// "s,
|
||||
// "min",
|
||||
"h",
|
||||
"d",
|
||||
"wk",
|
||||
"mo",
|
||||
"a",
|
||||
] as const;
|
||||
|
||||
export const MEDICATION_STATEMENT_STATUS = [
|
||||
"active",
|
||||
"on_hold",
|
||||
"completed",
|
||||
"stopped",
|
||||
"unknown",
|
||||
"entered_in_error",
|
||||
"not_taken",
|
||||
"intended",
|
||||
] as const;
|
||||
|
||||
export const MEDICATION_REQUEST_INTENT = [
|
||||
"proposal",
|
||||
"plan",
|
||||
"order",
|
||||
"original_order",
|
||||
"reflex_order",
|
||||
"filler_order",
|
||||
"instance_order",
|
||||
] as const;
|
||||
|
||||
export const MEDICATION_REQUEST_STATUS = [
|
||||
"active",
|
||||
"on-hold",
|
||||
"ended",
|
||||
"stopped",
|
||||
"completed",
|
||||
"cancelled",
|
||||
"entered_in_error",
|
||||
"draft",
|
||||
"unknown",
|
||||
] as const;
|
||||
|
||||
export const ENCOUNTER_PRIORITY = [
|
||||
"ASAP",
|
||||
"callback_results",
|
||||
"callback_for_scheduling",
|
||||
"elective",
|
||||
"emergency",
|
||||
"preop",
|
||||
"as_needed",
|
||||
"routine",
|
||||
"rush_reporting",
|
||||
"stat",
|
||||
"timing_critical",
|
||||
"use_as_directed",
|
||||
"urgent",
|
||||
] as const;
|
||||
|
||||
export const DOSAGE_UNITS_CODES: { code: string, display: string, system: string }[] = [
|
||||
{
|
||||
code: "mg",
|
||||
display: "Milligram",
|
||||
system: "http://unitsofmeasure.org",
|
||||
},
|
||||
{
|
||||
code: "g",
|
||||
display: "Gram",
|
||||
system: "http://unitsofmeasure.org",
|
||||
},
|
||||
{
|
||||
code: "mL",
|
||||
display: "Milliliter",
|
||||
system: "http://unitsofmeasure.org",
|
||||
},
|
||||
{
|
||||
code: "[drp]",
|
||||
display: "Drop",
|
||||
system: "http://unitsofmeasure.org",
|
||||
},
|
||||
{
|
||||
code: "{tbl}",
|
||||
display: "Tablets",
|
||||
system: "http://unitsofmeasure.org",
|
||||
},
|
||||
];
|
@ -1,28 +1,7 @@
|
||||
import { ScribePromptMap } from "@/types";
|
||||
import { ScribePromptMap, ValueSetSystem } from "@/types";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export const BOUNDS_DURATION_UNITS = [
|
||||
// TODO: Are these smaller units required?
|
||||
// "ms",
|
||||
// "s,
|
||||
// "min",
|
||||
"h",
|
||||
"d",
|
||||
"wk",
|
||||
"mo",
|
||||
"a",
|
||||
] as const;
|
||||
|
||||
const MEDICATION_STATEMENT_STATUS = [
|
||||
"active",
|
||||
"on_hold",
|
||||
"completed",
|
||||
"stopped",
|
||||
"unknown",
|
||||
"entered_in_error",
|
||||
"not_taken",
|
||||
"intended",
|
||||
] as const;
|
||||
import z from "zod"
|
||||
import { BOUNDS_DURATION_UNITS, DOSAGE_UNITS_CODES, ENCOUNTER_PRIORITY, MEDICATION_REQUEST_INTENT, MEDICATION_REQUEST_STATUS, MEDICATION_REQUEST_TIMING_OPTIONS, MEDICATION_STATEMENT_STATUS } from "./constants";
|
||||
|
||||
const ARBITRARY_INPUT_PROMPTS: ScribePromptMap = {
|
||||
default: {
|
||||
@ -66,26 +45,89 @@ export const SCRIBE_REPEAT_PROMPT_MAP: ScribePromptMap = {
|
||||
},
|
||||
}
|
||||
|
||||
const code = z.object({
|
||||
code: z.string(),
|
||||
display: z.string(),
|
||||
system: z.string()
|
||||
})
|
||||
|
||||
const codeQuery = (type: ValueSetSystem, primary?: boolean) => z.object({
|
||||
code_search_query: z.string().describe("The query"),
|
||||
code_search_type: z.literal(type).describe("This field must not be changed"),
|
||||
...(primary ? { primary: z.literal(true).describe("This field must always be true") } : {})
|
||||
})
|
||||
|
||||
const codeStructure = (isRes: boolean | undefined, type: ValueSetSystem, primary?: boolean) => isRes ? z.union([code, codeQuery(type, primary)]) : codeQuery(type, primary)
|
||||
|
||||
const doseQuantity = z.object({
|
||||
value: z.number(),
|
||||
unit: z.object({
|
||||
code: z.enum(DOSAGE_UNITS_CODES.map(c => c.code) as [string]),
|
||||
display: z.enum(DOSAGE_UNITS_CODES.map(c => c.display) as [string]),
|
||||
system: z.literal("http://unitsofmeasure.org").describe("Do not change this value")
|
||||
})
|
||||
})
|
||||
|
||||
const doseRange = z.object({
|
||||
low: doseQuantity,
|
||||
high: doseQuantity
|
||||
})
|
||||
|
||||
const isoDateTime = z.string().regex(
|
||||
/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[\+\-]\d{2}:\d{2})?)?$/,
|
||||
"Invalid ISO date format"
|
||||
);
|
||||
|
||||
const withFallback = <T>(schema: z.ZodType<T>, fallback: T) =>
|
||||
z.preprocess(
|
||||
(value) => {
|
||||
const parseResult = schema.safeParse(value);
|
||||
if (parseResult.success) return value;
|
||||
return fallback;
|
||||
},
|
||||
z.custom(() => true)
|
||||
);
|
||||
|
||||
export const STRUCTURED_INPUT_PROMPTS = {
|
||||
"encounter": {
|
||||
prompt: `An array of only one object of the following schema. Everything in brackets is for your information and is not part of the schema. : {
|
||||
status?: "planned" | "in_progress" | "on_hold" | "discharged" | "completed" | "cancelled" | "discontinued" | "entered_in_error" | "unknown",
|
||||
encounter_class? : "imp" (Inpatient (IP)) | "amb" (Ambulatory (OP)) | "obsenc" (Observation Room) | "emer" (Emergency) | "vr" (Virtual) | "hh" (Home Health),'
|
||||
priority?: "ASAP" | "callback_results" | "callback_for_scheduling" | "elective" | "emergency" | "preop" | "as_needed" | "routine" | "rush_reporting" | "stat" | "timing_critical" | "use_as_directed" | "urgent";
|
||||
external_identifier (ip/op/obs/emr number)?: string;
|
||||
|
||||
(This will only be applicable if encounter_class is "imp", "absenc", or "emer")
|
||||
hospitalization?: {
|
||||
re_admission?: boolean;
|
||||
admit_source?: "hosp_trans" (Hospital Transfer) | "emd" (Emergency Department) | "outp" (Outpatient Department) | "born" (Born) | "gp" (General Practitioner) | "mp" (Medical Practitioner) | "nursing" (Nursing Home) | "psych" (Psychiatric Hospital) | "rehab" (Rehabilitation Facility) | "other" (Other);
|
||||
diet_preference?: "vegetarian" (Vegetarian) | "diary_free" (Dairy Free) | "nut_free" (Nut Free) | "gluten_free" (Gluten Free) | "vegan" (Vegan) | "halal" (Halal) | "kosher" (Kosher) | "none" (None);
|
||||
|
||||
(only applicable if status is "completed")
|
||||
discharge_disposition?: "home" (Home) | "alt_home" (Alternate Home) | "other_hcf" (Other Healthcare Facility) | "hosp" (Hospice) | "long" (Long Term Care) | "aadvice" (Left Against Advice) | "exp" (Expired) | "psy" (Psychiatric Hospital) | "rehab" (Rehabilitation) | "snf" (Skilled Nursing Facility) | "oth" (Other);
|
||||
};
|
||||
|
||||
...other data that is READ ONLY
|
||||
}. Make sure to only update the existing data of the user and not remove or update any data that was not explicitly told to be updated. Return ONLY the original data with requested updates.`,
|
||||
prompt: () => z.object({
|
||||
status: z.enum(["planned", "in_progress", "on_hold", "discharged", "completed", "cancelled", "discontinued", "entered_in_error", "unknown"]).describe("Status of the encounter"),
|
||||
encounter_class: z.enum(["imp", "amb", "obsenc", "emer", "vr", "hh"]).describe(`Class of the encounter : "imp" (Inpatient (IP)) | "amb" (Ambulatory (OP)) | "obsenc" (Observation Room) | "emer" (Emergency) | "vr" (Virtual) | "hh" (Home Health)`),
|
||||
priority: z.enum(ENCOUNTER_PRIORITY).describe("Priority of the encounter"),
|
||||
external_identifier: z.string().optional().describe("ip/op/obs/emr number"),
|
||||
hospitalization: z.object({
|
||||
re_admission: z.boolean().describe("Encounter is a readmission"),
|
||||
admit_source: z.enum(["hosp_trans"
|
||||
, "emd"
|
||||
, "outp"
|
||||
, "born"
|
||||
, "gp"
|
||||
, "mp"
|
||||
, "nursing"
|
||||
, "psych"
|
||||
, "rehab"
|
||||
, "other"]).describe(`Admission source out of : "hosp_trans" (Hospital Transfer) | "emd" (Emergency Department) | "outp" (Outpatient Department) | "born" (Born) | "gp" (General Practitioner) | "mp" (Medical Practitioner) | "nursing" (Nursing Home) | "psych" (Psychiatric Hospital) | "rehab" (Rehabilitation Facility) | "other" (Other)`),
|
||||
diet_preference: z.enum(["vegetarian"
|
||||
, "diary_free"
|
||||
, "nut_free"
|
||||
, "gluten_free"
|
||||
, "vegan"
|
||||
, "halal"
|
||||
, "kosher"
|
||||
, "none"]).optional().describe("Dietary preference of the patient"),
|
||||
discharge_disposition: z.enum(["home"
|
||||
, "alt_home"
|
||||
, "other_hcf"
|
||||
, "hosp"
|
||||
, "long"
|
||||
, "aadvice"
|
||||
, "exp"
|
||||
, "psy"
|
||||
, "rehab"
|
||||
, "snf"
|
||||
, "oth"]).optional().describe(`Only applicable if status is "completed". Choose from "home" (Home) | "alt_home" (Alternate Home) | "other_hcf" (Other Healthcare Facility) | "hosp" (Hospice) | "long" (Long Term Care) | "aadvice" (Left Against Advice) | "exp" (Expired) | "psy" (Psychiatric Hospital) | "rehab" (Rehabilitation) | "snf" (Skilled Nursing Facility) | "oth" (Other)`)
|
||||
}).optional().describe(`This will only be applicable if encounter_class is "imp", "absenc", or "emer"`)
|
||||
}),
|
||||
example: [{
|
||||
status: "in_progress",
|
||||
encounter_class: "imp",
|
||||
@ -101,123 +143,68 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
}],
|
||||
},
|
||||
"medication_request": {
|
||||
prompt: `An array of objects of the following type: {
|
||||
status: "active",
|
||||
intent: "order",
|
||||
category: "inpatient",
|
||||
priority: "urgent",
|
||||
do_not_perform?: false;
|
||||
medication? : {
|
||||
code_search_query: string,
|
||||
code_search_type: "system-medication",
|
||||
primary: true
|
||||
};
|
||||
authored_on?: ${new Date().toISOString()},
|
||||
dosage_instruction: [{
|
||||
sequence?: number;
|
||||
text?: string;
|
||||
additional_instruction?:[{
|
||||
code_search_query: string,
|
||||
code_search_type: "system-additional-instruction",
|
||||
}];
|
||||
patient_instruction?: string;
|
||||
|
||||
timing?: {
|
||||
repeat?: {
|
||||
(
|
||||
• Two times a day means frequency is 2 and period is 1 day and period_unit is “d”.
|
||||
• Three times a day means frequency is 3 and period is 1 day and period_unit is “d”.
|
||||
• Four times a day means frequency is 4 and period is 1 day and period_unit is “d”.
|
||||
• Every morning means frequency is 1 and period is 1 day and period_unit is “d”.
|
||||
• Every afternoon means frequency is 1 and period is 1 day and period_unit is “d”.
|
||||
• Every day means frequency is 1 and period is 1 day and period_unit is “d”.
|
||||
• Every other day means frequency is 1 and period is 2 days and period_unit is “d”.
|
||||
• Every hour means frequency is 24 and period is 1 day and period_unit is “d”.
|
||||
• Every 2 hours means frequency is 12 and period is 1 day and period_unit is “d”.
|
||||
• Every 3 hours means frequency is 8 and period is 1 day and period_unit is “d”.
|
||||
• Every 4 hours means frequency is 6 and period is 1 day and period_unit is “d”.
|
||||
• Every 6 hours means frequency is 4 and period is 1 day and period_unit is “d”.
|
||||
• Every 8 hours means frequency is 3 and period is 1 day and period_unit is “d”.
|
||||
• At bedtime means frequency is 1 and period is 1 day and period_unit is “d”.
|
||||
• Weekly means frequency is 1 and period is 1 week and period_unit is “wk”.
|
||||
• Monthly means frequency is 1 and period is 1 month and period_unit is “mo”.
|
||||
• Immediately means frequency is 1 and period is 1 second and period_unit is “s”.
|
||||
)
|
||||
frequency?: number;
|
||||
period: number; // number of units (ex. 12 days would mean 12 with unit "d");
|
||||
period_unit: "s" | "min" | "h" | "d" | "wk" | "mo" | "a";
|
||||
bounds_duration?: {
|
||||
(
|
||||
For medicine duration of
|
||||
• 10 days -> the bounds_duration.value will be 10 and bounds_duration.unit will be “d”.
|
||||
• 2 weeks -> the bounds_duration.value will be 2 and bounds_duration.unit will be “wk”.
|
||||
• 3 months -> the bounds_duration.value will be 3 and bounds_duration.unit will be “mo”.
|
||||
• 1 year -> the bounds_duration.value will be 1 and bounds_duration.unit will be “a”.
|
||||
... and so on.
|
||||
)
|
||||
value: number;
|
||||
unit: ${BOUNDS_DURATION_UNITS.join(" | ")};
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* True if it is a PRN medication
|
||||
*/
|
||||
as_needed_boolean?: boolean;
|
||||
/**
|
||||
* If it is a PRN medication (as_needed_boolean is true), the indicator.
|
||||
*/
|
||||
as_needed_for?: {
|
||||
code_search_query: string,
|
||||
code_search_type: "system-as-needed-reason",
|
||||
};
|
||||
site?: {
|
||||
code_search_query: string,
|
||||
code_search_type: "system-body-site",
|
||||
};
|
||||
route?: {
|
||||
code_search_query: string,
|
||||
code_search_type: "system-route",
|
||||
};
|
||||
method?: {
|
||||
code_search_query: string,
|
||||
code_search_type: "system-administration-method",
|
||||
};
|
||||
/**
|
||||
* One of \`dose_quantity\` or \`dose_range\` must be present.
|
||||
* \`type\` is optional and defaults to \`ordered\`.
|
||||
*
|
||||
* - If \`type\` is \`ordered\`, \`dose_quantity\` must be present.
|
||||
* - If \`type\` is \`calculated\`, \`dose_range\` must be present. This is used for titrated medications.
|
||||
*/
|
||||
dose_and_rate?:
|
||||
| {
|
||||
type?: "ordered";
|
||||
dose_quantity?: DosageQuantity;
|
||||
dose_range?: undefined;
|
||||
}
|
||||
| {
|
||||
type: "calculated";
|
||||
dose_range?: {
|
||||
low: DosageQuantity;
|
||||
high: DosageQuantity;
|
||||
};
|
||||
dose_quantity?: undefined;
|
||||
};
|
||||
max_dose_per_period?: {
|
||||
low: DosageQuantity;
|
||||
high: DosageQuantity;
|
||||
};
|
||||
}];
|
||||
note?: string
|
||||
}
|
||||
|
||||
DosageQuantity {
|
||||
value?: number;
|
||||
unit?: "mg" | "g" | "ml" | "drop(s)" | "ampule(s)" | "tsp" | "mcg" | "unit(s)"
|
||||
}
|
||||
|
||||
Update existing data, delete existing data or append to the existing list as per the will of the user. NOTE: Make sure not to discard existing data until explicitly said so. Current date is ${new Date().toLocaleDateString()}`,
|
||||
prompt: (isRes?: boolean) => z.array(z.object({
|
||||
status: z.enum(MEDICATION_REQUEST_STATUS).describe("Status of the medication"),
|
||||
intent: z.enum(MEDICATION_REQUEST_INTENT).optional().describe("Intent of the medication request"),
|
||||
category: z.enum(["inpatient", "outpatient", "community", "discharge"]).describe("Category of the medication request"),
|
||||
priority: z.enum(["stat", "urgent", "asap", "routine"]).describe("Priority of the medication request"),
|
||||
do_not_perform: z.literal(false).describe("Do not update this value"),
|
||||
medication: codeStructure(isRes, "system-medication", true),
|
||||
authored_on: withFallback(isoDateTime.default(new Date().toISOString()).describe("When was this medication request authored? In ISO datetime"), new Date().toISOString()),
|
||||
dosage_instruction: z.array(z.object({
|
||||
sequence: z.number().optional(),
|
||||
text: z.string().optional(),
|
||||
additional_instruction: z.array(codeStructure(isRes, "system-additional-instruction")).optional(),
|
||||
patient_instruction: z.string().optional(),
|
||||
timing: z.object({
|
||||
repeat: z.object({
|
||||
frequency: z.number().optional(),
|
||||
period: z.number().describe("number of units (ex. 12 days would mean 12 with unit 'd')"),
|
||||
period_unit: z.enum(["s", "min", "h", "d", "wk", "mo", "a"]),
|
||||
bounds_duration: z.object({
|
||||
value: z.number(),
|
||||
unit: z.enum(BOUNDS_DURATION_UNITS)
|
||||
}).optional().describe(`
|
||||
For medicine duration of
|
||||
• 10 days -> the bounds_duration.value will be 10 and bounds_duration.unit will be “d”.
|
||||
• 2 weeks -> the bounds_duration.value will be 2 and bounds_duration.unit will be “wk”.
|
||||
• 3 months -> the bounds_duration.value will be 3 and bounds_duration.unit will be “mo”.
|
||||
• 1 year -> the bounds_duration.value will be 1 and bounds_duration.unit will be “a”.
|
||||
... and so on.
|
||||
`)
|
||||
|
||||
}).optional().describe(`
|
||||
${Object.entries(MEDICATION_REQUEST_TIMING_OPTIONS).map(([, timing]) => `• ${timing.timing.code.display} (${timing.display}) means frequency is ${timing.timing.repeat.frequency}, period is ${timing.timing.repeat.period}, period_unit is ${timing.timing.repeat.period_unit} and code is ${timing.timing.code.code}`)}
|
||||
`),
|
||||
code: z.object({
|
||||
code: z.enum(Object.values(MEDICATION_REQUEST_TIMING_OPTIONS).map(timing => timing.timing.code.code) as [string]),
|
||||
display: z.enum(Object.values(MEDICATION_REQUEST_TIMING_OPTIONS).map(timing => timing.timing.code.display) as [string]),
|
||||
system: z.literal("http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation")
|
||||
}),
|
||||
}).optional(),
|
||||
|
||||
as_needed_boolean: withFallback(z.boolean().describe("True if the prescription is PRN, else false. Do not ommit this.").default(false), false),
|
||||
as_needed_for: codeStructure(isRes, "system-as-needed-reason").optional().describe("If it is a PRN medication (as_needed_boolean is true), the indicator"),
|
||||
site: codeStructure(isRes, "system-body-site").optional().describe("The site the medication should be administered at"),
|
||||
route: codeStructure(isRes, "system-route").optional().describe("The route of the medicine"),
|
||||
method: codeStructure(isRes, "system-administration-method").optional().describe("The method in which the medicine should be administered"),
|
||||
dose_and_rate: z.union([z.object({
|
||||
type: z.literal("ordered"),
|
||||
dose_quantity: doseQuantity,
|
||||
}), z.object({
|
||||
type: z.literal("calculated"),
|
||||
dose_range: doseRange,
|
||||
})]).optional().describe(`
|
||||
One of \`dose_quantity\` or \`dose_range\` must be present.
|
||||
\`type\` is optional and defaults to \`ordered\`.
|
||||
|
||||
- If \`type\` is \`ordered\`, \`dose_quantity\` must be present.
|
||||
- If \`type\` is \`calculated\`, \`dose_range\` must be present. This is used for titrated medications.
|
||||
`),
|
||||
max_dose_per_period: doseRange.optional()
|
||||
})),
|
||||
note: z.string().optional().describe("Additional Notes")
|
||||
})),
|
||||
example: [
|
||||
{
|
||||
status: "active",
|
||||
@ -237,7 +224,11 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
type: "ordered",
|
||||
dose_quantity: {
|
||||
value: 1,
|
||||
unit: "mg"
|
||||
unit: {
|
||||
code: "mg",
|
||||
display: "Milligram",
|
||||
system: "http://unitsofmeasure.org"
|
||||
}
|
||||
}
|
||||
},
|
||||
route: {
|
||||
@ -256,11 +247,16 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
repeat: {
|
||||
frequency: 1,
|
||||
period: 1,
|
||||
period_unit: "d",
|
||||
period_unit: "h",
|
||||
bounds_duration: {
|
||||
value: 12,
|
||||
unit: "wk"
|
||||
}
|
||||
},
|
||||
},
|
||||
code: {
|
||||
code: "Q1H",
|
||||
display: "Every 1 hour",
|
||||
system: "http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation"
|
||||
}
|
||||
},
|
||||
additional_instruction: [
|
||||
@ -270,74 +266,75 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
status: "active",
|
||||
intent: "order",
|
||||
category: "inpatient",
|
||||
priority: "urgent",
|
||||
do_not_perform: false,
|
||||
medication: {
|
||||
code_search_type: "system-medication",
|
||||
code_search_query: "Zinc 50 mg oral capsule",
|
||||
primary: true
|
||||
},
|
||||
authored_on: new Date().toLocaleDateString(),
|
||||
dosage_instruction: [
|
||||
{
|
||||
status: "active",
|
||||
intent: "order",
|
||||
category: "inpatient",
|
||||
priority: "urgent",
|
||||
do_not_perform: false,
|
||||
medication: {
|
||||
code_search_type: "system-medication",
|
||||
code_search_query: "Zinc 50 mg oral capsule",
|
||||
primary: true
|
||||
},
|
||||
authored_on: new Date().toLocaleDateString(),
|
||||
dosage_instruction: [
|
||||
{
|
||||
dose_and_rate: {
|
||||
type: "ordered",
|
||||
dose_quantity: {
|
||||
value: 21,
|
||||
unit: "mg"
|
||||
}
|
||||
},
|
||||
as_needed_boolean: true,
|
||||
as_needed_for: {
|
||||
code_search_type: "system-as-needed-reason",
|
||||
code_search_query: "Chronic nontraumatic intracranial subdural haematoma",
|
||||
},
|
||||
additional_instruction: [
|
||||
{
|
||||
code_search_type: "system-additional-instruction",
|
||||
code_search_query: "Until symptoms improve",
|
||||
}
|
||||
],
|
||||
route: {
|
||||
code_search_type: "system-route",
|
||||
code_search_query: "Sublabial route",
|
||||
},
|
||||
method: {
|
||||
code_search_type: "system-administration-method",
|
||||
code_search_query: "Dialysis System",
|
||||
},
|
||||
site: {
|
||||
code_search_type: "system-body-site",
|
||||
code_search_query: "Structure of left deltoid muscle",
|
||||
},
|
||||
dose_and_rate: {
|
||||
type: "ordered",
|
||||
dose_quantity: {
|
||||
value: 21,
|
||||
unit: {
|
||||
code: "mg",
|
||||
display: "Milligram",
|
||||
system: "http://unitsofmeasure.org"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
as_needed_boolean: true,
|
||||
as_needed_for: {
|
||||
code_search_type: "system-as-needed-reason",
|
||||
code_search_query: "Chronic nontraumatic intracranial subdural haematoma",
|
||||
},
|
||||
additional_instruction: [
|
||||
{
|
||||
code_search_type: "system-additional-instruction",
|
||||
code_search_query: "Until symptoms improve",
|
||||
}
|
||||
],
|
||||
route: {
|
||||
code_search_type: "system-route",
|
||||
code_search_query: "Sublabial route",
|
||||
},
|
||||
method: {
|
||||
code_search_type: "system-administration-method",
|
||||
code_search_query: "Dialysis System",
|
||||
},
|
||||
site: {
|
||||
code_search_type: "system-body-site",
|
||||
code_search_query: "Structure of left deltoid muscle",
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"medication_statement": {
|
||||
prompt: `An array of objects of the following type {
|
||||
status?: ${MEDICATION_STATEMENT_STATUS.join(" | ")},
|
||||
dosage_text?: string,
|
||||
information_source?: "patient" | "user" | "related_person"
|
||||
medication?: {
|
||||
code_search_type: "system-medication",
|
||||
code_search_query: string,
|
||||
primary: true
|
||||
},
|
||||
note?: string,
|
||||
reason?: string,
|
||||
effective_period?: {
|
||||
start: ISO date string,
|
||||
end: ISO date string
|
||||
}
|
||||
}. Update existing data, delete existing data or append to the existing list as per the will of the user. Current date is ${new Date().toLocaleDateString()}`,
|
||||
prompt: (isRes?: boolean) => z.array(z.object({
|
||||
status: z.enum(MEDICATION_STATEMENT_STATUS).describe("Status of the medication"),
|
||||
dosage_text: z.string().optional().describe("Text to support the dosage"),
|
||||
information_source: z.string().optional().describe("The information source of the medication"),
|
||||
medication: codeStructure(isRes, "system-medication", true),
|
||||
note: z.string().optional().describe("Additional notes on the medication"),
|
||||
reason: z.string().optional().describe("Reason for medication"),
|
||||
effective_period: z.object({
|
||||
start: isoDateTime.describe("ISO date"),
|
||||
end: isoDateTime.describe("ISO date")
|
||||
}).optional().describe("Medication effective period")
|
||||
})),
|
||||
example: [
|
||||
{
|
||||
status: "completed",
|
||||
@ -358,20 +355,15 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
]
|
||||
},
|
||||
"symptom": {
|
||||
prompt: `An array of objects of the following type {
|
||||
code: {
|
||||
code_search_type: "system-condition-code",
|
||||
code_search_query: string,
|
||||
primary: true
|
||||
},
|
||||
clinical_status: "active" | "recurrence" | "relapse" | "inactive" | "remission" | "resolved",
|
||||
verification_status: "unconfirmed" | "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error",
|
||||
severity?: "severe" | "moderate" | "mild",
|
||||
onset?: {
|
||||
onset_datetime: YYYY-MM-DD string
|
||||
},
|
||||
note?: string
|
||||
}. Update existing data, delete existing data or append to the existing list as per the will of the user. Current date is ${new Date().toLocaleDateString()} Default onset_datetime to today unless otherwise specified`,
|
||||
prompt: (isRes?: boolean) => z.array(z.object({
|
||||
code: codeStructure(isRes, "system-condition-code", true),
|
||||
clinical_status: z.enum(["active", "recurrence", "relapse", "inactive", "remission", "resolved"]).describe("Clinical Status of the symptom"),
|
||||
verification_status: z.enum(["unconfirmed", "provisional", "differential", "confirmed", "refuted", "entered-in-error"]).describe("Verification status of the symptom"),
|
||||
severity: z.enum(["severe", "moderate", "mild"]).optional().describe("Severity of the symptom"),
|
||||
onset: withFallback(z.object({ onset_datetime: isoDateTime }).default({ onset_datetime: new Date().toISOString() }).describe("Onset date of the symptom in ISO format"), { onset_datetime: new Date().toISOString() }),
|
||||
recorded_date: isoDateTime.optional().describe("Date the symptom was recorded in ISO format"),
|
||||
note: z.string().optional().describe("Additional notes")
|
||||
})),
|
||||
example: [
|
||||
{
|
||||
code: {
|
||||
@ -390,19 +382,14 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
]
|
||||
},
|
||||
"diagnosis": {
|
||||
prompt: `An array of objects of the following type: {
|
||||
code: {
|
||||
code_search_type: "system-condition-code",
|
||||
code_search_query: string,
|
||||
primary: true
|
||||
},
|
||||
clinical_status: "active" | "recurrence" | "relapse" | "inactive" | "remission" | "resolved",
|
||||
verification_status: "unconfirmed" | "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error",
|
||||
onset: {
|
||||
onset_datetime: YYYY-MM-DD string
|
||||
},
|
||||
note?: string
|
||||
}. Update existing data, delete existing data or append to the existing list as per the will of the user. Current date is ${new Date().toLocaleDateString()} Default onset_datetime to today unless otherwise specified`,
|
||||
prompt: (isRes?: boolean) => z.array(z.object({
|
||||
code: codeStructure(isRes, "system-condition-code", true),
|
||||
clinical_status: z.enum(["active", "recurrence", "relapse", "inactive", "remission", "resolved"]).describe("Clincal Status of the diagnosis"),
|
||||
verification_status: z.enum(["unconfirmed", "provisional", "differential", "confirmed", "refuted", "entered-in-error"]).describe("Verification Status of the diagnosis"),
|
||||
onset: withFallback(z.object({ onset_datetime: isoDateTime }).default({ onset_datetime: new Date().toISOString() }).describe("Onset date of the symptom in ISO format"), { onset_datetime: new Date().toISOString() }),
|
||||
recorded_date: isoDateTime.optional().describe("Date the diagnosis was recorded. In ISO format"),
|
||||
note: z.string().optional().describe("Additional notes")
|
||||
})),
|
||||
example: [
|
||||
{
|
||||
code: {
|
||||
@ -420,19 +407,15 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
]
|
||||
},
|
||||
"allergy_intolerance": {
|
||||
prompt: `An array of objects of the following type: {
|
||||
code: {
|
||||
code_search_type: "system-allergy-code",
|
||||
code_search_query: string,
|
||||
primary: true
|
||||
},
|
||||
clinical_status?: "active" | "inactive" | "resolved",
|
||||
category?: "food" | "medication" | "environment" | "biologic",
|
||||
criticality?: "low" | "high" | "unable-to-assess",
|
||||
verification?: "unconfirmed" | "presumed" | "confirmed" | "refuted" | "entered-in-error"
|
||||
last_occurrence?: YYYY-MM-DD string,
|
||||
note?: string
|
||||
}. Update existing data, delete existing data or append to the existing list as per the will of the user. Current date is ${new Date().toLocaleDateString()}`,
|
||||
prompt: (isRes?: boolean) => z.array(z.object({
|
||||
code: codeStructure(isRes, "system-allergy-code", true),
|
||||
clinical_status: z.enum(["active", "inactive", "resolved"]).optional().describe("Clincal status of the allergy"),
|
||||
category: z.enum(["food", "medication", "environment", "biologic"]).optional().describe("Category of the allergy"),
|
||||
criticality: z.enum(["low", "high", "unable-to-assess"]).optional().describe("How critical is the allergy"),
|
||||
verification_status: z.enum(["unconfirmed", "presumed", "confirmed", "refuted", "entered-in-error"]).optional().describe("Verification Status of the allergy"),
|
||||
last_occurence: isoDateTime.optional().describe("The last occurance of the allergy In ISO format"),
|
||||
note: z.string().optional().describe("Additional Notes")
|
||||
})),
|
||||
example: [
|
||||
{
|
||||
code: {
|
||||
@ -449,9 +432,9 @@ export const STRUCTURED_INPUT_PROMPTS = {
|
||||
]
|
||||
},
|
||||
"follow_up_appointment": {
|
||||
prompt: `An object of the following type : {
|
||||
reason_for_visit: string
|
||||
}. Update the existing data on the will of the user.`,
|
||||
prompt: () => z.object({
|
||||
reason_for_visit: z.string().describe("The reason for the appointment")
|
||||
}),
|
||||
example: {
|
||||
reason_for_visit: "No change in condition"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user