Compare commits

3 Commits

Author SHA1 Message Date
1ef8af4d42 commit 30/09/2025 2025-09-30 09:51:24 +07:00
1fd1b4a5ac commit 30/09/2025 2025-09-30 09:50:48 +07:00
f557828cda commit 27/08/2025 2025-09-30 09:20:43 +07:00
8 changed files with 41 additions and 8 deletions

6
.idea/copilot.data.migration.agent.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

6
.idea/copilot.data.migration.ask.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AskMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Ask2AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

6
.idea/copilot.data.migration.edit.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EditMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@@ -27,10 +27,9 @@ public class ErhaAPI {
private @Getter String API_USERNAME = "erha-pb-001"; private @Getter String API_USERNAME = "erha-pb-001";
private @Getter String API_PASSWORD = "bM0tH!s"; private @Getter String API_PASSWORD = "bM0tH!s";
private String auth; private String auth;
private String API_URL=""; private String API_URL="";
private boolean DermiesMode = false;
private final Gson gson = new Gson(); private final Gson gson = new Gson();
@@ -42,6 +41,16 @@ public class ErhaAPI {
setProduction(isProduction); setProduction(isProduction);
} }
/**
* Create Erha API object
* @param isProduction if true will use Production URL, if false will use Staging URL
* @param dermiesMode if true will use Dermies Mode (for Dermies Clinic)
*/
public ErhaAPI(boolean isProduction, boolean dermiesMode){
setProduction(isProduction);
this.DermiesMode = dermiesMode;
}
public void setProduction(boolean isProduction){ public void setProduction(boolean isProduction){
final String API_URL_PROD = "https://connect-api.aryanoble.co.id/api"; final String API_URL_PROD = "https://connect-api.aryanoble.co.id/api";
final String API_URL_STAGING = "https://connect-api-staging.aryanoble.web.id/api"; final String API_URL_STAGING = "https://connect-api-staging.aryanoble.web.id/api";
@@ -99,7 +108,7 @@ public class ErhaAPI {
try (HttpClient client = HttpClient.newHttpClient()) { try (HttpClient client = HttpClient.newHttpClient()) {
int medical_record_detail_id = toInt(Barcode); int medical_record_detail_id = toInt(Barcode);
HttpRequest request = HttpRequest.newBuilder() HttpRequest request = HttpRequest.newBuilder()
.uri(java.net.URI.create(API_URL+"/photobooth/photobooth/" + medical_record_detail_id)) .uri(java.net.URI.create(API_URL+ (DermiesMode ? "/photobooth/dermies/":"/photobooth/photobooth/") + medical_record_detail_id))
.header("Authorization", "Basic " + auth) .header("Authorization", "Basic " + auth)
.GET() .GET()
.build(); .build();
@@ -193,7 +202,7 @@ public class ErhaAPI {
System.out.println("Uploading file : " + filename + " to " + (config.isProduction()?"Production":"Staging")+" API "); System.out.println("Uploading file : " + filename + " to " + (config.isProduction()?"Production":"Staging")+" API ");
HttpRequest request = HttpRequest.newBuilder() HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(API_URL + "/photobooth/photobooth")) .uri(new URI(API_URL + (DermiesMode ?"/photobooth/dermies":"/photobooth/photobooth")))
.header("Authorization", "Basic " + auth) .header("Authorization", "Basic " + auth)
.header("Content-Type", "multipart/form-data; boundary=" + boundary) .header("Content-Type", "multipart/form-data; boundary=" + boundary)
.POST(HttpRequest.BodyPublishers.ofByteArray(multipartData)) .POST(HttpRequest.BodyPublishers.ofByteArray(multipartData))

View File

@@ -7,7 +7,6 @@ import javafx.application.Platform;
import javafx.geometry.Insets; import javafx.geometry.Insets;
import javafx.geometry.Pos; import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.image.Image; import javafx.scene.image.Image;

View File

@@ -90,7 +90,8 @@ public class CaptureView {
private final AtomicBoolean isTakingPhoto = new AtomicBoolean(false); private final AtomicBoolean isTakingPhoto = new AtomicBoolean(false);
private final ErhaAPI erhaAPI = new ErhaAPI(config.isProduction()); // dermiesMode = true means for Dermies Clinic, false means for Erha Clinic
private final ErhaAPI erhaAPI = new ErhaAPI(config.isProduction(), true);
// for timeout 180 detik // for timeout 180 detik
private final int timeout = 180; private final int timeout = 180;

View File

@@ -24,7 +24,7 @@ import static Config.SomeCodes.config;
public class MainApplication extends Application { public class MainApplication extends Application {
final String version = "27082025-PRODUCTION-1.0.7"; final String version = "30092025-STAGING-1.0.7";
PhotoCleaner photoCleaner; PhotoCleaner photoCleaner;
public static Map<Integer, Detectors> detectorsList = new HashMap<>(); public static Map<Integer, Detectors> detectorsList = new HashMap<>();
@@ -54,7 +54,7 @@ public class MainApplication extends Application {
Screen screen = Screen.getPrimary(); Screen screen = Screen.getPrimary();
Rectangle2D screenbound = screen.getBounds(); Rectangle2D screenbound = screen.getBounds();
Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight()); Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight());
stage.setTitle("MultiCam Capture App for ERHA "+version); stage.setTitle("MultiCam Capture App for Dermies "+version);
stage.setScene(scene); stage.setScene(scene);
stage.setResizable(true); stage.setResizable(true);
stage.setMaximized(true); stage.setMaximized(true);