Skip to content

Commit

Permalink
Update bulk-import-ci script to not show ANSI encoded in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fongsean committed Nov 28, 2023
1 parent e99ff0b commit 3079c2d
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions bulk-import-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import requests
import subprocess
import sys
import platform

formsServerEndpoint = "https://smartforms.csiro.au/api/fhir"
implementationGuideOutputDirectory = "output"
Expand All @@ -13,14 +14,23 @@
"Questionnaire/AboriginalTorresStraitIslanderHealthCheck"
)

# Define colors for console output
HEADER = '\033[95m'
ERROR_RED = '\033[91m'
WARNING_YELLOW = '\033[93m'
OK_GREEN = '\033[92m'
INFO_BLUE = '\033[94m'
if platform.system() == "Windows":
# ANSI doesn't work on Windows
HEADER = ''
ERROR_RED = ''
WARNING_YELLOW = ''
OK_GREEN = ''
INFO_BLUE = ''
END_C = ''
else:
# Define colors for console output
HEADER = '\033[95m'
ERROR_RED = '\033[91m'
WARNING_YELLOW = '\033[93m'
OK_GREEN = '\033[92m'
INFO_BLUE = '\033[94m'
END_C = '\033[0m'

END_C = '\033[0m'

HEADERS = {"Content-Type": "application/json"}

Expand Down Expand Up @@ -116,6 +126,7 @@ def assembleQuestionnaire(questionnaires):
f"{OK_GREEN}POST request Questionnaire/$assemble successful at {formsServerEndpoint}: {response.status_code} OK{END_C}"
)
assembleOutputParams = response.json()
print(assembleOutputParams)

# Return bare questionnaire
if assembleOutputParams["resourceType"] == "Questionnaire":
Expand Down

0 comments on commit 3079c2d

Please sign in to comment.