Analysis of BPJS Healthcare Facilities in Indonesia 2019

Anggi Setyawan Riyadi
15 min readFeb 1, 2024

--

bpjs image

Table of content

· Table of content
·
Introduction
·
Install Library and Load Dataset
·
Install Library
·
Preprocessing
Set Kota/Kab
Clear latitude and longitude
· Analize
Provinces that have Health Facilities with BPJS
Data to be displayed in the visualization map
· Visualization
Geographical visualization of 16499 BPJS health facilities
· Visualization of all data
City/Regency with the highest number of health facilities with BPJS
· Pivotable in Python
·
Dashboard
·
Conclusion

Introduction

BPJS Kesehatan is a public legal entity established to administer health insurance programs as stipulated in Law Number 24 of 2011 concerning the Social Security Organizing Body. In this blog, we will analyze the healthcare facilities (FasKes) provided by BPJS in Indonesia. The data for this analysis was obtained through kaggle.com.

The following is the content within the dataset:

  1. NoLink: Sequential number or unique identification for each data row.
  2. Provinsi: Name of the province in Indonesia.
  3. KotaKab: Name of the city or district within the province.
  4. Link: Hyperlink or URL that may lead to a page related to the data.
  5. TipeFaskes: Type of healthcare facility, which could include hospitals, health centers (puskesmas), clinics, etc.
  6. No: Sequential number or unique identification for each healthcare facility.
  7. KodeFaskes: Unique code possibly used to identify the healthcare facility.
  8. NamaFaskes: Full name of the healthcare facility.
  9. LatLongFaskes: Latitude and longitude coordinates of the healthcare facility’s location.
  10. AlamatFaskes: Physical address of the healthcare facility.
  11. TelpFaskes: Contact telephone number for the healthcare facility.

Install Library and Load Dataset

If you haven’t already, you’ll need to install the library.

Install Library

pip install folium
pip install ipypivot
# process
import numpy as np
import pandas as pd

# viz
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns

# text process
import re

# viz maps
import folium
from folium import plugins

#pivottable
from pivottablejs import pivot_ui
df = pd.read_csv("Data Faskes BPJS 2019.csv", header=0)
df.head()
# data information
df.info()

