satusehat-integration
Open-source Python SDK for integrating with SATUSEHAT — Indonesia's national health data platform powered by FHIR R4. Pure Python, no framework dependency.
Overview
satusehat-integration is an open-source Python SDK for integrating with SATUSEHAT — Indonesia's national health data platform powered by FHIR R4.
Built on the official SATUSEHAT Platform Guidelines. Ships with:
- 115+ PayloadBuilder classes — fluent builders for all FHIR R4 resources (Patient, Practitioner, Organization, Encounter, Observation, Procedure, etc.)
- 50 DataType classes — composable FHIR R4 value objects with
to_json()serialization - TerminologyResolver — castable terminology strings (
"ICD10:A00","LOINC:2951-2","SNOMED:38341003") directly to CodeableConcept - 3 SATUSEHAT-specific resources: BillingStatus (NON-FHIR JSON), PurificationDecision (NON-FHIR JSON), Endpoint (FHIR R4)
- Queue + Rate Limiter — in-memory queue with configurable RPM rate limiting
- pytest test suite — all builders have comprehensive unit tests
Zero dependencies beyond standard library. Works standalone or with Django/FastAPI/Flask.
Requirements
- Python 3.10 or later
Quick Install
pip install satusehat-integration
# or
git clone https://github.com/ivanwilliammd/satusehat-integration.git
cd satusehat-integration && pip install -e .
# .env
SATUSEHAT_ENV=DEV # DEV | STG | PROD
SATUSEHAT_BASE_URL_DEV=https://api-satusehat-dev.dto.kemkes.go.id
CLIENTID_DEV=your_client_id
CLIENTSECRET_DEV=your_client_secret
ORGID_DEV=your_org_id
Architecture
DataType Classes (src/datatype/)
Atomic FHIR R4 value objects. All provide a to_json() method — nested types serialize to clean FHIR JSON automatically.
| Category | Classes |
|---|---|
| Core | Coding, CodeableConcept, Identifier, ContactPoint, Address, HumanName, Reference |
| Quantity | Age, Quantity |
| Utility | Period, ParameterComponent |
Example — HumanName:
from src.datatype.datatypes import HumanName
name = HumanName(
family='Doe',
given=['John', 'Michael'],
use='official'
)
# name.to_json() → {'family': 'Doe', 'given': ['John', 'Michael'], 'use': 'official'}
PayloadBuilder Pattern (src/builder/)
Fluent builder for each FHIR resource. Each builder exposes chainable methods and returns the resource payload via to_json().
from src.builder.payload_builders import PatientBuilder, HumanName
patient = PatientBuilder()
patient.add_name(HumanName(family='Doe', given=['John'], use='official').to_json())
patient.set_gender('male')
patient.set_birth_date('1990-01-15')
payload = patient.to_json()
Supported FHIR Resources
115+ PayloadBuilder classes covering all FHIR R4 resources used in SATUSEHAT interoperability, plus 3 SATUSEHAT-specific resources.
SATUSEHAT Interoperability Resources (47)
| # | Resource | Builder |
|---|---|---|
| 1 | Account | AccountBuilder |
| 2 | AllergyIntolerance | AllergyIntoleranceBuilder |
| 3 | BillingStatus ⚡NON-FHIR | BillingStatusBuilder |
| 4–37 | CarePlan, Condition, Encounter, Goal, Immunization, Location, Medication*, Observation, Organization, Patient, Practitioner, Procedure, ServiceRequest, Specimen, Substance, Task, and more | see src/builder/ |
| 38 | Endpoint | EndpointBuilder |
| 39 | MedicationStatement | MedicationStatementBuilder |
| 40 | Task | TaskBuilder |
| 41 | PurificationDecision ⚡NON-FHIR | PurificationDecisionBuilder |
| 42–47 | Claim, ClaimResponse, CoverageEligibilityRequest/Response, DocumentReference, QuestionnaireResponse | see src/builder/ |
⚡ = NON-FHIR JSON (SATUSEHAT-specific extension)
BillingStatus (NON-FHIR JSON)
from src.builder.billing_status import BillingStatusBuilder
billing = (BillingStatusBuilder()
.set_id('bs-001')
.add_identifier('http://sys-ids.kemkes.go.id/billing/org-001', 'BILL-12345')
.set_status('active')
.set_insurer('Organization/org-bpjs', 'BPJS Kesehatan')
.set_subject('100000030009', 'Budi Santoso')
.set_request('cer-001')
.build())
Endpoint (FHIR R4)
from src.builder.endpoint import EndpointBuilder
endpoint = (EndpointBuilder()
.set_id('ep-001')
.set_status('active')
.set_connection_type('ihe-xcpd', 'IHE XCPD')
.set_name('SATUSEHAT FHIR Endpoint')
.set_managing_organization('Organization/org-ihs')
.set_address('https://satusehat-api.example.com/fhir/r4')
.build())
PurificationDecision (NON-FHIR JSON)
from src.builder.purification_decision import PurificationDecisionBuilder
pd = (PurificationDecisionBuilder()
.set_id('pd-001')
.add_identifier('http://sys-ids.kemkes.go.id/purification/org-001', 'PD-12345')
.set_status('approved', 'Approved')
.set_insurer('Organization/org-bpjs', 'BPJS Kesehatan')
.set_provider('Organization/hos-001', 'Rumah Sakit Sehat')
.set_claim_response('cr-001')
.set_created('2024-01-15T10:35:00+00:00')
.build())
TerminologyResolver — castable codes
from src.terminology.resolver import resolve, expand_array
# Cast terminology strings directly to CodeableConcept
resolve('ICD10:A00')
# → {'coding': [{'system': 'http://hl7.org/fhir/sid/icd-10', 'code': 'A00', 'display': 'A00'}], 'text': 'A00'}
resolve('LOINC:2951-2')
# → {'coding': [{'system': 'http://loinc.org', 'code': '2951-2', 'display': '2951-2'}], 'text': '2951-2'}
# Batch expand
expand_array(['ICD10:A00', 'ICD10:J18.9'])
# → [resolved_A00, resolved_J18.9]
Usage Examples
Patient
from src.builder.payload_builders import PatientBuilder
patient = PatientBuilder()
patient.add_name({
'family': 'Doe',
'given': ['John'],
'use': 'official'
})
patient.set_gender('male')
patient.set_birth_date('1990-01-15')
patient.add_telecom({'system': 'phone', 'value': '081234567890', 'use': 'mobile'})
payload = patient.to_json()
print(payload)
Claim (BPJS Klaim)
from src.builder.payload_builders import ClaimBuilder
claim = ClaimBuilder()
claim.set_status('active')
claim.set_use('claim')
claim.set_type('institutional')
claim.set_patient('pat-123', 'enc-456')
claim.add_item(1, 'PROCID001', 150000, 'IDR')
claim.set_total(150000, 'IDR')
payload = claim.to_json()
Documentation
| Page | Description |
|---|---|
| Wiki Home | Full documentation |
| Getting Started | Installation, configuration |
| DataTypes | Complete type reference |
| Builders | Builder usage guide |
| Resources | All FHIR resources |
| Claim Module | BPJS Klaim integration |
External Resources
Contributing
Contributions are welcome. Please ensure tests pass and follow existing code conventions.
License
MIT — see LICENSE.
Metadata
Release files for satusehat-integration 4.11.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| satusehat_integration-4.11.3.tar.gz | 64.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| satusehat_integration-4.11.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 185.4 kB
Release files / satusehat_integration-4.11.3.tar.gz
| Download URL | satusehat_integration-4.11.3.tar.gz |
|---|---|
| Size | 64.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74e437df18e5399de665c88736f0a47186f5f825954f94c4272cb0e14e03dae2
|
|
BLAKE2b-256 checksum How to use checksums |
dbb2506782d2ac81381e09676d3f8547d7e2c413100a20845c470bed8158686c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / satusehat_integration-4.11.3-py3-none-any.whl
| Download URL | satusehat_integration-4.11.3-py3-none-any.whl |
|---|---|
| Size | 120.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19b617445a9c75a85c1fa4809cf0a988877310ea973f438b61410684ca14f847
|
|
BLAKE2b-256 checksum How to use checksums |
bbd4a1e26b6e64b4b7ed009a3612efb7a403e25b3a8c5ba4bed4d05df297993d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency log