tested in batam 30mei2025

This commit is contained in:
mario
2025-05-30 16:48:32 +07:00
parent c945ead72f
commit 06cd92013b
3 changed files with 37 additions and 10 deletions

View File

@@ -79,6 +79,11 @@ pip install -r requirements.txt
## Cara Menjalankan Aplikasi
### Aktifkan venv
```bash
source /home/pacs/pydicom-migrasi-clarity/venv/bin/activate
```
### Contoh Penggunaan Umum
Untuk migrasi data harian baru:
```bash
@@ -94,17 +99,21 @@ Program ini mendukung beberapa mode operasi:
python main.py process --start-date 20250501 --end-date 20250502
```
2. **Find-Studies** - Hanya mencari studi berdasarkan rentang tanggal:
2. **Process-Study** - Menjalankan alur kerja lengkap untuk studi tertentu:
```bash
python main.py process-study --study-uid 1.2.826.1.3680043.9.5282.150415.30338.202504010001
```
3. **Find-Studies** - Hanya mencari studi berdasarkan rentang tanggal:
```bash
python main.py find-studies --start-date 20250501 --end-date 20250502
```
3. **Get-Study** - Mengambil studi tertentu berdasarkan StudyInstanceUID:
4. **Get-Study** - Mengambil studi tertentu berdasarkan StudyInstanceUID:
```bash
python main.py get-study --study-uid 1.2.826.1.3680043.9.5282.150415.30338.202504010001
```
4. **Send-Study** - Mengirim studi tertentu ke PACS tujuan:
5. **Send-Study** - Mengirim studi tertentu ke PACS tujuan:
```bash
python main.py send-study --study-uid 1.2.826.1.3680043.9.5282.150415.30338.202504010001
```

View File

@@ -8,14 +8,14 @@ SOURCE_PORT = 8888 # Our port
# Source PACS Configuration (where to query/get data from)
SOURCE_PACS = {
"host": "192.168.22.3",
"host": "192.168.2.30",
"port": 11112,
"aet": "ABPACS"
"aet": "FREEDOM"
}
# Destination PACS Configuration (where to send data to)
DESTINATION_PACS = {
"host": "152.42.173.210",
"host": "192.168.1.29",
"port": 11112,
"aet": "ABPACS"
}
@@ -40,5 +40,5 @@ JSON_OUTPUT_DIR = "output/json"
DICOM_STORE_DIR = "output/dicom"
# HIS Configuration
HIS_HOST = "localhost:8787"
HIS_URL = "/result_series"
HIS_HOST = "192.168.1.1:80"
HIS_URL = "/poapi/api_migrasiclarity.php?name=migrasi_data_pacs"

22
main.py
View File

@@ -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