--- output: ---

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 29157 entries, 0 to 29156
Data columns (total 11 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 NoLink 29157 non-null int64
1 Provinsi 29157 non-null object
2 KotaKab 29157 non-null object
3 Link 29157 non-null object
4 TipeFaskes 29157 non-null object
5 No 29157 non-null object
6 KodeFaskes 29157 non-null object
7 NamaFaskes 29157 non-null object
8 LatLongFaskes 29157 non-null object
9 AlamatFaskes 29157 non-null object
10 TelpFaskes 29157 non-null object
dtypes: int64(1), object(10)
memory usage: 2.4+ MB

This dataset comprises 29,157 entries with one column of integer type and ten columns of object type (text or mixed). The memory usage of this dataset is approximately 2.4 MB. The data provides information regarding healthcare facilities, encompassing details such as province, city/district, facility type, geographic coordinates, address, and contact numbers. All columns appear complete without any missing values, facilitating further analysis.

Preprocessing

Set Kota/Kab

def setspace(space):
word = " ".join(space.split())
return word

def setkotakab(kotakab):
word1 = " ".join(kotakab.split())
word2 = word1.replace('Kode Faskes dan Alamat Rumah Sakit BPJS di','')
return word2
df['KotaKab'] = df.KotaKab.apply(setkotakab)
df['NamaFaskes'] = df.NamaFaskes.apply(setspace)
df['TelpFaskes'] = df.TelpFaskes.apply(setspace)
df.drop(['Link', 'NoLink'], axis=1, inplace=True)

df.head(10)
output set data

Clear latitude and longitude

def searchLatLong(row):
str = re.search('(-?([0-9]{1}|[0-9]0|[1-8]{1,2}).[0-9]{1,6},(-?(1[0-8]{1,2}|9[1-9]{1}).[1-9]{1,6}))', row)
if str:
return str.group()
return np.NaN

df['LatLongFaskes'] = df['LatLongFaskes'].apply(searchLatLong)
df.head(10)
set latitude and langitude

The Python function, ‘searchLatLong’, is used to search for latitude and longitude coordinates in a specific format within the ‘LatLongFaskes’ column of a DataFrame. This function is applied to each cell in that column using the `apply` method. The coordinates found are stored in the same column, while if none are found, NaN values are applied. The results are displayed by showing the first 10 rows of the DataFrame after this transformation. Thus, the purpose of this code is to update the values in the ‘LatLongFaskes’ column based on the corresponding coordinate patterns from each row.

# Split LatLongFaskes menjadi dua kolom dan ubah ke numerik
df[['Latitude', 'Longitude']] = df['LatLongFaskes'].str.split(',', expand=True).apply(pd.to_numeric, errors='coerce')

# Filter nilai yang valid
df['Latitude'] = np.where((-90.0 <= df['Latitude']) & (df['Latitude'] <= 90.0), df['Latitude'], np.NaN)
df['Longitude'] = np.where((-180.0 <= df['Longitude']) & (df['Longitude'] <= 180.0), df['Longitude'], np.NaN)

# Hapus kolom LatLongFaskes
df.drop(['LatLongFaskes'], axis=1, inplace=True)

df.head(10)
latitude langitud clear

Analize

Provinces that have Health Facilities with BPJS

province = df.Provinsi.unique().tolist()
print(province)
print('\nTotal province: ', len(province))

--- output: ---

['Nanggroe Aceh Darussalam', 'Sumatera Utara', 'Sumatera Barat',
'Riau', 'Jambi', 'Sumatera Selatan', 'Bengkulu', 'Lampung',
'Kep. Bangka Belitung', 'Dki Jakarta', 'Jawa Barat', 'Jawa Tengah',
'D I Yogyakarta', 'Jawa Timur', 'Banten', 'Bali', 'Nusa Tenggara Barat',
'Nusa Tenggara Timur', 'Kalimantan Barat', 'Kalimantan Tengah',
'Kalimantan Selatan', 'Kalimantan Timur', 'Sulawesi Utara', 'Sulawesi Tengah', 'Sulawesi Selatan', 'Sulawesi Tenggara', 'Gorontalo', 'Maluku', 'Maluku Utara', 'Papua', 'Papua Barat', 'Sulawesi Barat', 'Kepulauan Riau', 'Kalimantan Utara']

Total province: 34

These are the provinces in Indonesia with BPJS (Badan Penyelenggara Jaminan Sosial or Social Security Organizing Agency) health facilities in the year 2019.

city_regency = df['KotaKab'].unique().tolist()
print(city_regency)
print('\nTotal: ', len(city_regency))

--- output: ---

[' Kota Langsa', ' Kab. Gayo Lues', ' Kab. Aceh Selatan', ' Kab. Aceh Tenggara', ' Kab. Aceh Timur', ' Kab. Aceh Tengah', ' Kab.Aceh Barat', ' Kab. Aceh Besar', ' Kab. Pidie',
' Kab. Aceh Tamiang', ' Kab. Aceh Utara', ' Kab. Bireun', ' Kota Lhokseumawe', ' Kab. Aceh Singkil', ' Kab. Simeulue', ' Kota Banda Aceh', ' Kota Sabang', ' Kab. Aceh Jaya',
' Kab. Nagan Raya', ' Kab. Aceh Barat Daya', ' Kab. Bener', ' Kab. Pidie Jaya', ' Kab. Subulussalam', ' Kab. Nias', ' Kab. Mandailing Natal', ' Kab. Tapanuli Selatan',
' Kab. Tapanuli Tengah', ' Kab. Tapanuli Utara', ' Kab. Toba Samosir', ' Kab. Labuhanbatu', ' Kab. Asahan', ' Kab. Simalungun', ' Kab. Dairi', ' Kab. Karo', ' Kab. Deli Serdang',
' Kab. Langkat', ' Kota Sibolga', ' Kota Tanjung Balai', ' Kota Pematang Siantar', ' Kota Tebing Tinggi', ' Kota Medan', ' Kota Binjai', ' Kab. Serdang Bedagai', ' Kab. Samosir',
' Kab. Pakpak Bharat', ' Kab. Nias Selatan', ' Kab. Humbang Hasundutan', ' Kota Padang Sidempuan', ' Kab. Batu Bara', ' Kab. Padang Lawas Utara', ' Kab. Padang Lawas',
' Kota Gunungsitoli', ' Kab. Nias Utara', ' Kab. Nias Barat', ' Kab. Labuhanbatu Utara', ' Kab. Labuhanbatu Selatan', ' Kab. Kep Mentawai', ' Kab. Pesisir Selatan', ' Kab Solok',
' Kab. Tanah Datar', ' Kab. Padang Pariaman', ' Kab. Agam', ' Kab. Lima Puluh Koto', ' Kab. Pasaman', ' Kota Padang', ' Kota Solok', ' Kota Sawahlunto', ' Kota Padang Panjang',
' Kota Bukittinggi', ' Kota Payakumbuh', ' Kota Pariaman', ' Kab. Pasaman Barat', ' Kab. Solok Sel', ' Kab. Dharmasraya', ' Kab. Kuantan Singingi', ' Kab. Indragiri Hulu',
' Kab. Indragiri Hilir', ' Kab. Pelalawan', ' Kab. Siak Sri Indrapura', ' Kab. Kampar', ' Kab. Rokan Hulu', ' Kab. Bengkalis', ' Kab. Rokan Hilir', ' Kota Pekan Baru', ' Kota Dumai',
' Kab. Meranti', ' Kab. Kerinci', ' Kab. Merangin', ' Kab. Sarolangun', ' Kab. Batang Hari', ' Kab. Muara Jambi', ' Kab. Tanjab Tim', ' Kab. Tanjab Bar', ' Kab. Tebo', ' Kab. Bungo',
' Kota Jambi', ' Kota Sungai Penuh', ' Kab. Ogan Komering Ulu', ' Kab. Ogan Komering Hilir', ' Kab. Muara Enim', ' Kab. Lahat', ' Kab. Musi Rawas', ' Kab. Musi Banyuasin',
' Kota Lubuk Linggau', ' Kota Palembang', ' Kota Prabumulih', ' Kota Pagar Alam', ' Kab. Banyuasin', ' Kab. Ogan Ilir', ' Kab. O.K.U Timur', ' Kab. O.K.U Selatan',
' Kab. Empat Lawang', ' Kab. Penungkalabab L Ilir', ' Kab. Musi Rawas Utara', ' Kota Bengkulu Selatan', ' Kab. Rejang Lebong', ' Kab. Bengkulu Utara', ' Kota Bengkulu',
' Kab. Muko-Muko', ' Kab. Seluma', ' Kab. Kaur', ' Kab. Lebong', ' Kab. Kepahyang', ' Kab. Bengkulu Tengah', ' Kab. Lampung Barat', ' Kab. Tanggamus', ' Kab. Lampung Selatan',
' Kab. Lampung Timur', ' Kab. Lampung Tengah', ' Kab. Lampung Utara', ' Kab. Way Kanan', ' Kab. Tulang Bawang', ' Kota Bandar Lampung', ' Kota Metro', ' Kab. Pesawaran',
' Kab. Tulang Bawang Barat', ' Kab. Mesuji', ' Kab. Pringsewu', ' Kab. Pesisir Barat', ' Kab. Bangka', ' Kab. Belitung', ' Kota Pangkal Pinang', ' Kab. Bangka Selatan',
' Kab. Bangka Barat', ' Kab. Bangka Tengah', ' Kab. Belitung Timur', ' Kota Jakarta Selatan', ' Kota Jakarta Timur', ' Kota Jakarta Pusat', ' Kota Jakarta Barat', ' Kota Jakarta Utara',
' Kab. Kep. Seribu', ' Kota Cimahi', ' Kota Banjar', ' Kab. Bogor', ' Kab. Sukabumi', ' Kab. Cianjur', ' Kab. Bandung', ' Kab. Garut', ' Kab. Tasikmalaya', ' Kab. Ciamis', ' Kab. Kuningan',
' Kab. Cirebon', ' Kab. Majalengka', ' Kab. Sumedang', ' Kab. Indramayu', ' Kab. Subang', ' Kab. Purwakarta', ' Kab. Karawang', ' Kab. Bekasi', ' Kota Bogor', ' Kota Sukabumi',
' Kota Bandung', ' Kota Cirebon', ' Kota Bekasi', ' Kota Depok', ' Kota Tasikmalaya', ' Kab. Bandung Barat', ' Kab. Pangandaran', ' Kab. Cilacap', ' Kab. Banyumas',
' Kab. Purbalingga', ' Kab. Banjarnegara', ' Kab. Kebumen', ' Kab. Purworejo', ' Kab. Wonosobo', ' Kab. Magelang', ' Kab. Boyolali', ' Kab. Klaten', ' Kab. Sukoharjo', ' Kab. Wonogiri',
' Kab. Karanganyar', ' Kab. Sragen', ' Kab. Grobogan', ' Kab. Blora', ' Kab. Rembang', ' Kab. Pati', ' Kab. Kudus', ' Kab. Jepara', ' Kab. Demak', ' Kab. Semarang', ' Kab. Temanggung',
' Kab. Kendal', ' Kab. Batang', ' Kab. Pekalongan', ' Kab. Pemalang', ' Kab. Tegal', ' Kab. Brebes', ' Kota Magelang', ' Kota Surakarta', ' Kab. Salatiga', ' Kota Semarang',
' Kota Pekalongan', ' Kota Tegal', ' Kab. Kulon Progo', ' Kab. Bantul', ' Kab. Gunung Kidul', ' Kab. Sleman', ' Kota Yogyakarta', ' Kab. Pacitan', ' Kab. Ponorogo', ' Kab. Trenggalek',
' Kab. Tulungagung', ' Kab. Blitar', ' Kab. Kediri', ' Kab. Malang', ' Kab. Lumajang', ' Kab. Jember', ' Kab. Banyuwangi', ' Kab. Bondowoso', ' Kab. Situbondo', ' Kab. Probolinggo',
' Kab. Pasuruan', ' Kab. Sidoarjo', ' Kab. Mojokerto', ' Kab. Jombang', ' Kab. Nganjuk', ' Kab. Madiun', ' Kab. Magetan', ' Kab. Ngawi', ' Kab. Bojonegoro', ' Kab. Tuban',
' Kab. Lamongan', ' Kab. Gresik', ' Kab. Bangkalan', ' Kab. Sampang', ' Kab. Pamekasan', ' Kab. Sumenep', ' Kota Kediri', ' Kota Blitar', ' Kota Malang', ' Kota Probolinggo',
' Kota Pasuruan', ' Kota Mojokerto', ' Kota Madiun', ' Kota Surabaya', ' Kota Batu', ' Kab. Pandeglang', ' Kab. Lebak', ' Kab. Tangerang', ' Kab. Serang', ' Kota Tangerang',
' Kota Cilegon', ' Kota Serang', ' Kota Tangerang Selatan', ' Kab. Jembrana', ' Kab. Tabanan', ' Kab. Badung', ' Kab. Gianyar', ' Kab. Klungkung', ' Kab. Bangli', ' Kab. Karang Asem',
' Kab. Buleleng', ' Kota Denpasar', ' Kab. Lombok Barat', ' Kab. Lombok Tengah', ' Kab. Lombok Timur', ' Kab. Dompu', ' Kab. Bima', ' Kota Mataram', ' Kab. Sumbawa Besar',
' Kota Bima', ' Kab. Sumbawa Barat', ' Kab. Lombok Utara', ' Kab. Sumba Barat', ' Kab. Sumba Timur', ' Kab. Kupang', ' Kab. T.T.S Soe', ' Kab. T.T.U Kefamenanu', ' Kab. Belu',
' Kab. Alor', ' Kab. Lembata', ' Kab. Flores Timur', ' Kab. Sikka', ' Kab. Ende', ' Kab. Ngada', ' Kab. Manggarai', ' Kota Kupang', ' Kab. Rote-Ndao', ' Kab. Manggarai Barat',
' Kab. Nagekeo', ' Kab. Sumba Tengah', ' Kab. Sumba Barat Daya', ' Kab. Manggarai Timur', ' Kab. Sabu Raijua', ' Kab. Malaka', ' Kota Singkawang', ' Kab. Sambas',
' Kab. Bengkayang', ' Kab. Landak', ' Kab. Mempawah', ' Kab. Sanggau', ' Kab. Ketapang', ' Kab. Sintang', ' Kab. Kapuas Hulu', ' Kota Pontianak', ' Kab. Melawi', ' Kab. Sekadau',
' Kab. Kayong Utara', ' Kab. Kubu Raya', ' Kab. Pulang Pisau', ' Kab. Seruyan', ' Kab. Kotawaringin Barat', ' Kab. Kotawaringin Timur', ' Kab. Kapuas', ' Kab. Barito Selatan',
' Kab. Barito Utara', ' Kab. Sukamara', ' Kab. Lamandau', ' Kab. Barito Timur', ' Kab. Katingan', ' Kab. Gunung Mas', ' Kab. Murung Raya', ' Kota Palangka Raya', ' Kab. Tanah Laut',
' Kab. Kotabaru', ' Kab. Banjar', ' Kab. Barito Kuala', ' Kab. Tapin', ' Kab. Hulu Sungai Selatan', ' Kab. Hulu Sungai Tengah', ' Kab. Hulu Sungai Utara', ' Kab. Tabalong',
' Kota Banjarmasin', ' Kota Banjar Baru', ' Kab. Tanah Bumbu', ' Kab. Balangan', ' Kab. Pasir', ' Kab. Pasir Utara', ' Kab. Kutai Barat', ' Kab. Kutai Kertanegara', ' Kab. Kutai Timur',
' Kab. Berau', ' Kota Balikpapan', ' Kota Samarinda', ' Kota Bontang', ' Kab. Mahakam Ulu', ' Kab. Sangirtalaut', ' Kab. Minahasa', ' Kab. Sangihe', ' Kab. Boloangmongondow',
' Kota Manado', ' Kota Bitung', ' Kab. Minahasa Selatan', ' Kota Tomohon', ' Minahasa Utara', ' Kota Kotamobagu', ' Kab. Minahasa Tenggara', ' Kab.Bolaang Mongondow Utr',
' Kab.Kp Siao Tagulandang B', ' Kab.Bolaang Mongondow Slt', ' Kab.Bolaang Mongondow Tmr', ' Kab. Parigi Moutong', ' Kab. Banggai', ' Kab. Banggai Kepulauan',
' Kab. Morowali', ' Kab. Poso', ' Kab. Donggala', ' Kab. Toli Toli', ' Kab. Buol', ' Kota Palu', ' Kab. Tojo Una Una', ' Kab. Sigi', ' Kab. Morowali Utara', ' Kab. Banggai Laut',
' Kota Palopo', ' Kab. Selayar', ' Kab. Bulukumba', ' Kab. Bantaeng', ' Kab. Jeneponto', ' Kab. Takalar', ' Kab. Gowa', ' Kab. Sinjai', ' Kab. Maros', ' Kab. Pangkep', ' Kab. Barru',
' Kab. Bone', ' Kab. Soppeng', ' Kab. Wajo', ' Kab. Sidenreng Rappang', ' Kab. Pinrang', ' Kab. Enrekang', ' Kab. Luwu', ' Kab. Tana Toraja', ' Kab. Luwu Utara', ' Kota Makassar',
' Kab. Luwu Timur', ' Kab. Toraja Utara', ' Kota Bau-Bau', ' Kab. Buton', ' Kab. Muna', ' Kab. Konawe', ' Kab. Kolaka', ' Kota Kendari', ' Kab. Konawe Selatan', ' Kab. Kolaka Utara',
' Kab. Wakatobi', ' Kab. Bombana', ' Kab. Konawe Utara', ' Kab. Buton Utara', ' Kab. Konawe Kepulauan', ' Kab. Kolaka Timur', ' Kab.Muna Barat', ' Kab. Buton Tengah',
' Kab. Buton Selatan', ' Kab. Boalemo', ' Kab. Gorontalo', ' Kota Gorontalo', ' Kab. Bone Bolango', ' Kab. Pohuwato', ' Kab. Gorontalo Utara', ' Kab.Maluku Tenggara Barat',
' Kab. Maluku Tenggara', ' Kab. Maluku Tengah', ' Kab. Buru', ' Kota Ambon', ' Kab. Seram Bagian Timur', ' Kab. Seram Bagian Barat', ' Kab. Kepulauan Aru', ' Kota Tual',
' Kab. Buru Selatan', ' Kab. Maluku Barat Daya', ' Kab. Halmahera Tengah', ' Kota Ternate', ' Kab. Halmahera Barat', ' Kab. Halmahera Utara', ' Kab. Halmahera Selatan',
' Kab. Kepulauan Sula', ' Halmahera Timur', ' Kota Tidore Kepulauan', ' Kab. Pulau Morotai', ' Kab. Pulau Taliabu', ' Kab. Merauke', ' Kab. Jayawijaya', ' Kab. Jayapura',
' Kab. Yapen', ' Kab. Biak Numfor', ' Kab. Paniai', ' Kab. Mimika', ' Kota Jayapura', ' Kab. Kerom', ' Kab. Sarmi', ' Kab. Puncak Jaya', ' Kab. Pegunungan Bintang', ' Kab. Yahukimo',
' Kab. Mapi', ' Kab. Asmat', ' Kab. Bouven Digul', ' Kab. Waropen', ' Kab. Nabire', ' Kab. Tolikara', ' Kab. Supiori', ' Kab. Membramo Raya', ' Kab. Mamberamo Tengah',
' Kab. Yalimo', ' Kab. Lanny Jaya', ' Kab. Nduga', ' Kab. Puncak', ' Kab. Dogiyai', ' Kab. Intan Jaya', ' Kab. Deiyai', ' Kab. Fak Fak', ' Kab. Sorong', ' Kab. Manokwari', ' Kota Sorong',
' Kab. Sor Sel', ' Kab. Raja Ampat', ' Kab. Kaimana', ' Kab. Teluk Bintuni', ' Kab. Teluk Wondama', ' Kab. Tambrauw', ' Kab. Maybrat', ' Kab. Pegunungan Arfak',
' Kab. Manokwari Selatan', ' Kab. Polewali Mandar', ' Kab. Majene', ' Kab. Mamuju', ' Kab. Mamasa', ' Kab. Mamuju Utara', ' Kab. Mamuju Tengah', ' Kota Tanjung Pinang',
' Kab. Bintan (Kepri)', ' Kab. Tj Balai Karimun', ' Kab. Natuna', ' Kota Batam', ' Kab. Lingga', ' Kab. Kep. Anambas', ' Kab. Malinau', ' Kab. Bulungan', ' Kab. Nunukan',
' Kota Tarakan', ' Kab. Tana Tidung']



Total: 512

These are the cities or districts in Indonesia with BPJS (Badan Penyelenggara Jaminan Sosial or Social Security Organizing Agency) health facilities in the year 2019.

Data to be displayed in the visualization map

total_data_count = df.shape[0]
displayed_data = df.dropna().shape[0]
data_not_displayed = df[df['Latitude'].isnull() | df['Longitude'].isnull()].shape[0]

print('\nTotal facility data: ', total_data_count)
print('\nTotal facilities that can be displayed on the map:', displayed_data)
print('\nTotal facilities that cannot be displayed on the map:', data_not_displayed)

--- output: ---

Total facility data: 29157

Total facilities that can be displayed on the map: 16499

Total facilities that cannot be displayed on the map: 12658

Visualization

Geographical visualization of 16499 BPJS health facilities

Visualization of geographic data with folium FastMarkCluster!

data_map = df.dropna().info()
data_map

--- output: ---

<class 'pandas.core.frame.DataFrame'>
Index: 16499 entries, 0 to 29149
Data columns (total 10 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Provinsi 16499 non-null object
1 KotaKab 16499 non-null object
2 TipeFaskes 16499 non-null object
3 No 16499 non-null object
4 KodeFaskes 16499 non-null object
5 NamaFaskes 16499 non-null object
6 AlamatFaskes 16499 non-null object
7 TelpFaskes 16499 non-null object
8 Latitude 16499 non-null float64
9 Longitude 16499 non-null float64
dtypes: float64(2), object(8)
memory usage: 1.4+ MB
maps_dataset = df.dropna()
rome_lat, rome_lng = -6.200000, 106.816666 # jakarta

# init the folium map object
maps = folium.Map(location=[rome_lat, rome_lng], zoom_start=5)

# input all points from the dataset file into a map object using FastMarkerCluster
maps.add_child(plugins.FastMarkerCluster(maps_dataset[['Latitude', 'Longitude']].values.tolist()))

maps
Faskes maps by province

Visualization of numbers per city/district with available latitude and longitude!

# 5 cities or districts with the largest number of BPJS facilities
city_regency = df['KotaKab'].value_counts().rename_axis('city_regrency').reset_index(name='Total')
city_regency.head()

--- output: ---

city_regrency Total
0 Kota Surabaya 364
1 Kota Semarang 305
2 Kab. Bogor 298
3 Kota Makassar 292
4 Kota Palembang 288

The top five cities or regency with the highest number of BPJS facilities in Indonesia are Surabaya City, Semarang City, Bogor Regency, Makassar City and Palembang City. The city of Surabaya occupies the top ranking with a total of 364 BPJS facilities, followed by the city of Semarang with a total of 305 BPJS facilities. Bogor Regency, Makassar City and Palembang City also have quite a large number of BPJS facilities, with 298, 292 and 288 BPJS facilities respectively. These areas show a significant presence of BPJS facilities, reflecting the accessibility and availability of health services in these areas.

# Retrieve latitude and longitude data per city/district
kabkota = []
prov = []
lati = []
longi = []

df1 = df.dropna()

for prv, kk, ltk, lnk in zip(df1['Provinsi'],
df1['KotaKab'],
df1['Latitude'],
df1['Longitude']):
if (not(kk in kabkota) and not(ltk == np.NaN) and not(lnk == np.NaN)):
prov.append(prv)
kabkota.append(kk)
lati.append(ltk)
longi.append(lnk)

print("Total: ", len(kabkota))

data_fas = pd.DataFrame(list(zip(prov, kabkota, lati, longi)),
columns=['Provinsi', 'city_regrency', 'Latitude', 'Langitude'])
data_fas.head()

--- output: ---

Total: 460

Provinsi city_regrency Latitude Langitude
0 Nanggroe Aceh Darussalam Kota Langsa 4.488058 97.947963
1 Nanggroe Aceh Darussalam Kab. Gayo Lues 4.059445 97.463333
2 Nanggroe Aceh Darussalam Kab. Aceh Selatan 3.111916 97.368642
3 Nanggroe Aceh Darussalam Kab. Aceh Tenggara 3.496266 97.800000
4 Nanggroe Aceh Darussalam Kab. Aceh Timur 4.961196 97.762670

Latitude and longitude data have been collected for 460 cities and districts in various provinces in Indonesia. This information is important for geographic mapping and location-based analysis. For example, in Nanggroe Aceh Darussalam, Langsa City is located at approximately 4.49° South Latitude and 97.95° East Latitude, Gayo Lues Regency at 4.06° South Latitude and 97.46° East Latitude, South Aceh Regency at 3 .11° South Latitude and 97.37° E. Southeast Aceh Regency’s longitude is 3.11° South Latitude and 97.37° East Longitude. 3.50° N and 97.80° E, and East Aceh Regency at 4.96° N and 97.76° E. This data allows for a more comprehensive analysis of the distribution of health facilities and can be used for various geographic insights.

Visualization of all data

City/Regency with the highest number of health facilities with BPJS

df.Provinsi.value_counts()

--- output: ---

Provinsi
Jawa Tengah 3688
Jawa Barat 3683
Jawa Timur 3548
Sumatera Utara 1628
Sulawesi Selatan 1155
Dki Jakarta 995
Sumatera Selatan 993
Banten 913
Lampung 784
Nanggroe Aceh Darussalam 776
Bali 765
Riau 729
Nusa Tenggara Timur 722
Sumatera Barat 721
Papua 712
Kalimantan Selatan 671
Kalimantan Timur 634
Sulawesi Utara 543
D I Yogyakarta 534
Kalimantan Barat 531
Sulawesi Tenggara 500
Jambi 446
Kalimantan Tengah 418
Nusa Tenggara Barat 393
Bengkulu 390
Sulawesi Tengah 386
Maluku 334
Kepulauan Riau 319
Papua Barat 278
Maluku Utara 253
Gorontalo 206
Sulawesi Barat 187
Kep. Bangka Belitung 182
Kalimantan Utara 140
Name: count, dtype: int64

This dataset displays the distribution of health facilities in various provinces in Indonesia. Central Java, West Java and East Java are the provinces with the largest number of health facilities, with 3,688, 3,683 and 3,548 facilities respectively. These provinces, located on the island of Java, show a concentration of health care infrastructure. Other provinces that have adequate health facilities are North Sumatra (1,628), South Sulawesi (1,155), and DKI Jakarta (995). This distribution highlights the diverse healthcare landscape across the archipelago, with Java leading the way in terms of the number of health facilities, followed by other large islands such as Sumatra and Sulawesi. This data provides valuable insight into the regional distribution of health resources in Indonesia.

df.KotaKab.value_counts()

--- output: ---

KotaKab
Kota Surabaya 364
Kota Semarang 305
Kab. Bogor 298
Kota Makassar 292
Kota Palembang 288
...
Kab.Bolaang Mongondow Tmr 12
Kab. Banggai Laut 12
Kab. Mamberamo Tengah 11
Kab. Tana Tidung 11
Kab. Manokwari Selatan 10
Name: count, Length: 512, dtype: int64
df.TipeFaskes.value_counts()

--- output: ---

TipeFaskes
Puskesmas 9913
Klinik Pratama 6597
Klinik Utama 5375
Apotek 2982
Rumah Sakit 2249
Dokter Gigi 1410
Dokter Praktik Perorangan 631
Name: count, dtype: int64

Pivotable in Python

from pivottablejs import pivot_ui
pivot_ui(df)
faskes count by prov
faskes prov count by Kota/Kab
count faskes type

Dashboard

tableau dashboard

Conclusion

In summary, the analysis of the BPJS Kesehatan healthcare facilities dataset in Indonesia reveals that major cities like Surabaya, Semarang, Bogor, Makassar, and Palembang have a substantial number of BPJS facilities, indicating widespread access to healthcare services. The inclusion of geographic coordinates for 460 cities and districts enhances the dataset’s utility for mapping and location-based analysis. The distribution of health facilities across provinces shows that Java, particularly Central, West, and East Java, leads in total numbers, followed by other key provinces. This dataset provides valuable insights for optimizing healthcare resource allocation and accessibility in Indonesia.

Photo by suara.com

--

--

Anggi Setyawan Riyadi

Data enthusiast Anggi Setyawan: Unveiling insights, sharing tips, and exploring the world of data together! | https://anggise2023.github.io/ 🚀 #DataExploration