-
+
No. RM
@@ -50,7 +54,10 @@ if (props.data.responsible_doctor) {
-
+
Tgl. Kunjungan
@@ -72,9 +79,17 @@ if (props.data.responsible_doctor) {
-
+
- Billing
+
+ Billing
+
Rp. 000.000
diff --git a/app/components/content/soapi/form-function.vue b/app/components/content/soapi/form-function.vue
index d9ef1d65..ade9e4d1 100644
--- a/app/components/content/soapi/form-function.vue
+++ b/app/components/content/soapi/form-function.vue
@@ -7,9 +7,16 @@ import { FunctionSoapiSchema } from '~/schemas/soapi.schema'
import { toast } from '~/components/pub/ui/toast'
import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
+const route = useRoute()
const isOpen = ref(false)
const data = ref([])
const schema = FunctionSoapiSchema
+const payload = ref({
+ encounter_id: 0,
+ time: '',
+ typeCode: 'function',
+ value: '',
+})
const model = ref({
'prim-compl': '',
'past-disease': '',
@@ -76,10 +83,19 @@ async function actionHandler(type: string) {
console.log(type)
const result = await entryRehabRef.value?.validate()
if (result?.valid) {
- console.log('✅ Valid data:', result.data)
- handleActionSave(result.data, {}, toast)
+ console.log('data', result.data)
+ handleActionSave(
+ {
+ ...payload.value,
+ value: JSON.stringify(result.data),
+ encounter_id: +route.params.id,
+ time: new Date().toISOString(),
+ },
+ {},
+ toast,
+ )
} else {
- console.log('❌ Ada error di form', result)
+ console.log('Ada error di form', result)
}
}
diff --git a/app/components/content/soapi/form-rehab.vue b/app/components/content/soapi/form-rehab.vue
index 6681e64c..655063f9 100644
--- a/app/components/content/soapi/form-rehab.vue
+++ b/app/components/content/soapi/form-rehab.vue
@@ -7,9 +7,16 @@ import { EarlyRehabSchema } from '~/schemas/soapi.schema'
import { toast } from '~/components/pub/ui/toast'
import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
+const route = useRoute()
const isOpen = ref(false)
const data = ref([])
const schema = EarlyRehabSchema
+const payload = ref({
+ encounter_id: 0,
+ time: '',
+ typeCode: 'early-rehab',
+ value: '',
+})
const model = ref({
'prim-compl': '',
'medical-plan': '',
@@ -81,10 +88,19 @@ async function actionHandler(type: string) {
console.log(type)
const result = await entryRehabRef.value?.validate()
if (result?.valid) {
- console.log('✅ Valid data:', result.data)
- handleActionSave(result.data, {}, toast)
+ console.log('data', result.data)
+ handleActionSave(
+ {
+ ...payload.value,
+ value: JSON.stringify(result.data),
+ encounter_id: +route.params.id,
+ time: new Date().toISOString(),
+ },
+ {},
+ toast,
+ )
} else {
- console.log('❌ Ada error di form', result)
+ console.log('Ada error di form', result)
}
}
diff --git a/app/components/content/soapi/form.vue b/app/components/content/soapi/form.vue
index f1857de6..794daef9 100644
--- a/app/components/content/soapi/form.vue
+++ b/app/components/content/soapi/form.vue
@@ -7,9 +7,16 @@ import { EarlySchema } from '~/schemas/soapi.schema'
import { toast } from '~/components/pub/ui/toast'
import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
+const route = useRoute()
const isOpen = ref(false)
const data = ref([])
const schema = EarlySchema
+const payload = ref({
+ encounter_id: 0,
+ time: '',
+ typeCode: 'early',
+ value: '',
+})
const model = ref({
'prim-compl': '',
@@ -54,10 +61,19 @@ async function actionHandler(type: string) {
console.log(type)
const result = await entryRef.value?.validate()
if (result?.valid) {
- console.log('✅ Valid data:', result.data)
- handleActionSave(result.data, {}, toast)
+ console.log('data', result.data)
+ handleActionSave(
+ {
+ ...payload.value,
+ value: JSON.stringify(result.data),
+ encounter_id: +route.params.id,
+ time: new Date().toISOString(),
+ },
+ {},
+ toast,
+ )
} else {
- console.log('❌ Ada error di form', result)
+ console.log('Ada error di form', result)
}
}