feat(sep): testing vclaim monitoring
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { id } from 'date-fns/locale'
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
// Types
|
||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||
@@ -8,6 +7,8 @@ import type { PatientEntity } from '~/models/patient'
|
||||
|
||||
// Services
|
||||
import { getPatientDetail, getPatients } from '~/services/patient.service'
|
||||
import { getList as getVclaimMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
||||
import { getList as getVclaimMonitoringHistoryList } from '~/services/vclaim-monitoring-history.service'
|
||||
|
||||
const openPatient = ref(false)
|
||||
const openLetter = ref(false)
|
||||
@@ -155,6 +156,14 @@ function handleEvent(value: string) {
|
||||
navigateTo('/bpjs/sep')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getVclaimMonitoringHistoryList({ nop: '0002078925513', tglawal: '2025-07-20', tglakhir: '2025-10-10' }).then(
|
||||
(value) => {
|
||||
console.log('value:', value)
|
||||
},
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -166,7 +175,10 @@ function handleEvent(value: string) {
|
||||
<span class="font-semibold">Tambah</span>
|
||||
SEP
|
||||
</div>
|
||||
<AppSepEntryForm :patient="selectedPatientObject" @event="handleEvent" />
|
||||
<AppSepEntryForm
|
||||
:patient="selectedPatientObject"
|
||||
@event="handleEvent"
|
||||
/>
|
||||
<AppSepTableSearchPatient
|
||||
v-model:open="openPatient"
|
||||
v-model:selected="selectedPatient"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/diagnosaprb'
|
||||
const name = 'diagnose-referral'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/diagnosa'
|
||||
const name = 'diagnose'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/monitoring/history'
|
||||
const name = 'monitoring-history'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
let url = path
|
||||
if (params && params?.nop) {
|
||||
url += `/${params.nop}`
|
||||
delete params.nop
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/monitoring/kunjungan'
|
||||
const name = 'monitoring-visit'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
}
|
||||
@@ -6,8 +6,10 @@ export default defineNuxtConfig({
|
||||
devtools: { enabled: true },
|
||||
runtimeConfig: {
|
||||
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'https://main-api.dev-hopis.sabbi.id',
|
||||
VCLAIM: process.env.NUXT_API_VCLAIM || 'https://vclaim-api.multy.chat',
|
||||
public: {
|
||||
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'https://main-api.dev-hopis.sabbi.id',
|
||||
VCLAIM: process.env.NUXT_API_VCLAIM || 'https://vclaim-api.multy.chat',
|
||||
}
|
||||
},
|
||||
ssr: false,
|
||||
|
||||
+15
-5
@@ -1,3 +1,4 @@
|
||||
import { is } from 'date-fns/locale'
|
||||
import { defineEventHandler, getCookie, getRequestHeaders, getRequestURL, readBody } from 'h3'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
@@ -5,11 +6,16 @@ export default defineEventHandler(async (event) => {
|
||||
const headers = getRequestHeaders(event)
|
||||
const url = getRequestURL(event)
|
||||
const config = useRuntimeConfig()
|
||||
|
||||
const apiOrigin = config.public.API_ORIGIN
|
||||
const pathname = url.pathname.replace(/^\/api/, '')
|
||||
|
||||
const targetUrl = apiOrigin + pathname + (url.search || '')
|
||||
const apiOrigin = config.public.API_ORIGIN
|
||||
const apiVclaim = config.public.VCLAIM
|
||||
const pathname = url.pathname.replace(/^\/api/, '')
|
||||
const isVclaim = pathname.includes('/vclaim')
|
||||
|
||||
let targetUrl = apiOrigin + pathname + (url.search || '')
|
||||
if (pathname.includes('/vclaim')) {
|
||||
targetUrl = apiVclaim + pathname.replace('/vclaim', '') + (url.search || '')
|
||||
}
|
||||
|
||||
const verificationId = headers['verification-id'] as string | undefined
|
||||
let bearer = ''
|
||||
@@ -22,7 +28,7 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
const forwardHeaders = new Headers()
|
||||
if (headers['content-type']) forwardHeaders.set('Content-Type', headers['content-type'])
|
||||
forwardHeaders.set('Authorization', `Bearer ${bearer}`)
|
||||
if (!isVclaim) forwardHeaders.set('Authorization', `Bearer ${bearer}`)
|
||||
|
||||
let body: any
|
||||
if (['POST', 'PATCH'].includes(method!)) {
|
||||
@@ -41,5 +47,9 @@ export default defineEventHandler(async (event) => {
|
||||
body,
|
||||
})
|
||||
|
||||
if (isVclaim) {
|
||||
console.log('res:', res)
|
||||
}
|
||||
|
||||
return res
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user