@geoalgeria/sante 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js ADDED
@@ -0,0 +1,12 @@
1
+ // @geoalgeria/sante — lightweight loaders for Algeria's public health establishments.
2
+ import { readFileSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+
6
+ const DATA = join(dirname(fileURLToPath(import.meta.url)), "data");
7
+ const load = (p) => JSON.parse(readFileSync(join(DATA, p), "utf-8"));
8
+
9
+ export const sante = () => load("sante.json"); // public health establishments (MSP registry, geocoded)
10
+ export const metadata = () => load("metadata.json");
11
+
12
+ export default { sante, metadata };
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@geoalgeria/sante",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Public health establishments of Algeria — hospitals (EPH), proximity health (EPSP), specialized hospitals (EHS) and university hospitals (CHU) from the Ministère de la Santé, bilingual FR/AR, geocoded via OpenStreetMap & Wikidata, with commune/wilaya linkage. JSON, CSV, GeoJSON, TypeScript.",
6
+ "main": "index.js",
7
+ "types": "types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./types/index.d.ts",
11
+ "default": "./index.js"
12
+ },
13
+ "./data/*": "./data/*"
14
+ },
15
+ "files": [
16
+ "data/**/*.json",
17
+ "data/**/*.csv",
18
+ "data/**/*.geojson",
19
+ "types/",
20
+ "index.js"
21
+ ],
22
+ "scripts": {
23
+ "fetch": "node scripts/fetch.mjs",
24
+ "test": "node ../../scripts/validate-packages.mjs sante"
25
+ },
26
+ "keywords": [
27
+ "algeria",
28
+ "sante",
29
+ "health",
30
+ "hospital",
31
+ "hopital",
32
+ "eph",
33
+ "epsp",
34
+ "ehs",
35
+ "chu",
36
+ "healthcare",
37
+ "ministry-of-health",
38
+ "openstreetmap",
39
+ "wikidata",
40
+ "geojson",
41
+ "geoalgeria",
42
+ "dz"
43
+ ],
44
+ "author": "Yasser's Studio (https://yasser.studio)",
45
+ "license": "MIT",
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/yasserstudio/geoalgeria/issues"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/yasserstudio/geoalgeria.git",
55
+ "directory": "packages/sante"
56
+ },
57
+ "homepage": "https://geoalgeria.com",
58
+ "engines": {
59
+ "node": ">=18"
60
+ }
61
+ }
@@ -0,0 +1,98 @@
1
+ // Type definitions for @geoalgeria/sante
2
+ // Public health establishments of Algeria — the Ministère de la Santé (MSP)
3
+ // registry, geocoded via OpenStreetMap (ODbL) and Wikidata (CC0).
4
+
5
+ /** Establishment category. */
6
+ export type HealthType = "eph" | "epsp" | "ehs" | "chu" | "clinique" | "hopital";
7
+
8
+ /** Ownership sector. The MSP registry is public; private clinics carry "private". */
9
+ export type HealthSector = "public" | "private";
10
+
11
+ /** Where the record's identity came from, plus which geo sources contributed a precise point. */
12
+ export type HealthSource =
13
+ | "msp"
14
+ | "msp+osm"
15
+ | "msp+wikidata"
16
+ | "msp+osm+wikidata";
17
+
18
+ /** How the coordinates were obtained. */
19
+ export type GeoPrecision =
20
+ | "osm_point"
21
+ | "wikidata_point"
22
+ | "commune_centroid"
23
+ | "none";
24
+
25
+ /** A public health establishment. */
26
+ export interface HealthEstablishment {
27
+ /** Stable id, `{wilaya_code}-{type}-{seq}` (e.g. "22-eph-01"). */
28
+ id: string;
29
+ /** Best available display name (French preferred, else Arabic). */
30
+ name: string;
31
+ /** Arabic name, or null. */
32
+ name_ar: string | null;
33
+ /** French name, or null. */
34
+ name_fr: string | null;
35
+ /** Establishment category. */
36
+ type: HealthType;
37
+ /** Canonical French label for the type. */
38
+ type_label_fr: string;
39
+ /** Canonical Arabic label for the type. */
40
+ type_label_ar: string;
41
+ /** Ownership sector ("public" for the MSP registry). */
42
+ sector: HealthSector;
43
+ /** Wilaya name (French). */
44
+ wilaya: string;
45
+ /** Wilaya name (Arabic). */
46
+ wilaya_ar: string;
47
+ /** Wilaya code as a zero-padded string ("01".."69"). */
48
+ wilaya_code: string;
49
+ /** Commune name (French), best-effort from the establishment locality. Null when unresolved. */
50
+ commune: string | null;
51
+ /** Commune code (geoalgeria code_commune), best-effort. Null when unresolved. */
52
+ commune_code: number | null;
53
+ /** Latitude, or null when the establishment could not be geocoded. */
54
+ lat: number | null;
55
+ /** Longitude, or null when the establishment could not be geocoded. */
56
+ lng: number | null;
57
+ /** Provenance: MSP registry, plus OSM/Wikidata where a precise point matched. */
58
+ source: HealthSource;
59
+ /** How `lat`/`lng` were obtained. */
60
+ geo_precision: GeoPrecision;
61
+ /** Wikidata QID when a Wikidata facility matched, else null. */
62
+ wikidata: string | null;
63
+ /** OSM element id (e.g. "node/123") when an OSM facility matched, else null. */
64
+ osm_id: string | null;
65
+ /** Source post id on sante.gov.dz (French post preferred). */
66
+ msp_id: number;
67
+ /** URL slug of the source post (French post preferred). */
68
+ slug: string;
69
+ }
70
+
71
+ /** Dataset metadata (data/metadata.json). */
72
+ export interface Metadata {
73
+ source: string;
74
+ origin: string;
75
+ license: string;
76
+ sante: number;
77
+ by_type: Record<HealthType, number>;
78
+ by_sector: Record<HealthSector, number>;
79
+ by_geo_precision: Record<GeoPrecision, number>;
80
+ wilayas_covered: number;
81
+ geocoded: number;
82
+ bilingual: number;
83
+ linkage_note: string;
84
+ coverage_note: string;
85
+ /** ISO date (YYYY-MM-DD) the snapshot was generated. */
86
+ generated_at: string;
87
+ }
88
+
89
+ /** All public health establishments. */
90
+ export function sante(): HealthEstablishment[];
91
+ /** Dataset metadata. */
92
+ export function metadata(): Metadata;
93
+
94
+ declare const _default: {
95
+ sante: typeof sante;
96
+ metadata: typeof metadata;
97
+ };
98
+ export default _default;