penambahan docker dan lain lain untuk penyesuaian docker
This commit is contained in:
+62
-11
@@ -705,7 +705,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
try {
|
||||
console.log(`🔄 [queueStore] Fetching patients for loket ${loketId}...`);
|
||||
const response = await fetch(`http://10.10.123.140:8089/api/v1/loket/${loketId}`);
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/loket/${loketId}`);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
@@ -1704,7 +1705,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API when patient is called
|
||||
try {
|
||||
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -1815,7 +1817,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API when patient is called
|
||||
try {
|
||||
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -1873,7 +1876,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API when patient finishes at loket
|
||||
try {
|
||||
fetch('http://10.10.123.140:8089/api/v1/tiket/selesai', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
fetch(`${apiBase}/tiket/selesai`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -1942,7 +1946,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API and WAIT for response
|
||||
try {
|
||||
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
@@ -2004,7 +2009,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API and WAIT for response
|
||||
try {
|
||||
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
@@ -2056,7 +2062,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API to revert status to sedang diproses (status 8)
|
||||
try {
|
||||
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -2116,7 +2123,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
|
||||
// POST to external API when patient is being processed (sedang diproses)
|
||||
try {
|
||||
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
fetch(`${apiBase}/tiket/update`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -2678,7 +2686,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
case "selesai":
|
||||
// Send API call to finish endpoint
|
||||
try {
|
||||
const apiUrl = 'http://10.10.123.135:8084/api/v1/visit/status/finish';
|
||||
const visitApiBase = config.public.externalApiBaseUrl || 'http://10.10.123.135:8084/api/v1';
|
||||
const apiUrl = `${visitApiBase}/visit/status/finish`;
|
||||
const requestBody = {
|
||||
patient_visit_healthcare_service_id: patient.healthcareServiceId,
|
||||
visit_code: patient.barcode || patient.visitCode,
|
||||
@@ -2712,11 +2721,51 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
message = `Pasien ${pCode} selesai diproses`;
|
||||
break;
|
||||
case "terlambat":
|
||||
// Send API call to update status to 33 (TR PEMERIKSAAN)
|
||||
try {
|
||||
const visitApiBase = '/visit-api';
|
||||
const apiUrl = `${visitApiBase}/visit/status/finish`;
|
||||
const requestBody = {
|
||||
patient_visit_healthcare_service_id: patient.healthcareServiceId,
|
||||
visit_code: patient.barcode || patient.visitCode,
|
||||
visit_status_id: [33]
|
||||
};
|
||||
|
||||
console.log('📤 [queueStore] Sending terlambat status to API:', requestBody);
|
||||
await fetch(apiUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(requestBody)
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('❌ [queueStore] Error calling terlambat API:', error);
|
||||
}
|
||||
|
||||
allPatients.value[patientIndex] = { ...allPatients.value[patientIndex], status: "terlambat" };
|
||||
currentProcessingPatient.value[storageKey] = null;
|
||||
message = `Pasien ${pCode} ditandai terlambat`;
|
||||
break;
|
||||
case "pending":
|
||||
// Send API call to update status to 32 (PE PEMERIKSAAN)
|
||||
try {
|
||||
const visitApiBase = '/visit-api';
|
||||
const apiUrl = `${visitApiBase}/visit/status/finish`;
|
||||
const requestBody = {
|
||||
patient_visit_healthcare_service_id: patient.healthcareServiceId,
|
||||
visit_code: patient.barcode || patient.visitCode,
|
||||
visit_status_id: [32]
|
||||
};
|
||||
|
||||
console.log('📤 [queueStore] Sending pending status to API:', requestBody);
|
||||
await fetch(apiUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(requestBody)
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('❌ [queueStore] Error calling pending API:', error);
|
||||
}
|
||||
|
||||
allPatients.value[patientIndex] = { ...allPatients.value[patientIndex], status: "pending" };
|
||||
currentProcessingPatient.value[storageKey] = null;
|
||||
message = `Pasien ${pCode} di-pending`;
|
||||
@@ -2987,7 +3036,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
console.log('📤 [queueStore] API Body:', body);
|
||||
|
||||
// 3. Call API
|
||||
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/generate', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/tiket/generate`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@@ -3088,7 +3138,8 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
idklinikstatus2: "2"
|
||||
};
|
||||
|
||||
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/checkin', {
|
||||
const apiBase = config.public.verificationApiBaseUrl || 'http://10.10.123.140:8089/api/v1';
|
||||
const response = await fetch(`${apiBase}/tiket/checkin`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body)
|
||||
|
||||
Reference in New Issue
Block a user