tested in batam 30mei2025
This commit is contained in:
22
main.py
22
main.py
@@ -485,7 +485,16 @@ def process_workflow(args):
|
||||
# STEP 5: Send study_log to HIS API
|
||||
his_url = f"http://{settings.HIS_HOST}{settings.HIS_URL}"
|
||||
try:
|
||||
response = requests.post(his_url, json=study_log)
|
||||
# Header tembak API HIS
|
||||
headers = {
|
||||
'id': 'Vmtaa2MySnRUblJTYWtKb1ZucHNNVlZVU2pSaFIwNTBZa1JDYkZaV1NtOWFSV1JIVmxkSmQxSnJUbFpTVlZwRlZsaGpPVkJSUFQwPQ==',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.post(his_url, json=study_log, headers=headers)
|
||||
|
||||
# Gunakan ini untuk development
|
||||
# response = requests.post(his_url, json=study_log)
|
||||
|
||||
if response.status_code == 200 and response.json().get('OK') == "1":
|
||||
his_log.append(study_log)
|
||||
logger.info(f"Successfully sent JSON {accession_number} to HIS API")
|
||||
@@ -595,7 +604,16 @@ def process_workflow_by_study(args):
|
||||
# STEP 4: Send study_log to HIS API
|
||||
his_url = f"http://{settings.HIS_HOST}{settings.HIS_URL}"
|
||||
try:
|
||||
response = requests.post(his_url, json=study_log)
|
||||
# Header tembak API HIS
|
||||
headers = {
|
||||
'id': 'Vmtaa2MySnRUblJTYWtKb1ZucHNNVlZVU2pSaFIwNTBZa1JDYkZaV1NtOWFSV1JIVmxkSmQxSnJUbFpTVlZwRlZsaGpPVkJSUFQwPQ==',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.post(his_url, json=study_log, headers=headers)
|
||||
|
||||
# Pakai ini untuk Development
|
||||
# response = requests.post(his_url, json=study_log)
|
||||
|
||||
if response.status_code == 200 and response.json().get('OK') == "1":
|
||||
logger.info(f"Successfully sent JSON {accession_number} to HIS API")
|
||||
# Save successful log
|
||||
|
||||
Reference in New Issue
Block a user