From e3507e3b0770ecaee4abd88b7e5407aef4f116df Mon Sep 17 00:00:00 2001 From: sharon2719 Date: Thu, 21 Nov 2024 17:27:43 +0300 Subject: [PATCH 1/3] Add troubleshooting snapshot --- efsity/build.gradle.kts | 2 +- .../command/QuestionnaireResponseGeneratorCommand.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/efsity/build.gradle.kts b/efsity/build.gradle.kts index 7a98867..19a3a98 100644 --- a/efsity/build.gradle.kts +++ b/efsity/build.gradle.kts @@ -18,7 +18,7 @@ repositories { group = "org.smartregister" -version = "2.3.10-SNAPSHOT" +version = "2.3.11-SNAPSHOT" description = "fhircore-tooling (efsity)" diff --git a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java index 3629168..3aeb208 100644 --- a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java +++ b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java @@ -372,12 +372,17 @@ static String populateMode(String questionnaireData, String fhir_base_url, Strin String.join("/", fhir_base_url, resourceType, questionnaire_id, "$populate"); List result = HttpClient.postRequest(params.toString(), populate_endpoint, null); + JSONObject questionnaire_response = new JSONObject(result.get(1)); + FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); + if (questionnaire_response.has("contained")) { questionnaire_response.remove("contained"); } JSONArray response = (JSONArray) questionnaire_response.get("item"); JSONArray questions = resource.getJSONArray("item"); + FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); + JSONArray response_with_answers = getAnswers(questions, response, extras); questionnaire_response.put("item", response_with_answers); From 8997f1c98b5e764be35d057f2b747a502e2f7c99 Mon Sep 17 00:00:00 2001 From: sharon2719 Date: Thu, 21 Nov 2024 17:34:02 +0300 Subject: [PATCH 2/3] Run spotless --- .../command/QuestionnaireResponseGeneratorCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java index 3aeb208..61e8d64 100644 --- a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java +++ b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java @@ -372,17 +372,17 @@ static String populateMode(String questionnaireData, String fhir_base_url, Strin String.join("/", fhir_base_url, resourceType, questionnaire_id, "$populate"); List result = HttpClient.postRequest(params.toString(), populate_endpoint, null); - JSONObject questionnaire_response = new JSONObject(result.get(1)); - FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); + FctUtils.printInfo( + "Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); if (questionnaire_response.has("contained")) { questionnaire_response.remove("contained"); } JSONArray response = (JSONArray) questionnaire_response.get("item"); JSONArray questions = resource.getJSONArray("item"); - FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); - + FctUtils.printInfo( + "Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); JSONArray response_with_answers = getAnswers(questions, response, extras); questionnaire_response.put("item", response_with_answers); From d659e8478605abeeffd8a4506363ffda59a56551 Mon Sep 17 00:00:00 2001 From: sharon2719 Date: Thu, 21 Nov 2024 17:55:25 +0300 Subject: [PATCH 3/3] Update snapshot --- efsity/build.gradle.kts | 2 +- .../command/QuestionnaireResponseGeneratorCommand.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/efsity/build.gradle.kts b/efsity/build.gradle.kts index 19a3a98..dec09a2 100644 --- a/efsity/build.gradle.kts +++ b/efsity/build.gradle.kts @@ -18,7 +18,7 @@ repositories { group = "org.smartregister" -version = "2.3.11-SNAPSHOT" +version = "2.3.11-DEV-SNAPSHOT" description = "fhircore-tooling (efsity)" diff --git a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java index 61e8d64..893d6c7 100644 --- a/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java +++ b/efsity/src/main/java/org/smartregister/command/QuestionnaireResponseGeneratorCommand.java @@ -373,16 +373,14 @@ static String populateMode(String questionnaireData, String fhir_base_url, Strin List result = HttpClient.postRequest(params.toString(), populate_endpoint, null); JSONObject questionnaire_response = new JSONObject(result.get(1)); - FctUtils.printInfo( - "Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); + FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response); if (questionnaire_response.has("contained")) { questionnaire_response.remove("contained"); } JSONArray response = (JSONArray) questionnaire_response.get("item"); JSONArray questions = resource.getJSONArray("item"); - FctUtils.printInfo( - "Debug: questionnaire_response before line 379: " + questionnaire_response.toString(2)); + FctUtils.printInfo("Debug: questionnaire_response before line 379: " + questionnaire_response); JSONArray response_with_answers = getAnswers(questions, response, extras); questionnaire_response.put("item", response_with_answers);