created somAI
Browse files- tsconfig.json +29 -0
- types.ts +75 -0
- vite.config.ts +23 -0
tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
"target": "ES2022",
|
| 4 |
+
"experimentalDecorators": true,
|
| 5 |
+
"useDefineForClassFields": false,
|
| 6 |
+
"module": "ESNext",
|
| 7 |
+
"lib": [
|
| 8 |
+
"ES2022",
|
| 9 |
+
"DOM",
|
| 10 |
+
"DOM.Iterable"
|
| 11 |
+
],
|
| 12 |
+
"skipLibCheck": true,
|
| 13 |
+
"types": [
|
| 14 |
+
"node"
|
| 15 |
+
],
|
| 16 |
+
"moduleResolution": "bundler",
|
| 17 |
+
"isolatedModules": true,
|
| 18 |
+
"moduleDetection": "force",
|
| 19 |
+
"allowJs": true,
|
| 20 |
+
"jsx": "react-jsx",
|
| 21 |
+
"paths": {
|
| 22 |
+
"@/*": [
|
| 23 |
+
"./*"
|
| 24 |
+
]
|
| 25 |
+
},
|
| 26 |
+
"allowImportingTsExtensions": true,
|
| 27 |
+
"noEmit": true
|
| 28 |
+
}
|
| 29 |
+
}
|
types.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
export interface PatientProfile {
|
| 3 |
+
name: string;
|
| 4 |
+
age: number;
|
| 5 |
+
condition: string;
|
| 6 |
+
history: string;
|
| 7 |
+
allergies: string;
|
| 8 |
+
streak: number; // For medication rewards
|
| 9 |
+
lastStreakUpdate: string; // ISO Date string
|
| 10 |
+
badges: string[]; // Gamification badges
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
export interface Medication {
|
| 14 |
+
id: string;
|
| 15 |
+
name: string;
|
| 16 |
+
dosage: string;
|
| 17 |
+
time: string; // e.g., "08:00"
|
| 18 |
+
taken: boolean;
|
| 19 |
+
startDate?: string;
|
| 20 |
+
endDate?: string;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
export interface ClinicalVitals {
|
| 24 |
+
systolicBp: number;
|
| 25 |
+
glucose: number;
|
| 26 |
+
sleepQuality: number; // 0-10
|
| 27 |
+
missedDoses: number; // last 7 days
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
export interface ICDCode {
|
| 31 |
+
code: string;
|
| 32 |
+
description: string;
|
| 33 |
+
type: 'Primary' | 'History' | 'Symptom';
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
export interface RiskAnalysisResult {
|
| 37 |
+
numericScore: number;
|
| 38 |
+
summary: string;
|
| 39 |
+
actionItems: string[];
|
| 40 |
+
icd10Codes: string[]; // Legacy array for simple tags
|
| 41 |
+
codingPipeline: ICDCode[]; // New structured pipeline
|
| 42 |
+
insuranceNote: string; // Justification for coverage
|
| 43 |
+
timestamp: string;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
export interface ChatMessage {
|
| 47 |
+
id: string;
|
| 48 |
+
role: 'user' | 'model';
|
| 49 |
+
text: string;
|
| 50 |
+
timestamp: number;
|
| 51 |
+
image?: string;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
export enum AppMode {
|
| 55 |
+
GENERAL = 'GENERAL',
|
| 56 |
+
THERAPY = 'THERAPY'
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
export const INITIAL_PROFILE: PatientProfile = {
|
| 60 |
+
name: 'Patient X',
|
| 61 |
+
age: 45,
|
| 62 |
+
condition: 'Hypertension',
|
| 63 |
+
history: 'None',
|
| 64 |
+
allergies: 'None',
|
| 65 |
+
streak: 0,
|
| 66 |
+
lastStreakUpdate: new Date().toISOString(),
|
| 67 |
+
badges: []
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
export const INITIAL_VITALS: ClinicalVitals = {
|
| 71 |
+
systolicBp: 120,
|
| 72 |
+
glucose: 100,
|
| 73 |
+
sleepQuality: 7,
|
| 74 |
+
missedDoses: 0
|
| 75 |
+
};
|
vite.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import path from 'path';
|
| 2 |
+
import { defineConfig, loadEnv } from 'vite';
|
| 3 |
+
import react from '@vitejs/plugin-react';
|
| 4 |
+
|
| 5 |
+
export default defineConfig(({ mode }) => {
|
| 6 |
+
const env = loadEnv(mode, '.', '');
|
| 7 |
+
return {
|
| 8 |
+
server: {
|
| 9 |
+
port: 3000,
|
| 10 |
+
host: '0.0.0.0',
|
| 11 |
+
},
|
| 12 |
+
plugins: [react()],
|
| 13 |
+
define: {
|
| 14 |
+
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
|
| 15 |
+
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
|
| 16 |
+
},
|
| 17 |
+
resolve: {
|
| 18 |
+
alias: {
|
| 19 |
+
'@': path.resolve(__dirname, '.'),
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
};
|
| 23 |
+
});
|